Kaynağa Gözat

计费单位拦截修改

wengyuwen 4 yıl önce
ebeveyn
işleme
12b6bed0c8

+ 11 - 10
src/views/warehouseBusiness/goodsTransfer/index.vue

@@ -1719,13 +1719,7 @@
         // 贸易方式(数据字典),对应t_trademodels 字典
         fTrademodeidOptions: [],
         // 计费单位(数据字典),下拉选择毛重或净重字典
-        fFeetunitOptions: [
-          { dictLabel: "件数", dictValue: 1 },
-          { dictLabel: "毛重", dictValue: 2 },
-          { dictLabel: "净重", dictValue: 3 },
-          { dictLabel: "尺码", dictValue: 4 },
-          { dictLabel: "固定", dictValue: 5 }
-        ],
+        fFeetunitOptions: [],
         // 结算方式(数据字典),下拉选择字典
         fStltypeOptions: [],
         // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典
@@ -1791,7 +1785,7 @@
         orgStorageDate: null,
         // 表单参数
         form: {
-          fFeetunit:2
+          fFeetunit:"2"
         },
         // 库存总账参数
         whgenlegParams: {
@@ -1871,6 +1865,9 @@
       this.getDicts('sys_common_status').then((response) => {
         this.fBillstatusOptions = response.data
       })
+      this.getDicts('data_unitfees').then((response) => {
+        this.fFeetunitOptions = response.data
+      })
       this.register()
     },
     activated(){
@@ -2411,7 +2408,7 @@
         getGoodsTransfer(fId).then((response) => {
           this.form = response.data.warehousebills
           this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
-          this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
+          this.$set(this.form, 'fFeetunit', this.form.fFeetunit + '')
           this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
           this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
           this.fMblnoOptions = response.data.corps
@@ -2518,6 +2515,10 @@
         this.$refs['form'].validate((valid) => {
           if (valid) {
             for (let li in this.dataList) {
+              if(this.form.fFeetunit > 3){
+                this.$message.error('请维护主表计费单位为件数、毛重或净重')
+                return false
+              }
               if (!this.dataList[li].fWarehouselocids) {
                 this.$message({ message: '请维护第' + Number(li) + 1 + '行库区', type: 'warning' })
                 return false
@@ -2695,7 +2696,7 @@
               this.msgSuccess('保存成功')
               this.form = response.data.warehouseBills
               this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
-              this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
+              this.$set(this.form, 'fFeetunit',this.form.fFeetunit + '')
               this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
               this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
               this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))

+ 27 - 21
src/views/warehouseBusiness/inStock/index.vue

@@ -607,7 +607,7 @@
                 style="width: 100%"
                 v-model="form.remark"
                 type="textarea"
-                :disabled="browseStatus || formBrowseStatus"
+                :disabled="browseStatus"
                 placeholder="请输入内容"
               />
             </el-form-item>
@@ -2888,13 +2888,7 @@ export default {
       // 仓储类型 入库时选择 产地 规格 品牌 所用,对应storage_type 字典
       fStorageTypeOptions: [],
       // 计费单位(数据字典),下拉选择毛重或净重字典
-      fFeetunitOptions: [
-        { dictLabel: "件数", dictValue: "1" },
-        { dictLabel: "毛重", dictValue: "2" },
-        { dictLabel: "净重", dictValue: "3" },
-        { dictLabel: "尺码", dictValue: "4" },
-        { dictLabel: "固定", dictValue: "5" },
-      ],
+      fFeetunitOptions: [],
       // 结算方式(数据字典),下拉选择字典
       fStltypeOptions: [],
       // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典
@@ -3053,6 +3047,9 @@ export default {
     this.getDicts("sys_common_status").then((response) => {
       this.fBillstatusOptions = response.data;
     });
+    this.getDicts("data_unitfees").then((response) => {
+      this.fFeetunitOptions = response.data;
+    });
   },
   activated() {
     this.adoPt()
@@ -3378,6 +3375,10 @@ export default {
         // if (!this.form.fId) {
         //   this.form.fId = this.fid
         // }
+        if(this.form.fFeetunit > 3){
+          this.$message.error('请维护主表计费单位为件数、毛重或净重')
+          return false
+        }
         if (!this.form.fBusinessType) {
           this.$message.error('请选择货物属性!')
           return false
@@ -3627,12 +3628,12 @@ export default {
           });
         }
         for (let list in this.warehouseDrList) {
-          if (this.warehouseDrList[list].fFeeUnitid === 1) {
-            this.$set(this.warehouseDrList[list], "fQty", this.fQty.toFixed(2));
-          } else if (this.warehouseDrList[list].fFeeUnitid === 2) {
-            this.$set(this.warehouseDrList[list], "fQty", this.fGrossweight.toFixed(2));
-          } else if (this.warehouseDrList[list].fFeeUnitid === 3) {
-            this.$set(this.warehouseDrList[list], "fQty", this.fNetweight.toFixed(2));
+          if (this.warehouseDrList[list].fFeeUnitid === "1") {
+            this.$set(this.warehouseDrList[list], "fQty", (this.fQty/1000).toFixed(2));
+          } else if (this.warehouseDrList[list].fFeeUnitid === "2") {
+            this.$set(this.warehouseDrList[list], "fQty", (this.fGrossweight/1000).toFixed(2));
+          } else if (this.warehouseDrList[list].fFeeUnitid === "3") {
+            this.$set(this.warehouseDrList[list], "fQty", (this.fNetweight/1000).toFixed(2));
           } else {
             this.$set(this.warehouseDrList[list], "fQty", 0);
           }
@@ -3665,12 +3666,12 @@ export default {
           });
         }
         for (let list in this.warehouseCrList) {
-          if (this.warehouseCrList[list].fFeeUnitid === 1) {
-            this.$set(this.warehouseCrList[list], "fQty", this.fQty.toFixed(2));
-          } else if (this.warehouseCrList[list].fFeeUnitid === 2) {
-            this.$set(this.warehouseCrList[list], "fQty", this.fGrossweight.toFixed(2));
-          } else if (this.warehouseCrList[list].fFeeUnitid === 3) {
-            this.$set(this.warehouseCrList[list], "fQty", this.fNetweight.toFixed(2));
+          if (this.warehouseCrList[list].fFeeUnitid === "1") {
+            this.$set(this.warehouseCrList[list], "fQty", (this.fQty/1000).toFixed(2));
+          } else if (this.warehouseCrList[list].fFeeUnitid === "2") {
+            this.$set(this.warehouseCrList[list], "fQty", (this.fGrossweight/1000).toFixed(2));
+          } else if (this.warehouseCrList[list].fFeeUnitid === "3") {
+            this.$set(this.warehouseCrList[list], "fQty", (this.fNetweight/1000).toFixed(2));
           } else {
             this.$set(this.warehouseCrList[list], "fQty", 0);
           }
@@ -3858,7 +3859,7 @@ export default {
       this.form = {
         fBusinessType: '常规入账',
           fItemsStatus: null,
-          fFeetunit: '2'
+          fFeetunit:"2"
       }
       this.browseStatus = status;
       this.queryUser();
@@ -3936,6 +3937,7 @@ export default {
         this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
         this.$set(this.form, "fTrademodeid", this.form.fTrademodeid + "");
         this.$set(this.form, "createTime", Date.parse(this.form.createTime));
+        this.$set(this.form, "fFeeUnitid", this.form.fFeeunitid + "");
         this.$set(this.form, "fPlannetweight", this.form.fPlannetweight.toFixed(2));
         this.$set(this.form, "fPlangrossweight", this.form.fPlangrossweight.toFixed(2));
         for (let list in this.dataList) {
@@ -4136,6 +4138,10 @@ export default {
     creditClick() {
       this.$refs['form'].validate((valid) => {
         for (let warehouseCr in this.Printinglist) {
+          if(this.form.fFeetunit > 3){
+            this.$message.error('请维护主表计费单位为件数、毛重或净重')
+            return false
+          }
           if (!this.Printinglist[warehouseCr].fQty || this.Printinglist[warehouseCr].fQty === 0) {
             this.$message.error("请维护入库件数");
             return false;

+ 19 - 12
src/views/warehouseBusiness/outStock/index.vue

@@ -2605,13 +2605,7 @@ export default {
       fWbuOptions: [],
       approVal:false,
       // 计价单位
-      jFeetunitOptions: [
-        {dictLabel: "件数",dictValue: 1},
-        {dictLabel: "毛重",dictValue: 2},
-        {dictLabel: "净重",dictValue: 3},
-        {dictLabel: "尺码",dictValue: 4},
-        {dictLabel: "固定",dictValue: 5},
-      ],
+      jFeetunitOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -2739,6 +2733,9 @@ export default {
     this.getDicts("sys_common_status").then((response) => {
       this.fBillstatusOptions = response.data;
     });
+    this.getDicts("data_unitfees").then((response) => {
+      this.jFeetunitOptions = response.data;
+    });
   },
   activated() {
     this.adoPt()
@@ -3047,9 +3044,9 @@ export default {
         }
         let qty = 1;
         if (this.dialogWhgenlegList[zhgen].fFeeUnitid === 1) {
-          qty = this.fQty
+          qty = (this.fQty/1000).toFixed(2)
         } else if (this.dialogWhgenlegList[zhgen].fFeeUnitid === 2) {
-          qty = this.fGrossweight
+          qty = (this.fGrossweight/1000).toFixed(2)
         } else if (this.dialogWhgenlegList[zhgen].fFeeUnitid === 3) {
           qty = this.fNetweight
         } else if (this.dialogWhgenlegList[zhgen].fFeeUnitid === 4) {
@@ -3066,8 +3063,9 @@ export default {
             fCurrency: 'RMB',
             fExrate: 1,
             fAmount: fAmount,
-            fTaxrate: this.fTaxrate
+            fTaxrate: this.fTaxrate,
           })
+          console.log(this.fQty)
         } else {
           this.warehouseDrList.push({
             fQty: qty,
@@ -3247,6 +3245,10 @@ export default {
           this.$message.error("请先保存!");
           return false;
         }
+        if(this.form.fFeetunit > 3){
+          this.$message.error('请维护主表计费单位为件数、毛重或净重')
+          return false
+        }
         // if (!this.printinglist[li].fBusinessType) {
         //   this.$message.error('请先维护业务类型!')
         //   return false
@@ -3544,7 +3546,7 @@ export default {
       this.relevantAttachments = [];
       this.title = "出库单";
       this.formBrowseStatus = false;
-      this.form.fFeetunit = 2
+      this.form.fFeetunit = "2"
     },
     /** 修改按钮操作 */
     handleUpdate(row, status) {
@@ -3816,6 +3818,10 @@ export default {
     creditClick() {
       this.$refs["form"].validate((valid) => {
         for (let warehouseCr in this.dataListSelection) {
+          if(this.form.fFeetunit > 3){
+            this.$message.error('请维护主表计费单位为件数、毛重或净重')
+            return false
+          }
           if (this.dataListSelection[warehouseCr].fBillstatus === 10) {
             this.$message.error("请先打印作业单");
             return false;
@@ -4088,6 +4094,7 @@ export default {
           setTimeout(() => {
             this.form.fBillstatus = 2
             let formData = new window.FormData()
+            console.log(this.form)
             formData.append("warehouseBills", JSON.stringify(this.form));
             formData.append("warehousebillsitems", JSON.stringify(this.dataList));
             formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
@@ -4099,7 +4106,7 @@ export default {
               this.$set(this.form, 'fEta', Date.parse(this.form.fEta))
               this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
               this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
-              this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
+              this.$set(this.form, 'fFeetunit', this.form.fFeetunit + '')
               this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
               this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
               this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))