From 5fadb9533dae67ad5e2327f97a4faa0f5068de62 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 10 四月 2025 10:40:20 +0800
Subject: [PATCH] 流程添加

---
 src/views/eam/maintenance/modules/EamInspectionOrderModal.vue |  106 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 89 insertions(+), 17 deletions(-)

diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
index 19b2053..67e0612 100644
--- a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
+++ b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
@@ -13,8 +13,8 @@
       <a-form-model ref="form" :model="model" :rules="validatorRules">
         <a-row :gutter="24">
           <a-col :span="8">
-            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜">
-              <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.standardCode" disabled />
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="宸ュ崟鍙�">
+              <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled />
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
@@ -32,8 +32,8 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="8">
-            <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate">
-              <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="model.inspectionDate" style="width: 100%" />
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜">
+              <a-input placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" disabled v-model="model.standardCode" />
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
@@ -42,8 +42,36 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="鐐规浜�">
+              <j-dict-select-tag v-model="model.operator" placeholder="璇烽�夋嫨鐢ㄦ埛" dictCode="sys_user,realname,username,username!='admin' order by create_time"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span="8">
+            <a-form-model-item label="鐐规鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate">
+              <j-date placeholder="璇烽�夋嫨鐐规鏃ユ湡" v-model="model.inspectionDate" @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
             <a-form-model-item label="鐐规杩囨湡鏃堕棿" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime">
               <j-date placeholder="璇烽�夋嫨鐐规杩囨湡鏃堕棿" v-model="model.expirationTime" disabled style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="8">
+            <a-form-model-item
+              label="鐓х墖鏂囦欢"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="imageFiles">
+              <lx-upload :returnUrl="false"
+                         :multiple="false"
+                         v-model="model.imageFiles"
+                         biz="EamMaintenanceStandard">
+              </lx-upload>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -58,10 +86,10 @@
           <j-vxe-table
             ref="editableDetailTable"
             :rowNumber="true"
-            :rowSelection="false"
+            :rowSelection="true"
             :bordered="true"
             :alwaysEdit="true"
-            :toolbar="false"
+            :toolbar="true"
             keep-source
             :height="300"
             :loading="detail.loading"
@@ -79,6 +107,7 @@
 import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
 import { JVXETypes } from '@/components/jeecg/JVxeTable'
 import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
+import moment from 'dayjs'
 
 export default {
   name: 'EamMaintenanceStandardModal',
@@ -116,14 +145,16 @@
         ],
         equipmentId: [
           { required: true, message: '璇烽�夋嫨璁惧!' }
-        ]
+        ],
       },
       url: {
-        add: '/eam/maintenanceStandard/add',
-        edit: '/eam/maintenanceStandard/edit',
-        detail: '/eam/eamMaintenanceStandardDetail/queryList'
+        add: '/eam/eamInspectionOrder/add',
+        edit: '/eam/eamInspectionOrder/edit',
+        detail: '/eam/eamMaintenanceStandardDetail/queryList',
+        detailOrder: '/eam/eamInspectionOrderDetail/queryList'
       },
       maintenanceCategory: 'POINT_INSPECTION',
+      standardId:"",
       detail: {
         loading: false,
         dataSource: [],
@@ -131,21 +162,33 @@
           {
             title: '搴忓彿',
             key: 'itemCode',
+            type: JVXETypes.inputNumber,
             width: '10%',
-            align: 'center'
+            align:"center",
+            validateRules: [
+              {required : true, unique: true, message: '搴忓彿涓嶈兘閲嶅'}
+            ]
           },
           {
             title: '淇濆吇椤�',
             key: 'itemName',
+            type: JVXETypes.textarea,
             width: '20%',
-            align: 'center'
+            align:"center",
+            validateRules: [
+              {required : true, message: '淇濆吇椤逛笉鑳戒负绌猴紒'}
+            ]
           },
           {
             title: '淇濆吇瑕佹眰',
             key: 'itemDemand',
+            type: JVXETypes.textarea,
             width: '30%',
-            align: 'center'
-          }
+            align:"center",
+            validateRules: [
+              {required : true, message: "淇濆吇瑕佹眰涓嶈兘涓虹┖锛�"}
+            ]
+          },
         ]
       }
     }
@@ -155,20 +198,24 @@
   methods: {
     add() {
       this.model = {}
+      this.detail.dataSource = [];
       this.visible = true
       this.editable = false
     },
     edit(record) {
+      console.log(record)
       this.model = Object.assign({}, record)
+      this.standardId=record.standardId
       this.visible = true
       this.editable = true
+      this.detail.dataSource = []
       if (record && record.referenceFile) {
         let obj = JSON.parse(record.referenceFile)
         this.model.fileList = [obj]
       } else {
         this.model.fieldList = []
       }
-      this.loadDetail(record.id)
+      this.loadDetailOrder(record.id)
     },
     close() {
       this.$emit('close')
@@ -200,6 +247,7 @@
             httpurl += this.url.edit
             method = 'put'
           }
+          this.model.standardId=this.standardId
           httpAction(httpurl, this.model, method).then((res) => {
             if (res.success) {
               that.$message.success(res.message)
@@ -222,19 +270,43 @@
     autocompleteForm(selectObj) {
       this.model.standardName = selectObj.standardName
       this.model.maintenancePeriod=selectObj.maintenancePeriod
+      this.model.standardCode=selectObj.standardCode
+      if (this.standardId===undefined || this.standardId==="") {
+        this.standardId=selectObj.id
+        this.loadDetail(selectObj.id)
+      }
+    },
+    expirationTimeFrom(date) {
+      //杩囨湡鏃堕棿鏄垵濮嬫椂闂�+淇濆吇鍛ㄦ湡
+      if (date && this.model.maintenancePeriod) {
+        // 杞崲涓烘椂闂存埑瀛楃涓诧紙鎴栨寚瀹氭牸寮忥級
+        this.model.expirationTime = moment(date)
+          .add(this.model.maintenancePeriod, 'days')
+          .format('YYYY-MM-DD')
+      } else {
+        this.model.expirationTime = null; // 娓呯┖鏃犳晥鍊�
+      }
     },
     //鍔犺浇璇︽儏鏁版嵁
     loadDetail(standardId) {
-      this.detail.dataSource = []
       if (standardId) {
         getAction(this.url.detail, { standardId: standardId }).then(res => {
+          if (res.success) {
+            this.detail.dataSource = [...res.result]
+            this.standardId=undefined;
+          }
+        })
+      }
+    },
+    loadDetailOrder(orderId){
+      if (orderId) {
+        getAction(this.url.detailOrder, { orderId: orderId }).then(res => {
           if (res.success) {
             this.detail.dataSource = [...res.result]
           }
         })
       }
     }
-
   }
 }
 </script>

--
Gitblit v1.9.3