From c887bb7836b82573c0bc7d11b8dd46b4d7e522e1 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期四, 14 九月 2023 18:11:55 +0800
Subject: [PATCH] 预测性维护工单

---
 src/views/eam/PredictiveWorkPlanList.vue                                  |    9 
 src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue   |   45 +
 src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue     |  277 +++++++---
 src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue    |  329 ++++++-----
 src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue   |  105 +--
 src/views/eam/PredictiveWorkOrderList.vue                                 |   65 +
 src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue         |   32 
 src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue            |  319 +++++++++++
 src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue |  404 ++++++++------
 9 files changed, 1,074 insertions(+), 511 deletions(-)

diff --git a/src/views/eam/PredictiveWorkOrderList.vue b/src/views/eam/PredictiveWorkOrderList.vue
index a55a5a8..ada83a3 100644
--- a/src/views/eam/PredictiveWorkOrderList.vue
+++ b/src/views/eam/PredictiveWorkOrderList.vue
@@ -14,6 +14,20 @@
             :md="6"
             :sm="8"
           >
+            <a-form-item label="宸ュ崟鐘舵��">
+              <j-dict-select-tag
+                allow-clear
+                placeholder="璇烽�夋嫨宸ュ崟鐘舵��"
+                :triggerChange="true"
+                dictCode="repair_order_status"
+                v-model="queryParam.status"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col
+            :md="6"
+            :sm="8"
+          >
             <a-form-item label="缁存姢宸ュ崟缂栫爜">
               <a-input
                 placeholder="璇疯緭鍏ョ淮鎶ゅ伐鍗曠紪鐮�"
@@ -21,17 +35,28 @@
               ></a-input>
             </a-form-item>
           </a-col>
-          <!-- <a-col
+          <a-col
             :md="6"
             :sm="8"
           >
-            <a-form-item label="鐐规鏂规硶鍚嶇О">
-              <j-input
-                placeholder="璇疯緭鍏ョ偣妫�鏂规硶鍚嶇О"
-                v-model="queryParam.name"
-              ></j-input>
+            <a-form-item label="璁惧缂栫爜">
+              <a-input
+                placeholder="璇疯緭鍏ヨ澶囩紪鐮�"
+                v-model="queryParam.equipmentNum"
+              ></a-input>
             </a-form-item>
-          </a-col> -->
+          </a-col>
+          <a-col
+            :md="6"
+            :sm="8"
+            >
+              <a-form-item label="璁惧鍚嶇О">
+                <a-input
+                  placeholder="璇疯緭鍏ヨ澶囧悕绉�"
+                  v-model="queryParam.equipmentName"
+                ></a-input>
+              </a-form-item>
+            </a-col>
           <a-col
             :md="6"
             :sm="8"
@@ -60,7 +85,7 @@
 
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
-      <a-button
+      <!-- <a-button
         @click="handleAdd"
         type="primary"
         icon="plus"
@@ -70,7 +95,7 @@
         type="primary"
         @click="batchAssign"
         style="margin-left: 8px"
-      >宸ュ崟娲惧伐</a-button>
+      >宸ュ崟娲惧伐</a-button> -->
     </div>
 
     <!-- table鍖哄煙-begin -->
@@ -227,6 +252,12 @@
       ref="PredictiveWorkOrderDrawer"
       @ok="modalFormOk"
     ></predictive-work-order-drawer>
+    <order-assign-modal 
+    ref="OrderAssign"
+    @ok="modalFormOk"
+    >
+
+    </order-assign-modal>
   </a-card>
 </template>
 
@@ -238,14 +269,14 @@
 import { getAction, postAction, requestPut } from '@/api/manage'
 import PredictiveWorkOrderModel from './modules/predictiveWorkOrder/PredictiveWorkOrderModel'
 import PredictiveWorkOrderDrawer from './modules/predictiveWorkOrder/PredictiveWorkOrderDrawer'
-
-
+import OrderAssignModal from './modules/predictiveWorkOrder/OrderAssignModal.vue'
 export default {
   name: 'PredictiveWorkOrderList',
   mixins: [JeecgListMixin, mixinDevice],
   components: {
     PredictiveWorkOrderModel,
-    PredictiveWorkOrderDrawer
+    PredictiveWorkOrderDrawer,
+    OrderAssignModal
   },
   data() {
     return {
@@ -376,8 +407,8 @@
         deleteBatch: "/eam/specialtyMaintenanceOrder/deleteBatch",
         exportXlsUrl: "/eam/specialtyMaintenanceOrder/exportXls",
         importExcelUrl: "eam/specialtyMaintenanceOrder/importExcel",
-        edit: "/eam/specialtyMaintenanceOrder/editStatus",
-        orderGet: "/eam/specialtyMaintenanceOrder/orderGet",
+        edit: "/eam/predictiveworkorder/editStatus",
+        orderGet: "/eam/predictiveworkorder/orderGet",
       },
     }
   },
@@ -491,9 +522,9 @@
       })
     },
     handleAssignOrder: function (record) {
-      this.$refs.SpecialtyMaintenanceOrderAssignModal.edit(record)
-      this.$refs.SpecialtyMaintenanceOrderAssignModal.title = '宸ュ崟鏀规淳'
-      this.$refs.SpecialtyMaintenanceOrderAssignModal.disableSubmit = false
+      this.$refs.OrderAssign.edit(record)
+      this.$refs.OrderAssign.title = '宸ュ崟鏀规淳'
+      this.$refs.OrderAssign.disableSubmit = false
     },
     // modalFormOk() {
     //   alert(0)
diff --git a/src/views/eam/PredictiveWorkPlanList.vue b/src/views/eam/PredictiveWorkPlanList.vue
index fe4d1b0..0a96f78 100644
--- a/src/views/eam/PredictiveWorkPlanList.vue
+++ b/src/views/eam/PredictiveWorkPlanList.vue
@@ -393,7 +393,8 @@
         this.selectionRows = []
         this.planId = ''
         this.equipmentId = ''
-        this.isAdd = false
+        this.isAdd = falses
+        
       },
       handleDelete: function(id) {
         if (!this.url.delete) {
@@ -452,7 +453,7 @@
         const that = this
         that.confirmLoading = true
         this.$confirm({
-          title: '鏃ュ父淇濆吇鏍囧噯鐗堟湰鐢熸晥锛�',
+          title: '鐗堟湰鐢熸晥锛�',
           content: '鎻愮ず锛氱増鏈敓鏁堝悗涓婁竴鐗堟湰灏嗚嚜鍔ㄥけ鏁堬紝璇疯皑鎱庢搷浣滐紒',
           okText: '纭',
           cancelText: '鍙栨秷',
@@ -474,10 +475,6 @@
           }
         })
       },
-
-      searchReset() {
-        this.loadData(1)
-      }
     }
   }
 </script>
diff --git a/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue b/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue
index 448d049..22a19f5 100644
--- a/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue
@@ -29,20 +29,50 @@
           />
           <a-input-number
             :value="text"
-            v-if="col.dataIndex == 'actualQuantity'"
+            v-if="col.dataIndex == 'quantity'"
             :min="1"
             :max="99999"
             @change="(e)=>handleChange(e, record.key, col, index)"
-            :disabled="record.disabled"
+            :disabled="record.isLock == 'yes'||orderStatus!='4'"
           />
 
         </div>
       </template>
       <span
         slot='action'
-        slot-scope='text, record,index'
+        slot-scope='text, record'
       >
