Browse Source

修改发料和补料

lijuncheng0816
niexiting 6 months ago
parent
commit
c5f600bdb6
  1. 43
      src/common/label.js
  2. 8
      src/pages/inventoryMove/coms/comMoveRecord.vue
  3. 86
      src/pages/issue/coms/comScanIssuePack.vue
  4. 10
      src/pages/issue/job/issueDetail.vue
  5. 1
      src/pages/repleinsh/coms/comScanReplishPack.vue
  6. 1
      src/pages/repleinsh/job/repleinshDetail.vue

43
src/common/label.js

@ -12,45 +12,45 @@ import {
export function getLabelInfo(scanMsg,headerType, callBack) { export function getLabelInfo(scanMsg, headerType, callBack) {
console.log('扫描信息:', scanMsg); console.log('扫描信息:', scanMsg);
if (scanMsg.length == 0) { if (scanMsg.length == 0) {
return null return null
} }
let items = scanMsg.split(';'); let items = scanMsg.split(';');
let header = items[0]; let header = items[0];
let version = items[1]; let version = items[1];
if ((header != undefined) && (version!=undefined)) { if ((header != undefined) && (version != undefined)) {
var hearList =getDirectoryItemArray(headerType) var hearList = getDirectoryItemArray(headerType)
if(!checkDirectoryItemExist(hearList,header)){ if (!checkDirectoryItemExist(hearList, header)) {
let labelResult = { let labelResult = {
label: { label: {
labelType: "", labelType: "",
barType: '', barType: '',
code:"" code: ""
}, },
package: null, package: null,
success: false, success: false,
message: '请输入'+headerType+"开始的标签", message: '请输入' + headerType + "开始的标签",
} }
callBack(labelResult); callBack(labelResult);
return; return;
} }
//解析扫描的是一维码还是二维码 //解析扫描的是一维码还是二维码
let type = header.substring(header.length - 1, header.length); let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode if (type == 'Q') //qrcode
{ {
getQRCodeInfo(header, version, scanMsg, callBack); getQRCodeInfo(header, version, scanMsg, callBack);
} }
// else if (type == 'B') //barcode // else if (type == 'B') //barcode
// { // {
// getBarCodeInfo(header, version, items[2], callBack); // getBarCodeInfo(header, version, items[2], callBack);
// } // }
else { //直接输入文本 else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
} }
}else { } else {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
// let labelResult = { // let labelResult = {
// label: { // label: {
@ -79,7 +79,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
message: '' message: ''
} }
getLabelByHeader(header, version).then(res => { getLabelByHeader(header, version).then(res => {
if (res.data==null) { if (res.data == null) {
labelResult.success = false; labelResult.success = false;
labelResult.message = '未查找到标签头为[' + header + ']的标签类型'; labelResult.message = '未查找到标签头为[' + header + ']的标签类型';
callBack(labelResult); callBack(labelResult);
@ -89,7 +89,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
version: version, version: version,
label: res.data, label: res.data,
}; };
labelDic.push(newItem); labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack); getLabelItems(newItem, scanMsg, callBack);
} }
@ -108,13 +108,13 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息 //查询包装信息
let packingNumber = labelResult.label.packingNumber let packingNumber = labelResult.label.packingNumber
if (packingNumber != undefined) { if (packingNumber != undefined && packingNumber != '') {
getPackageListByNumber(packingNumber).then(pack => { getPackageListByNumber(packingNumber).then(pack => {
if (pack.data.reqPackage) { if (pack.data.reqPackage) {
labelResult.package = pack.data.reqPackage; labelResult.package = pack.data.reqPackage;
labelResult.package.subList = pack.data.subList; labelResult.package.subList = pack.data.subList;
console.log('包装信息', JSON.stringify(labelResult.package)) console.log('包装信息', JSON.stringify(labelResult.package))
} else { } else {
labelResult.success = false; labelResult.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
@ -126,9 +126,12 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
callBack(labelResult); callBack(labelResult);
}) })
} else { } else {
labelResult.success = false; //线边的物料可能没有箱码
labelResult.message = '在条码中未解析到箱码'; labelResult.package = labelResult.label;
callBack(labelResult); callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';
// callBack(labelResult);
} }
} else { } else {
callBack(labelResult); callBack(labelResult);
@ -145,7 +148,7 @@ export function analysisQRCodeLabel(labelItem, scanMsg) {
success: true, success: true,
message: '' message: ''
} }
let separators = labelItem.label.separators; let separators = labelItem.label.separators;
if (separators == undefined || separators == null) { if (separators == undefined || separators == null) {
labelResult.message = "未读取到分隔符"; labelResult.message = "未读取到分隔符";
@ -189,11 +192,11 @@ export function getBarCodeInfo(header, version, value, callBack) {
label: { label: {
labelType: header, labelType: header,
barType: 'BarCode', barType: 'BarCode',
code:value code: value
}, },
package: null, package: null,
success: true, success: true,
message: '', message: '',
} }
callBack(labelResult); callBack(labelResult);
} }

8
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -191,7 +191,7 @@
getBasicLocationByCode(this.toLocationCode).then(res => { getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) { if (res.data.total > 0) {
let result = res.data.list[0]; let result = res.data.list[0];
if(result.code!=this.toLocationCode){ if (result.code != this.toLocationCode) {
this.showErrorMessage('未查询到库位[' + this.toLocationCode + ']') this.showErrorMessage('未查询到库位[' + this.toLocationCode + ']')
return; return;
} }
@ -245,7 +245,11 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
//
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
if (this.businessTypeCode == "Move") { if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = balance.inventoryStatus;
} else { } else {

86
src/pages/issue/coms/comScanIssuePack.vue

@ -331,91 +331,6 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
// this.getBalance(result.label, packageInfo, balances => {
// this.packageInfo = packageInfo;
// //
// let s = '';
// if (!result.package.parentNumber) {
// if (balances.list.length == 0) {
// this.showErrorMessage(',')
// } else {
// let newBalances = balances.list.filter(b => b.locationCode == that
// .fromLocationCode);
// if (newBalances.length == 0) {
// this.showErrorMessage(',')
// } else if (newBalances.length == 1) {
// let balance = newBalances[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(newBalances);
// }
// }
// } else {
// //
// if (balances.list.length == 0) {
// this.showErrorMessage(',')
// } else {
// //
// let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
// .number)
// //
// let subParentPackitems = balances.list.filter(r => r.packingNumber ==
// packageInfo
// .parentNumber && r.locationCode == this.fromLocationCode)
// //
// if (subPackitems.length == 0) {
// //
// if (subParentPackitems.length > 0) {
// if (subParentPackitems.length == 1) {
// let balance = subParentPackitems[0];
// balance.qty = packageInfo.qty;
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(subParentPackitems);
// }
// } else {
// this.showErrorMessage('' + packageInfo.parentNumber + '' +
// packageInfo.number + '')
// }
// } else {
// var locationCode = this.fromLocationCode
// if (balances.list == 1) {
// locationCode = balances.list[0].locationCode
// } else {
// var manyBlances = balances.list.filter(r => r.locationCode != this
// .fromLocationCode)
// if (manyBlances.length > 0) {
// locationCode = manyBlances[0].locationCode;
// }
// }
// this.showErrorMessage('' + packageInfo.number + '' +
// locationCode +
// ',')
// // var locationCode = this.fromLocationCode
// // if(balances.list==1){
// // locationCode=balances.list[0].locationCode
// // }else {
// // var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
// // if(manyBlances.length>0){
// // locationCode = manyBlances[0].locationCode;
// // }
// // }
// // this.showErrorMessage('' + packageInfo.number + '' +
// // locationCode +
// // ',')
// }
// }
// }
// uni.hideLoading();
// });
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
@ -598,6 +513,7 @@
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance; batch.detail = balance;
batch.detail.fromLocationCode=balance.locationCode;
location.Batchs.push(batch); location.Batchs.push(batch);
return location; return location;
}, },

10
src/pages/issue/job/issueDetail.vue

@ -272,7 +272,7 @@
// }) // })
// }, // },
submit() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -346,8 +346,12 @@
.ContainerNumber; .ContainerNumber;
record.toInventoryStatus = r record.toInventoryStatus = r
.inventoryStatus; .inventoryStatus;
record.toLocationCode = subItem // record.toLocationCode = subItem
.toLocationCode; // .toLocationCode;
record.toLocationCode = this.jobContent
.detailToLocationCode;
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
let single_price = r.balance let single_price = r.balance

1
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -425,6 +425,7 @@
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance; batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch); location.Batchs.push(batch);
return location; return location;
}, },

1
src/pages/repleinsh/job/repleinshDetail.vue

@ -278,7 +278,6 @@
}); });
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
return;
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {

Loading…
Cancel
Save