feature/2.15.1.2407.01-导入工具
This commit is contained in:
parent
75b6c0969a
commit
74ba398c90
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className="weapp-batch-impsteps-picker-content-imp-step1">
|
||||
|
|
@ -45,7 +46,7 @@ class ImpStep1 extends Component {
|
|||
{this.props.importParams}
|
||||
</div>
|
||||
}
|
||||
<div className="title">{getLabel(543202, "导入Excel")}</div>
|
||||
{_.isEmpty(this.props.customDragger) && <div className="title">{getLabel(543202, "导入Excel")}</div>}
|
||||
<p className="draggerUploadWrapper">
|
||||
<Dragger {...dragger}>
|
||||
<div>
|
||||
|
|
@ -56,36 +57,39 @@ class ImpStep1 extends Component {
|
|||
</div>
|
||||
</Dragger>
|
||||
</p>
|
||||
{
|
||||
(_.isNil(this.props.customDragger) || this.props.customDragger.showOperateDesc) &&
|
||||
<React.Fragment>
|
||||
<div className="bottom-border">
|
||||
<div>{getLabel(27577, "操作步骤")}</div>
|
||||
<p>
|
||||
<span>{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}</span>
|
||||
{
|
||||
typeof this.props.link === "string" ?
|
||||
<a href={this.props.link} className="weapp-salary-link"
|
||||
target="_blank">{getLabel(543207, "点击这里下载模板")}</a> :
|
||||
<a className="weapp-salary-link"
|
||||
onClick={this.props.link}
|
||||
>{getLabel(543207, "点击这里下载模板")}</a>
|
||||
}
|
||||
|
||||
{this.props.exportDataDom}
|
||||
</p>
|
||||
<p>{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}</p>
|
||||
<p>{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}</p>
|
||||
<p>
|
||||
{`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="bottom-border">
|
||||
<div>{getLabel(27577, "操作步骤")}</div>
|
||||
<p>
|
||||
<span>{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}</span>
|
||||
{
|
||||
typeof this.props.link === "string" ?
|
||||
<a href={this.props.link} className="weapp-salary-link"
|
||||
target="_blank">{getLabel(543207, "点击这里下载模板")}</a> :
|
||||
<a className="weapp-salary-link"
|
||||
onClick={this.props.link}
|
||||
>{getLabel(543207, "点击这里下载模板")}</a>
|
||||
}
|
||||
|
||||
{this.props.exportDataDom}
|
||||
</p>
|
||||
<p>{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}</p>
|
||||
<p>{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}</p>
|
||||
<p>
|
||||
{`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="description">
|
||||
<div>{getLabel(543223, "Excel文件说明")}</div>
|
||||
<p>{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}</p>
|
||||
<p>{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}</p>
|
||||
<p><span>{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}</span></p>
|
||||
</div>
|
||||
|
||||
<div className="description">
|
||||
<div>{getLabel(543223, "Excel文件说明")}</div>
|
||||
<p>{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}</p>
|
||||
<p>{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}</p>
|
||||
<p><span>{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}</span></p>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class ImpStep3 extends Component {
|
|||
</div>
|
||||
}
|
||||
{
|
||||
(!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
|
||||
!_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
|
||||
<WeaTable
|
||||
columns={[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,13 +36,17 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
renderChildren = () => {
|
||||
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 = <ImpStep1 importParams={importParams} link={link} exportDataDom={exportDataDom}
|
||||
ref={dom => this.step1Ref = dom}/>;
|
||||
CurrentDom =
|
||||
<ImpStep1 importParams={importParams} customDragger={customDragger} link={link} exportDataDom={exportDataDom}
|
||||
ref={dom => this.step1Ref = dom}/>;
|
||||
break;
|
||||
case 1:
|
||||
CurrentDom = <ImpStep2 {...this.props} scrollHeight={scrollHeight}/>;
|
||||
|
|
|
|||
|
|
@ -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) => {
|
|||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
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 = [<Button type="primary" loading={loading} onClick={this.appSettingSave}>保存</Button>];
|
||||
const {
|
||||
openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version, moveInDialog
|
||||
} = this.state;
|
||||
const btns = [
|
||||
<Button type="primary" loading={loading} onClick={this.appSettingSave}>保存</Button>,
|
||||
<Button type="ghost" onClick={() => this.handleOperate("import")}>{getLabel(111, "迁入")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.handleOperate("export")}>{getLabel(111, "迁出")}</Button>
|
||||
];
|
||||
const items = [
|
||||
{
|
||||
com: Input({
|
||||
|
|
@ -115,6 +146,8 @@ class AppConfig extends Component {
|
|||
buttons={btns}
|
||||
/>
|
||||
<WeaSearchGroup title="" showGroup center items={items}/>
|
||||
<MoveInDialog {...moveInDialog}
|
||||
onCancel={() => this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: false } })}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<ImportDialog
|
||||
{...this.props} {...importDialog} excludeKey={1}
|
||||
onResetImportResult={() => this.setState({
|
||||
importDialog: {
|
||||
...importDialog, importResult: {}, imageId: "", link: ""
|
||||
}
|
||||
})}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default MoveInDialog;
|
||||
Loading…
Reference in New Issue