Selaa lähdekoodia

快速出入库新增费用明细和暂存功能

lichao 3 vuotta sitten
vanhempi
commit
7b024cc727

+ 8 - 0
src/api/warehouseBusiness/fastInStock.js

@@ -8,3 +8,11 @@ export function fastInStock(data) {
     data: data
   })
 }
+// 暂存
+export function saveInstock(data) {
+  return request({
+    url: '/warehouseBusiness/inStock/quick_staging',
+    method: 'post',
+    data: data
+  })
+}

+ 8 - 0
src/api/warehouseBusiness/fastOutStock.js

@@ -16,3 +16,11 @@ export function changeSelect(data) {
     data: data
   })
 }
+// 暂存
+export function saveOutstock(data) {
+  return request({
+    url: '/warehouseBusiness/outStock/quick_staging',
+    method: 'post',
+    data: data
+  })
+}

+ 141 - 3
src/components/fastStorage/fastInStock/index.vue

@@ -734,9 +734,10 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {queryUserVal} from "@/api/system/user";
 import print from "print-js";
-import {fastInStock} from "@/api/warehouseBusiness/fastInStock";
+import {fastInStock, saveInstock} from "@/api/warehouseBusiness/fastInStock";
 import {listFees, getFees} from "@/api/basicdata/fees";
 import uploadExcel from "./uploadExcel";
+import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseInStock";
 
 export default {
   name: "fastInStock",
@@ -748,6 +749,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       activeName: 'inStockList',
       visible: false,
       form: {},
@@ -1057,6 +1059,7 @@ export default {
             fSrcTypeId: 0,
             fBusinessType: '0',
             remarks: null,
+            fDc: 'D',
           })
         }
       })
