From 336dcb70c156c947530eab0f0a96ee17de477929 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期五, 12 七月 2024 18:04:33 +0800
Subject: [PATCH] 设备管理修改

---
 src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue |  103 +++++++++++++++++++--------------------------------
 1 files changed, 39 insertions(+), 64 deletions(-)

diff --git a/src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue b/src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
index dc2e7d1..7a0f2fe 100644
--- a/src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
+++ b/src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
@@ -20,28 +20,29 @@
       >
         <div :key="col.dataIndex">
           <a-input
-               :value="text"
-               v-if="col.dataIndex == 'sparePartId'"
-               auto-size
-               placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
-               @change="(e)=>handleChange(e, record.key, col, index)"
-               :disabled="record.disabled"
+            :value="text"
+            v-if="col.dataIndex == 'sparePartId'"
+            auto-size
+            placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+            @change="(e)=>handleChange(e, record.key, col, index)"
+            :disabled="record.disabled"
           />
           <a-input
-               :value="text"
-               v-if="col.dataIndex == 'repairOrderAmUda1'"
-               auto-size
-               placeholder="璇疯緭鍏ュ崟浣�"
-               @change="(e)=>handleChange(e, record.key, col, index)"
-               :disabled="record.disabled"
+            :value="text"
+            v-if="col.dataIndex == 'repairOrderAmUda1'"
+            auto-size
+            placeholder="璇疯緭鍏ュ崟浣�"
+            @change="(e)=>handleChange(e, record.key, col, index)"
+            :disabled="record.disabled"
           />
-          <j-dict-select-tag 
-                :value='text'
-                v-if="col.dataIndex == 'outboundOrderId'"
-                dictCode="material_type"
-                :disabled="true"
-                style="width: 100%;"
-                @change='(e)=>handleChange(e, record.key, col, index)'/>
+          <j-dict-select-tag
+            :value='text'
+            v-if="col.dataIndex == 'outboundOrderId'"
+            dictCode="material_type"
+            :disabled="false"
+            style="width: 100%;"
+            @change='(e)=>handleChange(e, record.key, col, index)'
+          />
           <a-input-number
             :value="text"
             v-if="col.dataIndex == 'actualQuantity'"
@@ -95,8 +96,9 @@
       type="dashed"
       icon="plus"
       @click="addMaterial"
-      :disabled="mainId.status!='3'||( mainId.repairOrderUda1!='needPart'&&mainId.repairOrderUda1!='needSpare')"
+      :disabled="mainId.status!='3'"
     >娣诲姞瀹為檯鐢ㄦ枡</a-button>
+    <!-- :disabled="mainId.status!='3'||( mainId.repairOrderUda1!='needPart'&&mainId.repairOrderUda1!='needSpare')" -->
     <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
       <a-row :style="{textAlign:'right'}">
         <a-button
@@ -201,74 +203,39 @@
             return parseInt(index) + 1;
           }
         },
-        // {
-        //   title: '棰嗘枡鍑哄簱鍗�',
-        //   dataIndex: 'num',
-        //   align: "center",
-        //   width: 150,
-        // },
-        // {
-        //   title: '澶囦欢缂栫爜',
-        //   dataIndex: 'sparePartNum',
-        //   align: "center",
-
-        // },
         {
           title: '鐗╂枡鍚嶇О',
           dataIndex: 'sparePartId',
           scopedSlots: { customRender: 'sparePartId' },
           align: "center",
-           className: 'red',
-          width: 250,
+          className: 'red',
+          // width: 250,
         },
         {
           title: '鐗╂枡绉嶇被',
           dataIndex: 'outboundOrderId',
           scopedSlots: { customRender: 'outboundOrderId' },
           align: "center",
-          width: 250,
+          // width: 250,
         },
-        // {
-        //   title: '鍨嬪彿',
-        //   dataIndex: 'sparePartModel',
-        //   align: "center",
-        // },
-        // {
-        //   title: '鍒堕�犲晢',
-        //   dataIndex: 'constructorName',
-        //   align: "center",
-        // },
         {
           title: '鍗曚綅',
           dataIndex: 'repairOrderAmUda1',
           scopedSlots: { customRender: 'repairOrderAmUda1' },
           align: "center",
           className: 'red',
-          width: 250,
         },
-        // {
-        //   title: '涓绘暟閲�',
-        //   align: 'center',
-        //   dataIndex: 'mainQuantity'
-        // },
-        // {
-        //   title: '鍙敤鏁伴噺',
-        //   align: 'center',
-        //   dataIndex: 'availableQuantity'
-        // },
         {
           title: '浣跨敤鏁伴噺',
           dataIndex: 'actualQuantity',
           align: "center",
           scopedSlots: { customRender: 'actualQuantity' },
           className: 'red',
-          width: 250,
         },
         {
           title: '鎿嶄綔',
           dataIndex: 'action',
           align: 'center',
-          width: 250,
           scopedSlots: { customRender: 'action' }
         }
       ],
@@ -286,7 +253,7 @@
   watch: {
     mainId: {
       immediate: true,
-      deep:true,
+      deep: true,
       handler(val) {
         console.log(val)
         if (!this.mainId.id) {
@@ -314,7 +281,8 @@
       // this.$refs.JSelectSparePartModal.showModals(ids);
       // this.$refs.JSelectSparePartModal.title = '閫夋嫨澶囦欢淇℃伅'
       // this.$refs.JSelectSparePartModal.disableSubmit = false
-      this.dataSource.push({ sparePartId: '', outboundOrderId: this.mainId.repairOrderUda1,repairOrderAmUda1: '', actualQuantity:'',repairOrderId:this.mainId.id })
+      // this.dataSource.push({ sparePartId: '', outboundOrderId: this.mainId.repairOrderUda1, repairOrderAmUda1: '', actualQuantity: '', repairOrderId: this.mainId.id })
+      this.dataSource.push({ sparePartId: '', outboundOrderId: '', repairOrderAmUda1: '', actualQuantity: '', repairOrderId: this.mainId.id })
     },
     handleCancel() {
       this.$bus.$emit('closeDrawer')
@@ -342,14 +310,17 @@
       //   this.dataSource = temp
       // }
       if ('sparePartId' == column.dataIndex) {
-          target['sparePartId'] = value.target.value
+        target['sparePartId'] = value.target.value
       }
       if ('repairOrderAmUda1' == column.dataIndex) {
-          target['repairOrderAmUda1'] = value.target.value
-      } 
+        target['repairOrderAmUda1'] = value.target.value
+      }
       if ('actualQuantity' == column.dataIndex) {
         target['actualQuantity'] = value
-      } 
+      }
+      if ('outboundOrderId' == column.dataIndex) {
+        target['outboundOrderId'] = value
+      }
     },
     clearList() {
       this.dataSource = [];
@@ -448,6 +419,10 @@
             that.$message.warning('璇峰~鍐欑' + (i + 1) + '琛屼娇鐢ㄦ暟閲忥紒')
             return false
           }
+          if (workHoursDataSource[i].outboundOrderId == undefined || workHoursDataSource[i].outboundOrderId == null || workHoursDataSource[i].outboundOrderId == '') {
+            that.$message.warning('璇峰~鍐欑' + (i + 1) + '琛岀墿鏂欑绫伙紒')
+            return false
+          }
         }
       }
       if (that.dataSource.length === 0) {

--
Gitblit v1.9.3