diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 924662b3..63108170 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -232,6 +232,25 @@ export const tempCondition = [ rules: "required|string", viewAttr: 3 }, + { + conditionType: "UPLOAD", + domkey: ["fileId"], + fieldcol: 14, + label: "导出模板", + lanId: 111, + labelcol: 6, + value: "", + datas: [], + multiSelection: false, + showClearAll: false, + showListBottom: true, + showListTop: true, + maxFilesNumber: 1, + limitType: "xlsx", + uploadUrl: "/api/doc/upload/uploadFile", + category: "111", + viewAttr: 2 + }, { conditionType: "SELECT", domkey: ["sharedType"], diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 657c4dfb..718ed21f 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -200,6 +200,10 @@ class SalaryDetails extends Component { }; handelAddTemp = (templateId = "") => { const { tempDialog, tempPageList } = this.state; + if (_.isEmpty(this.transferRef.state.rightDatas)) { + message.warning(getLabel(111, "请选择设置!")); + return; + } this.setState({ tempDialog: { ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js index 5fc57e80..47ecfbb5 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js @@ -57,6 +57,13 @@ class SalaryDetailTempDialog extends Component { value: id ? template["limitIds"].join(",") : "", options: _.map(data, o => ({ key: o.id, showname: o.content })) }; + } else if (getKey(o) === "fileId") { + return { + ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "", + datas: id && template[getKey(o)] ? [ + { fileid: template[getKey(o)], filename: template["fileName"], showDelete: true } + ] : [] + }; } return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" }; }) @@ -73,12 +80,13 @@ class SalaryDetailTempDialog extends Component { tempForm.validateForm().then(f => { if (f.isValid) { this.setState({ loading: true }); - const { limitIds, ...formVal } = tempForm.getFormParams(); + const { limitIds, fileId, ...formVal } = tempForm.getFormParams(); const payload = { page: "salary_details_report", setting, id, ...formVal, limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : [] }; - API.savePageListTemplate(payload).then(({ status, errormsg }) => { + API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => { + this.setState({ loading: false }); if (status) { message.success(getLabel(111, "操作成功!")); this.props.onCancel(this.props.onSuccess()); @@ -101,6 +109,12 @@ class SalaryDetailTempDialog extends Component { ...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1, rules: value === "0" ? "required|string" : "" }; + } else if (getKey(o) === "fileId") { + return { + ...o, value, datas: value ? _.map(field[key].valueSpan, o => ({ + fileid: o.fileid, filename: o.filename, showDelete: true + })) : [] + }; } return { ...o }; })