Qukaidi 4 tahun lalu
induk
melakukan
c977fdfd64

+ 249 - 215
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -3964,7 +3964,7 @@ export default {
           addWhgenleg(formData).then((response) => {
             if ((response.code = 200)) {
               this.mblnoStatus = "";
-              this.form = response.data.warehouseBills;
+              this.form = response.data.warehouse;
               this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
               this.$set(this.form, "fBstime", Date.parse(this.form.fBstime));
               this.$set(
@@ -3990,7 +3990,7 @@ export default {
                   this.form.fTrademodeid.toString()
                 );
               }
-              response.data.warehousebillsitems.map((e) => {
+              response.data.warehouseItem.map((e) => {
                 e.fBsdate = Date.parse(e.fBsdate);
                 e.fBusinessType = e.fBusinessType.toString();
                 e.fLntype = e.fLntype ? e.fLntype.toString() : null;
@@ -4241,150 +4241,167 @@ export default {
       });
     },
     submitForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          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") {
-              } else {
-                this.$message.error(
-                  "请维护收款信息第" + (Number(item) + 1) + "行客户名称"
-                );
-                return false;
+      let checkData = {
+        fId: this.form.fId,
+        fType: "warehouse",
+        codeVal: this.form.fDateChanged,
+      };
+      checkCode(checkData).then((response) => {
+        if (!response) {
+          this.$confirm("数据发生变化,请更新一下数据?", "提示", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.getForm();
+          });
+        } else {
+          this.$refs["form"].validate((valid) => {
+            if (valid) {
+              if (this.detailList.length === 0) {
+                return this.$message.error("请新增库存明细!");
               }
-            }
-            if (!this.warehouseDrList[item].fFeeid) {
-              if (item === "fBusinessType") {
-              } else {
-                this.$message.error(
-                  "请维护收款信息第" + (Number(item) + 1) + "行费用名称"
-                );
-                return false;
+              this.updateDeduplication();
+              for (let item in this.warehouseDrList) {
+                if (!this.warehouseDrList[item].fCorpid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护收款信息第" + (Number(item) + 1) + "行客户名称"
+                    );
+                    return false;
+                  }
+                }
+                if (!this.warehouseDrList[item].fFeeid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护收款信息第" + (Number(item) + 1) + "行费用名称"
+                    );
+                    return false;
+                  }
+                }
+                if (!this.warehouseDrList[item].fFeeUnitid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护收款信息第" + (Number(item) + 1) + "行计价单位"
+                    );
+                    return false;
+                  }
+                }
               }
-            }
-            if (!this.warehouseDrList[item].fFeeUnitid) {
-              if (item === "fBusinessType") {
+              for (let item in this.warehouseCrList) {
+                if (!this.warehouseCrList[item].fCorpid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护付款信息第" + (Number(item) + 1) + "行客户名称"
+                    );
+                    return false;
+                  }
+                }
+                if (!this.warehouseCrList[item].fFeeid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护付款信息第" + (Number(item) + 1) + "行费用名称"
+                    );
+                    return false;
+                  }
+                }
+
+                if (!this.warehouseCrList[item].fFeeUnitid) {
+                  if (item === "fBusinessType") {
+                  } else {
+                    this.$message.error(
+                      "请维护付款信息第" + (Number(item) + 1) + "行计价单位"
+                    );
+                    return false;
+                  }
+                }
+              }
+              // 附件数据
+              this.form.fBillingway = this.form.fFeetUnit;
+              if (this.detailList.length == 0) {
+                this.form.fNetweight = 0;
+                this.form.fPlanvolumn = 0;
+                this.form.fGrossweight = 0;
               } else {
-                this.$message.error(
-                  "请维护收款信息第" + (Number(item) + 1) + "行计价单位"
-                );
-                return false;
+                this.form.fNetweight = this.fNetweight;
+                this.form.fPlanvolumn = this.fPlanvolumn;
+                this.form.fGrossweight = this.fGrossweight;
               }
-            }
-          }
-          for (let item in this.warehouseCrList) {
-            if (!this.warehouseCrList[item].fCorpid) {
-              if (item === "fBusinessType") {
+              if (this.CntrTable.length > 0) {
+                let arr = [];
+                this.CntrTable.map((e) => {
+                  this.cntrList.map((item) => {
+                    if (item.fId == e.fCntrid) {
+                      arr.push(item.fName + "X" + e.fCntrcount);
+                    }
+                  });
+                });
+                arr = [...new Set(arr)];
+                this.form.fCntval = arr.join(",");
               } else {
-                this.$message.error(
-                  "请维护付款信息第" + (Number(item) + 1) + "行客户名称"
-                );
-                return false;
+                this.form.fCntval = null;
               }
-            }
-            if (!this.warehouseCrList[item].fFeeid) {
-              if (item === "fBusinessType") {
+              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.$message.error(
-                  "请维护付款信息第" + (Number(item) + 1) + "行费用名称"
-                );
-                return false;
+                this.form.fProductName = "";
               }
-            }
-
-            if (!this.warehouseCrList[item].fFeeUnitid) {
-              if (item === "fBusinessType") {
+              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.$message.error(
-                  "请维护付款信息第" + (Number(item) + 1) + "行计价单位"
-                );
-                return false;
+                this.form.fMarks = "";
               }
-            }
-          }
-          // 附件数据
-          this.form.fBillingway = this.form.fFeetUnit;
-          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 + "X" + e.fCntrcount);
-                }
-              });
-            });
-            arr = [...new Set(arr)];
-            this.form.fCntval = arr.join(",");
-          } else {
-            this.form.fCntval = null;
-          }
-          if (this.detailList.length > 0) {
-            let arr = [];
-            this.detailList.map((e) => {
-              this.goodsOptions.map((item) => {
-                if (e.fGoodsid == item.fId) {
-                  arr.push(item.fName);
+              let formData = new window.FormData();
+              formData.append("warehouseBills", JSON.stringify(this.form));
+              // 库存明细
+              formData.append(
+                "warehousebillsitems",
+                JSON.stringify(this.detailList)
+              );
+              // 附件数据
+              formData.append(
+                "tEnclosure",
+                JSON.stringify(this.relevantAttachments)
+              );
+              // 费用明细付款
+              formData.append(
+                "warehousebillsfeesCr",
+                JSON.stringify(this.warehouseCrList)
+              );
+              // 收款
+              formData.append(
+                "warehousebillsfeesDr",
+                JSON.stringify(this.warehouseDrList)
+              );
+              formData.append("mblnoStatus", JSON.stringify(this.mblnoStatus));
+              formData.append("tCntr", JSON.stringify(this.CntrTable));
+              warehouseSubmission(formData).then((response) => {
+                if (response.code == 200) {
+                  this.msgSuccess("提交成功");
+                  setTimeout(() => {
+                    this.cancel();
+                  }, 200);
                 }
               });
-            });
-            arr = [...new Set(arr)];
-            this.form.fProductName = arr.join(",");
-          } else {
-            this.form.fProductName = "";
-          }
-          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 = "";
-          }
-          let formData = new window.FormData();
-          formData.append("warehouseBills", JSON.stringify(this.form));
-          // 库存明细
-          formData.append(
-            "warehousebillsitems",
-            JSON.stringify(this.detailList)
-          );
-          // 附件数据
-          formData.append(
-            "tEnclosure",
-            JSON.stringify(this.relevantAttachments)
-          );
-          // 费用明细付款
-          formData.append(
-            "warehousebillsfeesCr",
-            JSON.stringify(this.warehouseCrList)
-          );
-          // 收款
-          formData.append(
-            "warehousebillsfeesDr",
-            JSON.stringify(this.warehouseDrList)
-          );
-          formData.append("mblnoStatus", JSON.stringify(this.mblnoStatus));
-          formData.append("tCntr", JSON.stringify(this.CntrTable));
-          warehouseSubmission(formData).then((response) => {
-            if (response.code == 200) {
-              this.msgSuccess("提交成功");
-              setTimeout(() => {
-                this.cancel();
-              }, 200);
             }
           });
         }
@@ -4421,89 +4438,106 @@ export default {
       }
     },
     verifyForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          this.updateDeduplication();
