发票二维码解析

prod
wangwei 2 years ago
parent e78a050793
commit 6c658887db

@ -57,6 +57,14 @@ export function insertInvoice(params) {
}); });
} }
export function parseInvoice(params) {
return axios({
url: "/udiwms/inout/biz/parseInvoice",
method: "get",
params: params
});
}
export function updateorderBiz(params) { export function updateorderBiz(params) {
return axios({ return axios({
url: "/udiwms/inout/biz/updateorderBiz", url: "/udiwms/inout/biz/updateorderBiz",

@ -13,25 +13,28 @@
:model="inputQuery" :model="inputQuery"
:rules="formRules" :rules="formRules"
ref="dataForm" ref="dataForm"
label-width="110px" label-width="150px"
style="padding-top: 40px" style="padding-top: 40px"
> >
<el-card style="margin-top: -30px"> <el-card style="margin-top: -30px">
<!--<el-row>--> <el-row>
<!-- <el-col :span="20">--> <el-col :span="20">
<!-- <el-form-item prop="code" label="发票码:">--> <el-form-item prop="code" label="请扫入发票二维码:">
<!-- <el-input--> <el-input
<!-- id="inputer"--> id="inputer"
<!-- placeholder="请输入发票码"--> @focus="getInputFocus($event)"
<!-- type="tel"--> @keypress.enter.native="enterKey($event)"
<!-- :disabled="true"--> ref="inputRef"
<!-- ></el-input>--> style="ime-mode: disabled"
<!-- </el-form-item>--> type="password"
<!-- </el-col>--> v-model="inputQuery.code"
<!--</el-row>--> ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="机械编码:" prop="machineNo"> <el-form-item label="机编码:" prop="machineNo">
<el-input <el-input
v-model="inputQuery.machineNo" v-model="inputQuery.machineNo"
auto-complete="off" auto-complete="off"
@ -205,6 +208,12 @@
width="100" width="100"
></el-table-column> ></el-table-column>
<el-table-column
label="金额"
prop="amount"
width="100"
></el-table-column>
<el-table-column <el-table-column
label="生产日期" label="生产日期"
prop="productDate" prop="productDate"
@ -258,7 +267,7 @@ import {
insertInvoice, insertInvoice,
updateOrder, updateOrder,
filterBizOrderList, filterBizOrderList,
updateorderBiz, updateorderBiz, parseInvoice,
} from "@/api/inout/orderDetailBiz"; } from "@/api/inout/orderDetailBiz";
import AcceptOrder from "@/views/inout/DialogReviewOrder"; import AcceptOrder from "@/views/inout/DialogReviewOrder";
import DialogInvoice from "@/views/inout/DialogInvoice"; import DialogInvoice from "@/views/inout/DialogInvoice";
@ -341,12 +350,12 @@ export default {
1: "发票登记", 1: "发票登记",
}, },
formRules: { formRules: {
machineNo: [ // machineNo: [
{required: true, message: "请输入机械编码", trigger: "blur"}, // {required: true, message: "", trigger: "blur"},
], // ],
invoiceCode: [ // invoiceCode: [
{required: true, message: "请输入发票代码", trigger: "blur"}, // {required: true, message: "", trigger: "blur"},
], // ],
invoiceEncode: [ invoiceEncode: [
{required: true, message: "请输入发票编码", trigger: "blur"}, {required: true, message: "请输入发票编码", trigger: "blur"},
], ],
@ -479,14 +488,14 @@ export default {
this.$message.error("请选择要登记的物资! "); this.$message.error("请选择要登记的物资! ");
return false; return false;
} }
if (this.$isBlank(this.inputQuery.machineNo)) { // if (this.$isBlank(this.inputQuery.machineNo)) {
this.$message.error("机械编码不能为空!"); // this.$message.error("");
return; // return;
} // }
if (this.$isBlank(this.inputQuery.invoiceCode)) { // if (this.$isBlank(this.inputQuery.invoiceCode)) {
this.$message.error("发票代码不能为空!"); // this.$message.error("");
return; // return;
} // }
if (this.$isBlank(this.inputQuery.invoiceEncode)) { if (this.$isBlank(this.inputQuery.invoiceEncode)) {
this.$message.error("发票编码不能为空!"); this.$message.error("发票编码不能为空!");
return; return;
@ -500,6 +509,14 @@ export default {
return; return;
} }
this.inputQuery.list = this.invoiceRow; 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) insertInvoice(this.inputQuery)
.then((response) => { .then((response) => {
if (response.code === 20000) { if (response.code === 20000) {
@ -518,6 +535,23 @@ 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() { uploadHandleError() {
}, },
uploadHandleSuccess(response, file, fileList) { uploadHandleSuccess(response, file, fileList) {

Loading…
Cancel
Save