qukaidi 4 vuotta sitten
vanhempi
commit
2f22296f6e
1 muutettua tiedostoa jossa 216 lisäystä ja 28 poistoa
  1. 216 28
      src/views/Warehousing/inStock/AddOrUpdate.vue

+ 216 - 28
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -3302,16 +3302,46 @@ export default {
           this.CntrTable.map((e) => {
             this.cntrList.map((item) => {
               if (item.fId == e.fCntrid) {
-                arr.push(item.fName + "*" + e.fCntrcount);
+                arr.push(item.fName + "X" + e.fCntrcount);
               }
             });
           });
           arr = [...new Set(arr)];
           this.form.fCntval = arr.join(",");
         }
-        this.form.fNetweight = this.fNetweight;
-        this.form.fPlanvolumn = this.fPlanvolumn;
-        this.form.fGrossweight = this.fGrossweight;
+        if (this.detailList.length > 0) {
+          let arr = [];
+          this.detailList.map((e) => {
+            this.goodsOptions.map((item) => {
+              if (e.fGoodsid == item.fId) {
+                arr.push(item.fName);
+              }
+            });
+          });
+          arr = [...new Set(arr)];
+          this.form.fProductName = arr.join(",");
+        }else {
+            this.form.fProductName = null;
+          }
+        if (this.detailList.length > 0) {
+          let arr = [];
+          this.detailList.map((e) => {
+            arr.push(e.fMarks);
+          });
+          arr = [...new Set(arr)];
+          this.form.fMarks = arr.join(",");
+        }else {
+            this.form.fMarks = null;
+          }
+        if (this.detailList.length == 0) {
+          this.form.fNetweight = 0;
+          this.form.fPlanvolumn = 0;
+          this.form.fGrossweight = 0;
+        } else {
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fGrossweight = this.fGrossweight;
+        }
         let formData = new window.FormData();
         formData.append("warehouseBills", JSON.stringify(this.form));
         formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
@@ -3362,16 +3392,46 @@ export default {
         this.CntrTable.map((e) => {
           this.cntrList.map((item) => {
             if (item.fId == e.fCntrid) {
-              arr.push(item.fName + "*" + e.fCntrcount);
+              arr.push(item.fName + "X" + e.fCntrcount);
             }
           });
         });
         arr = [...new Set(arr)];
         this.form.fCntval = arr.join(",");
       }
-      this.form.fNetweight = this.fNetweight;
-      this.form.fPlanvolumn = this.fPlanvolumn;
-      this.form.fGrossweight = this.fGrossweight;
+      if (this.detailList.length > 0) {
+        let arr = [];
+        this.detailList.map((e) => {
+          this.goodsOptions.map((item) => {
+            if (e.fGoodsid == item.fId) {
+              arr.push(item.fName);
+            }
+          });
+        });
+        arr = [...new Set(arr)];
+        this.form.fProductName = arr.join(",");
+      }else {
+            this.form.fProductName = null;
+          }
+      if (this.detailList.length > 0) {
+        let arr = [];
+        this.detailList.map((e) => {
+          arr.push(e.fMarks);
+        });
+        arr = [...new Set(arr)];
+        this.form.fMarks = arr.join(",");
+      }else {
+            this.form.fMarks = null;
+          }
+      if (this.detailList.length == 0) {
+        this.form.fNetweight = 0;
+        this.form.fPlanvolumn = 0;
+        this.form.fGrossweight = 0;
+      } else {
+        this.form.fNetweight = this.fNetweight;
+        this.form.fPlanvolumn = this.fPlanvolumn;
+        this.form.fGrossweight = this.fGrossweight;
+      }
       let formData = new window.FormData();
       formData.append("warehouseBills", JSON.stringify(this.form));
       formData.append("warehousebillsitems", JSON.stringify(this.Printinglist));
@@ -3421,16 +3481,46 @@ export default {
         this.CntrTable.map((e) => {
           this.cntrList.map((item) => {
             if (item.fId == e.fCntrid) {
-              arr.push(item.fName + "*" + e.fCntrcount);
+              arr.push(item.fName + "X" + e.fCntrcount);
             }
           });
         });
         arr = [...new Set(arr)];
         this.form.fCntval = arr.join(",");
       }
