发票二维码解析

ywj_dev
wangwei 2 years ago
parent 21c2a7e8d5
commit d5c4b9b376

@ -100,6 +100,15 @@ export function filterBizOrderList(params) {
});
}
export function parseInvoice(params) {
return axios({
url: "/udiwms/inout/biz/parseInvoice",
method: "get",
params: params
});
}

@ -13,22 +13,25 @@
:model="inputQuery"
:rules="formRules"
ref="dataForm"
label-width="110px"
label-width="150px"
style="padding-top: 40px"
>
<el-card style="margin-top: -30px">
<!--<el-row>-->
<!-- <el-col :span="20">-->
<!-- <el-form-item prop="code" label="发票码:">-->
<!-- <el-input-->
<!-- id="inputer"-->
<!-- placeholder="请输入发票码"-->
<!-- type="tel"-->
<!-- :disabled="true"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!--</el-row>-->
<el-row>
<el-col :span="20">
<el-form-item prop="code" label="请扫入发票二维码:">
<el-input
id="inputer"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey($event)"
ref="inputRef"
style="ime-mode: disabled"
type="password"
v-model="inputQuery.code"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="机器编码:" prop="machineNo">
@ -205,6 +208,12 @@
width="100"
></el-table-column>
<el-table-column
label="金额"
prop="amount"
width="100"
></el-table-column>
<el-table-column
label="生产日期"
prop="productDate"
@ -256,7 +265,7 @@ import {
insertInvoice,
updateOrder,
filterBizOrderList,
updateorderBiz,
updateorderBiz,parseInvoice
} from "@/api/inout/orderDetailBiz";
import AcceptOrder from "@/views/inout/DialogReviewOrder";
import DialogInvoice from "@/views/inout/DialogInvoice";
@ -341,9 +350,9 @@ export default {
// machineNo: [
// { required: true, message: "", trigger: "blur" },
// ],
invoiceCode: [
{ required: true, message: "请输入发票代码", trigger: "blur" },
],
// invoiceCode: [
// { required: true, message: "", trigger: "blur" },
// ],
invoiceEncode: [
{ required: true, message: "请输入发票编码", trigger: "blur" },
],
@ -480,10 +489,10 @@ export default {
// this.$message.error("");
// return;
// }
if (this.$isBlank(this.inputQuery.invoiceCode)) {
this.$message.error("发票代码不能为空!");
return;
}
// if (this.$isBlank(this.inputQuery.invoiceCode)) {
// this.$message.error("");
// return;
// }
if (this.$isBlank(this.inputQuery.invoiceEncode)) {
this.$message.error("发票编码不能为空!");
return;
@ -497,6 +506,15 @@ export default {
return;
}
this.inputQuery.list = this.invoiceRow;
let mount=0;
for(var i=0;i<this.invoiceRow.length;i++){
mount+=this.invoiceRow[i].amount
}
if(mount != this.inputQuery.price){
this.$message.error("价格不匹配!");
return;
}
insertInvoice(this.inputQuery)
.then((response) => {
if (response.code === 20000) {
@ -515,6 +533,25 @@ export default {
});
},
getInputFocus(event) {
event.currentTarget.select();
},
enterKey(){
let param={
code :this.inputQuery.code
}
parseInvoice(param)
.then((res)=>{
if(res.code == 20000){
this.inputQuery=res.data;
}
})
},
uploadHandleError() {},
uploadHandleSuccess(response, file, fileList) {
debugger;

Loading…
Cancel
Save