From b0379edfce842cf521edd555269412f8cd0ec11b Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期日, 29 九月 2024 17:33:09 +0800 Subject: [PATCH] 1. 评估记录批量修改监测数据得分 --- src/components.d.ts | 7 ++----- src/views/fysp/evaluation/EvalutationRecord.vue | 43 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index f6d6d8e..578dfa8 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -18,7 +18,6 @@ ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] - ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCascader: typeof import('element-plus/es')['ElCascader'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] @@ -31,9 +30,6 @@ ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] @@ -63,11 +59,12 @@ ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTabPane: typeof import('element-plus/es')['ElTabPane'] + ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] - ElUpload: typeof import('element-plus/es')['ElUpload'] Footer: typeof import('./components/core/Footer.vue')['default'] FormCol: typeof import('./components/layout/FormCol.vue')['default'] FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default'] diff --git a/src/views/fysp/evaluation/EvalutationRecord.vue b/src/views/fysp/evaluation/EvalutationRecord.vue index 00077c9..ad93e21 100644 --- a/src/views/fysp/evaluation/EvalutationRecord.vue +++ b/src/views/fysp/evaluation/EvalutationRecord.vue @@ -104,7 +104,12 @@ @click="scoreShow = true" >鐩戞祴鏁版嵁寰楀垎</el-button > - <el-button v-show="scoreShow" size="small" type="primary" @click="updateMultipleScore" + <el-button + v-show="scoreShow" + size="small" + type="primary" + @click="updateMultipleScore" + :loading="updateLoading" >涓婁紶</el-button > <el-button v-show="scoreShow" size="small" type="error" @click="scoreShow = false" @@ -161,7 +166,8 @@ name: '鐩戞祴鏁版嵁鏈堝潎鍊艰秴鍖哄煙鏈堝潎鍊�20%浠ヤ笂鎴栨暟鎹槑鏄惧紓甯�' } }, - scoreShow: false + scoreShow: false, + updateLoading: false }; }, computed: { @@ -208,8 +214,21 @@ evaluateApi.fetchAutoEvaluation(this.area).then((res) => { if (res.data) { this.tableData = res.data; + this.tableData.forEach((v) => { + // 灏嗗師濮嬬殑寰楀垎灞曠ず鍒拌〃鏍间腑 + if (v.itemEvaluations) { + for (const key in this.ruleName) { + const value = this.ruleName[key]; + const itemEva = v.itemEvaluations.find((ie) => { + return ie.esrguid == value.id && ie.extension1 == 'true'; + }); + if (itemEva) { + v[key] = itemEva.value; + } + } + } + }); this.orginData = useCloned(this.tableData).cloned; - console.log(this.orginData); this.getFilters(res.data); if (typeof func === 'function') { func({ data: this.tableData }); @@ -245,29 +264,35 @@ }, // 鎵归噺鏇存柊鐩戞祴鏁版嵁寰楀垎 updateMultipleScore() { + this.updateLoading = true; useMessageBoxTip({ confirmMsg: '鏄惁涓婁紶鐩戞祴鏁版嵁寰楀垎', confirmTitle: '涓婁紶鐩戞祴鏁版嵁寰楀垎', - onConfirm: () => { + onConfirm: async () => { if (this.evaluationRule) { - const param = this.tableData.map((v) => { + const subTaskEvaList = this.tableData.map((v) => { const subRule = []; for (const key in this.ruleName) { const value = this.ruleName[key]; subRule.push({ - first: value.id, - second: v[key].trim() != '' + id: value.id, + selected: v[key] && (v[key] + '').trim() != '' }); } return { - ...this.area, subTaskId: v.subTaskId, ruleId: this.evaluationRule.guid, subRule }; }); + const param = { + ...this.area, + subTaskEvaList + }; - evaluateApi.updateMultipleScore(param); + return await evaluateApi + .updateMultipleScore(param) + .finally(() => (this.updateLoading = false)); } } }); -- Gitblit v1.9.3