From 17d29a543b1b8a5c16901711fd3588770b33bab9 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 7 Feb 2025 14:43:47 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.19.1.2501.01-=E5=A5=97=E6=89=93?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/conditions.js | 19 +++++++++++++++++++ .../components/salaryDetails.js | 4 ++++ .../components/salaryDetailsTempDialog.js | 18 ++++++++++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) 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 }; })