From 8611a1ba1696e76cced04ff5d658ba138a05dafd Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期六, 19 八月 2023 14:37:32 +0800
Subject: [PATCH] 设备管理前端代码提交 截止 20230819 13:55 分

---
 src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue |   87 ++++++++++++++++++++++++++++---------------
 1 files changed, 57 insertions(+), 30 deletions(-)

diff --git a/src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue b/src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue
index c462277..7d45d2a 100644
--- a/src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue
+++ b/src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue
@@ -25,6 +25,7 @@
             :value="text"
             :read-only="true"
             @change="(e) => handleChange(e, record.key, col, index)"
+            :disabled="repairOrderStatus=='4'"
           />
           <a-input-number
             :value="text"
@@ -32,7 +33,7 @@
             :min="0"
             :max="99999"
             @change="(e)=>handleChange(e, record.key, col, index)"
-            :disabled="record.disabled"
+            :disabled="repairOrderStatus=='4'"
           />
 
         </div>
@@ -41,7 +42,10 @@
         slot='action'
         slot-scope='text, record,index'
       >
-        <a @click="handleDeleteFake(index)" v-if="record.isLock=='no'&&mainId.status=='3'">鍒犻櫎</a>
+        <a
+          :disabled="repairOrderStatus=='4'"
+          @click="handleDelete(index)"
+        >鍒犻櫎</a>
       </span>
     </a-table>
     <a-button
@@ -49,8 +53,9 @@
       type="dashed"
       icon="plus"
       @click="addHour"
-      :disabled="mainId.status=='4'"
+      :disabled="this.repairOrderStatus=='4' || this.repairOrderStatus=='2'"
     >娣诲姞瀹為檯宸ユ椂
+      <!-- :disabled="mainId.status=='4'" -->
     </a-button>
     <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
       <a-row :style="{textAlign:'right'}">
@@ -64,12 +69,12 @@
           @click="handleOk(1)"
           type="primary"
           :style="{marginRight: '8px'}"
-          :disabled="mainId.status=='4'"
+          :disabled="this.repairOrderStatus=='4' || this.repairOrderStatus=='2'"
         >鏆傚瓨</a-button>
         <a-button
           @click="handleOk(0)"
           type="primary"
-          :disabled="mainId.status=='4'"
+          :disabled="this.repairOrderStatus=='4' || this.repairOrderStatus=='2'"
         >淇濆瓨</a-button>
       </a-row>
       <!-- :disabled="false" -->
@@ -94,10 +99,29 @@
     JEllipsis,
     ActualHourUserSelect
   },
+  // props: {
+  //   mainId: {
+  //     type: Object,
+  //     required: false,
+  //     default: {}
+  //   }
+  // },
   props: {
-    mainId: {
-      type: Object,
-    }
+    repairOrderId: {
+      type: String,
+      required: false,
+      default: '-1'
+    },
+    repairOrderStatus: {
+      type: String,
+      required: false,
+      default: ''
+    },
+    teamId: {
+      type: String,
+      required: false,
+      default: ''
+    },
   },
   data() {
     return {
@@ -149,6 +173,16 @@
       dataSource: [],
       columns: [
         {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: "center",
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1;
+          }
+        },
+        {
           title: '*浜哄憳缂栫爜',
           dataIndex: 'username',
           align: "center",
@@ -185,30 +219,20 @@
       changeIndex: 0
     }
   },
-  created() {
-    // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId;
-    // this.queryParam['equipmentId'] = this.equipmentId
-    // this.loadData(1);
-  },
+
   watch: {
-    mainId: {
+    repairOrderId: {
       immediate: true,
       handler(val) {
-        console.log(val)
-        if (!this.mainId.id) {
-
-          this.clearList()
-        } else {
-
-          this.queryParam['repairOrderId'] = val.id
-          this.loadData(1)
-        }
+        this.clearList();
+        this.queryParam['repairOrderId'] = val
+        this.loadData(1)
       }
-    }
+    },
   },
   methods: {
     addHour() {
-      this.dataSource.push({ userId: '', repairOrderId: this.mainId.id, actualHour: 0, username: '', realname: '' })
+      this.dataSource.push({ userId: '', repairOrderId: this.repairOrderId, actualHour: 0, username: '', realname: '' })
     },
     handleCancel() {
       this.$bus.$emit('closeDrawer');
@@ -219,9 +243,10 @@
       this.disableSubmit = false;
       this.visible = false;
     },
-    handleDeleteFake(index) {
-      this.dataSource.pop(index);
+    handleDelete(text, record, index) {
+      this.dataSource.splice(index, 1);
     },
+
     handleOk(saveStatus) {
       const that = this
       if (saveStatus == 0) {
@@ -245,9 +270,10 @@
         if (!err) {
           that.confirmLoading = true
           let formData = {}
-          formData.repairOrderId = that.mainId.id;
+          // formData.repairOrderId = that.mainId.id;
+          formData.repairOrderId = that.repairOrderId;
           formData.repairOrderActualWorkHoursList = that.dataSource;
-          formData.equipmentId = that.equipmentId;
+          // formData.equipmentId = that.equipmentId;
           let obj = obj = postAction(this.url.confirmHour, formData)
           obj.then((res) => {
             if (res.success) {
@@ -281,7 +307,8 @@
     },
     onSearchUser(index) {
       this.recordIndex = index
-      this.$refs.actualUserSelect.list(this.mainId.teamId)
+      // this.$refs.actualUserSelect.list(this.mainId.teamId)
+      this.$refs.actualUserSelect.list(this.teamId)
       this.$refs.actualUserSelect.title = '浜哄憳閫夋嫨'
     },
     sendUserRecord(data, val) {

--
Gitblit v1.9.3