Jelajahi Sumber

快捷审核批量校验限制

ymz 4 bulan lalu
induk
melakukan
e09cb061a3
2 mengubah file dengan 80 tambahan dan 4 penghapusan
  1. TEMPAT SAMPAH
      dist.zip
  2. 80 4
      src/views/serviceManagement/quickReview/index.vue

TEMPAT SAMPAH
dist.zip


+ 80 - 4
src/views/serviceManagement/quickReview/index.vue

@@ -235,6 +235,37 @@
         <el-button type="primary" @click="checkForm" v-loading="loading">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="批量审核预处理结果" :visible.sync="lockedDialog" top="12vh" width="50%" :before-close="lockedDialogClose" center :show-close="false">
+      <div>
+        <div class="check-tips">
+          本次批量审核,拟处理服务 【{{ pretreatmentInfo?.total?.length }}】 个, 成功预留【{{ pretreatmentInfo?.available?.length }}】个,忽略【{{
+            pretreatmentInfo?.locked?.length
+          }}】个, 继续审核请点击“确定”,放弃请点击“取消”(有效期三分钟)。
+        </div>
+        <el-table
+          :data="pretreatmentInfo?.total"
+          border
+          style="width: 100%"
+          max-height="500"
+          :header-cell-style="{ 'text-align': 'center' }"
+          :cell-style="{ 'text-align': 'center' }"
+        >
+          <el-table-column prop="taskId" label="任务ID"> </el-table-column>
+          <el-table-column prop="status" label="预留结果">
+            <template slot-scope="scope">
+              <span :class="scope.row.status === '成功' ? 'status-success' : 'status-fail'">{{ scope.row.status }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="lockInfo" label="结果说明"> </el-table-column>
+          <el-table-column prop="expireAt" label="锁定至"> </el-table-column>
+        </el-table>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="lockedDialogClose">取 消</el-button>
+        <el-button type="primary" @click="lockedBtn">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -248,7 +279,9 @@ import {
   taskV2CheckBatchApi,
   checkSingleApi,
   getTaskV2PageTileApi,
-  getPkgV2Api
+  getPkgV2Api,
+  getPretreatmentApi,
+  pretreatmentClearApi
 } from '@/api/serviceManagement/servicesToBeReviewed/index.js';
 import refuseReason from '@/components/refuseReason';
 import { getDictType } from '@/api/common';
@@ -307,7 +340,10 @@ export default {
       rules: {
         checkResult: [{ required: true, message: '请选择审批意见', trigger: 'change' }]
       },
-      loading: false
+      loading: false,
+      pretreatmentInfo: {},
+      lockedInfo: [],
+      lockedDialog: false
     };
   },
   async created() {
@@ -503,8 +539,48 @@ export default {
       if (!this.checkIds.length) {
         return this.$message.error('请选择待审核数据');
       }
-      await this.getToken(this.checkIds);
-      this.reviewDialog = true;
+
+      this.getPretreatment();
+    },
+    async getPretreatment() {
+      const res = await getPretreatmentApi({ taskIds: this.checkIds });
+      if (res.data.code === 0) {
+        this.pretreatmentInfo = res.data.data;
+        this.lockedInfo = res.data.data.locked;
+        this.lockedDialog = true;
+      }
+    },
+    async lockedBtn() {
+      if (this.pretreatmentInfo.available.length) {
+        this.lockedDialog = false;
+        this.lockedInfo = [];
+        this.reviewDialog = true;
+        await this.getToken(this.checkIds);
+      } else {
+        this.$message.info('当前无可审核数据!');
+        this.list.forEach((item) => {
+          if (item.reviewInfo.checked) {
+            this.checkAllLength = 0;
+            this.checkAllTaskScore;
+            item.reviewInfo.checked = false;
+            item.reviewInfo.show = false;
+          }
+        });
+        this.lockedDialogClose();
+      }
+    },
+    async lockedDialogClose() {
+      const taskIds = this.pretreatmentInfo.available.map((item) => item.taskId);
+      if (this.pretreatmentInfo?.token?.token) {
+        const obj = {
+          taskIds: taskIds,
+          token: this.pretreatmentInfo.token.token
+        };
+        await pretreatmentClearApi(obj);
+      }
+
+      this.lockedDialog = false;
+      this.lockedInfo = [];
     },
     async getToken(taskIds) {
       const tokenRes = await getTaskV2TokenApi({ taskIds: taskIds });