| | |
| | | error = '打印模板解析错误!' |
| | | } else { |
| | | let control = [] |
| | | let rotate = configParam.rotate || 0 |
| | | let offsetTop = 0 |
| | | let offsetLeft = 0 |
| | | |
| | | if (rotate === 90) { |
| | | offsetTop = configParam.width - configParam.height |
| | | } else if (rotate === 270) { |
| | | offsetLeft = configParam.height - configParam.width |
| | | } |
| | | |
| | | configParam.elements.forEach(element => { |
| | | let _field = element.field |
| | | |
| | |
| | | Type: element.type, |
| | | Value: element.value || '', |
| | | Field: _field, |
| | | Left: element.left, |
| | | Top: element.top, |
| | | Left: element.left + offsetLeft, |
| | | Top: element.top + offsetTop, |
| | | Width: element.width, |
| | | Height: element.height, |
| | | Rotate: configParam.rotate || 0, |
| | | Rotate: rotate, |
| | | // Rotate: element.rotate, |
| | | BorderSize: element.borderSize / 10, |
| | | BorderColor: element.borderColor, |
| | |
| | | control.push(item) |
| | | }) |
| | | |
| | | let down = false |
| | | |
| | | if (rotate === 90 || rotate === 270) { |
| | | down = true |
| | | } |
| | | |
| | | _configparam = { |
| | | Version: '', |
| | | Title: configParam.name, |
| | |
| | | Description: configParam.remark, |
| | | PrintTempNO: configParam.PrintTempNO, |
| | | PageSetting: { |
| | | Width: configParam.width, |
| | | Height: configParam.height, |
| | | Width: down ? configParam.height : configParam.width, |
| | | Height: down ? configParam.width : configParam.height, |
| | | Left: '0', |
| | | Right: '0', |
| | | Top: '0', |
| | |
| | | }) |
| | | |
| | | if (list.length === 0) { |
| | | this.execError({ |
| | | ErrCode: btn.verify.emptyTip === 'false' ? '-1' : 'N', |
| | | message: '未获取到打印信息!', |
| | | ErrMesg: '', |
| | | status: false |
| | | }) |
| | | if (btn.verify.emptyTip === 'false') { |
| | | this.execSuccess({ |
| | | ErrCode: '-1', |
| | | message: '未获取到打印信息!', |
| | | ErrMesg: '', |
| | | status: true |
| | | }) |
| | | } else { |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: '未获取到打印信息!', |
| | | ErrMesg: '', |
| | | status: false |
| | | }) |
| | | } |
| | | return |
| | | } else if (_errors.length > 0) { |
| | | let lackerror = [] |
| | |
| | | const { btn } = this.props |
| | | const { autoMatic } = this.state |
| | | |
| | | if ((res && (res.ErrCode === 'S' || !res.ErrCode)) || autoMatic) { // 执行成功 |
| | | if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || this.state.dict['main.action.confirm.success'], |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || this.state.dict['main.action.confirm.success'] |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | } else if (res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | | } |
| | | |