From 53c269711fcb59f48fd2acd7e825bebfd31d09e5 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期三, 09 四月 2025 16:33:10 +0800
Subject: [PATCH] 点检工单修改,修改指派设备问题

---
 src/views/eam/maintenance/EamInspectionOrderList.vue |  180 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 145 insertions(+), 35 deletions(-)

diff --git a/src/views/eam/maintenance/EamInspectionOrderList.vue b/src/views/eam/maintenance/EamInspectionOrderList.vue
index 3fb8659..11083ce 100644
--- a/src/views/eam/maintenance/EamInspectionOrderList.vue
+++ b/src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -44,13 +44,10 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-<!--      <a-button type="primary" icon="download" @click="handleExportXls('eam_inspection_order')">瀵煎嚭</a-button>-->
-<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
-<!--        <a-button type="primary" icon="import">瀵煎叆</a-button>-->
-<!--      </a-upload>-->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item>
+          <a-menu-item key="1" @click="batchZf(5)"><a-icon type="snippets"/>浣滃簾</a-menu-item>
+          <a-menu-item key="2" @click="batchLq(2)"><a-icon type="form"/>棰嗗彇</a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button>
       </a-dropdown>
@@ -98,18 +95,25 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
+          <a v-if="record.inspectionStatus === '1'" @click="handleEdit(record)">缂栬緫</a>
 
-          <a-divider type="vertical" />
+          <a-divider v-if="record.inspectionStatus === '1'" type="vertical" />
+
+          <a-popconfirm v-if="record.inspectionStatus === '1'" title="纭畾棰嗗彇鍚�?" @confirm="() => handleInspection(record.id)">
+                  <a>棰嗗彇</a>
+          </a-popconfirm>
+
+          <a-divider v-if="record.inspectionStatus === '1'" type="vertical" />
+
           <a-dropdown>
             <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
             <a-menu slot="overlay">
               <a-menu-item>
                 <a @click="handleDetail(record)">璇︽儏</a>
               </a-menu-item>
-              <a-menu-item>
-                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
-                  <a>鍒犻櫎</a>
+              <a-menu-item  v-if="record.inspectionStatus === '1'" >
+                <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleDelete(record.id)">
+                  <a>浣滃簾</a>
                 </a-popconfirm>
               </a-menu-item>
             </a-menu>
@@ -120,6 +124,7 @@
     </div>
 
     <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal>
+    <EamInspectionOrderModalXq ref="modalFormXq" @ok="modalFormOk"></EamInspectionOrderModalXq>
   </a-card>
 </template>
 
