Sfoglia il codice sorgente

优化审核流程

hsh 9 mesi fa
parent
commit
9af3cd939c

+ 9 - 0
src/api/target-management/target-dict.js

@@ -150,4 +150,13 @@ export function updateTargetReportScoreByShf(data) {
         method: 'post',
         data,
     })
+}
+
+// 取消审核得分
+export function returnTargetReportScoreByShf(data) {
+    return request({
+        url: '/targetManagement/returnTargetReportScoreByShf',
+        method: 'post',
+        data,
+    })
 }

+ 66 - 14
src/views/target-management/target-dict/TargetDictConfig.vue

@@ -348,6 +348,7 @@
                   <el-form-item>
                     <el-button type="primary" @click="saveTargetDictZpf" :disabled="!isPf"> 确认</el-button>
                     <el-button type="primary" @click="saveTargetDictShf" :disabled="isPf"> 审核</el-button>
+                    <el-button type="warning" @click="returnTargetDictSh" :disabled="isPf"> 退审</el-button>
                   </el-form-item>
                 </el-form>
               </el-collapse-item>
@@ -378,7 +379,8 @@ import {
   selectTargetDictTree,
   selectTargetReportScore,
   updateTargetReportScore,
-  updateTargetReportScoreByShf
+  updateTargetReportScoreByShf,
+  returnTargetReportScoreByShf
 } from '@/api/target-management/target-dict'
 import {selectTargetZbReportId} from '@/api/target-management/report-dict'
 import {employeeList} from "@/api/zhu-yuan-yi-sheng/pat-info-query"
@@ -1078,6 +1080,7 @@ const scoreData = ref({
   criterionScore: '',
   authorId: '',
   authorName: '',
+  flag: ''
 })
 // 年度周期变化
 const cycleFormat = () => {
@@ -1165,8 +1168,9 @@ const callSaveTargetReportScore = () => {
   scoreData.value.reportScore = zbScore.value
   // 指标标准(得)分
   scoreData.value.criterionScore = ruleForm.value.score
-
-  updateTargetReportScore(scoreData.value)
+  // 审核标志
+  scoreData.value.flag = '2'
+  updateTargetReportScoreByShf(scoreData.value)
     .then((res: any) => {
       ElMessage({
         type: "success",
@@ -1413,7 +1417,6 @@ const saveTargetDictZpf = () => {
   zpfForm.value.pid = ruleForm.value.pid
   zpfForm.value.reportCycle = cycle.value
   zpfForm.value.criterionScore = ruleForm.value.score
-  zpfForm.value.year
   updateTargetReportScore(zpfForm.value)
     .then((res: any) => {
       ElMessage({
@@ -1464,17 +1467,25 @@ const saveTargetDictShf = () => {
     });
     return
   }
-  zpfForm.value.id = ruleForm.value.id
-  zpfForm.value.reportCycle = cycle.value
-  updateTargetReportScoreByShf(zpfForm.value)
-    .then((res: any) => {
-      ElMessage({
-        type: "success",
-        message: res.cg,
-        duration: 2500,
-        showClose: true,
+  ElMessageBox.confirm('请确认是否审核?', {
+    cancelButtonText: '取消',
+    confirmButtonText: '确定',
+  }).then(() => {
+    zpfForm.value.id = ruleForm.value.id
+    zpfForm.value.reportCycle = cycle.value
+    zpfForm.value.flag = '2'
+    updateTargetReportScoreByShf(zpfForm.value)
+      .then((res: any) => {
+        ElMessage({
+          type: "success",
+          message: res.cg,
+          duration: 2500,
+          showClose: true,
+        });
+        zbScore.value = zpfForm.value.reportScore
       });
-    });
+  }).catch(() => {
+  })
 }
 
 // 计算年均增长率
@@ -1493,6 +1504,47 @@ const callAverageAnnualGrowthRate = (data) => {
   }
 }
 
+// 取消审核
+const returnTargetDictSh = () => {
+  if(!ruleForm.value.id){
+    ElMessage({
+      type: "error",
+      message: '请选择一个指标!',
+      duration: 2500,
+      showClose: true,
+    });
+    return
+  }
+  if(!zpfForm.value.reportScore){
+    ElMessage({
+      type: "error",
+      message: '还未进行审核,无需取消审核!',
+      duration: 2500,
+      showClose: true,
+    });
+    return
+  }
+  ElMessageBox.confirm('请确认是否取消审核?', {
+    cancelButtonText: '取消',
+    confirmButtonText: '确定',
+  }).then(() => {
+    zpfForm.value.id = ruleForm.value.id
+    zpfForm.value.reportCycle = cycle.value
+    zpfForm.value.reportScore = ''
+    zpfForm.value.flag = '3'
+    returnTargetReportScoreByShf(zpfForm.value)
+      .then((res: any) => {
+        ElMessage({
+          type: "success",
+          message: res.cg,
+          duration: 2500,
+          showClose: true,
+        });
+        zbScore.value = ''
+      });
+  }).catch(() => {
+  })
+}
 </script>
 <style lang="scss" scoped>
 :deep(.hd-cl) {