@@ -1070,10 +1073,17 @@ export default {
     handleConfirm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          if (!this.form.fId) return this.$message.error('数据未保存,请先暂存')
           for (let item in this.detailList) {
+            if (!this.detailList[item].fId) {
+              return this.$message.error('数据未保存,请先暂存')
+            }
             if (!this.detailList[item].fGoodsid) {
               return this.$message.error('第' + (Number(item) + 1) + '行品名不能为空')
             }
+            if (!this.detailList[item].fWarehouseInformation) {
+              return this.$message.error('第' + (Number(item) + 1) + '行库区不能为空')
+            }
             this.goodsOptions.map((e) => {
               if (this.detailList[item].fGoodsid == e.fId) {
                 if (e.ifCntrno == "1") {
@@ -1092,6 +1102,12 @@ export default {
             if (!this.detailList[item].fQty) {
               return this.$message.error('第' + (Number(item) + 1) + '行件数不能为空')
             }
+            if (this.detailList[item].fNetweight == 0) {
+              return this.$message.error('第' + (Number(item) + 1) + '行净重不能为空')
+            }
+            if (this.detailList[item].fGrossweight == 0) {
+              return this.$message.error('第' + (Number(item) + 1) + '行毛重不能为空')
+            }
           }
           let fPlanqty = 0;
           let fPlannetweight = 0;
@@ -1130,11 +1146,16 @@ export default {
           });
           fMarks = [...new Set(fMarks)];
           this.form.fMarks = fMarks.join(",");
-          let data = {warehousebillsitemsList: this.detailList}
+          this.DrList.forEach(item => {
+            this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
+          })
+          let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
           data = Object.assign({}, data, this.form)
+          this.loading = true
           fastInStock(data).then(res => {
             this.$message.success('入库成功')
             this.closeDialog()
+            this.loading = false
           })
         }
       })
@@ -1159,6 +1180,9 @@ export default {
     // 打开打印窗口
     openPrint() {
       for (let item in this.detailList) {
+        if (!this.detailList[item].fId) {
+          return this.$message.error('数据未保存,请先暂存')
+        }
         if (!this.detailList[item].fCntrno) {
           return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
         }
@@ -1197,7 +1221,93 @@ export default {
     // 暂存
     handleSave() {
       this.$refs["form"].validate(valid => {
-        if (valid) {}
+        if (valid) {
+          if (this.detailList.length !== 0) {
+            for (let item in this.detailList) {
+              if (!this.detailList[item].fGoodsid) {
+                return this.$message.error('第' + (Number(item) + 1) + '行品名不能为空')
+              }
+              this.goodsOptions.map((e) => {
+                if (this.detailList[item].fGoodsid == e.fId) {
+                  if (e.ifCntrno == "1") {
+                    if (!this.detailList[item].fCntrno) {
+                      return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
+                    }
+                  }
+                }
+              });
+              if (!this.detailList[item].fBusinessType) {
+                return this.$message.error('第' + (Number(item) + 1) + '行属性不能为空')
+              }
+              if (!this.detailList[item].fMarks) {
+                return this.$message.error('第' + (Number(item) + 1) + '行属性详情不能为空')
+              }
+              if (!this.detailList[item].fQty) {
+                return this.$message.error('第' + (Number(item) + 1) + '行件数不能为空')
+              }
+            }
+          }
+          let fPlanqty = 0;
+          let fPlannetweight = 0;
+          let fPlangrossweight = 0;
+          this.detailList.forEach(item => {
+            this.$set(item, 'fBsdate', this.form.fBsdate)
+            this.$set(item, 'fChargedate', this.form.fBsdate)
+            this.$set(item, 'fMblno', this.form.fMblno)
+            this.$set(item, 'fOriginalbillno', this.form.fMblno)
+            this.$set(item, 'fPlanqty', item.fQty)
+            this.$set(item, 'fPlannetweight', item.fNetweight)
+            this.$set(item, 'fPlangrossweight', item.fGrossweight)
+            fPlanqty += Number(item.fQty)
+            fPlannetweight += Number(item.fNetweight)
+            fPlangrossweight += Number(item.fGrossweight)
+          })
+          this.$set(this.form, 'fPlanqty', fPlanqty)
+          this.$set(this.form, 'fPlannetweight', fPlannetweight)
+          this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
+          this.$set(this.form, 'fStltypeid', '1')
+          this.$set(this.form, 'fChargedate', this.form.fBsdate)
+
+          let fProductName = []
+          this.detailList.map((e) => {
+            this.goodsOptions.map((item) => {
+              if (e.fGoodsid == item.fId) {
+                fProductName.push(item.fName);
+              }
+            });
+          });
+          fProductName = [...new Set(fProductName)];
+          this.form.fProductName = fProductName.join(",");
+          let fMarks = []
+          this.detailList.map((e) => {
+            fMarks.push(e.fMarks);
+          });
+          fMarks = [...new Set(fMarks)];
+          this.form.fMarks = fMarks.join(",");
+          this.DrList.forEach(item => {
+            this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
+          })
+          let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
+          data = Object.assign({}, data, this.form)
+          this.loading = true
+          saveInstock(data).then(res => {
+            this.form = res.data
+            this.detailList = res.data.warehousebillsitemsList
+            this.DrList = res.data.warehousebillsfeesList
+            delete this.form.warehousebillsitemsList
+            delete this.form.warehousebillsfeesList
+            this.form.fBsdate = this.form.bsDate
+            this.form.fBstime = this.form.bsTime
+            this.detailList.forEach(item => {
+              item.fBusinessType = String(item.fBusinessType)
+            })
+            this.DrList.forEach(item => {
+              this.$set(item, 'fFeeUnitid', String(item.fFeeunitid))
+            })
+            this.$message.success('暂存成功')
+            this.loading = false
+          })
+        }
       })
     },
     changeFeeUnit() {},
@@ -1239,6 +1349,34 @@ export default {
       });
       this.detailList.push(...rows);
     },
+    // 费用明细请核
+    listCheck(row) {
+      feesCheck(row.fId).then(res => {
+        this.$message.success('请核成功')
+        res.data.fFeeUnitid = res.data.fFeeunitid.toString();
+        if (res.data.fDc == 'D') {
+          let index = this.DrList.findIndex(item => item.fId == res.data.fId)
+          this.DrList.splice(index, 1, res.data)
+        } else {
+          // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
+          // this.warehouseCrList.splice(index, 1, res.data)
+        }
+      })
+    },
+    // 费用明细撤销请核
+    revokeListCheck(row) {
+      revokefeeCheck(row.fId).then(res => {
+        res.data.fFeeUnitid = res.data.fFeeunitid.toString();
+        this.$message.success('操作成功')
+        if (res.data.fDc == 'D') {
+          let index = this.DrList.findIndex(item => item.fId == res.data.fId)
+          this.DrList.splice(index, 1, res.data)
+        } else {
+          // let index = this.CrList.findIndex(item => item.fId == res.data.fId)
+          // this.CrList.splice(index, 1, res.data)
+        }
+      })
+    },
 
     //列设置全选
     allChecked() {

+ 3 - 0
src/components/fastStorage/fastInStock/uploadExcel.vue

@@ -460,9 +460,12 @@ export default {
       this.loading = false
       if (res.code) {
         if (res.data.length) {
+          console.log(this.form.fGoodsType)
           res.data.map((e) => {
             e.fBsdate = this.form.fBsdate;
             e.fGoodsid = this.form.fGoodsid;
+            e.fBusinessType = this.form.fGoodsType
+            e.fMarks = this.form.fMarks
           });
         }
         this.excelList = res.data;

+ 108 - 6
src/components/fastStorage/fastOutStock/index.vue

@@ -646,7 +646,7 @@
               <td>日期</td>
               <td>{{ form.fBsdate | fBsdateFormat }}</td>
               <td>流水号</td>
-              <td colspan="2"></td>
+              <td colspan="2">{{ detailList.length > 0 ? detailList[0].fSerialNumber : '' }}</td>
             </tr>
             <tr>
               <td>车号</td>
@@ -722,9 +722,10 @@ import {listGoods} from "@/api/basicdata/goods";
 import {queryUserVal} from "@/api/system/user";
 import {listWhgenleg} from "@/api/reportManagement/whgenleg";
 import {addSet, resetModule, select} from '@/api/system/set';
-import {changeSelect, fastOutStock} from "@/api/warehouseBusiness/fastOutStock";
+import {changeSelect, fastOutStock, saveOutstock} from "@/api/warehouseBusiness/fastOutStock";
 import print from "print-js";
 import {listFees, getFees} from "@/api/basicdata/fees";
+import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseOutStock";
 
 export default {
   name: "fastOutStock",
@@ -734,6 +735,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       activeName: 'outStockList',
       disabled: false,
       visible: false,
@@ -954,6 +956,11 @@ export default {
     openPrint() {
       this.balance = 0;
       for (let item in this.detailList) {
+        for (let item in this.detailList) {
+          if (!this.detailList[item].fId) {
+            return this.$message.error('数据未保存,请先暂存')
+          }
+        }
         // if (!this.detailList[item].fCntrno) {
         //   return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
         // }
@@ -986,6 +993,11 @@ export default {
       this.$refs["form"].validate(vaild => {
         if (vaild) {
           if (!this.form.fTruckno) return this.$message.error('车号不能为空')
+          for (let item in this.detailList) {
+            if (!this.detailList[item].fId) {
+              return this.$message.error('数据未保存,请先暂存')
+            }
+          }
           let fPlanqty = 0;
           let fPlannetweight = 0;
           let fPlangrossweight = 0;
@@ -1026,15 +1038,79 @@ export default {
           fMarks = [...new Set(fMarks)];
           // this.form.fMarks = fMarks.join(",");
           this.$set(this.form, 'fMarks', fMarks.join(","))
-          let data = {warehousebillsitemsList: this.detailList}
+          let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
           data = Object.assign({}, data, this.form)
+          this.loading = true
           fastOutStock(data).then(res => {
             this.$message.success('出库成功')
             this.closeDialog()
+            this.loading = false
           })
         }
       })
     },
+    // 暂存
+    handleSave() {
+      if (!this.form.fTruckno) return this.$message.error('车号不能为空')
+      let fPlanqty = 0;
+      let fPlannetweight = 0;
+      let fPlangrossweight = 0;
+      this.detailList.forEach(item => {
+        this.$set(item, 'fBsdate', this.form.fBsdate)
+        this.$set(item, 'fOriginalbillno', item.fMblno)
+        this.$set(item, 'fIsPass', 'T')
+        this.$set(item, 'fStltypeid', '1')
+        this.$set(item, 'fTruckno', this.form.fTruckno)
+        fPlanqty += Number(item.fQty)
+        fPlannetweight += Number(item.fNetweight)
+        fPlangrossweight += Number(item.fGrossweight)
+        delete item.deleteId
+      })
+      this.$set(this.form, 'fStltypeid', '1')
+      this.$set(this.form, 'fPlanqty', fPlanqty)
+      this.$set(this.form, 'fPlannetweight', fPlannetweight)
+      this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
+      this.$set(this.form, 'fQty', fPlanqty)
+      this.$set(this.form, 'fNetweight', fPlannetweight)
+      this.$set(this.form, 'fGrossweight', fPlangrossweight)
+      this.$set(this.form, 'fChargedate', this.form.fBsdate)
+      let fProductName = []
+      this.detailList.map((e) => {
+        this.goodsOptions.map((item) => {
+          if (e.fGoodsid == item.fId) {
+            fProductName.push(item.fName);
+          }
+        });
+      });
+      fProductName = [...new Set(fProductName)];
+      this.$set(this.form, 'fProductName', fProductName.join(","))
+      let fMarks = []
+      this.detailList.map((e) => {
+        fMarks.push(e.fMarks);
+      });
+      fMarks = [...new Set(fMarks)];
+      this.$set(this.form, 'fMarks', fMarks.join(","))
+      this.DrList.forEach(item => {
+        this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
+      })
+      let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
+      data = Object.assign({}, data, this.form)
+      this.loading = true
+      saveOutstock(data).then(res => {
+        this.form = res.data
+        this.detailList = res.data.warehousebillsitemsList
+        this.DrList = res.data.warehousebillsfeesList
+        delete this.form.warehousebillsitemsList
+        delete this.form.warehousebillsfeesList
+        this.form.fBsdate = this.form.bsDate
+        this.form.fBstime = this.form.bsTime
+        this.detailList.forEach(item => {
+          item.fBusinessType = String(item.fBusinessType)
+        })
+        this.$message.success('暂存成功')
+        this.loading = false
+      })
+    },
     addList() {
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -1133,6 +1209,7 @@ export default {
             fSrcTypeId: 0,
             fBusinessType: '0',
             remarks: null,
+            fDc: 'D',
           })
         }
       })
@@ -1425,9 +1502,6 @@ export default {
       this.sums = sums;
       return sums;
     },
-    // 暂存
-    handleSave() {
-    },
     // 数量计算
     changeContractAmt(row) {
       let fQty = 0;
@@ -1444,6 +1518,34 @@ export default {
     deleteDrRow(index, rows) {
       rows.splice(index, 1);
     },
+    // 费用明细请核
+    listCheck(row) {
+      feesCheck(row.fId).then(res => {
+        this.$message.success('请核成功')
+        res.data.fFeeUnitid = res.data.fFeeunitid.toString();
+        if (res.data.fDc == 'D') {
+          let index = this.DrList.findIndex(item => item.fId == res.data.fId)
+          this.DrList.splice(index, 1, res.data)
+        } else {
+          // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
+          // this.warehouseCrList.splice(index, 1, res.data)
+        }
+      })
+    },
+    // 费用明细撤销请核
+    revokeListCheck(row) {
+      revokefeeCheck(row.fId).then(res => {
+        res.data.fFeeUnitid = res.data.fFeeunitid.toString();
+        this.$message.success('操作成功')
+        if (res.data.fDc == 'D') {
+          let index = this.DrList.findIndex(item => item.fId == res.data.fId)
+          this.DrList.splice(index, 1, res.data)
+        } else {
+          // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
+          // this.warehouseCrList.splice(index, 1, res.data)
+        }
+      })
+    },
 
 
     //列设置全选