@@ -129,12 +134,15 @@
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
+  import EamInspectionOrderModalXq from './modules/EamInspectionOrderModalXq.vue'
+  import { deleteAction, getAction } from '@api/manage'
 
   export default {
     name: 'EamInspectionOrderList',
     mixins:[JeecgListMixin, mixinDevice],
     components: {
-      EamInspectionOrderModal
+      EamInspectionOrderModal,
+      EamInspectionOrderModalXq
     },
     data () {
       return {
@@ -159,12 +167,12 @@
           {
             title:'璁惧缂栧彿',
             align:"center",
-            dataIndex: 'equipmentId'
+            dataIndex: 'equipmentId_dictText'
           },
           {
             title:'鏍囧噯缂栫爜',
             align:"center",
-            dataIndex: 'standardId'
+            dataIndex: 'standardId_dictText'
           },
           {
             title:'鐐规鏃ユ湡',
@@ -173,19 +181,6 @@
             customRender:function (text) {
               return !text?"":(text.length>10?text.substr(0,10):text)
             }
-          },
-          {
-            title:'鐐规鏃堕棿',
-            align:"center",
-            dataIndex: 'operateTime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
-          },
-          {
-            title:'鐐规浜�',
-            align:"center",
-            dataIndex: 'operator'
           },
           {
             title:'鐐规杩囨湡鏃堕棿',
@@ -198,12 +193,25 @@
           {
             title:'鍒涘缓鏂瑰紡',
             align:"center",
-            dataIndex: 'creationMethod'
+            dataIndex: 'creationMethod_dictText'
           },
           {
             title:'鐐规鐘舵��',
             align:"center",
             dataIndex: 'inspectionStatus_dictText'
+          },
+          {
+            title:'鐐规鏃堕棿',
+            align:"center",
+            dataIndex: 'operateTime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'鐐规浜�',
+            align:"center",
+            dataIndex: 'operator_dictText'
           },
           {
             title:'鐝粍闀跨‘璁�',
@@ -219,11 +227,6 @@
             }
           },
           {
-            title:'澶囨敞',
-            align:"center",
-            dataIndex: 'remark'
-          },
-          {
             title: '鎿嶄綔',
             dataIndex: 'action',
             align:"center",
@@ -234,11 +237,12 @@
         ],
         url: {
           list: "/eam/eamInspectionOrder/list",
-          delete: "/eam/eamInspectionOrder/delete",
+          delete: "/eam/eamInspectionOrder/cancelInspectionOrder",
           deleteBatch: "/eam/eamInspectionOrder/deleteBatch",
           exportXlsUrl: "/eam/eamInspectionOrder/exportXls",
           importExcelUrl: "eam/eamInspectionOrder/importExcel",
-
+          receiveInspectionOrder : "eam/eamInspectionOrder/receiveInspectionOrder",
+          cancelOrReceive: "eam/eamInspectionOrder/cancelOrReceive"
         },
         dictOptions:{},
         superFieldList:[],
@@ -271,7 +275,113 @@
         fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''})
         fieldList.push({type:'string',value:'imageFiles',text:'鐓х墖鏂囦欢ids;id浠ラ�楀彿鍒嗛殧',dictCode:''})
         this.superFieldList = fieldList
-      }
+      },
+      //璇︽儏
+      handleDetail: function(record) {
+        this.$refs.modalFormXq.edit(record);
+        this.$refs.modalFormXq.title = "璇︽儏";
+        this.$refs.modalFormXq.disableSubmit = true;
+      },
+      handleInspection(id) {
+        if (!this.url.receiveInspectionOrder) {
+          this.$message.error("璇疯缃畊rl.receiveInspectionOrder!")
+          return
+        }
+        var that = this;
+        getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => {
+          if (res.success) {
+            that.$notification.success({
+              message: '娑堟伅',
+              description: res.message
+            });
+            that.loadData();
+          } else {
+            // that.$message.warning(res.message);
+            that.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            });
+          }
+        });
+      },
+      batchZf(type){
+        if (this.selectedRowKeys.length <= 0) {
+          this.$notification.warning({
+            message:'娑堟伅',
+            description:"璇烽�夋嫨涓�鏉¤褰�"
+          });
+        } else {
+          var ids = "";
+          for (var a = 0; a < this.selectedRowKeys.length; a++) {
+            ids += this.selectedRowKeys[a] + ",";
+          }
+          var that = this;
+          this.$confirm({
+            title: "纭浣滃簾",
+            content: "鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?",
+            onOk: function () {
+              that.loading = true;
+              getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                  that.loadData();
+                  that.onClearSelected();
+                } else {
+                  // that.$message.warning(res.message);
+                  that.$notification.warning({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                }
+              }).finally(() => {
+                that.loading = false;
+              });
+            }
+          });
+        }
+      },
+      batchLq(type){
+        if (this.selectedRowKeys.length <= 0) {
+          this.$notification.warning({
+            message:'娑堟伅',
+            description:"璇烽�夋嫨涓�鏉¤褰�"
+          });
+        } else {
+          var ids = "";
+          for (var a = 0; a < this.selectedRowKeys.length; a++) {
+            ids += this.selectedRowKeys[a] + ",";
+          }
+          var that = this;
+          this.$confirm({
+            title: "纭棰嗗彇",
+            content: "鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?",
+            onOk: function () {
+              that.loading = true;
+              getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                  that.loadData();
+                  that.onClearSelected();
+                } else {
+                  // that.$message.warning(res.message);
+                  that.$notification.warning({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                }
+              }).finally(() => {
+                that.loading = false;
+              });
+            }
+          });
+        }
+      },
     }
   }
 </script>

--
Gitblit v1.9.3