-      this.form.fNetweight = this.fNetweight;
-      this.form.fPlanvolumn = this.fPlanvolumn;
-      this.form.fGrossweight = this.fGrossweight;
+      if (this.detailList.length > 0) {
+        let arr = [];
+        this.detailList.map((e) => {
+          this.goodsOptions.map((item) => {
+            if (e.fGoodsid == item.fId) {
+              arr.push(item.fName);
+            }
+          });
+        });
+        arr = [...new Set(arr)];
+        this.form.fProductName = arr.join(",");
+      }else {
+            this.form.fProductName = null;
+          }
+      if (this.detailList.length > 0) {
+        let arr = [];
+        this.detailList.map((e) => {
+          arr.push(e.fMarks);
+        });
+        arr = [...new Set(arr)];
+        this.form.fMarks = arr.join(",");
+      }else {
+            this.form.fMarks = null;
+          }
+      if (this.detailList.length == 0) {
+        this.form.fNetweight = 0;
+        this.form.fPlanvolumn = 0;
+        this.form.fGrossweight = 0;
+      } else {
+        this.form.fNetweight = this.fNetweight;
+        this.form.fPlanvolumn = this.fPlanvolumn;
+        this.form.fGrossweight = this.fGrossweight;
+      }
       // 撤回入库
       let formData = new window.FormData();
       formData.append("warehouseBills", JSON.stringify(this.form));
@@ -3533,9 +3623,9 @@ export default {
           this.$set(this.form, "fMblno", null);
           this.$set(this.form, "fMarks", null);
           this.$set(this.form, "fProductName", null);
-          this.$set(this.form, "fNetweight", null);
-          this.$set(this.form, "fPlanvolumn", null);
-          this.$set(this.form, "fGrossweight", null);
+          this.$set(this.form, "fNetweight", 0);
+          this.$set(this.form, "fPlanvolumn", 0);
+          this.$set(this.form, "fGrossweight", 0);
           this.$set(this.form, "fBusinessType", null);
         }
       });
@@ -3607,21 +3697,51 @@ export default {
           }
           // 附件数据
           this.form.fBillingway = this.form.fFeetUnit;
-          this.form.fNetweight = this.fNetweight;
-          this.form.fPlanvolumn = this.fPlanvolumn;
-          this.form.fGrossweight = this.fGrossweight;
+          if (this.detailList.length == 0) {
+            this.form.fNetweight = 0;
+            this.form.fPlanvolumn = 0;
+            this.form.fGrossweight = 0;
+          } else {
+            this.form.fNetweight = this.fNetweight;
+            this.form.fPlanvolumn = this.fPlanvolumn;
+            this.form.fGrossweight = this.fGrossweight;
+          }
           if (this.CntrTable.length > 0) {
             let arr = [];
             this.CntrTable.map((e) => {
               this.cntrList.map((item) => {
                 if (item.fId == e.fCntrid) {
-                  arr.push(item.fName + "*" + e.fCntrcount);
+                  arr.push(item.fName + "X" + e.fCntrcount);
                 }
               });
             });
             arr = [...new Set(arr)];
             this.form.fCntval = arr.join(",");
           }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              this.goodsOptions.map((item) => {
+                if (e.fGoodsid == item.fId) {
+                  arr.push(item.fName);
+                }
+              });
+            });
+            arr = [...new Set(arr)];
+            this.form.fProductName = arr.join(",");
+          }else {
+            this.form.fProductName = null;
+          }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              arr.push(e.fMarks);
+            });
+            arr = [...new Set(arr)];
+            this.form.fMarks = arr.join(",");
+          }else {
+            this.form.fMarks = null;
+          }
           let formData = new window.FormData();
           formData.append("tWarehouseBills", JSON.stringify(this.form));
           // 库存明细
@@ -3661,9 +3781,15 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           this.form.fBillingway = this.form.fFeetUnit;
-          this.form.fNetweight = this.fNetweight;
-          this.form.fPlanvolumn = this.fPlanvolumn;
-          this.form.fGrossweight = this.fGrossweight;
+          if (this.detailList.length == 0) {
+            this.form.fNetweight = 0;
+            this.form.fPlanvolumn = 0;
+            this.form.fGrossweight = 0;
+          } else {
+            this.form.fNetweight = this.fNetweight;
+            this.form.fPlanvolumn = this.fPlanvolumn;
+            this.form.fGrossweight = this.fGrossweight;
+          }
           let formData = new window.FormData();
           // 附件数据
           this.form.fQty = this.fQty;
