From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期五, 24 十一月 2023 16:41:32 +0800
Subject: [PATCH] 故障报修验收

---
 src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue |  138 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 122 insertions(+), 16 deletions(-)

diff --git a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue
index 13d9c64..ecea2ac 100644
--- a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue
+++ b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue
@@ -7,14 +7,19 @@
     cancelText="鍏抽棴"
     @cancel="handleCancel"
     :confirmLoading="confirmLoading"
+    title="闄勫綍2"
   >
-    <!-- :title="title" -->
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
+        <span
+          class="ant-descriptions-title"
+          style="font-size: large;font-size: 15px;float: right;"
+        >{{this.model.receiptsNum}}</span>
         <a-divider
           orientation="center"
           style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
-        > 鐢熶骇璁惧浜岀骇淇濆吇瀹屽伐绉讳氦鍗� </a-divider>
+        > {{this.model.receiptsName}} </a-divider>
+        <!-- 鐢熶骇璁惧浜岀骇淇濆吇瀹屽伐绉讳氦鍗� -->
         <a-row :gutter="24">
           <a-col :span="8">
             <a-form-item
@@ -78,6 +83,7 @@
       rowKey='id'
       :columns="columns"
       :dataSource="dataSource"
+      :pagination="false"
     >
 
     </a-table>
@@ -146,12 +152,39 @@
         鍏抽棴
       </a-button>
 
-      <a-button
+      <!-- <a-button
         @click="handleOk()"
         type="primary"
         :loading="confirmLoading"
         :disabled="disableSubmit || confirmLoading"
-      >纭畾</a-button>
+      >纭畾</a-button> -->
+      <a-popconfirm
+        @confirm="() => handleReject()"
+        title="纭灏嗗綋鍓嶄簩淇濆畬宸ョЩ浜ゅ崟椹冲洖锛�"
+        :disabled="this.model.confirmStatus == '0' || this.model.confirmStatus == '2'|| this.model.confirmStatus == '7'"
+      >
+        <a-button
+          :loading='confirmLoading'
+          :style="{marginRight: '8px'}"
+          :disabled="this.model.confirmStatus == '0' || this.model.confirmStatus == '2'|| this.model.confirmStatus == '7'"
+        >
+          椹冲洖
+        </a-button>
+      </a-popconfirm>
+      <a-popconfirm
+        @confirm="() => handleOk()"
+        title="纭灏嗗綋鍓嶄簩淇濆畬宸ョЩ浜ゅ崟瀹℃牳閫氳繃锛�"
+        :disabled="this.model.confirmStatus == '7'"
+      >
+        <a-button
+          type='primary'
+          :loading='confirmLoading'
+          :style="{marginRight: '8px'}"
+          :disabled="this.model.confirmStatus == '7'"
+        >
+          閫氳繃
+        </a-button>
+      </a-popconfirm>
     </template>
 
   </a-modal>
@@ -190,7 +223,7 @@
         {
           title: '绫诲瀷',
           align: 'center',
-          dataIndex: 'maintenanceMethod1'
+          dataIndex: 'maintenanceRole'
         },
 
         {
@@ -201,7 +234,7 @@
         {
           title: '淇濆吇椤圭洰',
           align: 'center',
-          dataIndex: 'maintenanceProjectNum'
+          dataIndex: 'maintenanceProjectName'
         },
         {
           title: '淇濆吇鏍囧噯',
@@ -211,12 +244,12 @@
         {
           title: '鎵ц鎯呭喌',
           align: 'center',
-          dataIndex: 'maintenanceTool1'
+          dataIndex: 'maintenanceOrderDetailUda2'
         },
         {
           title: '鎵ц浜�',
           align: 'center',
-          dataIndex: 'photo1',
+          dataIndex: 'maintenanceOrderDetailUda1',
         },
 
       ],
@@ -226,7 +259,7 @@
       codeDisable: true,
       dataSource: [],
       model: {},
-      departs: [],
+      // departs: [],
       labelCol: {
         xs: { span: 24 },
         sm: { span: 6 },
@@ -245,9 +278,9 @@
         },
       },
       url: {
-        add: "/eam/dailyMaintenanceOrder/add",
+        // add: "/eam/dailyMaintenanceOrder/add",
         edit: "/eam/dailyMaintenanceOrder/approve",
-        getSysDeparts: "/eam/dailyMaintenanceOrder/getSysDeparts",
+        getSysFileName: "/eam/sysFileName/getSysFileName",
         list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
       },
 
