| | |
| | | const { btn } = this.props |
| | | |
| | | let callback = null |
| | | let printReject = null |
| | | let skip = false |
| | | let send = false |
| | | |
| | | let data = fromJS({ |
| | | data: printlist, |
| | | form: formdata |
| | | }).toJS() |
| | | |
| | | if (!window.GLOB.errorLog) { |
| | | printReject = (msg) => { |
| | | if (send) return |
| | | |
| | | send = true |
| | | data.message = msg |
| | | |
| | | window.mkInfo(JSON.stringify(data)) |
| | | } |
| | | } else { |
| | | printReject = (msg) => { |
| | | if (send) return |
| | | |
| | | send = true |
| | | data.message = msg |
| | | |
| | | let param = { |
| | | func: 's_special_error_note_log', |
| | | api_url: btn.logLabel, |
| | | error_code: 507, |
| | | error_time: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | api_param: JSON.stringify(data) |
| | | } |
| | | Api.genericInterface(param) |
| | | } |
| | | } |
| | | |
| | | if (/callback\(\)/.test(btn.verify.printFunc)) { |
| | | callback = () => { |
| | | if (skip) return |
| | | skip = true |
| | | |
| | | this.execSuccess({ |
| | | ErrCode: '-1', |
| | | message: '', |
| | |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', 'callback', btn.verify.printFunc) |
| | | func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType, callback) |
| | | let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', 'callback', 'printReject', btn.verify.printFunc) |
| | | func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType, callback, printReject) |
| | | |
| | | // 自定义打印示例 |
| | | // let defaultPrinter = printer.defaultPrinter || 'lackprinter' |
| | |
| | | message: window.GLOB.dict['func_error'] || '自定义函数执行错误!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | printReject(window.GLOB.dict['func_error'] || '自定义函数执行错误!') |
| | | } |
| | | } |
| | | |
| | |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | let printReject = null |
| | | let send = false |
| | | |
| | | let data = fromJS({ |
| | | data: list, |
| | | template: template |
| | | }).toJS() |
| | | |
| | | if (!window.GLOB.errorLog) { |
| | | printReject = (msg) => { |
| | | if (send) return |
| | | |
| | | send = true |
| | | data.message = msg |
| | | |
| | | window.mkInfo(JSON.stringify(data)) |
| | | } |
| | | } else { |
| | | printReject = (msg) => { |
| | | if (send) return |
| | | |
| | | send = true |
| | | data.message = msg |
| | | |
| | | let param = { |
| | | func: 's_special_error_note_log', |
| | | api_url: btn.logLabel, |
| | | error_code: 507, |
| | | error_time: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | api_param: JSON.stringify(data) |
| | | } |
| | | Api.genericInterface(param) |
| | | } |
| | | } |
| | | |
| | | let _errors = [] |
| | | |
| | | let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter' |
| | |
| | | message: data.message, |
| | | status: false |
| | | }) |
| | | |
| | | printReject(data.message) |
| | | } |
| | | } |
| | | |