-        <a @click="handleDeleteFake(index)">鍒犻櫎</a>
+        <a-popconfirm
+          title="纭閿佹枡鍚�?"
+          @confirm="() => handleLock(record)"
+        >
+          <a
+            v-has="'specialtyMaintenanceOrder:actualMaterialLock'"
+            v-if="record.isLock=='no'&&orderStatus=='4'"
+          >閿佹枡</a>
+        </a-popconfirm>
+        <a-divider
+          v-if="record.isLock=='no'"
+          type="vertical"
+        />
+        <a-popconfirm
+          title="瑙i攣鍚庝細鑷姩閲婃斁搴撳瓨锛岀‘璁よВ閿佸悧?"
+          @confirm="() => handleUnLock(record)"
+        >
+          <a
+            v-has="'specialtyMaintenanceOrder:actualMaterialLock'"
+            v-if="record.isLock=='yes'&&orderStatus=='4'"
+          >瑙i攣</a>
+        </a-popconfirm>
+        <a-popconfirm
+          title="纭畾鍒犻櫎鍚�?"
+          @confirm="() => handleDelete(record.id)"
+        >
+          <a
+            v-has="'specialtyMaintenanceOrder:actualMaterialDelete'"
+            v-if="record.isLock=='no'&&orderStatus=='4'"
+          >鍒犻櫎</a>
+        </a-popconfirm>
       </span>
     </a-table>
     <a-button
@@ -50,37 +80,35 @@
       type="dashed"
       icon="plus"
       @click="addMaterial"
-      :disabled="repairOrderStatus!='3'"
-    >娣诲姞瀹為檯鐢ㄦ枡
-
-    </a-button>
+     :disabled="orderStatus!='4'"
+      v-has="'specialtyMaintenanceOrder:actualMaterialAdd'"
+    >娣诲姞瀹為檯鐢ㄦ枡</a-button>
     <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
       <a-row :style="{textAlign:'right'}">
-        <a-button
+        <!-- <a-button
           :style="{marginRight: '8px'}"
           @click="handleCancel"
-          :disabled="repairOrderStatus!='3'"
         >
-          娓呯┖
-        </a-button>
-        <a-button
+          鍙栨秷
+        </a-button> -->
+        <!-- <a-button
           @click="handleOk(1)"
           type="primary"
           :style="{marginRight: '8px'}"
-          :disabled="repairOrderStatus!='3'"
+         :disabled="orderStatus!='4'"
         >鏆傚瓨</a-button>
         <a-button
           @click="handleOk(0)"
           type="primary"
-          :disabled="repairOrderStatus!='3'"
-        >淇濆瓨</a-button>
+         :disabled="orderStatus!='4'"
+        >淇濆瓨</a-button> -->
       </a-row>
       <!-- :disabled="false" -->
     </div>
-    <actual-material-select
-      ref="actualMaterialSelect"
-      @sendMaterialRecord="sendMaterialRecord"
-    >
+    <actual-material-select 
+    @getSelectRows="getSelectRows"
+    ref='JSelectSparePartModal'>
+      <!-- @sendMaterialRecord="sendMaterialRecord" -->
     </actual-material-select>
   </a-card>
 </template>
