diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index f52953bb..eebd320f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -79,3 +79,11 @@ export const saveSalarySendFeedback = (params) => { export const exportDataReport = (params) => { return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params); }; +//迁入配置 +export const uploadConfig = (params) => { + return postFetch("/api/bs/hrmsalary/sys/uploadConfig", params); +}; +//迁入配置 +export const downloadConfig = (params) => { + return postExportFetch("/api/bs/hrmsalary/sys/downloadConfig", params); +}; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index 209125fb..b2ac42b0 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -33,7 +33,8 @@ class ImpStep1 extends Component { multiple: false, action: "/api/doc/upload/uploadFile", fileList, - onChange: this.handleChange + onChange: this.handleChange, + ...this.props.customDragger }; return (
@@ -45,7 +46,7 @@ class ImpStep1 extends Component { {this.props.importParams}
} -
{getLabel(543202, "导入Excel")}
+ {_.isEmpty(this.props.customDragger) &&
{getLabel(543202, "导入Excel")}
}

@@ -56,36 +57,39 @@ class ImpStep1 extends Component {

+ { + (_.isNil(this.props.customDragger) || this.props.customDragger.showOperateDesc) && + +
+
{getLabel(27577, "操作步骤")}
+

+ {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   + { + typeof this.props.link === "string" ? + {getLabel(543207, "点击这里下载模板")} : + {getLabel(543207, "点击这里下载模板")} + } +    + {this.props.exportDataDom} +

+

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
-
-
{getLabel(27577, "操作步骤")}
-

- {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   - { - typeof this.props.link === "string" ? - {getLabel(543207, "点击这里下载模板")} : - {getLabel(543207, "点击这里下载模板")} - } -    - {this.props.exportDataDom} -

-

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

-

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

-

- {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} -

-
- -
-
{getLabel(543223, "Excel文件说明")}
-

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

-

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

-

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

-
- +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+
+ } ); } diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js index df9575ef..3ea07724 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -31,7 +31,7 @@ class ImpStep3 extends Component { } { - (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && + !_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && { - const { current } = this.state, { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + const { current } = this.state, { + importParams, link, excludeKey, importResult, + exportDataDom = null, customDragger + } = this.props; const scrollHeight = this.importRef ? this.importRef.state.height - 232 : 606.6; let CurrentDom = null; switch (current) { case 0: - CurrentDom = this.step1Ref = dom}/>; + CurrentDom = + this.step1Ref = dom}/>; break; case 1: CurrentDom = ; diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index a7b3d7ce..e13000eb 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -5,7 +5,17 @@ * Date: 2022-09-27 18:17:02 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaTop } from "ecCom"; +import { + WeaCheckbox, + WeaDatePicker, + WeaFormItem, + WeaInput, + WeaLoadingGlobal, + WeaLocaleProvider, + WeaSearchGroup, + WeaTop +} from "ecCom"; +import MoveInDialog from "./moveInDialog"; import * as API from "../../apis/ruleconfig"; import { Button, message } from "antd"; import "./index.less"; @@ -18,6 +28,7 @@ const Input = (props) => { ); }; +const getLabel = WeaLocaleProvider.getLabel; class AppConfig extends Component { constructor(props) { @@ -28,7 +39,8 @@ class AppConfig extends Component { isLog: "0", openFormulaForcedEditing: "0", version: "", - loading: false + loading: false, + moveInDialog: { visible: false, title: getLabel(111, "数据迁入") } }; } @@ -62,10 +74,29 @@ class AppConfig extends Component { } }); }; + handleOperate = (type) => { + switch (type) { + case "import": + this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: true } }); + break; + case "export": + WeaLoadingGlobal.start(); + const promise = API.downloadConfig(); + break; + default: + break; + } + }; render() { - const { openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version } = this.state; - const btns = []; + const { + openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version, moveInDialog + } = this.state; + const btns = [ + , + , + + ]; const items = [ { com: Input({ @@ -115,6 +146,8 @@ class AppConfig extends Component { buttons={btns} /> + this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: false } })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js b/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js new file mode 100644 index 00000000..7fcc32cc --- /dev/null +++ b/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js @@ -0,0 +1,62 @@ +/* + * 数据迁入 + * + * @Author: 黎永顺 + * @Date: 2024/8/12 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { message } from "antd"; +import ImportDialog from "../../components/importDialog"; +import * as API from "../../apis/ruleconfig"; + +const getLabel = WeaLocaleProvider.getLabel; + +class MoveInDialog extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + nextloading: false, importResult: {}, imageId: "", + customDragger: { showOperateDesc: false, accept: ".xml" } + } + }; + } + + + handleImport = (payload) => { + const { importDialog } = this.state = this.props; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + API.uploadConfig({ ...payload }).then(({ data, status, errormsg }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog } = this.state; + return ( + this.setState({ + importDialog: { + ...importDialog, importResult: {}, imageId: "", link: "" + } + })} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default MoveInDialog;