@@ -3,12 +3,6 @@ | |||
let getNumber = (item, index, arr, props) => { | |||
let number = 1 | |||
while (arr[++index]) { | |||
// props.forEach(prop => { | |||
// debugger | |||
// if (arr[index][prop].trim() != item[prop].trim()) { | |||
// return number; | |||
// } | |||
// }) | |||
for (let prop of props) { | |||
if (arr[index][prop].trim() != item[prop].trim()) { | |||
return number; | |||
@@ -28,32 +22,17 @@ export let base = { | |||
return arr.map((item, index) => { | |||
if (item.quota1.trim() != quota1 && (code == undefined || item.code.trim() == code) && (item.year.trim() == year || year == undefined)) { | |||
quota1 = item.quota1.trim(); | |||
// item.quota1Row = arr.filter(child => { | |||
// return child.year == item.year && child.code == item.code && item.quota1 == child.quota1 | |||
// }).length | |||
item.quota1Row = getNumber(item, index, arr, ["quota1", "code", "year"]) | |||
} | |||
if (item.code.trim() != code && (year == undefined || year == item.year.trim())) { | |||
code = item.code.trim(); | |||
quota1 = item.quota1.trim(); | |||
// item.quota1Row = arr.filter(child => { | |||
// return child.year == item.year && child.code == item.code && item.quota1 == child.quota1 | |||
// }).length | |||
// item.codeRow = arr.filter(child => { | |||
// return child.year == item.year && child.code == item.code | |||
// }).length | |||
item.quota1Row = getNumber(item, index, arr, ['quota1', "code", "year"]) | |||
item.codeRow = getNumber(item, index, arr, ['code', "year"]) | |||
} | |||
if (item.year.trim() != year) { | |||
year = item.year.trim(); | |||
code = item.code.trim(); | |||
// item.codeRow = arr.filter(child => { | |||
// return child.year == item.year && child.code == item.code | |||
// }).length | |||
// item.yearRow = arr.filter(child => { | |||
// return child.year == item.year | |||
// }).length; | |||
item.yearRow = getNumber(item, index, arr, ['year']) | |||
item.codeRow = getNumber(item, index, arr, ['code', 'year']) | |||
} | |||
@@ -116,30 +95,14 @@ export let assessing = { | |||
return arr.map((item, index) => { | |||
if (item.quota2.trim() != quota2 && (quota1 == undefined || quota1 == item.quota1.trim())) { | |||
quota2 = item.quota2.trim(); | |||
// item.quota2Row = arr.filter(child => { | |||
// if (child.quota1 == item.quota1 && child.quota2 == item.quota2) { | |||
// return true | |||
// } | |||
// return false | |||
// }).length | |||
item.quota2Row = getNumber(item, index, arr, ['quota2', 'quota1']); | |||
// console.log(item.quota2Row) | |||
} | |||
if (item.quota1.trim() != quota1) { | |||
quota1 = item.quota1.trim(); | |||
quota2 = item.quota2.trim(); | |||
// item.quota2Row = arr.filter(child => { | |||
// return child.quota1 == item.quota1 && child.quota2 == item.quota2 | |||
// }).length | |||
// item.quota1Row = arr.filter(child => { | |||
// return child.quota1 == item.quota1 | |||
// }).length; | |||
// return item; | |||
item.quota1Row = getNumber(item, index, arr, ['quota1']) | |||
item.quota2Row = getNumber(item, index, arr, ['quota2', 'quota1']) | |||
// console.log(item.quota2Row,item.quota1Row) | |||
// console.log(item.quota1Row) | |||
} | |||
return item; | |||
}) | |||
@@ -185,9 +148,6 @@ export let quota = { | |||
return arr.map((item, index) => { | |||
if (item.quota.trim() != quota) { | |||
quota = item.quota.trim(); | |||
// item.quotaRow = arr.filter(child => { | |||
// return child.quota == item.quota | |||
// }).length | |||
item.quotaRow = getNumber(item, index, arr, ['quota']) | |||
} | |||
return item; | |||
@@ -225,9 +185,6 @@ export let categoryName = { | |||
console.log(item) | |||
if (item.categoryName.trim() != categoryName) { | |||
categoryName = item.categoryName.trim(); | |||
// item.quotaRow = arr.filter(child => { | |||
// return child.quota == item.quota | |||
// }).length | |||
item.quotaRow = getNumber(item, index, arr, ['categoryName']) | |||
} | |||
return item; | |||
@@ -263,7 +220,6 @@ export function mergeSpan(params) { | |||
methods: { | |||
reduceData(data) { | |||
let arr = data; | |||
console.log(arr) | |||
let prev = new Array(params.length).fill(undefined); | |||
try { | |||
return arr.map((item, index) => { | |||
@@ -285,7 +241,6 @@ export function mergeSpan(params) { | |||
} | |||
} | |||
}) | |||
console.log(item) | |||
return item; | |||
}) | |||
} catch (e) { |
@@ -274,7 +274,6 @@ export default { | |||
this.page = page; | |||
}, | |||
updatePoints(row, index) { | |||
console.log(row.deptPoints > row.points); | |||
if (row.deptPoints == this.preValue) { | |||
return; | |||
} |
@@ -5,7 +5,7 @@ | |||
v-loading="loading" | |||
element-loading-background="rgba(255, 255, 255, 1)" | |||
> | |||
<search :type="1" :search-params="searchParams" /> | |||
<search :type="1" @search:task="updateParams($event)" /> | |||
<div class="operating"> | |||
<el-button size="small" type="primary">导出</el-button> | |||
</div> | |||
@@ -15,6 +15,7 @@ | |||
:height="tableHeight" | |||
border | |||
:span-method="arraySpanMethod" | |||
ref="table" | |||
> | |||
<el-table-column | |||
type="index" | |||
@@ -151,18 +152,32 @@ export default { | |||
this.getDataList(); | |||
}, | |||
methods: { | |||
updateParams(data) { | |||
console.log(data); | |||
this.searchParams = data; | |||
this.resetCurrentPage(); | |||
this.getDataList(); | |||
}, | |||
resetCurrentPage() { | |||
let page = this.page; | |||
page.page = 1; | |||
this.page = page; | |||
}, | |||
getDataList() { | |||
try { | |||
this.$refs.table.bodyWrapper.scrollTop = 0; | |||
} catch (e) {} | |||
this.loading = true; | |||
apiSummary | |||
.getBasicTableList(Object.assign({}, this.page, this.searchParams)) | |||
.then((res) => { | |||
let data = res.data.data; | |||
this.count=data.total | |||
this.count = data.total; | |||
this.dataList = this.reduceData(data.records); | |||
}) | |||
.catch((e) => { | |||
this.dataList = []; | |||
this.count=0 | |||
this.count = 0; | |||
}) | |||
.finally(() => { | |||
this.loading = false; |
@@ -26,6 +26,7 @@ | |||
label="考核指标" | |||
min-width="150" | |||
align="center" | |||
prop="quota" | |||
></el-table-column> | |||
<el-table-column | |||
label="考核内容和计分细则" | |||
@@ -134,9 +135,8 @@ export default { | |||
}, | |||
mixins: [ | |||
mergeSpan([ | |||
{ name: "quota1", col: [1] }, | |||
{ name: "quota2", col: [2] }, | |||
{ name: "content", col: [3] }, | |||
{ name: "quota", col: [1] }, | |||
{ name: "content", col: [2] }, | |||
]), | |||
], | |||
created() { |
@@ -1,37 +1,107 @@ | |||
<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> | |||
<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="littleContent"></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 }"> | |||
<router-link | |||
:to="{name:'segmentation', params:{row, type: 2}}" | |||
>分项</router-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="littleContent" | |||
></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"> | |||
<template slot-scope="{ row }"> | |||
{{ row.leaderDeptList | formatList }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="责任领导" min-width="80" align="center"> | |||
<template slot-scope="{ row }"> | |||
{{ row.leaderPrincipalList | formatList }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
label="配合部门" | |||
min-width="80" | |||
align="center" | |||
prop="cooperateDept" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.cooperateDeptList | formatList }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
label="责任领导" | |||
min-width="80" | |||
align="center" | |||
prop="cooperateDeptList" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.cooperatePrincipalList | formatList }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
label="操作" | |||
width="125" | |||
align="center" | |||
> | |||
<template slot-scope="{ row }"> | |||
<router-link | |||
:to="{ name: 'segmentation', params: { row, type: 2 } }" | |||
>分项</router-link | |||
> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<el-pagination | |||
:current-page.sync="page.page" | |||
:page-size="page.limit" | |||
:total="count" | |||
@@ -48,7 +118,9 @@ | |||
<script> | |||
import search from "../search"; | |||
import api from "@/api/second/segmentation/reward"; | |||
import apiSummary from "@/api/second/taskSummary"; | |||
import { mergeSpan } from "@/utils/mixin"; | |||
export default { | |||
components: { | |||
search, | |||
@@ -56,13 +128,11 @@ export default { | |||
data() { | |||
return { | |||
searchParams: {}, | |||
dataList: [ | |||
{quota1:'sdewfdewd',} | |||
], | |||
dataList: [{ quota1: "sdewfdewd" }], | |||
loading: false, | |||
form: {}, | |||
quota1List:[], | |||
quota2List:[], | |||
quota1List: [], | |||
quota2List: [], | |||
count: 0, | |||
tableHeight: document.documentElement.clientHeight - 360, | |||
page: { | |||
@@ -73,18 +143,48 @@ export default { | |||
}, | |||
}; | |||
}, | |||
mixins: [ | |||
mergeSpan([ | |||
{ name: "quota1", col: [1] }, | |||
{ name: "quota2", col: [2] }, | |||
{ name: "content", col: [3] }, | |||
]), | |||
], | |||
created() { | |||
this.getDataList(); | |||
}, | |||
methods: { | |||
getDataList() {}, | |||
} | |||
getDataList() { | |||
this.loading = true; | |||
apiSummary | |||
.getBasicTableList(Object.assign({}, this.page, this.searchParams)) | |||
.then((res) => { | |||
let data = res.data.data; | |||
this.count = data.total; | |||
this.dataList = this.reduceData(data.records); | |||
}) | |||
.catch((e) => { | |||
this.dataList = []; | |||
this.count = 0; | |||
}) | |||
.finally(() => { | |||
this.loading = false; | |||
}); | |||
}, | |||
}, | |||
filters: { | |||
formatList(val) { | |||
if (val) { | |||
return val.join(","); | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
<style scoped> | |||
a { | |||
text-decoration:none; | |||
color:#66B1FF; | |||
} | |||
a { | |||
text-decoration: none; | |||
color: #66b1ff; | |||
} | |||
</style> |