|
@@ -224,7 +224,7 @@ export default {
|
|
|
async mounted() {
|
|
|
const res = await getSendInfo({ userId: localStorage.getItem("userId") })
|
|
|
if (res.code == 444) {
|
|
|
- Toast(res.msg)
|
|
|
+ Toast(res.error)
|
|
|
} else {
|
|
|
this.SendInfoValue = res
|
|
|
}
|
|
@@ -301,7 +301,8 @@ export default {
|
|
|
let result1 = res.resultStr.split(",");
|
|
|
result = result1[result1.length - 1];
|
|
|
}
|
|
|
- this.authorization = value
|
|
|
+ console.log(result, '======财务核销码返回结果')
|
|
|
+ this.authorization = result
|
|
|
},
|
|
|
error: function (res) {
|
|
|
console.log(res, 'error++++++++++');
|
|
@@ -441,6 +442,10 @@ export default {
|
|
|
this.getPrintersList = getPrinters.data.map((item) => {
|
|
|
return { printerName: item.printerName, id: item.id }
|
|
|
})
|
|
|
+ if (this.getPrintersList.length === 1) {
|
|
|
+ this.shipServe(this.getPrintersList[0].id)
|
|
|
+ return
|
|
|
+ }
|
|
|
this.printerShow = true
|
|
|
} else {
|
|
|
Toast('系统异常')
|
|
@@ -460,8 +465,25 @@ export default {
|
|
|
this.printerName = e.printerName;
|
|
|
this.printerId = e.id;
|
|
|
|
|
|
+ await this.shipServe(e.id)
|
|
|
+
|
|
|
+ // 开始走打印机面单
|
|
|
+ // try {
|
|
|
+ // const res = await storagePrintSmallTab({ printId: e.id })
|
|
|
+ // if (res.msg == 'success') {
|
|
|
+ // Toast('打印成功')
|
|
|
+ // }
|
|
|
+ // console.log(res, '最后')
|
|
|
+ // this.printerShow = false;
|
|
|
+ // } catch (error) {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // toask.clear();
|
|
|
+ },
|
|
|
+
|
|
|
+ async shipServe(printId) {
|
|
|
//先走基础打印
|
|
|
- Toast.loading({
|
|
|
+ const $toast = Toast.loading({
|
|
|
message: '保存中...',
|
|
|
forbidClick: true,
|
|
|
duration: 0
|
|
@@ -494,27 +516,16 @@ export default {
|
|
|
addresseeName: this.transmitMessageVlaue.addresseeName,//寄件人姓名
|
|
|
addresseePhone: this.transmitMessageVlaue.addresseePhone,//收件人手机号
|
|
|
verificationCode: this.authorization, //财务核销码
|
|
|
- printId: e.id
|
|
|
+ printId: printId
|
|
|
}
|
|
|
const res = await saveMailDo({ ...parmas })
|
|
|
if (res.msg == 'success') {
|
|
|
Toast('寄件成功')
|
|
|
this.$router.push('/')
|
|
|
+ } else {
|
|
|
+ this.$toast(res.error)
|
|
|
}
|
|
|
- Toast.clear()
|
|
|
-
|
|
|
- // 开始走打印机面单
|
|
|
- // try {
|
|
|
- // const res = await storagePrintSmallTab({ printId: e.id })
|
|
|
- // if (res.msg == 'success') {
|
|
|
- // Toast('打印成功')
|
|
|
- // }
|
|
|
- // console.log(res, '最后')
|
|
|
- // this.printerShow = false;
|
|
|
- // } catch (error) {
|
|
|
-
|
|
|
- // }
|
|
|
- // toask.clear();
|
|
|
+ $toast.clear()
|
|
|
}
|
|
|
},
|
|
|
|