| | |
| | | // 系统打印数据,校验data字段 |
| | | if (!cell.data || cell.data.length === 0) return |
| | | |
| | | Object.keys(cell).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | cell[_key] = cell[key] |
| | | } |
| | | }) |
| | | |
| | | cell.data.forEach(item => { |
| | | let _item = {...formdata} |
| | | |
| | |
| | | } |
| | | }) |
| | | if (!errorMsg) { |
| | | resolve({next: true, list: result.map(res => { |
| | | Object.keys(res).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | res[_key] = res[key] |
| | | } |
| | | }) |
| | | |
| | | return res |
| | | })}) |
| | | resolve({next: true, list: result}) |
| | | } else { |
| | | this.execError(errorMsg) |
| | | resolve({next: false, list: []}) |
| | |
| | | |
| | | return Api.genericInterface(_callbackparam) |
| | | } else if (response.status) { |
| | | Object.keys(response).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | response[_key] = response[key] |
| | | } |
| | | }) |
| | | |
| | | _list.push(response) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | |
| | | if (!response) return |
| | | |
| | | if (response.status) { |
| | | Object.keys(response).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | response[_key] = response[key] |
| | | } |
| | | }) |
| | | |
| | | _list.push(response) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | Object.keys(res).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | res[_key] = res[key] |
| | | } |
| | | }) |
| | | _list.push(res) |
| | | |
| | | if (params.length === 0) { |