|
|
|
@ -291,6 +291,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
// this.$refs.BarCodeSearch.focus()
|
|
|
|
|
}
|
|
|
|
|
async getBarcode() {
|
|
|
|
|
//open是lock开关
|
|
|
|
|
if (this.open == false) {
|
|
|
|
|
if (this.form.barCode.length < 20) {
|
|
|
|
|
this.customToast(this.$t('message.barCodeLength') as string);
|
|
|
|
@ -300,10 +301,18 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.standard') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//查询条码接口:wmspda/product/finished/show-info
|
|
|
|
|
await this.model.queryOrderInInfo(this.form);
|
|
|
|
|
|
|
|
|
|
if (this.model.searchCode == '1') {
|
|
|
|
|
await this.model.queryTypeList(this.model.materielList[0].productCode);
|
|
|
|
|
this.form.aimWl = model.firstLocation;
|
|
|
|
|
if (session.factoryCode == '9A61' || session.factoryCode == '9A62') {
|
|
|
|
|
await this.model.queryTypeListVN(this.model.materielList);
|
|
|
|
|
this.form.aimWl = model.firstLocation;
|
|
|
|
|
} else {
|
|
|
|
|
//查询库位接口/wmspda/fg/getMdLocationProd
|
|
|
|
|
await this.model.queryTypeList(this.model.materielList[0].productCode);
|
|
|
|
|
this.form.aimWl = model.firstLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.form.barCode.length < 20) {
|
|
|
|
@ -314,29 +323,59 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.standard') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//更新this.model.materielList
|
|
|
|
|
await this.model.queryOrderInInfo(this.form);
|
|
|
|
|
if (this.model.searchCode == '1') {
|
|
|
|
|
if (this.materielList.length == 0) {
|
|
|
|
|
this.materielList.push(this.model.materielList[0]);
|
|
|
|
|
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
|
|
|
|
|
this.materielList[this.materielList.length - 1].index = this.materielList.length;
|
|
|
|
|
this.model.setSearchCode();
|
|
|
|
|
} else {
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materielList.length; i++) {
|
|
|
|
|
if (this.form.barCode == this.materielList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
|
if (session.factoryCode == '9A61' || session.factoryCode == '9A62') {
|
|
|
|
|
await this.model.queryTypeListVN(this.model.materielList);
|
|
|
|
|
this.form.aimWl = model.firstLocation;
|
|
|
|
|
//console.log("this.form.aimWl:"+JSON.stringify(this.form.aimWl));
|
|
|
|
|
// console.log("this.materielList:"+JSON.stringify(this.materielList));
|
|
|
|
|
//this.materielList.length:列表的长度,第一次为0
|
|
|
|
|
if (this.materielList.length == 0) {
|
|
|
|
|
this.materielList.push(this.model.materielList[0]);
|
|
|
|
|
//this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
|
|
|
|
|
//this.materielList[this.materielList.length - 1].index = this.materielList.length;
|
|
|
|
|
} else {
|
|
|
|
|
//是否重复扫描
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materielList.length; i++) {
|
|
|
|
|
if (this.form.barCode == this.materielList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
this.materielList.push(this.model.materielList[0]);
|
|
|
|
|
//this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
|
|
|
|
|
// this.materielList[this.materielList.length - 1].index = this.materielList.length;
|
|
|
|
|
} else {
|
|
|
|
|
this.customToast(this.$t('message.product_Tip7') as string);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
} else {
|
|
|
|
|
if (this.materielList.length == 0) {
|
|
|
|
|
this.materielList.push(this.model.materielList[0]);
|
|
|
|
|
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
|
|
|
|
|
this.materielList[this.materielList.length - 1].index = this.materielList.length;
|
|
|
|
|
this.model.setSearchCode();
|
|
|
|
|
} else {
|
|
|
|
|
this.model.setSearchCode();
|
|
|
|
|
this.customToast(this.$t('message.product_Tip7') as string);
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materielList.length; i++) {
|
|
|
|
|
if (this.form.barCode == this.materielList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
this.materielList.push(this.model.materielList[0]);
|
|
|
|
|
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
|
|
|
|
|
this.materielList[this.materielList.length - 1].index = this.materielList.length;
|
|
|
|
|
this.model.setSearchCode();
|
|
|
|
|
} else {
|
|
|
|
|
this.model.setSearchCode();
|
|
|
|
|
this.customToast(this.$t('message.product_Tip7') as string);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|