@@ -95,29 +123,34 @@
   mixins: [JeecgListMixin],
   components: {
     JEllipsis,
-    ActualMaterialSelect
+    ActualMaterialSelect,
   },
   props: {
-    repairOrderId: {
-      type: String,
-      required: false,
-      default: '-1'
-    },
-    repairOrderStatus: {
+    orderId: {
       type: String,
       required: false,
       default: ''
-    }
+    },
+    orderStatus: {
+      type: String,
+      required: false,
+      default: ''
+    },
+    equipmentId: {
+      type: String,
+      required: false,
+      default: ''
+    },
   },
   data() {
     return {
-      title: "宸ヨ壓纭",
-      flag: false,//涓婚〉闈㈢殑鏍囪浣�  鐢ㄤ簬鍖哄垎鏄惁纭杩囧伐鍗曞伐鑹� 鏉ュ尯鍒唗able椤靛睍绀� 宸ュ崟宸ュ簭 杩樻槸浜у搧宸ュ簭
+      disableMixiCreated:true,
+      title: "瀹為檯鐢ㄦ枡",
       visible: false,
       model: {},
-      obj: {},
       maskClosable: true,
       confirmLoading: false,
+      // specialyMaintenanceOrderStatus: '',
       form: this.$form.createForm(this),
       /* 鍒嗛〉鍙傛暟 */
       ipagination: {
@@ -137,7 +170,7 @@
             { required: true, message: '璇烽�夋嫨鐗╂枡!' },
           ]
         },
-        actualQuantity: {
+        quantity: {
           rules: [
             { required: false, message: '璇峰~鍐欐暟閲�!' },
           ]
@@ -158,8 +191,8 @@
       loading: false,
       dataSource: [],
       columns: [
-       {
-          title: '棰嗘枡鍑哄簱鍗曞彿',
+        {
+          title: '棰嗘枡鍑哄簱鍗�',
           dataIndex: 'num',
           align: "center",
           width: 150,
@@ -224,23 +257,44 @@
         }
       ],
       url: {
-        list: "/eam/repairOrder/listRepairOrderActualMaterialByMainId",
-        confirmMaterial: "/eam/repairOrder/addRepairOrderActualMaterial"
+        list: "/eam/maintenanceOrderActualMaterial/getMaintenanceOrderActualMaterialList",
+        confirmMaterial: "/eam/maintenanceOrderActualMaterial/add",
+        delete: "/eam/maintenanceOrderActualMaterial/delete",
+        addInit: "/eam/maintenanceOrderActualMaterial/addInit",
+        lock: "/eam/maintenanceOrderActualMaterial/lock",
+        unLock: "/eam/maintenanceOrderActualMaterial/unLock"
       },
       changeIndex: 0
     }
   },
-
-  created() {
-    this.queryParam['repairOrderId'] = this.repairOrderId;
-    this.loadData(1);
+  watch: {
+    orderId: {
+      immediate: true,
+      handler(val) {
+        if(this.orderId){
+          alert
+          this.queryParam['maintenanceOrderId'] = val
+          this.queryParam['equipmentId'] = this.equipmentId
+          this.queryParam['delFlag'] = 0
+          this.loadData(1);
+        }else{
+          this.clearList();
+        }
+      }
+    },
   },
   methods: {
     addMaterial() {
-      this.dataSource.push({ materialId: '', repairOrderId: this.repairOrderId, actualQuantity: 1, materialNum: '', materialName: '', materialModel: '', materialSpecification: '', unitId_dictText: '' })
+      let ids = [];
+      for (let i = 0; i < this.dataSource.length; i++) {
+        ids.push(this.dataSource[i].outboundOrderDetailId);
+      }
+      this.$refs.JSelectSparePartModal.showModals(ids);
+      this.$refs.JSelectSparePartModal.title = '閫夋嫨澶囦欢淇℃伅'
+      this.$refs.JSelectSparePartModal.disableSubmit = false
     },
     handleCancel() {
-      this.close()
+      this.$bus.$emit('closeDrawer');
     },
     close() {
       this.$emit('close');
@@ -261,18 +315,23 @@
             that.$message.warning("璇烽�夋嫨绗�" + (i + 1) + "琛岀墿鏂欙紒");
             return false;
           }
-          if (materialDataSource[i].actualQuantity == undefined || materialDataSource[i].actualQuantity == null || materialDataSource[i].actualQuantity == '') {
+          if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
             that.$message.warning("璇峰~鍐欑" + (i + 1) + "琛岀敤鏂欐暟锛�");
             return false;
           }
         }
       }
+      if (that.dataSource.length === 0) {
+        that.$message.warning("璇锋坊鍔犵墿鏂欙紒")
+        return
+      }
       this.form.validateFields((err, values) => {
         if (!err) {
           that.confirmLoading = true
           let formData = {}
-          formData.repairOrderId = that.repairOrderId;
-          formData.actualMaterialList = that.dataSource;
+          formData.maintenanceOrderId = that.specialyMaintenanceOrderId;
+          formData.maintenanceOrderActualMaterials = that.dataSource;
+          formData.equipmentId = that.equipmentId;
           let obj = obj = postAction(this.url.confirmMaterial, formData)
           obj.then((res) => {
             if (res.success) {
@@ -290,18 +349,17 @@
       })
     },
     handleChange(value, key, column, index) {
-      let that = this;
-      const temp = [...that.dataSource];
-      const target = temp[index];
+      console.log(column)
+      const temp = [...this.dataSource]
+      const target = temp[index]
+      let availableQuantity = target['availableQuantity']
       if (target) {
-        target[column.dataIndex] = value;
-        if ('materialId' == column.dataIndex) {
-          target['materialId'] = value;
+        if (value != undefined && value != null && value != '' && availableQuantity < value) {
+          this.$message.error('浣跨敤鏁伴噺涓嶈兘澶т簬鍙敤鏁伴噺!')
+        } else {
         }
-        if ('actualQuantity' == column.dataIndex) {
-          target['actualQuantity'] = value;
-        }
-        that.dataSource = temp;
+        target[column.dataIndex] = value
+        this.dataSource = temp
       }
     },
     onSearchMaterial(index) {
@@ -309,37 +367,94 @@
       this.$refs.actualMaterialSelect.list()
       this.$refs.actualMaterialSelect.title = '鐗╂枡閫夋嫨'
     },
-    sendMaterialRecord(data, val) {
-      let record = data.record
-      const temp = [...this.dataSource]
-      const target = temp[this.recordIndex]
-      if (target) {
-        console.log(target)
-        target.materialId = record.id;
-        target.materialName = record.name;
-        target.materialNum = record.num;
-        target.materialModel = record.model;
-        target.materialSpecification = record.specification;
-        target.unitId_dictText = record.unitId_dictText;
-        this.dataSource = temp
-      }
-    },
     clearList() {
       this.dataSource = [];
       this.ipagination.current = 1
+    },
+    // getUuiD(randomLength) {
+    //   return Number(
+    //     Math.random()
+    //       .toString()
+    //       .substr(2, randomLength) + Date.now()
+    //   ).toString(36)
+    // },
+    handleLock(record) {
+      let that = this;
+      if (record.quantity == null || record.quantity == undefined || record.quantity == '') {
+        this.$message.error('璇峰厛濉啓鏁伴噺!');
+        return false
+      }
+      if (record.availableQuantity < record.quantity) {
+        this.$message.error('浣跨敤鏁伴噺涓嶈兘澶т簬鍙敤鏁伴噺!');
+        return false;
+      }
+      this.confirmLoading = true;
+      postAction(this.url.lock, record).then(res => {
+        if (res.success) {
+          this.$message.success("搴撳瓨閿佸畾鎴愬姛锛�")
+        } else {
+          this.$message.error(res.message)
+        }
+      }).finally(res => {
+        that.confirmLoading = false
+        that.loadData();
+      })
+
+    },
+    handleUnLock(record) {
+      let that = this;
+      this.confirmLoading = true;
+      postAction(this.url.unLock, record).then(res => {
+        if (res.success) {
+          this.$message.success("搴撳瓨瑙i攣鎴愬姛锛�")
+        } else {
+          this.$message.error(res.message)
+        }
+      }).finally(res => {
+        that.confirmLoading = false
+        that.loadData();
+      })
+    },
+    getSelectRows(data){
+      let newActualMaterials = [];
+      for (let i = 0; i < data.length; i++) {
+        newActualMaterials.push({
+          // id: this.getUuiD(16),
+          // num: data[i].num,
+          outboundOrderDetailId: data[i].id,
+          sparePartId: data[i].sparePartId,
+          // sparePartNum: data[i].spareNum,
+          // sparePartName: data[i].spareName,
+          // specification: data[i].specification,
+          // model: data[i].model,
+          // constructorName: data[i].constructorName,
+          // constructorId: data[i].constructorId,
+          // mainUnitName: data[i].mainUnitName,
+          // mainUnitId: data[i].mainUnitId,
+          mainQuantity: data[i].mainQuantity,
+          useQuantity: data[i].useQuantity,
+          availableQuantity: data[i].availableQuantity,
+          maintenanceOrderId: this.orderId,
+          equipmentId: this.equipmentId,
+          isLock: 'no'
+        })
+      }
+      let that = this
+      postAction(this.url.addInit, newActualMaterials).then((res) => {
+        if (res.success) {
+          that.$message.success(res.message)
+          that.$emit('ok')
+        } else {
+          that.$message.warning(res.message)
+        }
+      }).finally(res => {
+        newActualMaterials = []
+        that.loadData();
+
+      })
+
     }
   },
-
-  watch: {
-    repairOrderId: {
-      immediate: true,
-      handler(val) {
-        this.clearList();
-        this.queryParam['repairOrderId'] = val
-        this.loadData(1);
-      }
-    }
-  }
 }
 </script>
 
diff --git a/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue b/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue
index 8fe8162..0bf4755 100644
--- a/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue
@@ -1,80 +1,92 @@
 <template>
-  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
-  <a-table
-         ref="table"
-         bordered
-         rowKey="id"
-         :columns="columns"
-         :dataSource="dataSource"
-         :pagination="ipagination"
-         @change="handleTableChange"
-       >
-         <template
-           v-for="col in columns"
-           :slot="col.dataIndex"
-           slot-scope='text, record, index'
-         >
-           <div :key="col.dataIndex">
-               <a-input-search
-               v-if="col.dataIndex == 'username'"
-               enter-button
-               @search="onSearchUser(index)"
-               :value="text"
-               :read-only="true"
-               @change="(e) => handleChange(e, record.key, col, index)"
-              />
-             <a-input-number
-               :value="text"
-               v-if="col.dataIndex == 'actualHour'"
-               :min="1"
-               :max="99999"
-               @change="(e)=>handleChange(e, record.key, col, index)"
-               :disabled="record.disabled"
-             />
-          
-           </div>
-         </template>
-         <span slot='action' slot-scope='text, record,index'>
-                 <a @click="handleDeleteFake(index)">鍒犻櫎</a>
-        </span>
-       </a-table>
-       <a-button
-         style="width: 100%; margin-top: 16px; margin-bottom: 8px"
-         type="dashed"
-         icon="plus"
-         @click="addHour"
-         :disabled="repairOrderStatus!='3'"
-       >娣诲姞瀹為檯宸ユ椂
-       </a-button>
-       <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
-       <a-row :style="{textAlign:'right'}">
-         <a-button
-           :style="{marginRight: '8px'}"
-           @click="handleCancel"
-           :disabled="repairOrderStatus!='3'"
-         >
-          娓呯┖
-         </a-button>
-         <a-button
-            @click="handleOk(1)"
-            type="primary"
-            :style="{marginRight: '8px'}"
-            :disabled="repairOrderStatus!='3'"
-          >鏆傚瓨</a-button>
-          <a-button
+  <a-card
+    :bordered="false"
+    :class="'cust-erp-sub-tab'"
+  >
+    <a-table
+      ref="table"
+      bordered
+      rowKey="id"
+      :columns="columns"
+      :dataSource="dataSource"
+      :pagination="ipagination"
+      @change="handleTableChange"
+    >
+      <template
+        v-for="col in columns"
+        :slot="col.dataIndex"
+        slot-scope='text, record, index'
+      >
+        <div :key="col.dataIndex">
+          <a-input-search
+            v-if="col.dataIndex == 'username'"
+            enter-button
+            @search="onSearchUser(index)"
+            :value="text"
+            :read-only="true"
+            :disabled="orderStatus!='4'"
+            @change="(e) => handleChange(e, record.key, col, index)"
+          />
+          <a-input-number
+            :value="text"
+            v-if="col.dataIndex == 'actualWorkingHourQuota'"
+            :min="0"
+            :max="99999"
+            @change="(e)=>handleChange(e, record.key, col, index)"
+            :disabled="record.disabled||orderStatus!='4'"
+          />
+
+        </div>
+      </template>
+      <span
+        slot='action'
+        slot-scope='text, record,index'
+      >
+        <a
+          v-has="'specialtyMaintenanceOrder:actualWorkHoursDelete'"
+          v-if="orderStatus=='4'"
+          @click="handleDelete(index)"
+        >鍒犻櫎</a>
+      </span>
+    </a-table>
+    <a-button
+      style="width: 100%; margin-top: 16px; margin-bottom: 8px"
+      type="dashed"
+      icon="plus"
+      @click="addHour"
+      :disabled="orderStatus!='4'"
+    >娣诲姞瀹為檯宸ユ椂
+    </a-button>
+    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+      <a-row :style="{textAlign:'right'}">
+        <a-button
+          :style="{marginRight: '8px'}"
+          @click="handleCancel"
+        >
+          鍙栨秷
+        </a-button>
+        <a-button
+          @click="handleOk(1)"
+          type="primary"
+          :style="{marginRight: '8px'}"
+          :disabled="orderStatus!='4'"
+          v-has="'specialtyMaintenanceOrder:actualWorkHoursTS'"
+        >鏆傚瓨</a-button>
+        <a-button
           @click="handleOk(0)"
           type="primary"
-          :disabled="repairOrderStatus!='3'"
-          >淇濆瓨</a-button>
-       </a-row>
-       <!-- :disabled="false" -->
-     </div>
-     <actual-hour-user-select
-     ref="actualUserSelect"
-     @sendUserRecord="sendUserRecord"
-     >
-     </actual-hour-user-select>
-     </a-card>
+          :disabled="orderStatus!='4'"
+          v-has="'specialtyMaintenanceOrder:actualWorkHoursSave'"
+        >淇濆瓨</a-button>
+      </a-row>
+      <!-- :disabled="false" -->
+    </div>
+    <actual-hour-user-select
+      ref="actualUserSelect"
+      @sendUserRecord="sendUserRecord"
+    >
+    </actual-hour-user-select>
+  </a-card>
 </template>
 <script>
 import { postAction, getAction } from '@/api/manage'
@@ -83,27 +95,37 @@
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import ActualHourUserSelect from './select/ActualHourUserSelect.vue'
 export default {
- name: 'ActualWorkHoursEditTable',
- mixins: [JeecgListMixin],
+  name: 'ActualWorkHoursEditTable',
+  mixins: [JeecgListMixin],
   components: {
     JEllipsis,
     ActualHourUserSelect
   },
-  props:{
-    repairOrderId:{
-      type:String,
-      required:false,
-      default:''
+  props: {
+    orderId: {
+      type: String,
+      required: false,
+      default: ''
     },
-    repairOrderStatus:{
-      type:String,
-      required:false,
-      default:''
-    }
+    orderStatus: {
+      type: String,
+      required: false,
+      default: ''
+    },
+    equipmentId: {
+      type: String,
+      required: false,
+      default: ''
+    },
+    teamId: {
+      type: String,
+      required: false,
+      default: ''
+    },
   },
   data() {
     return {
-      title: "宸ヨ壓纭",
+      title: "瀹為檯宸ユ椂",
       flag: false,//涓婚〉闈㈢殑鏍囪浣�  鐢ㄤ簬鍖哄垎鏄惁纭杩囧伐鍗曞伐鑹� 鏉ュ尯鍒唗able椤靛睍绀� 宸ュ崟宸ュ簭 杩樻槸浜у搧宸ュ簭
       visible: false,
       model: {},
@@ -131,7 +153,7 @@
         },
         actual_hour: {
           rules: [
-            { required: false, message: '璇峰~鍐欏伐鏃�!'},
+            { required: false, message: '璇峰~鍐欏伐鏃�!' },
           ]
         },
       },
@@ -150,53 +172,65 @@
       loading: false,
       dataSource: [],
       columns: [
-          {
-            title: '*浜哄憳缂栫爜',
-            dataIndex: 'username',
-            align: "center",
-            scopedSlots: { customRender: 'username' },
-            className: 'red',
-            width: 250,
-          },
-          {
-            title: '浜哄憳鍚嶇О',
-            dataIndex: 'realname',
-            align: "center",
-            width: 250,
-          },
-          {
-            title: '*瀹為檯宸ユ椂',
-            dataIndex: 'actualHour',
-            align: "center",
-            className: 'red',
-            scopedSlots: { customRender: 'actualHour' },
-            width: 250,
-          },
-          {
+        {
+          title: '*浜哄憳缂栫爜',
+          dataIndex: 'username',
+          align: "center",
+          scopedSlots: { customRender: 'username' },
+          className: 'red',
+          width: 250,
+        },
+        {
+          title: '浜哄憳鍚嶇О',
+          dataIndex: 'realname',
+          align: "center",
+          width: 250,
+        },
+        {
+          title: '*瀹為檯宸ユ椂',
+          dataIndex: 'actualWorkingHourQuota',
+          align: "center",
+          className: 'red',
+          scopedSlots: { customRender: 'actualWorkingHourQuota' },
+          width: 250,
+        },
+        {
           title: '鎿嶄綔',
           dataIndex: 'action',
           align: 'center',
           width: 250,
           scopedSlots: { customRender: 'action' }
-          }
-        ],
+        }
+      ],
       url: {
-        list: "/eam/repairOrder/listRepairOrderActualWorkHoursByMainId",
-        confirmHour:"/eam/repairOrder/addRepairOrderActualWorkHours"
+        list: "/eam/maintenanceOrderActualWorkingHour/getMaintenanceOrderActualWorkingHourList",
+        confirmHour: "/eam/maintenanceOrderActualWorkingHour/add"
       },
       changeIndex: 0
     }
   },
-  created(){
-    this.queryParam['repairOrderId'] = this.repairOrderId;
+  created() {
+    this.queryParam['maintenanceOrderId'] = this.orderId;
+    this.queryParam['equipmentId'] = this.equipmentId
     this.loadData(1);
+  },
+  watch: {
+    orderId: {
+      immediate: true,
+      handler(val) {
+        this.clearList();
+        this.queryParam['maintenanceOrderId'] = val
+        this.queryParam['equipmentId'] = this.equipmentId
+        this.loadData(1);
+      }
+    },
   },
   methods: {
     addHour() {
-      this.dataSource.push({userId:'',repairOrderId:this.repairOrderId,actualHour:0,username:'',realname:''})
+      this.dataSource.push({ id: this.getUuiD(16), userId: '', maintenanceOrderId: this.dailyMaintenanceOrderId, actualWorkingHourQuota: 0, username: '', realname: '' })
     },
     handleCancel() {
-      this.close()
+      this.$bus.$emit('closeDrawer');
     },
     close() {
       this.$emit('close');
@@ -204,30 +238,39 @@
       this.disableSubmit = false;
       this.visible = false;
     },
-    handleDeleteFake(index){
-      this.dataSource.pop(index);
+    // handleDeleteFake(index) {
+    //   this.dataSource.splice(index,1);
+    // },
+    handleDelete(text, record, index) {
+      this.dataSource.splice(index, 1);
     },
+
     handleOk(saveStatus) {
       const that = this
-      if(saveStatus==0){
+      if (saveStatus == 0) {
         let workHoursDataSource = that.dataSource;
         for (let i = 0; i < workHoursDataSource.length; i++) {
           if (workHoursDataSource[i].userId == undefined || workHoursDataSource[i].userId == null || workHoursDataSource[i].userId == '') {
-            that.$message.warning("璇烽�夋嫨绗�"+(i+1)+"琛岀淮淇汉鍛橈紒");
+            that.$message.warning("璇烽�夋嫨绗�" + (i + 1) + "琛岀淮淇汉鍛橈紒");
             return false;
           }
-          if(workHoursDataSource[i].actualHour == undefined || workHoursDataSource[i].actualHour == null||workHoursDataSource[i].actualHour==''){
-            that.$message.warning("璇峰~鍐欑"+(i+1)+"琛屽疄闄呭伐鏃讹紒");
+          if (workHoursDataSource[i].actualWorkingHourQuota == undefined || workHoursDataSource[i].actualWorkingHourQuota == null || workHoursDataSource[i].actualWorkingHourQuota == '') {
+            that.$message.warning("璇峰~鍐欑" + (i + 1) + "琛屽疄闄呭伐鏃讹紒");
             return false;
           }
         }
+      }
+      if (that.dataSource.length === 0) {
+        that.$message.warning("璇烽�夋嫨浜哄憳锛�")
+        return
       }
       this.form.validateFields((err, values) => {
         if (!err) {
           that.confirmLoading = true
           let formData = {}
-          formData.repairOrderId = that.repairOrderId;
-          formData.actualHourList = that.dataSource;
+          formData.maintenanceOrderId = that.orderId;
+          formData.maintenanceOrderActualWorkingHourList = that.dataSource;
+          formData.equipmentId = that.equipmentId;
           let obj = obj = postAction(this.url.confirmHour, formData)
           obj.then((res) => {
             if (res.success) {
@@ -253,15 +296,15 @@
         if ('userId' == column.dataIndex) {
           target['userId'] = value;
         }
-        if ('actualHour' == column.dataIndex) {
-          target['actualHour'] = value;
+        if ('actualWorkingHourQuota' == column.dataIndex) {
+          target['actualWorkingHourQuota'] = value;
         }
         that.dataSource = temp;
       }
     },
     onSearchUser(index) {
       this.recordIndex = index
-      this.$refs.actualUserSelect.list()
+      this.$refs.actualUserSelect.list(this.teamId)
       this.$refs.actualUserSelect.title = '浜哄憳閫夋嫨'
     },
     sendUserRecord(data, val) {
@@ -276,21 +319,19 @@
         this.dataSource = temp
       }
     },
-    clearList(){
-        this.dataSource=[];
-        this.ipagination.current = 1
-    }
+    clearList() {
+      this.dataSource = [];
+      this.ipagination.current = 1
+    },
+    getUuiD(randomLength) {
+      return Number(
+        Math.random()
+          .toString()
+          .substr(2, randomLength) + Date.now()
+      ).toString(36)
+    },
   },
-  watch:{
-    repairOrderId:{
-      immediate: true,
-        handler(val) {
-            this.clearList();
-            this.queryParam['repairOrderId'] = val
-            this.loadData(1);
-        }
-    }
-  }
+
 }
 </script>
 
diff --git a/src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue b/src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue
new file mode 100644
index 0000000..b39652f
--- /dev/null
+++ b/src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue
@@ -0,0 +1,319 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="1250"
+    :visible="visible"
+    :maskClosable="false"
+    @ok="handleOk"
+    cancelText="鍏抽棴"
+    @cancel="handleCancel"
+    :confirmLoading="confirmLoading"
+  >
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item
+              label="宸ュ崟缁熶竴缂栫爜"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ュ伐鍗曠粺涓�缂栫爜'"
+                v-decorator="['num', validatorRules.num ]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item
+              label="缁存姢鏃ユ湡"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+            <j-date
+                :disabled="disableSubmit"
+                v-decorator="['planStartTime', validatorRules.planStartTime ]"
+                placeholder="璇烽�夋嫨淇濆吇鏃堕棿"
+                style="width: 100%"
+                :showTime="true"
+                dateFormat="YYYY-MM-DD HH:mm:ss"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item
+              label="棰勬祴鎬х淮鎶ゆ柟妗�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇烽�夋嫨棰勬祴鎬х淮鎶ゆ柟妗�'"
+                v-decorator="['planNum', validatorRules.planNum ]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="娲惧伐鏂瑰紡"
+            >
+              <j-dict-select-tag
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇烽�夋嫨娲惧伐鏂瑰紡'"
+                :triggerChange="true"
+                dictCode="assign_mode"
+                v-decorator="['assignMode', validatorRules.assignMode]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="璐d换鐝粍"
+            >
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠荤彮缁�'"
+                v-decorator="['teamId_dictText', validatorRules.teamId_dictText ]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item
+              label="璐d换浜�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input-search
+                :disabled="false"
+                placeholder="璐d换浜�"
+                enter-button
+                @search="onDutyUserList()"
+                :read-only="true"
+                v-decorator="['maintenanceUserId_dictText', validatorRules.maintenanceUserId_dictText]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row
+          hidden
+          :gutter="24"
+        >
+          <a-col :span="12">
+            <a-form-item
+              label="璐d换鐝粍Id"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠荤彮缁処d'"
+                v-decorator="['teamId', validatorRules.teamId ]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item
+              label="璐d换浜�/鐐规浜篒d"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠讳汉/鐐规浜�'"
+                v-decorator="['maintenanceUserId', validatorRules.maintenanceUserId ]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </a-spin>
+
+    <template slot="footer">
+      <a-button
+        :style="{marginRight: '8px'}"
+        @click="handleCancel()"
+      >
+        鍏抽棴
+      </a-button>
+
+      <a-button
+        @click="handleOk()"
+        type="primary"
+        :loading="confirmLoading"
+      >纭畾</a-button>
+    </template>
+    <user-list
+      ref="UserList"
+      @sendDutyUserRecord='sendDutyUserRecord'
+    ></user-list>
+  </a-modal>
+
+</template>
+
+<script>
+import { getAction, postAction, requestPut } from '@/api/manage'
+import pick from 'lodash.pick'
+import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
+import Tooltip from 'ant-design-vue/es/tooltip'
+import UserList from '../specialtyMaintenanceOrder/UserList.vue'
+export default {
+  name: "SpecialtyInspectionOrderModal",
+  components: {
+    JMultiSelectTag,
+    Tooltip,
+    UserList,
+  },
+  data() {
+    return {
+      title: "鎿嶄綔",
+      visible: false,
+      disableSubmit: false,
+      codeDisable: true,
+      model: {},
+      inspectionCycles: [],
+      // isHidden: true,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      validatorRules: {
+        num: {
+          rules: [
+            { required: true, message: '璇疯緭鍏ョ紪鐮�!' },
+          ]
+        },
+        planStartTime: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨鏃ユ湡!' },
+          ]
+        },
+        maintenanceUserId_dictText: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨璐d换浜�!' },
+          ]
+        },
+        assignMode: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨娲惧伐鏂瑰紡!' },
+          ]
+        },
+        teamId_dictText: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨璐d换鐝粍!' },
+          ]
+        },
+      },
+      url: {
+        assign: "/eam/predictiveworkorder/assign",
+      },
+    }
+  },
+
+  methods: {
+    edit(record) {
+      let that = this;
+      this.form.resetFields();
+      this.model = Object.assign({}, record);
+      this.visible = true;
+      that.$nextTick(() => {
+        that.form.setFieldsValue(pick(that.model, 'num', 'planNum', 'assignMode', 'teamId', 'teamId_dictText', 'maintenanceUserId', 'maintenanceUserId_dictText', 'planStartTime'));
+      });
+    },
+
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+
+    handleCancel() {
+      this.close();
+    },
+
+    handleOk() {
+      const that = this;
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true;
+          let formData = Object.assign(this.model, values);
+          let obj;
+          obj = requestPut(this.url.assign, formData, { id: this.model.id });
+          obj.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();
+          })
+        }
+      })
+    },
+    onDutyUserList() {
+      let data = this.form.getFieldsValue(['teamId']);
+      if (data.teamId == null || data.teamId == "") {
+        this.$message.warning("璇峰厛缁存姢鐝粍锛�");
+        return
+      }
+      this.$refs.UserList.list(data.teamId);
+      this.$refs.UserList.title = "閫夋嫨浜哄憳";
+    },
+    sendDutyUserRecord(data) {
+      let record = data.record;
+      this.form.setFieldsValue({ maintenanceUserId: record.id, maintenanceUserId_dictText: record.username + "/" + record.realname });
+    },
+
+
+  },
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .frozenRowClass {
+  color: #c9c9c9;
+}
+.fontweight {
+  font-weight: bold;
+}
+.ant-btn {
+  padding: 0 10px;
+  margin-left: 3px;
+}
+
+.ant-form-item-control {
+  line-height: 0px;
+}
+
+/** 涓昏〃鍗曡闂磋窛 */
+.ant-form .ant-form-item {
+  margin-bottom: 10px;
+}
+
+/** Tab椤甸潰琛岄棿璺� */
+.ant-tabs-content .ant-form-item {
+  margin-bottom: 0px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue
index 66d6dcb..c95da53 100644
--- a/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue
@@ -44,7 +44,7 @@
                   <span
                     v-if="this.model != null"
                     class="hightColor"
-                  >{{ this.model.statusName }}</span>
+                  >{{ this.model.status_dictText }}</span>
                   <span
                     v-else
                     class="frozenRowClass"
@@ -55,7 +55,7 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="淇濆吇宸ュ崟鍙�"
+                  label="宸ュ崟缁熶竴缂栫爜"
                   class="hightColor"
                 >
                   <span
@@ -72,13 +72,13 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="淇濆吇绫诲瀷"
+                  label="鐩戞帶绫诲瀷"
                   class="hightColor"
                 >
                   <span
                     v-if="this.model != null"
                     class="hightColor"
-                  >{{ this.model.maintenanceTypeName }}</span>
+                  >{{ this.model.monitorType_dictText }}</span>
                   <span
                     v-else
                     class="frozenRowClass"
@@ -91,30 +91,13 @@
                 <a-form-item
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
-                  label="瀵硅薄閮ㄩ棬"
+                  label="鏍囧噯缂栫爜"
                   class="hightColor"
                 >
                   <span
                     v-if="this.model != null"
                     class="hightColor"
-                  >{{ this.model.departName }}</span>
-                  <span
-                    v-else
-                    class="frozenRowClass"
-                  >-</span>
-                </a-form-item>
-              </a-col>
-              <a-col :span="8">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="缁翠繚鏂瑰紡"
-                  class="hightColor"
-                >
-                  <span
-                    v-if="this.model != null"
-                    class="hight"
-                  >{{ this.model.maintenanceMode }}</span>
+                  >{{ this.model.planNum }}</span>
                   <span
                     v-else
                     class="frozenRowClass"
@@ -131,7 +114,7 @@
                   <span
                     v-if="this.model != null"
                     class="hightColor"
-                  >{{ this.model.teamName }}</span>
+                  >{{ this.model.teamId_dictText }}</span>
                   <span
                     v-else
                     class="frozenRowClass"
@@ -186,7 +169,7 @@
                   <span
                     v-if="this.model != null"
                     class="hightColor"
-                  >{{ this.model.equipmentModel }}</span>
+                  >{{ this.model.model }}</span>
                   <span
                     v-else
                     class="frozenRowClass"
@@ -200,7 +183,7 @@
             defaultActiveKey="1"
           >
             <a-tab-pane
-              tab='瑙﹀彂鏉′欢'
+              tab='鐩戞帶璁板綍'
               key="1"
               class="hightColor"
             >
@@ -208,11 +191,9 @@
             class="table-operator"
             style="margin:-16px"
             >
-                <predictive-spare-parts :planId='workPlanId' v-show="model.monitorType == 'smkz'"/>
-                <!--            v-if="selectionRows[0].monitorType == 'smkz'"-->
-                <predictive-parameters  :planId='workPlanId' v-show="model.monitorType == 'cskz'"/>
+                <predictive-parameters  :orderId='model.id' v-show="model.monitorType == 'cskz'"/>
                 <!--            v-if="selectionRows[0].monitorType == 'cskz'" -->
-                <predictive-warn :planId='workPlanId' v-show="model.monitorType == 'bjkz'"/>
+                <predictive-warn :orderId='model.id' v-show="model.monitorType == 'bjkz'"/>
                 <!--            v-if="selectionRows[0].monitorType == 'bjkz'"-->
             </div>
             </a-tab-pane>
@@ -267,9 +248,9 @@
               >
                 <actual-material-edit-table
                   ref="actualMaterialTabel"
-                  :specialyMaintenanceOrderId="this.model.id"
-                  :specialyMaintenanceOrderStatus="this.model.status"
-                  :equipmentId="this.model.equipmentId"
+                  :orderId="orderId"
+                  :orderStatus="orderStatus"
+                  :equipmentId="equipmentId"
                 ></actual-material-edit-table>
               </div>
             </a-tab-pane>
@@ -282,10 +263,10 @@
                 style="margin:-16px"
               >
                 <actual-work-hours-edit-table
-                  :specialyMaintenanceOrderId="this.model.id"
-                  :specialyMaintenanceOrderStatus="this.model.status"
-                  :equipmentId="this.model.equipmentId"
-                  :teamId="this.model.teamId"
+                  :orderId="orderId"
+                  :orderStatus="orderStatus"
+                  :equipmentId="equipmentId"
+                  :teamId = "teamId"
                 ></actual-work-hours-edit-table>
               </div>
             </a-tab-pane>
@@ -365,7 +346,13 @@
       currentPage: 1,
       pageSize: 1,
       total: 10,
+      //
       workPlanId:'',
+      orderId:'',
+      orderStatus:'',
+      equipmentId:'',
+      teamId:'',
+      //
       title: "涓撲笟宸ュ崟鎵ц",
       visible: false,
       maskClosable: true,
@@ -387,12 +374,14 @@
         sm: { span: 18 },
       },
       url: {
-        getEquipmentTotalByOrderId: "/eam/specialtyMaintenanceOrderDetail/getEquipmentTotalByOrderId",
+        listMaterial: "/eam/maintenanceOrderActualMaterial/getMaintenanceOrderActualMaterialList",
+        listHours: "/eam/maintenanceOrderActualWorkingHour/getMaintenanceOrderActualWorkingHourList",
+        getEquipmentTotalByOrderId: "/eam/predictiveworkorder/getEquipmentTotalByOrderId",
         urlDownload: window._CONFIG['staticDomainURL'],
         download: '/sys/upload/downloadFile',
-        editStatus: "/eam/specialtyMaintenanceOrder/editStatus",
-        revocation: "/eam/specialtyMaintenanceOrder/revocation",
-        report: "/eam/specialtyMaintenanceOrder/report",
+        editStatus: "/eam/predictiveworkorder/editStatus",
+        revocation: "/eam/predictiveworkorder/revocation",
+        report: "/eam/predictiveworkorder/report",
       },
     }
   },
