From bdfec44c9f3a37dbbe05bf14a252ffec04132a86 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 21:24:28 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/zshare/actionList/printbutton/index.jsx | 91 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 69 insertions(+), 22 deletions(-) diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index ff0cd12..d2bfa95 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -379,7 +379,7 @@ param.rduri = window.GLOB.mainSystemApi } - Api.getLocalConfig(param).then(result => { + Api.genericInterface(param).then(result => { result.tempId = tempId resolve(result) }) @@ -726,9 +726,16 @@ _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 } @@ -818,6 +825,8 @@ 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 @@ -931,6 +940,16 @@ error = '鎵撳嵃妯℃澘瑙f瀽閿欒锛�' } 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 @@ -943,11 +962,12 @@ 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, @@ -1015,6 +1035,12 @@ control.push(item) }) + let down = false + + if (rotate === 90 || rotate === 270) { + down = true + } + _configparam = { Version: '', Title: configParam.name, @@ -1022,8 +1048,8 @@ 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', @@ -1153,12 +1179,21 @@ }) 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 = [] @@ -1314,17 +1349,17 @@ 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') { // 瀹屾垚鍚庝笉鎻愮ず } @@ -1519,10 +1554,22 @@ } 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 @@ -1533,10 +1580,10 @@ _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) { -- Gitblit v1.8.0