Browse Source

修改绑定托标签提交

master_hella
李俊城 16 hours ago
parent
commit
8ef99439aa
  1. 39
      src/pages/palletLabel/bindPalletLabel.vue

39
src/pages/palletLabel/bindPalletLabel.vue

@ -68,7 +68,8 @@
import { import {
getPackingNumberAndBatchByList, getPackingNumberAndBatchByList,
deepCopyData deepCopyData,
getCurrDateTime
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -265,13 +266,13 @@
}); });
}, },
updateData() { updateData() {
calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) { for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i]; let item = this.detailSource[i];
if (item.qty == 0) { if (item.qty == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
this.calacQty();
}, },
removePack() { removePack() {
@ -292,9 +293,12 @@
} }
} }
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint,pointData) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData() this.clearData()
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}) })
}, },
clearData() { clearData() {
@ -344,16 +348,35 @@
var params = this.setParams(palletLabelInfo) var params = this.setParams(palletLabelInfo)
// //
if ( params.qty > params.packQty) { if ( params.qty > params.packQty) {
this.showErrorMessage("合托的总数量[" + params.qty + "]不能大于托包装的标包数量[" + params.packQty + "]") uni.hideLoading()
this.showErrorMessage("合托的总数量[" + params.qty + "]大于托包装的标包数量[" + params.packQty + "]")
return; return;
} }
return;
console.log("提交", JSON.stringify(params))
palletLabelBindSubmit(params).then(res => { palletLabelBindSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "\n" + let list = []
res.data) res.data.list.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
})
})
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "记录\n" +
res.data.number,list)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }

Loading…
Cancel
Save