Prechádzať zdrojové kódy

服务商审核快捷审核模式拒绝原因填写

yuanmingze 1 deň pred
rodič
commit
6e821264a5

BIN
dist.zip


+ 74 - 4
src/views/admin/assignPoints/quota/quickAudit.vue

@@ -294,6 +294,10 @@
               </div>
             </div>
           </template>
+
+          <el-input type="textarea" v-model="item.checkMessage"></el-input>
+
+          <refuseReason @selectRefuseReason="(refuseReason) => selectRefuseReason(refuseReason, item)" />
           <div class="btns">
             <el-button :disabled="getShowBtn(item)" class="btn" @click="debouncedPassClick(index, 4, item.id)">拒绝</el-button>
             <el-button :disabled="getShowBtn(item)" class="btn" type="primary" @click="debouncedPassClick(index, 3, item.id)">通过</el-button>
@@ -301,6 +305,22 @@
         </el-card>
       </div>
     </div>
+
+    <!-- 审核弹窗 -->
+    <el-dialog title="审核" :close-on-click-modal="false" :visible.sync="reviewDialog" top="12vh" width="50%" center :before-close="handleClose">
+      <div class="reviewContent" v-loading="loading">
+        <el-form :model="taskForm" :rules="rules" ref="taskForm" label-width="100px">
+          <el-form-item label="意见说明:" prop="checkMessage" class="formitem-box">
+            <el-input type="textarea" v-model="taskForm.checkMessage"></el-input>
+          </el-form-item>
+          <refuseReason @selectRefuseReason="formSelectRefuseReason" />
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">取 消</el-button>
+        <el-button type="primary" @click="checkForm" v-loading="loading">确 定</el-button>
+      </span>
+    </el-dialog>
   </basic-container>
 </template>
 
@@ -316,9 +336,10 @@ import QRCode from 'qrcode';
 import request from '@/router/axios';
 import ElImageViewer from 'element-ui/packages/image/src/image-viewer';
 import { mapGetters } from 'vuex';
+import refuseReason from '@/components/refuseReason';
 
 export default {
-  components: { ElImageViewer },
+  components: { ElImageViewer, refuseReason },
   data() {
     return {
       form: {
@@ -338,7 +359,20 @@ export default {
       column2Height: 270,
       imgTypeList: ['jpeg', 'jpg', 'png', 'git', 'bmp'], // 能查看的文件类型
       showViewer: false,
-      viewerList: []
+      viewerList: [],
+      reviewDialog: false,
+      taskForm: {
+        checkMessage: ''
+      },
+      rules: {
+        checkMessage: [
+          {
+            required: true,
+            message: '请输入审批说明',
+            trigger: 'blur'
+          }
+        ]
+      }
     };
   },
   computed: {
@@ -397,6 +431,21 @@ export default {
   },
 
   methods: {
+    handleClose() {
+      this.taskForm.checkMessage = '';
+      this.reviewDialog = false;
+    },
+    formSelectRefuseReason(reason) {
+      this.taskForm.checkMessage = reason;
+    },
+    checkForm() {
+      this.$refs.taskForm.validate(async (valid) => {
+        if (valid) {
+          this.allPassClick();
+          this.reviewDialog = false;
+        }
+      });
+    },
     // 判断审核按钮展示
     getShowBtn(row) {
       let flag = false;
@@ -513,6 +562,11 @@ export default {
         this.$message.error('请先选择数据!');
         return;
       }
+      const checkMessage = this.taskForm.checkMessage;
+      if (type == 4 && !this.taskForm.checkMessage) {
+        this.reviewDialog = true;
+        return;
+      }
       const taskIdToNodeIdMap = {};
       this.list.forEach((item) => {
         if (item.checked) {
@@ -539,10 +593,10 @@ export default {
         }
       });
       if (this.$route.query.type == '1') {
-        console.log('taskIdToNodeIdMap', taskIdToNodeIdMap);
         let obj = {
           id: this.checkedIds.join(','),
           taskIdToNodeIdMap: taskIdToNodeIdMap,
+          checkMessage: checkMessage,
           taskStatus: type
         };
         await batchApprovalTask(obj);
@@ -552,6 +606,7 @@ export default {
           reportId: this.$route.query.id,
           taskIdToNodeIdMap: taskIdToNodeIdMap,
           taskIds: this.checkedIds.join(','),
+          checkMessage: checkMessage,
           approvalOpinion: approvalOpinion
         };
         await wmreportBatchApprovalTask(obj);
@@ -561,6 +616,9 @@ export default {
       let curr = this.taskList.find((item) => item.id == taskType);
       if (curr) return curr.taskTypeName;
     },
+    selectRefuseReason(refuseReason, item) {
+      item.checkMessage = refuseReason;
+    },
     async getList() {
       let res;
       if (this.$route.query.type === '1') {
@@ -578,6 +636,7 @@ export default {
       }
       await res.data.data.forEach(async (item) => {
         if (item.config && item.config.length != 0) {
+          item.checkMessage = '';
           item.config.forEach((iten) => {
             iten.taskFiledType = iten.taskFiledType.trim();
             if (iten.taskFiledType == 'img') {
@@ -888,6 +947,12 @@ export default {
       return address;
     },
     async passClick(index, type, id) {
+      const curr = this.list[index];
+      const checkMessage = curr.checkMessage;
+      if (type == 4 && !checkMessage) {
+        return this.$message.warning('请完善拒绝原因');
+      }
+
       this.list[index].show = false;
       this.column1Height = 270;
       this.column2Height = 270;
@@ -897,11 +962,11 @@ export default {
         this.maps[id].setMap && this.maps[id].setMap(null);
       }
       this.$forceUpdate();
-
       if (this.$route.query.type == '1') {
         const obj = {
           id: id,
           taskStatus: type,
+          checkMessage: checkMessage,
           taskIdToNodeIdMap: {
             [id]: this.list[index].taskInfo.checkState.curNodeId
           }
@@ -920,6 +985,7 @@ export default {
         let obj = {
           reportId: this.$route.query.id,
           taskIds: id,
+          checkMessage: checkMessage,
           taskIdToNodeIdMap: {
             [id]: nodeId
           },
@@ -1083,4 +1149,8 @@ export default {
     }
   }
 }
+::v-deep .refuse-reason {
+  padding-left: 0 !important;
+  margin-top: 5px;
+}
 </style>