@@ -258,7 +291,9 @@
 
     edit(record) {
       let that = this;
-      this.getSysDeparts()
+      if (record.receipts == "" || record.receipts == null) {
+        this.getSysFileName()
+      }
       this.form.resetFields();
       this.model = Object.assign({}, record);
       this.visible = true;
@@ -286,12 +321,24 @@
       this.close();
     },
 
-    handleOk() {
+
+    handleReject() {
       const that = this;
       this.form.validateFields((err, values) => {
         if (!err) {
           that.confirmLoading = true;
           let formData = Object.assign(this.model, values);
+          if (this.model.confirmStatus == '1') {
+            formData.confirmStatus = '2'
+          } else if (this.model.confirmStatus == '3') {
+            formData.confirmStatus = '4'
+          } else if (this.model.confirmStatus == '5') {
+            formData.confirmStatus = '6'
+          } else if (this.model.confirmStatus == '6') {
+            formData.confirmStatus = '4'
+          } else if (this.model.confirmStatus == '4') {
+            formData.confirmStatus = '2'
+          }
           requestPut(this.url.edit, formData, { id: this.model.id }).then((res) => {
             if (res.success) {
               that.$message.success(res.message);
@@ -307,15 +354,74 @@
       })
     },
 
+
+    handleOk() {
+      const that = this;
+      that.form.validateFields((err, values) => {
+        if (!err) {
+          this.confirmLoading = true;
+          let formData = Object.assign(this.model, values);
+          if (this.model.confirmStatus == '0') {
+            formData.confirmStatus = '1'
+          } else if (this.model.confirmStatus == '2') {
+            formData.confirmStatus = '1'
+          } else if (this.model.confirmStatus == '1') {
+            formData.confirmStatus = '3'
+          } else if (this.model.confirmStatus == '4') {
+            formData.confirmStatus = '3'
+          } else if (this.model.confirmStatus == '3') {
+            formData.confirmStatus = '5'
+          } else if (this.model.confirmStatus == '6') {
+            formData.confirmStatus = '5'
+          } else if (this.model.confirmStatus == '5') {
+            formData.confirmStatus = '7'
+          }
+          requestPut(this.url.edit, formData, { id: this.model.id }).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message);
+              that.$emit('ok');
+            } else {
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+            that.close();
+          })
+        }
+      })
+    },
+
+
+    // handleOk() {
+    //   const that = this;
+    //   this.form.validateFields((err, values) => {
+    //     if (!err) {
+    //       that.confirmLoading = true;
+    //       let formData = Object.assign(this.model, values);
+    //       requestPut(this.url.edit, formData, { id: this.model.id }).then((res) => {
+    //         if (res.success) {
+    //           that.$message.success(res.message);
+    //           that.$emit('ok');
+    //         } else {
+    //           that.$message.warning(res.message);
+    //         }
+    //       }).finally(() => {
+    //         that.confirmLoading = false;
+    //         that.close();
+    //       })
+    //     }
+    //   })
+    // },
+
     handleDelete(text, record, index) {
       this.dataSource.splice(index, 1);
     },
 
 
-    getSysDeparts() {
-      getAction(this.url.getSysDeparts).then((res) => {
+    getSysFileName() {
+      getAction(this.url.getSysFileName, { name: '15' }).then((res) => {
         if (res.success) {
-          this.departs = res.result
+          this.model = Object.assign(this.model, res.result[0]);
         }
       })
     },

--
Gitblit v1.9.3