|
@@ -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() {
|