Commit 21119c43 authored by liuyanfang's avatar liuyanfang

添加打印失败的订单返回

parent c1a04b5c
...@@ -27,10 +27,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) { ...@@ -27,10 +27,12 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
let result = { let result = {
status: 0, status: 0,
msg: "", msg: "",
data: [], data: []
} }
let printError: any = orderNo
result = await waitOrder(); result = await waitOrder();
if (result.status > 0) { if (result.status > 0) {
result.data=printError
return result; return result;
} }
...@@ -41,6 +43,7 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) { ...@@ -41,6 +43,7 @@ async function booking(wayCompanyId: string, orderNo: string,fhy_type:number) {
result = await waitDialog(); result = await waitDialog();
if (result.status > 0) { if (result.status > 0) {
result.data=printError
return result; return result;
} }
for (let i = 0; i < domEle.selectWaybillTemplate.options.length; i++) { for (let i = 0; i < domEle.selectWaybillTemplate.options.length; i++) {
......
...@@ -262,6 +262,8 @@ function changeReactInputValue(inputDom:any,newText:string){ ...@@ -262,6 +262,8 @@ function changeReactInputValue(inputDom:any,newText:string){
const mouseClickEvents = ['mousedown', 'click', 'mouseup']; const mouseClickEvents = ['mousedown', 'click', 'mouseup'];
function simulateMouseClick(element:any){ function simulateMouseClick(element:any){
console.log('element',element);
if(!element) return
mouseClickEvents.forEach(mouseEventType => mouseClickEvents.forEach(mouseEventType =>
element.dispatchEvent( element.dispatchEvent(
new MouseEvent(mouseEventType, { new MouseEvent(mouseEventType, {
......
...@@ -194,8 +194,18 @@ const printWayBillByNew = function ({ orderNo, wayCompanyId, platform }: Pick<Pa ...@@ -194,8 +194,18 @@ const printWayBillByNew = function ({ orderNo, wayCompanyId, platform }: Pick<Pa
// web页面通信 // web页面通信
window.addEventListener("message",function(message:any){ window.addEventListener("message",function(message:any){
console.log(111111,message); chrome.storage.local.get({ AutoTime:null,proAutoTime:null }, function (res) {
if(res.AutoTime){
chrome.runtime.sendMessage(message.data,(ret)=>{
window.postMessage({AutoTime:res.AutoTime})
})
}
if(res.proAutoTime){
chrome.runtime.sendMessage(message.data,(ret)=>{
window.postMessage({proAutoTime:res.proAutoTime})
})
}
})
if(message.data.action == ACTION.BookingApp){ if(message.data.action == ACTION.BookingApp){
chrome.runtime.sendMessage(message.data,(ret)=>{ chrome.runtime.sendMessage(message.data,(ret)=>{
window.postMessage({isResult:1,...ret},"*") window.postMessage({isResult:1,...ret},"*")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment