From f3fcd30cadbcbd406a6e10e3c7df64e5306db069 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期二, 12 十二月 2023 17:28:43 +0800
Subject: [PATCH] 技术状态鉴定 批量点检驳回 审批

---
 src/views/eam/DailyInspectionStandardList.vue |  124 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 117 insertions(+), 7 deletions(-)

diff --git a/src/views/eam/DailyInspectionStandardList.vue b/src/views/eam/DailyInspectionStandardList.vue
index 2ba59ba..afc6879 100644
--- a/src/views/eam/DailyInspectionStandardList.vue
+++ b/src/views/eam/DailyInspectionStandardList.vue
@@ -92,6 +92,22 @@
         icon="reload"
         style="margin-left: 8px"
       >閲嶇疆</a-button>
+      <a-button
+        v-show="this.selectedRowKeys.length > 0 && this.queryParam.versionStatus == '1'"
+        type="primary"
+        @click="batchHandleOK"
+        icon="reload"
+        style="margin-left: 8px"
+        v-has="'dailyInspectionStandard:batchHandleOK'"
+      >鎵归噺閫氳繃</a-button>
+      <a-button
+        v-show="this.selectedRowKeys.length > 0 && this.queryParam.versionStatus == '1'"
+        type="primary"
+        @click="batchHandleReject"
+        icon="reload"
+        style="margin-left: 8px"
+        v-has="'dailyInspectionStandard:batchHandleReject'"
+      >鎵归噺椹冲洖</a-button>
     </div>
 
     <!-- table鍖哄煙-begin -->
@@ -292,11 +308,11 @@
           align: 'center',
           dataIndex: 'teamName',
         },
-        {
-          title: '娲惧伐鏂瑰紡',
-          align: 'center',
-          dataIndex: 'assignModeName',
-        },
+        // {
+        //   title: '娲惧伐鏂瑰紡',
+        //   align: 'center',
+        //   dataIndex: 'assignModeName',
+        // },
         {
           title: '瀹℃牳鎰忚',
           align: 'center',
@@ -377,7 +393,7 @@
           align: 'center',
           fixed: 'right',
           scopedSlots: { customRender: 'action' },
-          width: 200,
+          width: 230,
         }
       ],
       url: {
@@ -386,6 +402,7 @@
         deleteBatch: '/eam/inspectionStandard/deleteBatch',
         versionTakeEffect: "/eam/inspectionStandard/versionTakeEffect",
         importExcelUrl: "/eam/inspectionStandard/importExcel",
+        passBatch: '/eam/inspectionStandard/auditApprovalBatch',
       },
       version: '1.0',
       dictOptions: {},
@@ -514,7 +531,7 @@
     },
     searchReset() {
       this.inspectionStandardId = '-1'
-      this.queryParam = {}
+      this.queryParam = { versionStatus: '2' }
       this.loadData(1);
     },
     modalFormOk() {
@@ -523,6 +540,99 @@
       //娓呯┖鍒楄〃閫変腑
       // this.onClearSelected()
     },
+    batchHandleReject: function () {
+      if (this.selectedRowKeys.length <= 0) {
+        // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒');
+        this.$notification.warning({
+          message: '娑堟伅',
+          description: "璇烽�夋嫨涓�鏉¤褰�"
+        });
+        return;
+      } else {
+
+        var that = this;
+        this.$confirm({
+          title: "纭鎵归噺椹冲洖",
+          content: "鏄惁鎵归噺椹冲洖閫変腑鏁版嵁?",
+          onOk: function () {
+            that.loading = true;
+            that.confirmLoading = true;
+            let formData = {};
+            let dailyInspectionStandardlist = that.selectionRows
+            for (var i = 0; i < dailyInspectionStandardlist.length; i++) {
+              let record = dailyInspectionStandardlist[i]
+              if (record.approvalStatus == '1') {
+                record.approvalStatus = '2'
+              } else if (record.approvalStatus == '3') {
+                record.approvalStatus = '4'
+              } else if (record.approvalStatus == '4') {
+                record.approvalStatus = '2'
+              }
+            }
+            formData.dailyInspectionStandardlist = dailyInspectionStandardlist
+            requestPut(that.url.passBatch, formData).then((res) => {
+              if (res.success) {
+                that.$message.success("鎵归噺椹冲洖鎴愬姛锛�")
+                that.loadData(1)
+              } else {
+                that.$message.warning("鎵归噺閫氳繃澶辫触锛�")
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.loading = false;
+            })
+          }
+        });
+      }
+    },
+
+    batchHandleOK: function () {
+      if (this.selectedRowKeys.length <= 0) {
+        // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒');
+        this.$notification.warning({
+          message: '娑堟伅',
+          description: "璇烽�夋嫨涓�鏉¤褰�"
+        });
+        return;
+      } else {
+
+        var that = this;
+        this.$confirm({
+          title: "纭鎵归噺閫氳繃",
+          content: "鏄惁鎵归噺閫氳繃閫変腑鏁版嵁?",
+          onOk: function () {
+            that.loading = true;
+            that.confirmLoading = true;
+            let formData = {};
+            let dailyInspectionStandardlist = that.selectionRows
+            for (var i = 0; i < dailyInspectionStandardlist.length; i++) {
+              let record = dailyInspectionStandardlist[i]
+              if (record.approvalStatus == '1') {
+                record.approvalStatus = '3'
+              } else if (record.approvalStatus == '2') {
+                record.approvalStatus = '3'
+              } else if (record.approvalStatus == '3') {
+                record.approvalStatus = '5'
+              } else if (record.approvalStatus == '4') {
+                record.approvalStatus = '3'
+              }
+            }
+            formData.dailyInspectionStandardlist = dailyInspectionStandardlist
+            requestPut(that.url.passBatch, formData).then((res) => {
+              if (res.success) {
+                that.$message.success("鎵归噺閫氳繃鎴愬姛锛�")
+                that.loadData(1)
+              } else {
+                that.$message.warning("鎵归噺閫氳繃澶辫触锛�")
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.loading = false;
+            })
+          }
+        });
+      }
+    },
 
   }
 }

--
Gitblit v1.9.3