|
@@ -147,32 +147,37 @@ export default {
|
|
|
this.scanValue = ""
|
|
|
this.$message.error("扫码枪识别数据格式不正确,请重新扫描")
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param iT 发票类型
|
|
|
+ * @param iC 发票代码
|
|
|
+ * @param iN 发票号码
|
|
|
+ * @param bT 税前金额
|
|
|
+ * @param oT 发票日期
|
|
|
+ * @param cC 校验码
|
|
|
+ * */
|
|
|
+ const [ _, iT, iC, iN, bT, oT, cC ] = result
|
|
|
+ let _oT = ""
|
|
|
|
|
|
- const [_1,invoiceType,invCode,invNumber,subtotal_amount,open_time,checkNumber] = result
|
|
|
- let _open_time = ""
|
|
|
-
|
|
|
- if(open_time){
|
|
|
- const year = open_time.slice(0, 4);
|
|
|
- const month = open_time.slice(4, 6);
|
|
|
- const day = open_time.slice(6);
|
|
|
- _open_time = dayjs(`${year}-${month}-${day}`).format("YYYY-MM-DD HH:mm:ss");
|
|
|
+ if(oT){
|
|
|
+ const year = oT.slice(0, 4);
|
|
|
+ const month = oT.slice(4, 6);
|
|
|
+ const day = oT.slice(6);
|
|
|
+ _oT = dayjs(`${year}-${month}-${day}`).format("YYYY-MM-DD HH:mm:ss");
|
|
|
}
|
|
|
|
|
|
// 1,01,3,4,5,6,7,8,9
|
|
|
|
|
|
- const invoice = invoiceTypeList.find(({scanValue}) => scanValue === String(invoiceType))
|
|
|
-
|
|
|
+ const _iT = invoiceTypeList.find(({scanValue}) => scanValue === String(iT))
|
|
|
|
|
|
- console.log(invoice)
|
|
|
this.scanValue = ""
|
|
|
- // const { invoice } = mapPropertys
|
|
|
this.ruleForm = {
|
|
|
- [mapFields.invoiceType]:invoice ? invoice.value : "",
|
|
|
- [mapFields.invoiceCode]:invCode,
|
|
|
- [mapFields.beforeTax]:subtotal_amount,
|
|
|
- [mapFields.openTime]: _open_time,
|
|
|
- [mapFields.invoiceNumber]:invNumber,
|
|
|
- [mapFields.checkNumber]:checkNumber
|
|
|
+ [mapFields.beforeTax]: bT,
|
|
|
+ [mapFields.openTime]: _oT,
|
|
|
+ [mapFields.invoiceCode]: iC,
|
|
|
+ [mapFields.checkNumber]: cC,
|
|
|
+ [mapFields.invoiceNumber]: iN,
|
|
|
+ [mapFields.invoiceType]: _iT ? _iT.value : "",
|
|
|
}
|
|
|
},
|
|
|
initData(){
|