@@ -414,7 +403,15 @@
     handleShow(record) {
       this.model = Object.assign({}, record);
       this.workPlanId = record.workPlanId;
+      this.orderId = record.id;
+      this.orderStatus = record.status;
+      this.equipmentId = record.equipmentId;
+      this.teamId  = record.teamId;
       this.visible = true;
+      if(record.status=='4'){
+        this.$message.success("宸ュ崟姝e湪鎵ц褰撲腑锛岃鍦ㄦ杩囩▼涓綍鍏ュ疄闄呯敤鏂欏拰宸ユ椂")
+      }
+      
     },
     getEquipmentTotal() {
       var params = this.queryParam;//鏌ヨ鏉′欢
@@ -512,16 +509,15 @@
       const that = this;
       that.confirmLoading = true;
       this.$confirm({
-        title: '淇濆吇宸ュ崟寮�宸�',
+        title: '宸ュ崟寮�宸�',
         content: '鎻愮ず锛氬紑宸ュ悗鏃犳硶鎾ゅ洖锛岃璋ㄦ厧鎿嶄綔锛�',
         okText: '纭',
         cancelText: '鍙栨秷',
         onOk() {
-          requestPut(that.url.editStatus, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
+          requestPut(that.url.editStatus, { id: that.model.id, status: '4' }).then((res) => {
             if (res.success) {
               that.model.status = '4'
               that.$message.success("宸ュ崟寮�宸ユ垚鍔燂紒")
-              that.getEquipmentTotal()
               that.buttonDistable = false
               that.revocationDistable = true
               that.SWbuttonDistable = true
@@ -537,26 +533,18 @@
     },
     //鎶ュ伐
     handleReport() {
-      var actualMaterials = this.$refs.actualMaterialTabel.dataSource;
-      for (var i = 0; i < actualMaterials.length; i++) {
-        if (actualMaterials[i].isLock == 'no') {
-          this.$message.warn("瀹為檯鐢ㄦ枡绗�" + (i + 1) + "琛屽皻鏈攣鏂欙紝璇烽攣鏂欏悗鍐嶈繘琛屾姤宸�");
-          return false;
-        }
-      }
       const that = this;
       that.confirmLoading = true;
-      this.$confirm({
-        title: '淇濆吇宸ュ崟鎶ュ伐',
-        content: '鎻愮ず锛氭姤宸ュ悗鐐规瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�',
+      that.$confirm({
+        title: '宸ュ崟鎶ュ伐',
+        content: '鎻愮ず锛氬鏈夋湭濉啓鐨勫繀濉」鎴栧鑷存姤宸ュけ璐ワ紝纭鎶ュ伐鍚楋紒',
         okText: '纭',
         cancelText: '鍙栨秷',
         onOk() {
-          requestPut(that.url.report, { id: that.specialtyMaintenanceOrderId, status: '5' }).then((res) => {
+          requestPut(that.url.report, { id: that.orderId, status: '5' }).then((res) => {
             if (res.success) {
               that.model.status = '5'
               that.$message.success(res.message)
-              that.getEquipmentTotal()
               that.buttonDistable = false
               that.revocationDistable = true
               that.SWbuttonDistable = true
@@ -583,14 +571,15 @@
         okText: '纭',
         cancelText: '鍙栨秷',
         onOk() {
-          requestPut(that.url.revocation, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
+          requestPut(that.url.revocation, { id: that.orderId, status: '4' }).then((res) => {
             if (res.success) {
               that.model.status = '4'
+              that.orderStatus = '4'
               that.$message.success(res.message)
-              that.getEquipmentTotal()
               that.buttonDistable = false
               that.revocationDistable = true
               that.SWbuttonDistable = true
+              that.$emit('ok');
             } else {
               that.$message.warning(res.message)
             }
diff --git a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue
index 871d3d3..23f0d18 100644
--- a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue
@@ -59,17 +59,22 @@
       isDel: {
         type: Boolean,
         default: false
+      },
+      orderId:{
+        type: String,
+        default:'',
+        required: false
       }
     },
     mounted() {
 
     },
     watch: {
-      planId:{
+      orderId:{
         immediate:true,
           handler(val){
-            if (this.planId) {
-            this.queryParam.planId = val
+            if (this.orderId) {
+            this.queryParam.workOrderId = val
             this.queryParam.delFlag = 0
             this.loadData(1)
           }
@@ -92,7 +97,7 @@
           },
           {
             title: '鏉′欢',
-            dataIndex: 'conditionalRelationName',
+            dataIndex: 'parameterCondition_dictText',
             align: 'center',
             width:200
           },
@@ -109,27 +114,39 @@
             width:200
           },
           {
-            title: '鍙傛暟鍗曚綅',
-            dataIndex: 'unitName',
-            align: 'center',
-            width:200
-          },
-          {
-            title: '鍙傛暟涓婇檺',
+            title: '涓婇檺鍊�',
             dataIndex: 'upperLimitValue',
             align: 'center',
             width:200
           },
           {
-            title: '鍙傛暟涓嬮檺',
+            title: '涓嬮檺鍊�',
             dataIndex: 'lowerLimitValue',
             align: 'center',
             width:200
           },
+          {
+            title: '瀹為檯鍊�',
+            dataIndex: 'actualValue',
+            align: 'center',
+            width:200
+          },
+          {
+            title: '鍗曚綅',
+            dataIndex: 'parameterUnit',
+            align: 'center',
+            width:200
+          },
+          {
+            title: '妫�娴嬫椂闂�',
+            dataIndex: 'collectTime',
+            align: 'center',
+            width:200
+          },
+
         ],
         url: {
-          list: '/eam/predictiveworkplanparameter/pagePredictiveWorkPlanParameter',
-          delete: '/eam/predictiveworkplanparameter/delete'
+          list: '/eam/predictiveworkplanparameter/getHistoryPage',
         }
       }
     },
diff --git a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue
index e41a7c2..a59477f 100644
--- a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue
@@ -58,17 +58,22 @@
       isDel: {
         type: Boolean,
         default: false
+      },
+      orderId:{
+        type: String,
+        default:'',
+        required: false
       }
     },
     mounted() {
 
     },
     watch: {
-      planId:{
+      orderId:{
         immediate:true,
           handler(val){
-            if (this.planId) {
-            this.queryParam.planId = val
+            if (this.orderId) {
+            this.queryParam.workOrderId = val
             this.queryParam.delFlag = 0
             this.loadData(1)
           }
@@ -91,7 +96,7 @@
           },
           {
             title: '鏉′欢',
-            dataIndex: 'conditionalRelationName',
+            dataIndex: 'parameterCondition_dictText',
             align: 'center',
             width:200
           },
@@ -108,27 +113,14 @@
             width:200
           },
           {
-            title: '鎶ヨ鍛ㄦ湡',
-            dataIndex: 'warnCycle',
-            align: 'center',
-            width:200
-          },
-          {
-            title: '鎶ヨ鍛ㄦ湡鍗曚綅',
-            dataIndex: 'cycleUnitName',
-            align: 'center',
-            width:200
-          },
-          {
-            title: '鎶ヨ娆℃暟',
-            dataIndex: 'times',
+            title: '妫�娴嬫椂闂�',
+            dataIndex: 'collectTime',
             align: 'center',
             width:200
           },
         ],
         url: {
-          list: '/eam/predictiveworkplanwarn/pagePredictiveWorkPlanWarn',
-          delete: '/eam/predictiveworkplanwarn/delete'
+          list: '/eam/predictiveworkplanwarn/getHistoryPage',
         }
       }
     },
diff --git a/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue b/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue
index d5815d4..522cf50 100644
--- a/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue
+++ b/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue
@@ -1,230 +1,292 @@
 <template>
+  <!--鏀寔鍏ㄥ睆缂╂斁-->
   <a-modal
-    :title="title"
-    :width="1000"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @ok="handleOk"
-    @cancel="handleCancel"
-    cancelText="鍏抽棴"
+    :visible='visible'
+    :title='title'
+    switchFullscreen
+    @ok='handleSubmit'
+    @cancel='close'
+    style='top:50px'
+    cancelText='鍏抽棴'
+    :width='1250'
   >
-    <a-spin :spinning="confirmLoading">
-      <a-form :form="form">
-        <!-- 鏌ヨ鍖哄煙 -->
-        <div class="table-page-search-wrapper">
-          <a-form
-            layout="inline"
-            @keyup.enter.native="searchQuery"
-          >
-            <a-row :gutter="24">
-              <a-col
-                :md="6"
-                :sm="8"
-              >
-                <a-form-item label="鐗╂枡缂栫爜">
-                  <j-input
-                    placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"
-                    v-model="queryParam.num"
-                  ></j-input>
-                </a-form-item>
-              </a-col>
-              <a-col
-                :md="6"
-                :sm="8"
-              >
-                <a-form-item label="鐗╂枡鍚嶇О">
-                  <j-input
-                    placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
-                    v-model="queryParam.name"
-                  ></j-input>
-                </a-form-item>
-              </a-col>
-              <a-col
-                :md="6"
-                :sm="8"
+    <a-card :bordered='false'>
+      <div class='table-page-search-wrapper'>
+        <a-form
+          layout='inline'
+          @keyup.enter.native='searchQuery'
+        >
+          <a-row :gutter='24'>
+            <a-col
+              :md='8'
+              :sm='6'
+            >
+              <a-form-item label='鍗曟嵁鍙�'>
+                <a-input
+                  placeholder='璇疯緭鍏ュ崟鎹彿'
+                  v-model='queryParam.num'
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :md='3'>
+              <span
+                style='float: left;overflow: hidden;'
+                class='table-page-search-submitButtons'
               >
                 <a-button
-                  type="primary"
-                  @click="searchQuery"
-                  icon="search"
+                  type='primary'
+                  @click='searchQuery'
+                  icon='search'
                 >鏌ヨ</a-button>
                 <a-button
-                  @click="searchReset"
-                  icon="reload"
-                  style="margin-left:8px;"
+                  @click='searchReset'
+                  icon='reload'
+                  style='margin-left: 10px'
                 >閲嶇疆</a-button>
-              </a-col>
-            </a-row>
-            <a-row :gutter="24">
-              <a-col :span="24">
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-table
+        ref='table'
+        size='middle'
+        rowKey='id'
+        bordered
+        :columns='columns'
+        :dataSource='dataSource'
+        :pagination='ipagination'
+        :rowSelection='rowSelection'
+        :loading='loading'
+        @change='handleTableChange'
+        :scroll="{ x: 'calc(980px)', y: 900 }"
+      >
 
-              </a-col>
-            </a-row>
-          </a-form>
-        </div>
-        <div style="margin-top:8px;">
-          <a-table
-            ref="table"
-            bordered
-            size="middle"
-            rowKey="id"
-            :columns="columns"
-            :dataSource="dataSource"
-            :pagination="ipagination"
-            :loading="loading"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
-            @change="handleTableChange"
-            :customRow="clickThenCheck"
-          >
-          </a-table>
-        </div>
-      </a-form>
-    </a-spin>
+      </a-table>
+    </a-card>
   </a-modal>
 </template>
 
 <script>
-import pick from 'lodash.pick'
-import { httpAction, getAction } from '@/api/manage'
+import { filterObj } from '@/utils/util'
+import { getAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import JInput from '@/components/jeecg/JInput'
+
 export default {
-  name: "MaterialSelectTable",
+  name: 'JSelectSparePartModal',
   mixins: [JeecgListMixin],
-  components: {
-    JInput
-  },
+  components: {},
+  props: {},
   data() {
     return {
-      title: "鎿嶄綔",
-      visible: false,
-      model: {},
-      confirmLoading: false,
-      form: this.$form.createForm(this),
+      queryParam: {},
       columns: [
         {
           title: '#',
           dataIndex: '',
           key: 'rowIndex',
-          width: 50,
           align: 'center',
-          customRender: function (t, r, index) {
+          customRender: function(t, r, index) {
             return parseInt(index) + 1
-          }
+          },
+          width: 50
         },
         {
-          title: '鐗╂枡缂栧彿',
+          title: '鍗曟嵁鍙�',
           align: 'center',
-          dataIndex: 'num',
-          sorter: true,
+          dataIndex: 'num'
         },
         {
-          title: '鐗╂枡鍚嶇О',
+          title: '澶囦欢缂栫爜',
           align: 'center',
-          dataIndex: 'name',
-          sorter: true,
+          dataIndex: 'spareNum'
         },
         {
-          title: '鐗╂枡瑙勬牸',
+          title: '澶囦欢鍚嶇О',
           align: 'center',
-          dataIndex: 'specification',
-          sorter: true,
+          dataIndex: 'spareName'
         },
         {
-          title: '鐗╂枡鍨嬪彿',
+          title: '鍒堕�犲晢',
           align: 'center',
-          dataIndex: 'model',
-          sorter: true,
+          dataIndex: 'constructorName'
         },
         {
-          title: '鍗曚綅',
+          title: '瑙勬牸',
           align: 'center',
-          dataIndex: 'unitId_dictText',
-          sorter: true,
+          dataIndex: 'specification'
         },
-
+        {
+          title: '鍨嬪彿',
+          align: 'center',
+          dataIndex: 'model'
+        },
+        {
+          title: '涓诲崟浣�',
+          align: 'center',
+          dataIndex: 'mainUnitName'
+        },
+        {
+          title: '涓绘暟閲�',
+          align: 'center',
+          dataIndex: 'mainQuantity'
+        },
+        {
+          title: '鍙敤鏁伴噺',
+          align: 'center',
+          dataIndex: 'availableQuantity'
+        },
       ],
-      url: {
-        list: "/base/material/list",
+      selectedRowKeys: [],
+      oldSelectRows: [],
+      dataSource: [],
+      selectionRows: [],
+      title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨浜哄憳淇℃伅',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['5', '10', '30', '50', '100'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
       },
-      index: '',
+      isorter: {
+        column: 'num',
+        order: 'desc'
+      },
+      visible: false,
+      loading: false,
+      url: {
+        list: '/eam/repairOrder/materialSpareList'
+        // list:'/spare/sparePartOutbound/list',
+      }
     }
   },
-  methods: {
-
-    searchQuery() {
-      this.loadData(1);
-    },
-
-    list(index) {
-      this.visible = true;
-      this.index = index;
-      this.loadData(1);
-    },
-
-    clickThenCheck(record) {
+  computed: {
+    rowSelection() {
       return {
-        on: {
-          click: (e) => {
-            this.selectedRowRecord = record;
-            this.onSelectChange(record.id.split(","), [record]);
+        type: 'checkbox',
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.onSelectChange(selectedRows)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.distable
           }
-        }
-      };
-    },
-
-    onSelectChange(selectedRowKeys, selectedRows) {
-      this.selectedRowKeys = selectedRowKeys;
-      this.selectedRowRecord = selectedRows[0];
-    },
-
-    close() {
-      this.queryParam = {};
-      this.$emit('close');
-      this.visible = false;
-      this.selectedRowKeys = [];
-    },
-
-    handleOk() {
-      const that = this;
-      // 瑙﹀彂琛ㄥ崟楠岃瘉
-      if (that.selectedRowKeys.length > 0) {
-        if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
-          that.$emit('sendMaterialRecord', { index: this.index, record: that.selectedRowRecord });
-          that.close();
-        } else {
-          that.$message.error("璇烽�夋嫨鐗╂枡锛�")
-        }
-      } else {
-        that.$message.error("璇烽�夋嫨鐗╂枡锛�")
+        }),
+        selectedRowKeys: this.selectedRowKeys
       }
+    }
+  },
+
+  methods: {
+    async loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      const that = this
+      //this.loading = true
+      this.queryParam.status = '1'
+      let params = this.getQueryParams()
+
+      //鏌ヨ鏉′欢
+      await getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          for (let i = 0; i < res.result.records.length; i++) {
+            if (that.oldSelectRows.indexOf(res.result.records[i].id) > -1) {
+              res.result.records[i].distable = true
+            } else {
+              res.result.records[i].distable = false
+            }
+          }
+          this.dataSource = res.result.records
+          this.ipagination.total = res.result.total
+        }
+        if (res.code === 510) {
+          this.$message.warning(res.message)
+        }
+        //this.loading = false
+      })
     },
 
-    handleCancel() {
-      this.close();
+    showModals(oldSelectRows) {
+      this.selectionRows = []
+      this.oldSelectRows = oldSelectRows
+      this.visible = true
+      this.loadData(1)
     },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    //鏌ヨ鏉′欢澶勭悊
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      this.queryParam = []
+      if (num !== 0) {
+        that.loadData(1)
+      }
+      that.selectborrowIds = []
+    },
+    close() {
+      this.selectedRowKeys = []
+      this.selectionRows = []
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //TODO 绛涢��
 
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      if(this.selectionRows.length==0){
+        this.$message.warn("璇烽�夋嫨澶囦欢");
+         return false;
+      }
+      
+      this.$emit('getSelectRows', this.selectionRows)
+      this.close()
+    },
+    onSelectChange(selectionRows) {
+      this.selectionRows = selectionRows
+    },
+    searchQuery() {
+      this.loadData(1)
+    },
   }
 }
 </script>
-<style>
-@import '~@assets/less/common.less';
-.frozenRowClass {
-  color: #c9c9c9;
+
+<style scoped>
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
 }
 
-.fontweight {
-  font-weight: bold;
-}
-
-.fontweightfrozen {
-  font-weight: bold;
-  color: #c9c9c9;
-}
-.success {
-  color: green;
-}
-.error {
-  color: red;
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3