| | |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | Api.genericInterface(param).then(result => { |
| | | result.tempId = tempId |
| | | resolve(result) |
| | | }) |
| | |
| | | _param[setting.primaryKey] = cell[setting.primaryKey] |
| | | } |
| | | |
| | | let _cell = {} |
| | | if (index !== 0) { |
| | | Object.keys(cell).forEach(key => { |
| | | _cell[key.toLowerCase()] = cell[key] |
| | | }) |
| | | } |
| | | |
| | | formlist.forEach(_data => { |
| | | if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) { |
| | | _param[_data.key] = cell[_data.key] |
| | | if (index !== 0 && _data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) { |
| | | _param[_data.key] = _cell[_data.key.toLowerCase()] |
| | | } else { |
| | | _param[_data.key] = _data.value |
| | | } |
| | |
| | | if (window.GLOB.mkHS) { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | res.rduri = options.cloudServiceApi |
| | | res.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | res.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | res.rduri = btn.proInterface |
| | |
| | | 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: element.rotate, |
| | | Rotate: rotate, |
| | | // Rotate: element.rotate, |
| | | BorderSize: element.borderSize / 10, |
| | | BorderColor: element.borderColor, |
| | | Align: element.align, |
| | |
| | | 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: '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') { // 完成后不提示 |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | modelconfirm = () => { |
| | | const { BData } = this.props |
| | | const { btnconfig, selines } = this.state |
| | | let _this = this |
| | | let result = [] |
| | | let _data = {} |
| | | let BData = {} |
| | | |
| | | if (selines[0]) { |
| | | Object.keys(selines[0]).forEach(key => { |
| | | _data[key.toLowerCase()] = selines[0][key] |
| | | }) |
| | | } |
| | | if (this.props.BData) { |
| | | Object.keys(this.props.BData).forEach(key => { |
| | | BData[key.toLowerCase()] = this.props.BData[key] |
| | | }) |
| | | } |
| | | |
| | | btnconfig.fields.forEach(item => { |
| | | if (!item.field) return |
| | |
| | | _readin = false |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { |
| | | _initval = BData[item.field] |
| | | } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) { |
| | | _initval = selines[0][item.field] |
| | | if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) { |
| | | _initval = BData[item.field.toLowerCase()] |
| | | } else if (_readin && _data.hasOwnProperty(item.field.toLowerCase())) { |
| | | _initval = _data[item.field.toLowerCase()] |
| | | } else if (item.type === 'date' && _initval) { |
| | | _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD') |
| | | } else if (item.type === 'datemonth' && _initval) { |