feat: 通过发票获取单据

dev2.5_scan
chenhc 4 days ago
parent 295d299def
commit d621fb916d

@ -393,6 +393,13 @@ export default {
//
if (this.orderData.billNo == null) {
if (this.scanCode != null) {
if (this.validateFormat(this.scanCode)) {
this.parseInvoice(this.scanCode)
}
}
this.enterBillNoKey()
return
}
@ -491,7 +498,14 @@ export default {
checkCode(code) {
return this.checkCodeList.includes(code)
},
parseInvoice(inputText) {
const separator = inputText.includes(',') ? ',' : '';
const arr = inputText.split(separator);
if (arr.length == 8 ) this.scanCode = arr[3];
},
validateFormat(str) {
return str?.length >= 3 && /^(10|01|04|32|31)[,]/.test(str)
},
enterBillNoKey(billNo) {
this.loading = true;
this.filterQuery.code = this.scanCode
@ -501,9 +515,7 @@ export default {
busType: this.filterQuery.busType,
code: this.filterQuery.code.trim()
}
if (billNo != null) {
tQuery.code = billNo
}
enterCodeBillNo(tQuery).then((response) => {
if (response.code == 601) {
this.placeholder = '已选入单据,请扫描追溯码进行审核'

@ -390,6 +390,13 @@ export default {
//
if (this.orderData.billNo == null) {
if (this.scanCode != null) {
if (this.validateFormat(this.scanCode)) {
this.parseInvoice(this.scanCode)
}
}
this.enterBillNoKey()
return
}
@ -488,7 +495,14 @@ export default {
checkCode(code) {
return this.checkCodeList.includes(code)
},
parseInvoice(inputText) {
const separator = inputText.includes(',') ? ',' : '';
const arr = inputText.split(separator);
if (arr.length == 8 ) this.scanCode = arr[3];
},
validateFormat(str) {
return str?.length >= 3 && /^(10|01|04|32|31)[,]/.test(str)
},
enterBillNoKey(billNo) {
this.loading = true;
this.filterQuery.code = this.scanCode

Loading…
Cancel
Save