| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['main.action.confirm.selectline'], |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (item.Ot === 'requiredSgl' && data.length !== 1) { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['main.action.confirm.selectSingleLine'], |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (item.Ot !== 'notRequired' && !setting.primaryKey) { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未设置主键!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '导出按钮配置错误!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'excel导入验证信息未设置!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } else if (item.OpenType === 'popview' && this.props.type !== 'subtab') { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '弹窗页面不支持此设置!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } else if (item.OpenType === 'innerpage') { |
| | | let Id = data[0][setting.primaryKey] |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '页面类型设置错误!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } else if (item.OpenType === 'outerpage') { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '完善中。。。', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善打印验证信息!', |
| | | duration: 15 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | |
| | | execCustomPrint = (item, printlist, formdata) => { |
| | | this.setState({loadingUuid: ''}) |
| | | this.execSuccess(item, { |
| | | ErrCode: '-1', |
| | | message: '', |
| | | ErrMesg: '', |
| | | status: true |
| | | }) |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | |
| | | func(printlist, formdata, item.verify, notification) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义函数执行错误!', |
| | | duration: 10 |
| | | }) |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | | let evalfunc = eval('(true && function (data, form, printer, notification) {' + item.verify.printFunc + '})') |
| | | evalfunc(printlist, formdata, item.verify, notification) |
| | | } catch (error) { |
| | | console.warn(error) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义函数执行错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | }).then(response => { |
| | | if (!response) return |
| | | |
| | | response = {"status":true,"message":"","ErrCode":"","ErrMesg":"","CpCode":"YTO","InsideBill":"202003261727348572C0D0C2C0E444FD0B42A","PrintData":"{\"data\":{\"CpCode\":\"YTO\",\"WayBillCode\":\"YT2045589280491\",\"InsideBill\":\"19042003260002\",\"RecvInfo\":\"张先生 137147852 \\r\\n河北省保定市竞秀区001\",\"SendInfo\":\"宝时得科技(中国)有限公司 0512-65152888-5147 \\r\\n宝时得科技(中国)有限公司(B区)苏州工业园区东旺路18号\",\"BigShot\":\"176保定\",\"GatherCenterCode\":\"311911\",\"GatherCenterName\":\"\",\"CustomData\":\"wu800*2\\\\r\\\\n\",\"Pin\":\"\"},\"templateURL\":\"http://css.positecgroup.com/template/yto.srt\",\"ectype\":\"jdpop\"}","CustomData":""} |
| | | if (response.status) { |
| | | _list.push(response) |
| | | |
| | |
| | | }) |
| | | |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印信息!', |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: '未获取到打印信息!', |
| | | ErrMesg: '', |
| | | status: false |
| | | }, item) |
| | | return |
| | | } else if (_errors.length > 0) { |
| | | let lackerror = [] |
| | |
| | | msg.push(emptyerror.join(' ; ')) |
| | | } |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: msg.join(' ; ') + ' !', |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: msg.join(' ; ') + ' !', |
| | | ErrMesg: '', |
| | | status: false |
| | | }, item) |
| | | return |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | this.setState({loadingUuid: ''}) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '打印请求已发出。', |
| | | duration: 2 |
| | | this.execSuccess(item, { |
| | | ErrCode: 'S', |
| | | message: '', |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } |
| | | } |
| | |
| | | }) |
| | | |
| | | this.setState({loadingUuid: ''}) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '打印请求已发出。', |
| | | duration: 2 |
| | | this.execSuccess(item, { |
| | | ErrCode: 'S', |
| | | message: '', |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } |
| | | } |
| | |
| | | try { |
| | | data = JSON.parse(event.data) |
| | | } catch { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: event.data, |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: event.data, |
| | | ErrMesg: '', |
| | | status: false |
| | | }, item) |
| | | |
| | | data = '' |
| | | } |
| | | } |
| | |
| | | }) |
| | | |
| | | this.setState({loadingUuid: ''}) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '打印请求已发出。', |
| | | duration: 2 |
| | | this.execSuccess(item, { |
| | | ErrCode: 'S', |
| | | message: '', |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } else if (data && data.message && !data.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: data.message, |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: data.message, |
| | | ErrMesg: '', |
| | | status: false |
| | | }, item) |
| | | } |
| | | } |
| | | |
| | | socket.onerror = () => { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '无法连接到:' + item.verify.linkUrl, |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: '无法连接到:' + item.verify.linkUrl, |
| | | ErrMesg: '', |
| | | status: false |
| | | }, item) |
| | | } |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用创建凭证函数,需要选择行!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['main.action.settingerror'], |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | execAction: null, |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到按钮配置信息!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | execAction: null, |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '工作表《' + btn.verify.sheet + '》不存在!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } else if (errors === 'empty') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '工作表《' + btn.verify.sheet + '》为空!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } else if (errors === 'headerError') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '工作表《' + btn.verify.sheet + '》表头设置错误!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到工作表《' + btn.verify.sheet + '》数据!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.errors, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |