From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期五, 24 十一月 2023 16:41:32 +0800
Subject: [PATCH] 故障报修验收

---
 src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue |  247 ++++++++++++++++++++++++++++++++-----------------
 1 files changed, 162 insertions(+), 85 deletions(-)

diff --git a/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
index c22adfa..99252ff 100644
--- a/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
+++ b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
@@ -19,7 +19,7 @@
               :wrapperCol="wrapperCol"
             >
               <a-input
-                :disabled="disableSubmit"
+                :disabled="true"
                 placeholder="璇疯緭鍏ュ崟鎹彿"
                 v-decorator="['num', validatorRules.num]"
               />
@@ -33,20 +33,49 @@
             >
               <j-dict-select-tag
                 allow-clear
-                :disabled="disableSubmit"
                 :placeholder="disableSubmit?'':'璇烽�夋嫨鏄惁鍋滄満缁翠慨'"
                 :triggerChange="true"
                 dictCode="is_stop"
                 v-decorator="['isStop', validatorRules.isStop]"
               />
             </a-form-item>
-
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item
+              label="鎶ヤ慨浜�"
+              prop="name"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+            <a-input
+                v-decorator="['errUda2', validatorRules.errUda2]"
+                placeholder="璇疯緭鍏ユ姤淇汉"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="鏁呴殰鏃堕棿"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <j-date
+                :disabled="true"
+                style="width: 100%"
+                placeholder="璇烽�夋嫨鏁呴殰鏃堕棿"
+                :showTime="true"
+                dateFormat="YYYY-MM-DD HH:mm:ss"
+                v-decorator="['faultTime', validatorRules.faultTime]"
+              />
+            </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="24/2">
             <a-form-item
-              label="璁惧缂栫爜"
+              label="缁熶竴缂栧彿"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
@@ -62,24 +91,6 @@
           </a-col>
           <a-col :span="24/2">
             <a-form-item
-              label="鏁呴殰鏃堕棿"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-            >
-              <j-date
-                :disabled="disableSubmit"
-                style="width: 100%"
-                placeholder="璇烽�夋嫨鏁呴殰鏃堕棿"
-                :showTime="true"
-                dateFormat="YYYY-MM-DD HH:mm:ss"
-                v-decorator="['faultTime', validatorRules.faultTime]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24/2">
-            <a-form-item
               label="璁惧鍚嶇О"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
@@ -92,6 +103,8 @@
               />
             </a-form-item>
           </a-col>
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24/2">
             <a-form-item
               label="璁惧瑙勬牸"
@@ -106,6 +119,21 @@
               />
             </a-form-item>
           </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="璁惧鍨嬪彿"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                :disabled="true"
+                enter-button
+                :read-only="true"
+                v-decorator="['equipmentModel', validatorRules.equipmentModel]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
           <a-row
             hidden
             :gutter="24"
@@ -118,7 +146,7 @@
               >
                 <a-input
                   :disabled="true"
-                  :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囩紪鐮�/鍚嶇О/鍨嬪彿'"
+                  :placeholder="disableSubmit?'':'璇疯緭鍏ョ粺涓�缂栧彿/鍚嶇О/鍨嬪彿'"
                   v-decorator="['equipmentId', validatorRules.equipmentId ]"
                 />
               </a-form-item>
@@ -136,23 +164,8 @@
                 />
               </a-form-item>
             </a-col>
-          </a-row>
         </a-row>
         <a-row :gutter="24">
-          <a-col :span="24/2">
-            <a-form-item
-              label="璁惧鍨嬪彿"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-            >
-              <a-input
-                :disabled="true"
-                enter-button
-                :read-only="true"
-                v-decorator="['equipmentModel', validatorRules.equipmentModel]"
-              />
-            </a-form-item>
-          </a-col>
           <a-col :span="24/2">
             <a-form-item
               label="浣跨敤閮ㄩ棬"
@@ -171,37 +184,6 @@
                 :disabled="true"
                 :placeholder="disableSubmit?'':'璇疯緭鍏ヤ娇鐢ㄩ儴闂�'"
                 v-decorator="['departName', validatorRules.departName ]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24/2">
-            <a-form-item
-              label="绱ф�ョ▼搴�"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-            >
-              <j-dict-select-tag
-                allow-clear
-                :disabled="disableSubmit"
-                :placeholder="disableSubmit?'':'璇烽�夋嫨绱ф�ョ▼搴�'"
-                :triggerChange="true"
-                dictCode="urgency"
-                v-decorator="['urgency', validatorRules.urgency]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="24/2" v-show="false">
-            <a-form-item
-              label="鏁呴殰鍘熷洜"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-            >
-            <a-input
-              :disabled="disableSubmit"
-                enter-button
-                v-decorator="['faultReason', validatorRules.faultReason]"
               />
             </a-form-item>
           </a-col>
@@ -238,22 +220,67 @@
             </a-form-item>
           </a-col>
         </a-row>
-        <!-- <a-row :gutter="24">
-          <a-col :span="24/2">
+        <a-row :gutter="24">
+         <a-col :span="24/2">
             <a-form-item
