Переглянути джерело

生产计划 新增修改 增加校验

jingshuyong 11 місяців тому
батько
коміт
e0c8d23cbc

+ 10 - 4
src/views/productionPlan/components/factoryAdd/index.vue

@@ -76,7 +76,8 @@
             <template v-slot:requiredFormingNum="{ row, $index }">
 
               <el-input v-model.number="row.requiredFormingNum" size="small" type="number" style="width: 100%"
-                placeholder="输入数量" @input="tableHandleKeyUp(row, 'sum')"></el-input>
+                      placeholder="输入要求生产数量" @input="tableHandleKeyUp(row, 'procut')"></el-input>
+                <!-- placeholder="输入要求生产数量" @input="tableHandleKeyUp(row, 'sum')"></el-input> -->
 
             </template>
 
@@ -845,12 +846,14 @@ export default {
         }
 
         console.log(this.form);
+        let flag = true;
         this.form.productInfoList.forEach(v => {
           if (!v.produceRoutingId) {
+            flag = false
             return this.$message.error('请选择工艺路线');
           }
         })
-
+        if(!flag) return
         if (!this.form.id) {
           if (this.form.productInfoList.length) {
             this.form.productInfoList.map((item, index) => {
@@ -865,7 +868,7 @@ export default {
           this.form.timeDimensionPlanType = this.type;
           await this.getPlanCode();
           this.loading = true;
-
+          
           temporaryPlanSave(this.form)
             .then((res) => {
               this.$message.success('新增成功!');
@@ -943,7 +946,10 @@ export default {
     tableHandleKeyUp(row, name) {
       // return
       // , index, e, name
-
+      if(name == 'procut'){
+        let total = row.productUnitWeight * row.requiredFormingNum;
+        this.$set(row,'productWeight',total)
+      }
       if (row.specification && this.clientEnvironmentId == 4) {
 
         let modelArr = row.specification.split('*');

+ 1 - 0
src/views/workOrder/components/releaseDialog.vue

@@ -863,6 +863,7 @@
             dispatchMethod: 0,
             assignees
           };
+          // 先判断是否派单过 有的话直接用前面派单的 类型数据 否则就是自己选择的数据
           if (this.isDispatchRow.hasExists) {
             data.dispatchType = this.isDispatchRow.dispatchType;
           } else {

+ 1 - 0
src/views/workOrder/index.vue

@@ -535,6 +535,7 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
+        console.log('数据')
         if (where.status) {
           where.statusList = [];
           where.statusList.push(where.status);