@@ -3672,13 +3798,37 @@ export default {
             this.CntrTable.map((e) => {
               this.cntrList.map((item) => {
                 if (item.fId == e.fCntrid) {
-                  arr.push(item.fName + "*" + e.fCntrcount);
+                  arr.push(item.fName + "X" + e.fCntrcount);
                 }
               });
             });
             arr = [...new Set(arr)];
             this.form.fCntval = arr.join(",");
           }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              this.goodsOptions.map((item) => {
+                if (e.fGoodsid == item.fId) {
+                  arr.push(item.fName);
+                }
+              });
+            });
+            arr = [...new Set(arr)];
+            this.form.fProductName = arr.join(",");
+          } else {
+            this.form.fProductName = null;
+          }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              arr.push(e.fMarks);
+            });
+            arr = [...new Set(arr)];
+            this.form.fMarks = arr.join(",");
+          } else {
+            this.form.fMarks = null;
+          }
           formData.append("tWarehouseBills", JSON.stringify(this.form));
           // 库存明细
           formData.append(
@@ -3725,6 +3875,7 @@ export default {
               this.$set(this.form, "fEta", Date.parse(this.form.fEta));
               this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
               this.$set(this.form, "fBstime", Date.parse(this.form.fBstime));
+              this.$set(this.form, "fFeetUnit", this.form.fFeetunit);
               this.$set(
                 this.form,
                 "createTime",
@@ -4142,7 +4293,7 @@ export default {
       this.reset();
       this.fixdetaiNum = null;
       this.fixdetaiNum = index;
-      console.log(row)
+      console.log(row);
       row.fBsdate = new Date(row.fBsdate).getTime();
       row.fBusinessType = row.fBusinessType.toString();
       row.fCntrtype = Number(row.fCntrtype);
@@ -4160,6 +4311,13 @@ export default {
           this.sumMum += e.fQty;
         }
       });
+      if (this.detailList.length == 0) {
+        this.form.fProductName = "";
+        this.form.fMarks = "";
+        this.form.fNetweight = 0;
+        this.form.fPlanvolumn = 0;
+        this.form.fGrossweight = 0;
+      }
     },
     // 新增附件上传
     addRelevt() {
@@ -4410,17 +4568,47 @@ export default {
           this.CntrTable.map((e) => {
             this.cntrList.map((item) => {
               if (item.fId == e.fCntrid) {
-                arr.push(item.fName + "*" + e.fCntrcount);
+                arr.push(item.fName + "X" + e.fCntrcount);
               }
             });
           });
           arr = [...new Set(arr)];
           this.form.fCntval = arr.join(",");
         }
+        if (this.detailList.length > 0) {
+          let arr = [];
+          this.detailList.map((e) => {
+            this.goodsOptions.map((item) => {
+              if (e.fGoodsid == item.fId) {
+                arr.push(item.fName);
+              }
+            });
+          });
+          arr = [...new Set(arr)];
+          this.form.fProductName = arr.join(",");
+        }else {
+            this.form.fProductName = null;
+          }
+        if (this.detailList.length > 0) {
+          let arr = [];
+          this.detailList.map((e) => {
+            arr.push(e.fMarks);
+          });
+          arr = [...new Set(arr)];
+          this.form.fMarks = arr.join(",");
+        }else {
+            this.form.fMarks = null;
+          }
         this.form.fBillingway = this.form.fFeetUnit;
-        this.form.fNetweight = this.fNetweight;
-        this.form.fPlanvolumn = this.fPlanvolumn;
-        this.form.fGrossweight = this.fGrossweight;
+        if (this.detailList.length == 0) {
+          this.form.fNetweight = 0;
+          this.form.fPlanvolumn = 0;
+          this.form.fGrossweight = 0;
+        } else {
+          this.form.fNetweight = this.fNetweight;
+          this.form.fPlanvolumn = this.fPlanvolumn;
+          this.form.fGrossweight = this.fGrossweight;
+        }
         let formData = new window.FormData();
         formData.append("warehouseBills", JSON.stringify(this.form));
         formData.append(