-              label="鏁呴殰鐓х墖"
+              label="鏄惁鍦ㄥ姞宸ラ浂浠�"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
-              <j-image-upload
-                :disabled="disableSubmit"
-                :isMultiple="true"
-                v-decorator="['photo', {}]"
-              ></j-image-upload>
-
+              <j-dict-select-tag
+                allow-clear
+                :placeholder="disableSubmit?'':'璇烽�夋嫨鏄惁鍦ㄥ姞宸ラ浂浠�'"
+                :triggerChange="true"
+                @change="(e) => statusChange(e)"
+                dictCode="is_product"
+                v-decorator="['errUda1', validatorRules.errUda1]"
+              />
             </a-form-item>
           </a-col>
-        </a-row> -->
+          <a-col :span="24/2"  v-if="workingStatus">
+            <a-form-item
+              label="鍔犲伐闆朵欢鍙�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :placeholder="disableSubmit?'':'璇疯緭鍏ュ姞宸ラ浂浠跺彿'"
+                v-decorator="['partNumber', validatorRules.partNumber ]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2" v-if="workingStatus">
+            <a-form-item
+              label="鎵规鍙�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                allow-clear
+                :placeholder="disableSubmit?'':'璇疯緭鍏ユ壒娆″彿'"
+                v-decorator="['batchNo', validatorRules.batchNo ]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2"  v-if="workingStatus">
+            <a-form-item
+              label="浠舵暟"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input-number
+                allow-clear
+                style="width: 100%;"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ヤ欢鏁�'"
+                :min="1"
+                v-decorator="['quantity', validatorRules.quantity]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
       </a-form>
     </a-spin>
 
@@ -290,6 +317,8 @@
 // import JImageUpload from '@/components/jeecg/JImage2Upload'
 import EquipmentList from './EquipmentList'
 import Vue from 'vue'
+import dayjs from 'dayjs'
+
 
 export default {
   name: "MalfunctionRepaireModal",
@@ -297,7 +326,8 @@
     JMultiSelectTag,
     Tooltip,
     // JImageUpload,
-    EquipmentList
+    EquipmentList,
+    dayjs
   },
   data() {
     return {
@@ -338,14 +368,47 @@
             { required: true, message: '璇烽�夋嫨鏁呴殰鏃堕棿!' },
           ]
         },
+        faultDescription:{
+          rules: [
+            { required: true, message: '璇锋弿杩版晠闅�!' },
+            { max: 1000, min:1,message: '鏈�澶氬彲鎻忚堪1000瀛�!' },
+          ]
+        },
+        errUda1:{
+          rules: [
+            { required: true, message: '璇烽�夋嫨鏄惁鍦ㄥ姞宸ラ浂浠�!' },
+          ]
+        },
+        errUda2: {
+          rules: [
+            { required: true, message: '璇疯緭鍏ユ姤淇汉!' },
+            { min:1,max:10, message: '闀垮害涓嶈兘澶т簬10涓瓧绗�!' },
+          ]
+        },
+        partNumber:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ラ浂浠跺浘鍙�!' },
+          ]
+        },
+        batchNo:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ユ壒娆″彿!' },
+          ]
+        },
+        quantity:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ヤ欢鏁�!' },
+          ]
+        }
       },
       url: {
         add: "/eam/equipmentReportRepair/add",
         edit: "/eam/equipmentReportRepair/edit",
         getSysDeparts: "/eam/equipment/getSysDeparts",
+        getNum:'/eam/sysIdentity/getNumNew'
       },
-
       dataSource: [],
+      workingStatus:false
     }
   },
 
@@ -354,9 +417,21 @@
   },
 
   methods: {
-
     add() {
-      this.edit({})
+      let that = this;
+      let param = {
+          type: 'EquipmentReportRepair',
+          length: 4
+      };
+      let modelDefault = {};
+      getAction(this.url.getNum,param).then(res=>{
+          if(res.success){
+             modelDefault.num = res.result;
+             this.workingStatus = false;
+             modelDefault.faultTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
+             that.edit(modelDefault);
+          }
+      })
     },
     edit(record) {
       let that = this;
@@ -365,7 +440,7 @@
       that.model = Object.assign({}, record);
       that.visible = true;
       that.$nextTick(() => {
-        that.form.setFieldsValue(pick(that.model, 'num', 'isStop', 'equipmentId', 'equipmentNum', 'equipmentName', 'equipmentModel', 'equipmentSpecification', 'urgency', 'useDepartId', 'departName', 'faultDescription', 'faultTime', 'remark', "photo"));
+        that.form.setFieldsValue(pick(that.model,'errUda1' ,'num', 'isStop', 'equipmentId', 'equipmentNum', 'equipmentName', 'equipmentModel', 'equipmentSpecification', 'urgency', 'useDepartId', 'departName', 'faultDescription', 'faultTime', 'remark', "photo"));
       });
       if (record.id) {
         this.codeDisable = true;
@@ -426,7 +501,9 @@
       let record = data.record;
       this.form.setFieldsValue({ equipmentName: record.name, equipmentId: record.id, equipmentNum: record.num, equipmentModel: record.model, equipmentSpecification: record.specification, useDepartId: record.useId, departName: record.useId_dictText });
     },
-
+    statusChange(val){
+      this.workingStatus=val==='no'?false:true;
+    }
   },
 }
 </script>

--
Gitblit v1.9.3