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

+ 19 - 12
src/views/productionPlan/components/plan-view.vue

@@ -63,21 +63,19 @@
               <el-input
                 type="number"
                 v-model.number="row.formingNum"
-				@input="writeNum(row.formingNum,row)"
+                @input="writeNum(row.formingNum, row)"
               ></el-input>
             </el-form-item>
           </template>
         </el-table-column>
         <el-table-column label="成型重量" prop="" width="120">
           <template v-slot="{ row, $index }">
-			  <!-- :prop="`tableData.${$index}.formingWeight`" -->
-            <el-form-item
-              :rules="rule.formingWeight"
-            >
+            <!-- :prop="`tableData.${$index}.formingWeight`" -->
+            <el-form-item :rules="rule.formingWeight">
               <el-input
                 type="number"
                 v-model.number="row.formingWeight"
-		        		readonly
+                readonly
               ></el-input>
             </el-form-item>
           </template>
@@ -281,9 +279,13 @@
       }
     },
     methods: {
-	  writeNum(val,row){
-		  this.$set(row,'formingWeight',val*Number(this.infoData.productUnitWeight))
-	  },
+      writeNum (val, row) {
+        this.$set(
+          row,
+          'formingWeight',
+          val * Number(this.infoData.productUnitWeight)
+        );
+      },
       // 发布
       handleRelease () {
         this.$refs.formRef.validate((value) => {
@@ -302,10 +304,14 @@
                       Object.assign({}, i, {
                         status: 4,
                         model: this.infoData.model,
-                        brandNo: this.infoData.brandNo
+                        brandNo: this.infoData.brandNo,
+                        categoryId: this.infoData.categoryId
                       })
                     ),
-                    ...this.deleteList
+                    ...this.deleteList.map((i) => ({
+                      ...i,
+                      categoryId: this.infoData.categoryId
+                    }))
                   ]);
                   if (data) {
                     this.$message.success('发布成功!');
@@ -342,7 +348,8 @@
         row.executorName = executorName.substring(1);
       },
       addOrder () {
-				if(this.tableData.length>0) return  this.$message.warning('工单只能添加一条!');
+        if (this.tableData.length > 0)
+          return this.$message.warning('工单只能添加一条!');
         this.$refs.equipmentDailogRef.open(1);
       },
       editOrder (row) {

+ 11 - 4
src/views/saleOrder/components/plan-submit.vue

@@ -64,8 +64,10 @@
     <div slot="footer" class="footer">
       <div>
         <el-button @click="cancel">取消</el-button>
-        <el-button @click="submit(2)">提交并发布</el-button>
-        <el-button type="primary" @click="submit(1)">提交</el-button>
+        <el-button @click="submit(2)" :loading="loading">提交并发布</el-button>
+        <el-button type="primary" @click="submit(1)" :loading="loading"
+          >提交</el-button
+        >
       </div>
     </div>
   </el-dialog>
@@ -83,6 +85,7 @@
     data () {
       return {
         visible: false,
+        loading: false,
         tableList: []
       };
     },
@@ -101,8 +104,12 @@
         this.visible = false;
       },
       async getPlanCode () {
-        const code = await getCode('product_code');
-        this.$set(this.info, 'code', code);
+        this.loading = true;
+        try {
+          const code = await getCode('product_code');
+          this.$set(this.info, 'code', code);
+        } catch (err) {}
+        this.loading = false;
       },
       submit (type) {
         this.$emit('publish', type);

+ 14 - 14
src/views/saleOrder/salesToProduction.vue

@@ -299,7 +299,7 @@
         ref="versionRefs"
         @confirm="confirmVersion"
         :productCode="form.productCode"
-		:produceVersionId="form.produceVersionId"
+        :produceVersionId="form.produceVersionId"
       ></ProductionVersion>
       <PlanSubmit
         ref="submitRefs"
@@ -319,7 +319,7 @@
     saveSaleToPlan,
     updateSaleToPlan,
     getUpdateInfoById,
-	getProductVersion
+    getProductVersion
   } from '@/api/saleOrder';
   import dictMixins from '@/mixins/dictMixins';
   import { deepClone } from '@/utils/index';
@@ -373,8 +373,8 @@
       async getPlanInfo (id) {
         const data = await getUpdateInfoById(id);
         this.form = data;
-        if(data.productCode){
-        	this.getVersionData()
+        if (data.productCode) {
+          this.getVersionData();
         }
       },
       getSaleInfo (params) {
@@ -395,16 +395,16 @@
           }
         });
       },
-	  
-	  getVersionData () {
-	    getProductVersion(this.form.productCode).then((res) => {
-	       res.map(item=>{
-			    if(item.produceVersionId==this.form.produceVersionId){
-					this.lineNamesList = Array.from(new Set(item.lineNames || []));
-				}
-		   })
-	    });
-	  },
+
+      getVersionData () {
+        getProductVersion(this.form.productCode).then((res) => {
+          res.map((item) => {
+            if (item.produceVersionId == this.form.produceVersionId) {
+              this.lineNamesList = Array.from(new Set(item.lineNames || []));
+            }
+          });
+        });
+      },
       cancel () {
         this.$router.go(-1);
       },