-          this.form.fBillingway = this.form.fFeetUnit;
-          this.form.fFeetunit = this.form.fFeetUnit;
-          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;
-          if (this.CntrTable.length > 0) {
-            let arr = [];
-            this.CntrTable.map((e) => {
-              this.cntrList.map((item) => {
-                if (item.fId == e.fCntrid) {
-                  arr.push(item.fName + "X" + e.fCntrcount);
-                }
-              });
-            });
-            arr = [...new Set(arr)];
-            this.form.fCntval = arr.join(",");
-          } else {
-            this.form.fCntval = null;
-          }
-          if (this.detailList.length > 0) {
-            let arr = [];
-            this.detailList.map((e) => {
-              this.goodsOptions.map((item) => {
-                if (e.fGoodsid == item.fId) {
-                  arr.push(item.fName);
+      let checkData = {
+        fId: this.form.fId,
+        fType: "warehouse",
+        codeVal: this.form.fDateChanged,
+      };
+      checkCode(checkData).then((response) => {
+        if (!response) {
+          this.$confirm("数据发生变化,请更新一下数据?", "提示", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.getForm();
+          });
+        } else {
+          this.$refs["form"].validate((valid) => {
+            if (valid) {
+              this.updateDeduplication();
+              this.form.fBillingway = this.form.fFeetUnit;
+              this.form.fFeetunit = this.form.fFeetUnit;
+              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;
+              if (this.CntrTable.length > 0) {
+                let arr = [];
+                this.CntrTable.map((e) => {
+                  this.cntrList.map((item) => {
+                    if (item.fId == e.fCntrid) {
+                      arr.push(item.fName + "X" + e.fCntrcount);
+                    }
+                  });
+                });
+                arr = [...new Set(arr)];
+                this.form.fCntval = arr.join(",");
+              } else {
+                this.form.fCntval = null;
+              }
+              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 = "";
+              }
+              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 = "";
+              }
+              formData.append("tWarehouseBills", JSON.stringify(this.form));
+              // 库存明细
+              formData.append(
+                "tWarehousebillsitems",
+                JSON.stringify(this.detailList)
+              );
+              // 附件数据
+              formData.append(
+                "tEnclosure",
+                JSON.stringify(this.relevantAttachments)
+              );
+              // 费用明细付款
+              formData.append(
+                "tWarehousebillsfeesCr",
+                JSON.stringify(this.warehouseCrList)
+              );
+              // 收款
+              formData.append(
+                "tWarehousebillsfeesDr",
+                JSON.stringify(this.warehouseDrList)
+              );
+              formData.append("mblnoStatus", JSON.stringify(this.mblnoStatus));
+              formData.append("tCntr", JSON.stringify(this.CntrTable));
+              submitWarehousingApproval(formData).then((response) => {
+                if (response.code == 200) {
+                  this.msgSuccess("请核成功");
+                  this.$set(this.form, "warehouseStatus", 4);
+                  this.cancel();
                 }
               });
-            });
-            arr = [...new Set(arr)];
-            this.form.fProductName = arr.join(",");
-          } else {
-            this.form.fProductName = "";
-          }
-          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 = "";
-          }
-          formData.append("tWarehouseBills", JSON.stringify(this.form));
-          // 库存明细
-          formData.append(
-            "tWarehousebillsitems",
-            JSON.stringify(this.detailList)
-          );
-          // 附件数据
-          formData.append(
-            "tEnclosure",
-            JSON.stringify(this.relevantAttachments)
-          );
-          // 费用明细付款
-          formData.append(
-            "tWarehousebillsfeesCr",
-            JSON.stringify(this.warehouseCrList)
-          );
-          // 收款
-          formData.append(
-            "tWarehousebillsfeesDr",
-            JSON.stringify(this.warehouseDrList)
-          );
-          formData.append("mblnoStatus", JSON.stringify(this.mblnoStatus));
-          formData.append("tCntr", JSON.stringify(this.CntrTable));
-          submitWarehousingApproval(formData).then((response) => {
-            if (response.code == 200) {
-              this.msgSuccess("请核成功");
-              this.$set(this.form, "warehouseStatus", 4);
-              this.cancel();
             }
           });
         }

+ 1 - 1
src/views/basicdata/corps/index.vue

@@ -438,7 +438,7 @@
         </el-row>
         <el-row>
           <div style="display: flex; justify-content: flex-end">
-            <el-button @click="showForm = !showForm"
+            <el-button style="margin:10px" @click="showForm = !showForm"
               >{{ showForm ? "隐藏" : "更多" }}
             </el-button>
           </div>