From 9b0cca3161903645e37e734c5ab1a5bb3021e1da Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 10 九月 2025 11:42:28 +0800
Subject: [PATCH] art: 下料功能修改

---
 src/views/mes/modules/MesMaterialUnloadingForm.vue |   59 ++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/src/views/mes/modules/MesMaterialUnloadingForm.vue b/src/views/mes/modules/MesMaterialUnloadingForm.vue
index 8df1b81..7015a4b 100644
--- a/src/views/mes/modules/MesMaterialUnloadingForm.vue
+++ b/src/views/mes/modules/MesMaterialUnloadingForm.vue
@@ -1,36 +1,49 @@
 <template>
   <a-spin :spinning="confirmLoading">
-    <j-form-container :disabled="formDisabled">
-      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+    <j-form-container :disabled="true">
+      <a-form-model ref="form1" :model="model" :rules="validatorRules" slot="detail">
         <a-row>
           <a-col :span="12">
-            <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
-              <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-model-item label="涓婃枡id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="loadingId">
-              <a-input v-model="model.loadingId" placeholder="璇疯緭鍏ヤ笂鏂檌d"  ></a-input>
+            <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
+              <j-search-select-tag placeholder="璇烽�夋嫨浜х嚎" v-model="model.factoryId"
+                                   dict="base_factory,factory_name,id,del_flag=0 and factory_category='3'"
+                                 ></j-search-select-tag>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="鐗╂枡缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
-              <a-input v-model="model.materialNumber" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"  ></a-input>
+              <a-input v-model="model.materialNumber" ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
-              <a-input v-model="model.materialName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"  ></a-input>
+              <a-input v-model="model.materialName"></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="鎵规鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
-              <a-input v-model="model.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿"  ></a-input>
+              <a-input v-model="model.batchNumber"></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
-              <a-input-number v-model="model.quantity" placeholder="璇疯緭鍏ユ暟閲�" style="width: 100%" />
+              <a-input-number v-model="model.quantity" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鍓╀綑鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remainingQuantity">
+              <a-input-number v-model="model.remainingQuantity" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="12">
+            <a-form-model-item label="涓嬫枡鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unloadingQuantity">
+              <a-input-number v-model="model.unloadingQuantity" placeholder="璇疯緭鍏ヤ笅鏂欐暟閲�" style="width: 100%" />
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -70,11 +83,12 @@
         },
         confirmLoading: false,
         validatorRules: {
+          unloadingQuantity: [
+            { required: true, message: '涓嬫枡鏁伴噺涓哄繀濉」', trigger: 'change' }
+          ]
         },
         url: {
-          add: "/mes/mesMaterialUnloading/add",
-          edit: "/mes/mesMaterialUnloading/edit",
-          queryById: "/mes/mesMaterialUnloading/queryById"
+          add: "/mes/mesMaterialLoading/unloading",
         }
       }
     },
@@ -101,16 +115,7 @@
         this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
+            httpAction(this.url.add,this.model,'post').then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
                 that.$emit('ok');
@@ -121,7 +126,7 @@
               that.confirmLoading = false;
             })
           }
-         
+
         })
       },
     }

--
Gitblit v1.9.3