瀏覽代碼

反复找错

master
YF-yuan 3 年之前
父節點
當前提交
c6db803072
共有 1 個文件被更改,包括 133 次插入78 次删除
  1. +133
    -78
      src/views/second/taskSummary/basicTable.vue

+ 133
- 78
src/views/second/taskSummary/basicTable.vue 查看文件

@@ -1,40 +1,104 @@
<template>
<div class="assessing-content ele-body">
<el-card shadow="never" v-loading="loading" element-loading-background="rgba(255, 255, 255, 1)">
<search :type="1" :search-params="searchParams" />
<div class="operating">
<el-card
shadow="never"
v-loading="loading"
element-loading-background="rgba(255, 255, 255, 1)"
>
<search :type="1" :search-params="searchParams" />
<div class="operating">
<el-button size="small" type="primary">导出</el-button>
</div>
<el-table highlight-current-row :data="dataList" :height="tableHeight" border :span-method="arraySpanMethod">
<el-table-column type="index" width="50" align="center" label="编号"></el-table-column>
<el-table-column label="一级指标" min-width="150" align="center" prop="quota1" ></el-table-column>
<el-table-column label="二级指标" min-width="150" align="center" prop="quota2"></el-table-column>
<el-table-column label="考核内容和计分细则" min-width="200" align="center" prop="content"></el-table-column>
<el-table-column label="小条内容" min-width="150" align="center" prop="itemContent"></el-table-column>
<el-table-column label="分值" min-width="60" align="center" prop="points"></el-table-column>
<el-table-column label="区牵头单位" min-width="80" align="center" prop="leaderUnit"></el-table-column>
<el-table-column label="牵头部门" min-width="80" align="center" prop="leaderDeptList"></el-table-column>
<el-table-column label="责任领导" min-width="80" align="center"></el-table-column>
<el-table-column label="配合部门" min-width="80" align="center" prop="cooperateDept"></el-table-column>
<el-table-column label="责任领导" min-width="80" align="center" prop="cooperateDeptList"></el-table-column>
<el-table-column
label="操作"
width="125"
align="center"
:key="Math.random()"
</div>
<el-table
highlight-current-row
:data="dataList"
:height="tableHeight"
border
:span-method="arraySpanMethod"
>
<template slot-scope="{ row }">
<el-link
slot="reference"
type="primary"
:underline="false"
@click="edit(row)"
>编辑</el-link
>
</template>
</el-table-column>
</el-table>
<el-pagination
<el-table-column
type="index"
width="50"
align="center"
label="编号"
></el-table-column>
<el-table-column
label="一级指标"
min-width="150"
align="center"
prop="quota1"
></el-table-column>
<el-table-column
label="二级指标"
min-width="150"
align="center"
prop="quota2"
></el-table-column>
<el-table-column
label="考核内容和计分细则"
min-width="200"
align="center"
prop="content"
></el-table-column>
<el-table-column
label="小条内容"
min-width="150"
align="center"
prop="itemContent"
></el-table-column>
<el-table-column
label="分值"
min-width="60"
align="center"
prop="points"
></el-table-column>
<el-table-column
label="区牵头单位"
min-width="80"
align="center"
prop="leaderUnit"
></el-table-column>
<el-table-column
label="牵头部门"
min-width="80"
align="center"
prop="leaderDeptList"
></el-table-column>
<el-table-column
label="责任领导"
min-width="80"
align="center"
></el-table-column>
<el-table-column
label="配合部门"
min-width="80"
align="center"
prop="cooperateDept"
></el-table-column>
<el-table-column
label="责任领导"
min-width="80"
align="center"
prop="cooperateDeptList"
></el-table-column>
<el-table-column
label="操作"
width="125"
align="center"
:key="Math.random()"
>
<template slot-scope="{ row }">
<el-link
slot="reference"
type="primary"
:underline="false"
@click="edit(row)"
>编辑</el-link
>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page.sync="page.page"
:page-size="page.limit"
:total="count"
@@ -95,28 +159,28 @@
}
"
/>
</el-form-item>
<el-form-item label="配合部门:" prop="cooperateDeptList">
<treeselect
:flat="true"
:options="formatDep"
:multiple="true"
placeholder="请选择牵头部门"
:defaultExpandLevel="2"
:normalizer="
(d) => {
return {
id: d.id,
label: d.name,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
</el-form-item>
</el-form-item>
<el-form-item label="配合部门:" prop="cooperateDeptList">
<treeselect
:flat="true"
:options="formatDep"
:multiple="true"
placeholder="请选择牵头部门"
:defaultExpandLevel="2"
:normalizer="
(d) => {
return {
id: d.id,
label: d.name,
children:
d.children && d.children.length > 0
? d.children
: undefined,
};
}
"
/>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="save">确定</el-button>
@@ -131,12 +195,12 @@ import search from "../search";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect";
import { mapGetters } from "vuex";
import api from "@/api/second/taskSummary"
import api from "@/api/second/taskSummary";
import { mergeSpan } from "@/utils/mixin";
export default {
components: {
search,
Treeselect
Treeselect,
},
mixins: [
mergeSpan([
@@ -172,37 +236,28 @@ export default {
getDataList() {
this.loading = true;
api
.getList(Object.assign({}, this.searchParams, this.page))
.getBasicTableList(Object.assign({}, this.page, this.searchParams))
.then((res) => {
let data = res.data.data.records;
data = data.map((item) => {
item.year = item.year + "";
item.focus = false;
item.selectFocus = false;
return item;
});
let data = res.data.data;
this.dataList = this.reduceData(data);
this.count = res.data.data.total;
this.loading = false;
console.log(data);
})
.catch(() => {
.catch((e) => {
this.dataList = [];
this.count = 0;
this.loading = false;
})
},
.finally(() => {
this.loading = false;
});
},

edit(row) {
this.showEdit = true
this.showEdit = true;
},
save() {
this.showEdit = false
}
}
}
this.showEdit = false;
},
},
};
</script>

<style scoped>

</style>

Loading…
取消
儲存