qukaidi 4 年之前
父节点
当前提交
6e1e3ccf8e
共有 1 个文件被更改,包括 82 次插入18 次删除
  1. 82 18
      src/views/Warehousing/outStock/AddOrUpdate.vue

+ 82 - 18
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -633,7 +633,7 @@
                 :disabled="browseStatus"
                 size="small"
                 @click="addRelevant"
-                >录 入
+                >导入库存
               </el-button>
               <el-button
                 :disabled="browseStatus"
@@ -935,13 +935,6 @@
               </template>
             </el-table-column>
             <el-table-column
-              prop="fTruckno"
-              header-align="center"
-              width="130px"
-              align="center"
-              label="*车号"
-            />
-            <el-table-column
               prop="ftruckno"
               header-align="center"
               width="150px"
@@ -2642,7 +2635,7 @@
         type="warning"
         prop="打印"
         @click="print_rkd = true"
-        >库单
+        >库单
       </el-button>
       <el-button @click="discharge" :disabled="browseStatus">卸货</el-button>
       <el-button
@@ -2952,6 +2945,36 @@ export default {
       this.CntrTable = [];
       this.getForm();
     },
+    // 出库件数的计算
+    qtyChange(row) {
+      if (!row.fQty || row.fQty === "") {
+        this.$set(row, "fNetweight", 0);
+        this.$set(row, "fGrossweight", 0);
+        return false;
+      }
+      if (row.fPlanqty < row.fQty) {
+        this.$message.error("出库件数超出结余件数!");
+        this.$set(row, "fQty", 0);
+        this.$set(row, "fNetweight", 0);
+        this.$set(row, "fGrossweight", 0);
+        return false;
+      }
+      this.$set(
+        row,
+        "fNetweight",
+        parseFloat(
+          (Number(row.fPlannetweight) / Number(row.fPlanqty)) * Number(row.fQty)
+        ).toFixed(2)
+      );
+      this.$set(
+        row,
+        "fGrossweight",
+        parseFloat(
+          (Number(row.fPlangrossweight) / Number(row.fPlanqty)) *
+            Number(row.fQty)
+        ).toFixed(2)
+      );
+    },
     whgenlegData() {
       if (this.dialogWhgenlegList.length === 0) {
         this.$message({ message: "未勾选信息", type: "warning" });
@@ -2975,7 +2998,6 @@ export default {
           fOriginalbilldate: e.fOriginalbilldate,
           fOriginalbillno: e.fOriginalbillno,
           fPackagespecs: e.fPackagespecs,
-          fVolumn: e.fVolumnblc,
           fGrossweight: 0,
           fNetweight: 0,
           fQty: 0,
@@ -3219,7 +3241,7 @@ export default {
       addWhgenleg(formData).then((response) => {
         if ((response.code = 200)) {
           this.detailList.map((e, index) => {
-            response.datawarehouseItem.map((item) => {
+            response.data.warehouseItem.map((item) => {
               item.fBsdate = Date.parse(item.fBsdate);
               if (e.fId == item.fId) {
                 e = item;
@@ -3245,7 +3267,7 @@ export default {
           return this.$message.error("请存在未卸货的数据");
         }
         if (this.Printinglist[item].fBillstatus == 30) {
-          return this.$message.error("请存在未库的数据");
+          return this.$message.error("请存在未库的数据");
         }
       }
       if (this.CntrTable.length > 0) {
@@ -3367,10 +3389,15 @@ export default {
           this.browseStatus = false;
         }
         this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
-        this.$set(this.form, "fBstime", Date.parse(this.form.fBstime));
+        this.$set(this.form, "fBstifime", Date.parse(this.form.fBstime));
         this.$set(this.form, "createTime", Date.parse(this.form.createTime));
         this.$set(this.form, "fFeetUnit", this.form.fFeetunit);
-        this.$set(this.form, "fCartype", this.form.fCartype.toString());
+        if (this.form.fCartype||this.form.fCartype==0) {
+          this.$set(this.form, "fCartype", this.form.fCartype.toString());
+        }
+        if (this.form.fStltypeid || this.form.fStltypeid == 0) {
+          this.$set(this.form, "fStltypeid", this.form.fStltypeid.toString());
+        }
         if (this.form.fTrademodeid) {
           this.$set(
             this.form,
@@ -3378,9 +3405,6 @@ export default {
             this.form.fTrademodeid.toString()
           );
         }
-        if (this.form.fStltypeid || this.form.fStltypeid == 0) {
-          this.$set(this.form, "fStltypeid", this.form.fStltypeid.toString());
-        }
         if (!this.copyStatus) {
           if (response.data.warehouseBillsItem) {
             response.data.warehouseBillsItem.map((e) => {
@@ -3434,6 +3458,7 @@ export default {
           if (this.detailList.length === 0) {
             return this.$message.error("请新增库存明细!");
           }
+          this.updateDeduplication();
           for (let item in this.warehouseDrList) {
             if (!this.warehouseDrList[item].fCorpid) {
               if (item === "fBusinessType") {
@@ -3577,9 +3602,35 @@ export default {
         }
       });
     },
+    updateDeduplication() {
+      if (this.detailList.length) {
+        let fMarks = [];
+        let fProductName = [];
+        let fMblno = [];
+        this.detailList.map((e) => {
+          if (e.fMarks) {
+            fMarks.push(e.fMarks);
+          }
+          if (e.fGoodsids) {
+            fProductName.push(e.fGoodsids);
+          }
+          if (e.fMblno) {
+            fMblno.push(e.fMblno);
+          }
+        });
+        this.$set(this.form, "fMarks", [...new Set(fMarks)].join(","));
+        this.$set(
+          this.form,
+          "fProductName",
+          [...new Set(fProductName)].join(",")
+        );
+        this.$set(this.form, "fMblno", [...new Set(fMblno)].join(","));
+      }
+    },
     saveForm(status) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.updateDeduplication();
           this.form.fBillingway = this.form.fFeetUnit;
           if (this.detailList.length == 0) {
             this.form.fNetweight = 0;
@@ -3682,8 +3733,21 @@ export default {
                   "createTime",
                   Date.parse(this.form.createTime)
                 );
+                if (this.form.fStltypeid || this.form.fStltypeid == 0) {
+                  this.$set(
+                    this.form,
+                    "fStltypeid",
+                    this.form.fStltypeid.toString()
+                  );
+                }
                 this.$set(this.form, "fFeetUnit", this.form.fFeetunit);
-                this.$set(this.form, "fCartype", this.form.fCartype.toString());
+                if (this.form.fCartype||this.form.fCartype==0) {
+                  this.$set(
+                    this.form,
+                    "fCartype",
+                    this.form.fCartype.toString()
+                  );
+                }
                 if (this.form.fTrademodeid) {
                   this.$set(
                     this.form,