quwangxin пре 2 година
родитељ
комит
c21927a376

+ 29 - 15
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -23,16 +23,16 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <!-- <el-col :span="12">
+        <el-col :span="12">
           <el-form-item label="生产版本" prop="produceVersionName">
             <el-input
               :disabled="!formData.materialName"
-              placeholder="请选择"
+              :placeholder="!formData.materialName ? '请选择物料' : '请选择'"
               v-model="formData.produceVersionName"
               @click.native="chooseVersion"
             ></el-input>
           </el-form-item>
-        </el-col> -->
+        </el-col>
         <el-col :span="12">
           <el-form-item label="牌号" prop="brandNo">
             <el-input v-model="formData.brandNo" disabled></el-input>
@@ -90,7 +90,8 @@
     <!-- 选择生产版本 -->
     <ProductionVersion
       ref="versionRef"
-      :productCode="formData.categoryId"
+      :productCode="formData.materialCode"
+      @confirm="versionConfirm"
     ></ProductionVersion>
   </ele-modal>
 </template>
@@ -116,6 +117,13 @@
               trigger: ['blur', 'change']
             }
           ],
+          produceVersionName: [
+            {
+              required: true,
+              message: '请选择生产版本',
+              trigger: ['blur', 'change']
+            }
+          ],
           deliveryTime: [
             {
               required: true,
@@ -139,6 +147,7 @@
           unit: '',
           brandNo: '',
           model: '',
+          produceVersionName: '',
           materialCode: '',
           materialName: ''
         }
@@ -166,10 +175,10 @@
           if (value) {
             const request = this.type == 'add' ? save : update;
 
-            if (this.type == 'add') {
-              this.formData.produceVersionId = '1684162877351866369';
-              this.formData.produceVersionName = '挤压合金生产';
-            }
+            // if (this.type == 'add') {
+            //   this.formData.produceVersionId = '1684162877351866369';
+            //   this.formData.produceVersionName = '挤压合金生产';
+            // }
             await request(this.formData);
             this.$message.success('保存成功!');
             this.$emit('success');
@@ -181,14 +190,19 @@
         this.visible = false;
         this.formData = {};
         this.$refs.formRef.resetFields();
-      }
+      },
+      versionConfirm (cur) {
+        console.log(cur, '2222W33000000920');
+        this.formData.produceVersionId = cur.produceVersionId;
+        this.formData.produceVersionName = cur.produceVersionName;
+      },
 
-      // chooseVersion () {
-      //   if (!this.formData.materialName) {
-      //     return this.$message.error('请选择物料');
-      //   }
-      //   this.$refs.versionRef.open();
-      // }
+      chooseVersion () {
+        if (!this.formData.materialName) {
+          return this.$message.error('请选择物料');
+        }
+        this.$refs.versionRef.open();
+      }
     }
   };
 </script>

+ 3 - 0
src/views/saleOrder/components/order-search.vue

@@ -357,6 +357,9 @@
             if (data.code != -1) {
               this.$message.error(data.message);
             }
+          })
+          .finally(() => {
+            this.$refs.uploadFile.clearFiles();
           });
       }
     }