From 6b9795ba4e3e36347b1d7dc71051768286af874a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期二, 14 十一月 2023 17:41:49 +0800
Subject: [PATCH] 质量隐患确认,故障单

---
 src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue |  125 +++++++++++++++++++++++++++--------------
 1 files changed, 81 insertions(+), 44 deletions(-)

diff --git a/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
index 5394b39..95e4210 100644
--- a/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
+++ b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
@@ -39,7 +39,6 @@
                 v-decorator="['isStop', validatorRules.isStop]"
               />
             </a-form-item>
-
           </a-col>
         </a-row>
         <a-row :gutter="24">
@@ -174,37 +173,6 @@
             </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> -->
-        <!-- </a-row> -->
         <a-row :gutter="24">
           <a-col :span="24/2">
             <a-form-item
@@ -237,22 +205,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>
 
@@ -346,6 +359,26 @@
             { max: 1000, min:1,message: '鏈�澶氬彲鎻忚堪1000瀛�!' },
           ]
         },
+        errUda1:{
+          rules: [
+            { required: true, message: '璇烽�夋嫨鏄惁鍦ㄥ姞宸ラ浂浠�!' },
+          ]
+        },
+        partNumber:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ラ浂浠跺浘鍙�!' },
+          ]
+        },
+        batchNo:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ユ壒娆″彿!' },
+          ]
+        },
+        quantity:{
+          rules: [
+            { required: true, message: '璇疯緭鍏ヤ欢鏁�!' },
+          ]
+        }
       },
       url: {
         add: "/eam/equipmentReportRepair/add",
@@ -354,6 +387,7 @@
         getNum:'/eam/sysIdentity/getNumNew'
       },
       dataSource: [],
+      workingStatus:false
     }
   },
 
@@ -372,6 +406,7 @@
       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);
           }
@@ -384,7 +419,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;
@@ -445,7 +480,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