完成网格长报表

This commit is contained in:
TS-QD1 2023-05-13 17:46:48 +08:00
parent 569a03b7f3
commit 5bfbdf9bf0

View File

@ -7,8 +7,8 @@
<n-space class="search" vertical> <n-space class="search" vertical>
<n-grid :cols="7" :x-gap="10"> <n-grid :cols="7" :x-gap="10">
<n-grid-item> <n-grid-item>
<n-select placeholder="请选择街道" v-model:value="search.select.street.value" <n-select placeholder="请选择街道" v-model:value="search.select.area.value"
:options="search.select.street.options" :clearable="true" /> :options="search.select.area.options" :clearable="true" @update:value="onAreaValueUpdate"/>
</n-grid-item> </n-grid-item>
<n-grid-item> <n-grid-item>
<n-select placeholder="请选择社区" v-model:value="search.select.community.value" <n-select placeholder="请选择社区" v-model:value="search.select.community.value"
@ -96,7 +96,7 @@ export default {
userId: null, userId: null,
userName: null, userName: null,
select: { select: {
street: { area: {
value: null, value: null,
options: [ options: [
{ label: '稀土路街道', value: 'xtl' } { label: '稀土路街道', value: 'xtl' }
@ -218,7 +218,15 @@ export default {
title: '没完成办理流程', title: '没完成办理流程',
key: 'I', key: 'I',
keyName: 'unComplete', keyName: 'unComplete',
width: 60 width: 60,
render(row, index) {
return h('a', {
href: 'javascript:void(0);',
onClick() {
vueSelf.onUnCompleteClick(row, index);
}
}, row.I);
}
}, },
{ {
align: 'center', align: 'center',
@ -257,7 +265,10 @@ export default {
title: '网格案件调度情况得分', title: '网格案件调度情况得分',
key: 'L', key: 'L',
keyName: 'unComplete', keyName: 'unComplete',
width: 60 width: 60,
render(row, index) {
return vueSelf.computeL(row);
}
}, },
] ]
}, },
@ -335,6 +346,19 @@ export default {
onScroingCloseClick() { onScroingCloseClick() {
this.modal.scoring.show = false; this.modal.scoring.show = false;
}, },
// -
onUnCompleteClick(row, index) {
let unComplete = row.I;
this.modal.scoring.show = true;
this.modal.scoring.rowKey = 'I';
this.modal.scoring.rowIndex = index;
this.modal.scoring.score = unComplete;
this.modal.scoring.reason = row.reasonI;
this.modal.scoring.maxScore = null;
this.modal.scoring.minScore = null;
this.modal.scoring.userName = row.B;
this.modal.scoring.title = '没完成办理流程';
},
// - // -
onUnReportErrorClick(row, index) { onUnReportErrorClick(row, index) {
let unReportError = row.J; let unReportError = row.J;
@ -374,8 +398,11 @@ export default {
this.modal.scoring.userName = row.B; this.modal.scoring.userName = row.B;
this.modal.scoring.title = '网格工作季度考核'; this.modal.scoring.title = '网格工作季度考核';
}, },
computeL(row) {
return Math.max(row.F - row.H - row.I - row.J - row.K, 0);
},
computeN(row) { computeN(row) {
return row.C - row.E + row.L + row.M return Math.max(row.C - row.E + this.computeL(row) + row.M, 0);
}, },
resize() { resize() {
let body = document.body; let body = document.body;
@ -383,6 +410,46 @@ export default {
this.table.maxHeight = body.clientHeight - 355; this.table.maxHeight = body.clientHeight - 355;
// this.table.scrollX = body.clientWidth; // this.table.scrollX = body.clientWidth;
}, },
listArea() {
let vueSelf = this;
vueSelf.$axios.get(`api/kpi/list-area`, {
}).then(({ data }) => {
let optionArray = [];
data.forEach((item, index) => {
optionArray.push({
label: item.dictName,
value: item.dictId
})
})
vueSelf.search.select.area.options = optionArray;
}).catch(resp => {
vueSelf.message.error(resp.data.msg);
})
},
onAreaValueUpdate(value) {
this.listCommunity(value);
},
listCommunity(areaId) {
let vueSelf = this;
vueSelf.search.select.community.value = null;
if (!areaId) {
vueSelf.search.select.community.options = [];
return;
}
vueSelf.$axios.get(`api/kpi/list-community/area-id/${areaId}`, {
}).then(({ data }) => {
let optionArray = [];
data.forEach((item, index) => {
optionArray.push({
label: item.communityName,
value: item.communityId
})
})
vueSelf.search.select.community.options = optionArray;
}).catch(resp => {
vueSelf.message.error(resp.data.msg);
})
},
onSearchClick() { onSearchClick() {
this.listData(); this.listData();
}, },
@ -390,8 +457,9 @@ export default {
let vueSelf = this; let vueSelf = this;
let tableDatas = []; let tableDatas = [];
vueSelf.table.data.forEach(item => { vueSelf.table.data.forEach(item => {
item.AE = vueSelf.computeAE(item); item.L = vueSelf.computeL(item);
item.AG = (item.AE * item.AF / 100).toFixed(2); item.N = vueSelf.computeN(item);
item.P = (item.N * item.O / 100).toFixed(2);
tableDatas.push({...item}); tableDatas.push({...item});
}) })
vueSelf.dialog.warning({ vueSelf.dialog.warning({
@ -401,7 +469,7 @@ export default {
negativeText: "取消", negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
vueSelf.dataLoading = true; vueSelf.dataLoading = true;
vueSelf.$axios.put(`api/kpi/khxz/update-wgy/${vueSelf.search.select.wgy.value}`, { vueSelf.$axios.put(`api/kpi/khxz/update-wgz`, {
datas: tableDatas datas: tableDatas
}).then( resp => { }).then( resp => {
vueSelf.message.info('保存成功'); vueSelf.message.info('保存成功');
@ -419,7 +487,7 @@ export default {
onExportClick() { onExportClick() {
let vueSelf = this; let vueSelf = this;
vueSelf.btnExportDisabled = true; vueSelf.btnExportDisabled = true;
download(vueSelf.$axios, `api/kpi/khxz/export-wgy`, vueSelf.getQuery(), () => { download(vueSelf.$axios, `api/kpi/khxz/export-wgz`, vueSelf.getQuery(), () => {
vueSelf.btnExportDisabled = false; vueSelf.btnExportDisabled = false;
}); });
}, },
@ -451,6 +519,7 @@ export default {
this.search.select.year.value = getCurrentYear(); this.search.select.year.value = getCurrentYear();
this.search.select.month.options = listMonth(); this.search.select.month.options = listMonth();
this.search.select.month.value = getCurrentMonth(); this.search.select.month.value = getCurrentMonth();
this.listArea();
this.listData(); this.listData();
} }
}, },