处理单据多行条码输入

yanshishuju
yewj 7 months ago
parent 79eafbaa6f
commit e66329b550

@ -662,15 +662,23 @@ export default {
this.enterBillNoKey() this.enterBillNoKey()
return; return;
} }
this.checkSuccess = true; this.checkSuccess = true;
this.filterQuery.code = this.scanCode; this.filterQuery.code = this.scanCode.trim();
if (!this.parseString(this.filterQuery.code)) { if (this.filterQuery.code.includes(";")) {
this.$refs.inputRef.focus(); const codeArray = this.filterQuery.code.split(";");
this.$refs.inputRef.select(); let params = {
this.$message.error("非法产品编码"); codeList: codeArray,
};
this.batchVailCode(params)
return; return;
} }
if (this.filterQuery.code)
if (!this.parseString(this.filterQuery.code)) {
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
this.$message.error("非法产品编码");
return;
}
let tQuery = { let tQuery = {
viewType: "tagCode", viewType: "tagCode",
workPlaceCode: this.workplaceId, workPlaceCode: this.workplaceId,
@ -1192,13 +1200,16 @@ export default {
let params = { let params = {
codeList: event.detail.recCodes, codeList: event.detail.recCodes,
}; };
console.log(this.formData)
if (this.formData.billNo == null) { if (this.formData.billNo == null) {
this.$message.error("请先选入单据!"); this.$message.error("请先选入单据!");
return return
} }
this.batchVailCode(params)
},
// batchVailCode(params) {
batchVailCode(params).then((res) => { batchVailCode(params).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
this.valiCodes = []; this.valiCodes = [];
@ -1237,10 +1248,9 @@ export default {
this.$message.error(res.message) this.$message.error(res.message)
} }
}); });
}, },
// //
addGs() { addGs() {
const input = this.$refs.inputRef.$refs.input; const input = this.$refs.inputRef.$refs.input;
@ -1253,8 +1263,7 @@ export default {
input.selectionStart = input.selectionEnd = start + textToInsert.length; input.selectionStart = input.selectionEnd = start + textToInsert.length;
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}); });
} },
,
parseString(str) { parseString(str) {
// 1. "MA" // 1. "MA"

Loading…
Cancel
Save