| | |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | refreshdata: PropTypes.func, // 执行完成后数据刷新 |
| | | triggerPopview: PropTypes.func, // 弹窗标签页触发 |
| | | getexceloutparam: PropTypes.func, // 获取excel导出数据 |
| | | gettableselected: PropTypes.func // 获取表格中数据 |
| | | getexceloutparam: PropTypes.func, // 获取excel导出数据 |
| | | gettableselected: PropTypes.func, // 获取表格中数据 |
| | | permRoles: PropTypes.any // 用户权限列表 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | let printlist = [] |
| | | let templates = [] |
| | | let templates = [btn.verify.Template] |
| | | |
| | | this.setState({loadingUuid: btn.uuid}) |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.intertype === 'inner' && !btn.innerFunc) { |
| | | formdata.TemplateID = btn.verify.Template |
| | | templates.push(btn.verify.Template) |
| | | |
| | | if (btn.Ot === 'notRequired') { |
| | | printlist.push(formdata) |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(formdata))) |
| | | } |
| | | } else { |
| | | printlist.push(formdata) |
| | | } |
| | | } else { |
| | | printlist = data.map(cell => { |
| | | data.forEach(cell => { |
| | | let _cell = {...cell, ...formdata} |
| | | |
| | | return _cell |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | } |
| | | }) |
| | | } |
| | | resolve('getTemp') |
| | | } else { |
| | | this.getprintdata(btn, data, formdata, formlist).then(result => { |
| | | printlist = result.list.map(item => { |
| | | if (item.TemplateID) { |
| | | templates.push(item.TemplateID) |
| | | } else { |
| | | item.TemplateID = btn.verify.Template |
| | | } |
| | | return item |
| | | }) |
| | | result.list.forEach(item => { |
| | | let _cell = item.data |
| | | |
| | | if (_cell.TemplateID) { |
| | | templates.push(_cell.TemplateID) |
| | | } else { |
| | | _cell.TemplateID = btn.verify.Template |
| | | } |
| | | |
| | | if (item.count && typeof(item.count) === 'number' && item.count > 1) { |
| | | for (let i = 0; i < item.count; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | } |
| | | }) |
| | | |
| | | resolve(result.next) |
| | | }) |
| | | } |
| | |
| | | ID: tempId |
| | | } |
| | | |
| | | if (options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi.replace('dostars', 'dostar') |
| | | if (window.GLOB.mainSystemApi) { // 从单点登录服务器取打印配置信息 |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | |
| | | let errorMsg = '' |
| | | result.forEach(res => { |
| | | if (res.status) { |
| | | _list.push(res.data) |
| | | res.data.forEach(_item => { |
| | | _list.push({data: _item, count: res.printCount}) |
| | | }) |
| | | } else { |
| | | errorMsg = res |
| | | } |
| | |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | | // 回调请求 |
| | | |
| | | if (response.status) { |
| | | response.data.forEach(_item => { |
| | | _list.push({data: _item, count: response.printCount}) |
| | | }) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | | if (params.length === 0) { |
| | | _resolve({next: 'getTemp', list: _list}) |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | _list.push(res.data) |
| | | res.data.forEach(_item => { |
| | | _list.push({data: _item, count: res.printCount}) |
| | | }) |
| | | |
| | | if (params.length === 0) { |
| | | _resolve({next: 'getTemp', list: _list}) |
| | |
| | | error = '打印模板解析错误!' |
| | | } else { |
| | | let control = configParam.elements.map(element => { |
| | | let _field = element.field |
| | | |
| | | if (_field === 'other_field') { |
| | | _field = element.cusfield || '' |
| | | } |
| | | |
| | | let item = { |
| | | Name: element.name || '', |
| | | Type: element.type, |
| | | Value: element.value || '', |
| | | Field: element.field || '', |
| | | Field: _field, |
| | | Left: element.left, |
| | | Top: element.top, |
| | | Width: element.width, |
| | |
| | | btnloading: false |
| | | }) |
| | | } else { |
| | | if (_LongParam.groups.length > 0) { |
| | | _LongParam.groups.forEach(group => { |
| | | group.sublist = group.sublist.filter(cell => { |
| | | if (!cell.blacklist || cell.blacklist.length === 0) return true |
| | | |
| | | let _black = cell.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | _LongParam.fields = _LongParam.fields.filter(cell => { |
| | | if (!cell.blacklist || cell.blacklist.length === 0) return true |
| | | |
| | | let _black = cell.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | configMap: {...configMap, [action.uuid]: _LongParam}, |
| | | execAction: {..._LongParam, ...execAction} |