diff --git a/src/components/table/Wgz.vue b/src/components/table/Wgz.vue index 4b1813f..b006bb2 100644 --- a/src/components/table/Wgz.vue +++ b/src/components/table/Wgz.vue @@ -7,8 +7,8 @@ - + { + 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() { this.listData(); }, @@ -390,8 +457,9 @@ export default { let vueSelf = this; let tableDatas = []; vueSelf.table.data.forEach(item => { - item.AE = vueSelf.computeAE(item); - item.AG = (item.AE * item.AF / 100).toFixed(2); + item.L = vueSelf.computeL(item); + item.N = vueSelf.computeN(item); + item.P = (item.N * item.O / 100).toFixed(2); tableDatas.push({...item}); }) vueSelf.dialog.warning({ @@ -401,7 +469,7 @@ export default { negativeText: "取消", onPositiveClick: () => { 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 }).then( resp => { vueSelf.message.info('保存成功'); @@ -419,7 +487,7 @@ export default { onExportClick() { let vueSelf = this; 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; }); }, @@ -451,6 +519,7 @@ export default { this.search.select.year.value = getCurrentYear(); this.search.select.month.options = listMonth(); this.search.select.month.value = getCurrentMonth(); + this.listArea(); this.listData(); } },