Merge branch 'release/2.15.2.2409.01' into custom/喜盈门

This commit is contained in:
黎永顺 2024-09-12 13:29:36 +08:00
commit dc843caa3f
21 changed files with 667 additions and 151 deletions

View File

@ -1,5 +1,5 @@
import { WeaTools } from "ecCom";
import { postFetch } from "../util/request";
import { postExportFetch, postFetch } from "../util/request";
// 薪资项目-获取列表
export const getItemList = params => {
@ -84,3 +84,19 @@ export const getSalarySobBySalaryItem = params => {
export const syncSalaryItemToSalarySobItem = params => {
return postFetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem", params);
};
// 导出薪资项目
export const exportSalaryitem = (params) => {
return postExportFetch("/api/bs/hrmsalary/salaryitem/export", params);
};
// 下载模板
export const downloadTemplate = (params) => {
return postExportFetch("/api/bs/hrmsalary/salaryitem/downloadTemplate", params);
};
// 导入薪资项目
export const importSalaryitem = (params) => {
return postFetch("/api/bs/hrmsalary/salaryitem/import", params);
};

View File

@ -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);
};

View File

@ -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>&nbsp;&nbsp;
{
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>
}
&nbsp;&nbsp;
{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>&nbsp;&nbsp;
{
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>
}
&nbsp;&nbsp;
{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>
);
}

View File

@ -7,6 +7,7 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import successImg from "../../importModal/success.svg";
import MoveInResult from "./moveInResult";
const getLabel = WeaLocaleProvider.getLabel;
@ -16,32 +17,41 @@ class ImpStep3 extends Component {
return (
<div className="weapp-batch-impsteps-picker-content-imp-step3">
{
!_.isEmpty(importResult) ?
<div className="weapp-batch-impsteps-picker-spinText">
<p><img src={successImg} alt=""/></p>
<p>
<span>{getLabel(389249, "已导入")}</span>
<span style={{ color: "green" }}> {importResult.successCount}</span>&nbsp;&nbsp;
<span>{`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`}</span>
<span style={{ color: "red" }}> {importResult.errorCount}&nbsp;&nbsp;</span>{getLabel(30690, "")}
</p>
</div> :
<div className="weapp-batch-impsteps-picker-spinText">
<p>{getLabel(111, "导入失败")}</p>
</div>
}
{
(!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
<WeaTable
columns={[
importResult.results ? <MoveInResult dataSource={importResult.results}/> :
<React.Fragment>
{
title: getLabel(25700, "错误信息"),
dataIndex: "message"
!_.isEmpty(importResult) ?
<div className="weapp-batch-impsteps-picker-spinText">
<p><img src={successImg} alt=""/></p>
{
importResult.successCount &&
<p>
<span>{getLabel(389249, "已导入")}</span>
<span style={{ color: "green" }}> {importResult.successCount}</span>&nbsp;&nbsp;
<span>{`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`}</span>
<span
style={{ color: "red" }}> {importResult.errorCount}&nbsp;&nbsp;</span>{getLabel(30690, "")}
</p>
}
</div> :
<div className="weapp-batch-impsteps-picker-spinText">
<p>{getLabel(111, "导入失败")}</p>
</div>
}
]}
dataSource={importResult.errorData || importResult.errorNotice} pagination={false}
scroll={{ y: `calc(100vh - 387px)` }}
/>
{
!_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
<WeaTable
columns={[
{
title: getLabel(25700, "错误信息"),
dataIndex: "message"
}
]}
dataSource={importResult.errorData || importResult.errorNotice} pagination={false}
scroll={{ y: `calc(100vh - 387px)` }}
/>
}
</React.Fragment>
}
</div>
);

View File

@ -0,0 +1,56 @@
/*
* 薪酬迁入结果展示
*
* @Author: 黎永顺
* @Date: 2024/8/16
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class MoveInResult extends Component {
downloadTxtfile = (value, type) => {
if (!value) return;
const element = document.createElement("a");
const file = new Blob([value], { type: "text/plain" });
element.href = URL.createObjectURL(file);
element.download = `导入${type}信息.txt`;
document.body.appendChild(element);
element.click();
};
render() {
const { dataSource } = this.props;
return (
<WeaTable
columns={[
{ title: getLabel(111, "导入信息"), dataIndex: "message" },
{
title: getLabel(111, "下载信息"), dataIndex: "download", width: 250,
render: (text, record) => (<React.Fragment>
<span
style={{ marginRight: 16, color: "#0BB746", cursor: "pointer", display: "inline-block", minWidth: 60 }}
onClick={() => this.downloadTxtfile(record.success.join("\n"), getLabel(111, "成功"))}>
<i className="iconfont icon-successful"/><span
style={{ marginLeft: 8 }}>{record.success.length}</span></span>
<span
style={{ marginRight: 16, color: "#E6960C", cursor: "pointer", display: "inline-block", minWidth: 60 }}
onClick={() => this.downloadTxtfile(record.warning.join("\n"), getLabel(111, "警告"))}><i
className="iconfont icon-warning"/><span style={{ marginLeft: 8 }}>{record.warning.length}</span></span>
<span style={{ color: "#CF3736", cursor: "pointer", display: "inline-block", minWidth: 60 }}
onClick={() => this.downloadTxtfile(record.error.join("\n"), getLabel(111, "错误"))}><i
className="iconfont icon-error"/><span style={{ marginLeft: 8 }}>{record.error.length}</span></span>
</React.Fragment>)
}
]}
dataSource={dataSource} pagination={false} bordered scroll={{ y: `calc(100vh - 333px)` }}
/>
);
}
}
export default MoveInResult;

View File

@ -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}/>;
@ -99,13 +103,16 @@ class Index extends Component {
}
const [file] = fileList;
const { response } = file;
this.setState({
current: this.state.current + 1,
fileid: response.data.fileid
}, () => {
!excludeKey && this.props.nextCallback && this.props.nextCallback(this.state.fileid);
excludeKey && this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
});
if (!excludeKey) {
this.setState({
current: this.state.current + 1,
fileid: response.data.fileid
}, () => {
this.props.nextCallback && this.props.nextCallback(this.state.fileid);
});
} else {
this.props.nextUplaodCallback && this.props.nextUplaodCallback(response.data.fileid);
}
} else {
this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
}

View File

@ -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>
);
}

View File

@ -0,0 +1,73 @@
/*
* 数据迁入
*
* @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" }
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({
importDialog: {
...this.state.importDialog,
importResult: {}, imageId: "",
customDragger: { showOperateDesc: false, accept: ".xml" }
}
});
}
}
handleImport = (payload) => {
const { importDialog } = this.state;
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;

View File

@ -242,13 +242,21 @@ class Index extends Component {
<BaseInfo {...this.props}/>
<WeaTab
datas={tabDatas} keyParam="viewcondition" selectedKey={selectedKey}
onChange={v => this.setState({ selectedKey: v }, () => this.queryPCList())}
onChange={v => this.setState({
selectedKey: v,
pageInfo: { ...pageInfo, current: 1 }
}, () => this.queryPCList())}
onSearch={v => this.setState({
pageInfo: { ...pageInfo, current: 1 }
}, () => this.queryPCList())}
onAdSearch={v => this.setState({
pageInfo: { ...pageInfo, current: 1 }
}, () => this.queryPCList())}
buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220}
showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)}
onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })}
searchsBaseValue={PCSearchForm.getFormParams().employeeName}
onSearch={this.queryPCList} onAdSearch={this.queryPCList}
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
/>
<WeaTable

View File

@ -271,6 +271,9 @@ class EditCalcTable extends Component {
}
}).catch(() => this.setState({ loading: false }));
};
handleQuery = () => {
this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.queryCalcResultList());
};
handleBatchEditing = () => {
};

View File

@ -28,7 +28,7 @@ class Index extends Component {
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
onAdSearch = (bool = true) => {
this.calcTableRef.wrappedInstance.queryCalcResultList();
this.calcTableRef.wrappedInstance.handleQuery();
bool && this.openAdvanceSearch();
};
init = async () => {

View File

@ -110,7 +110,8 @@ class LedgerSlide extends Component {
return {
...item,
items: _.map(item.items, it => {
// delete it.formulaContent;
delete it.originFormulaContent;
delete it.originSqlContent;
// if (it.id && it.id.length > 4) delete it.id;
return { ...it };
})
@ -118,7 +119,8 @@ class LedgerSlide extends Component {
}),
items: _.map(_.find(itemGroups, it => it.name === "未分类").items, child => {
// if (child.id && child.id.length > 4) delete child.id;
// delete child.formulaContent;
delete child.originFormulaContent;
delete child.originSqlContent;
return { ...child };
}) || [],
salarySobId: salarySobId || saveSalarySobId

View File

@ -174,7 +174,7 @@ class Index extends Component {
if (it === "ackFeedbackStatus" || it === "feedbackStatus") {
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
} else {
payrollTempFeedbackForm.updateFields({ [it]: !_.isEmpty(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
}
});
this.setState({

View File

@ -36,8 +36,8 @@ class PovitpivotChartModal extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { id, dimensionId, dimensionValue, isShare } = nextProps;
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare });
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = nextProps;
this.getDataPerspective({ id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth });
} else {
this.setState({
dataSource: [],
@ -64,11 +64,11 @@ class PovitpivotChartModal extends Component {
});
} else if (type === "turn") {
if (id === "PAGEINFO") {
const { id, dimensionId, dimensionValue, isShare } = this.props;
const { id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth } = this.props;
const { pageNum: current, size: pageSize } = params;
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () =>
this.getDataPerspective({
id, dimensionId, dimensionValue, isShare
id, dimensionId, dimensionValue, isShare, salaryStartMonth, salaryEndMonth
}));
}
}

View File

@ -29,8 +29,8 @@ class ReportContent extends Component {
chartsType: "0",
chartsInfo: {},
povitView: {
visible: false, id: "", isShare: false,
dimensionId: "", dimensionValue: ""
visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "", salaryStartMonth: "",
salaryEndMonth: ""
},
rangSet: {
visible: false, reportId: "",
@ -69,10 +69,15 @@ class ReportContent extends Component {
if (id === "PIVOTCHART") {
const { record } = params;
const { dimension: dimensionValue } = record;
const { id: pivotId, dimensionId, isShare } = this.props.report;
const {
id: pivotId, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start
} = this.props.report;
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
this.setState({
povitView: {
visible: true, id: pivotId, dimensionId, dimensionValue, isShare
visible: true, id: pivotId, dimensionId, dimensionValue, isShare,
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
}
});
} else if (id === "PAGEINFO_REPORT") {
@ -282,7 +287,7 @@ class ReportContent extends Component {
onCancel={() => this.setState({
povitView: {
visible: false, id: "", dimensionId: "", dimensionValue: "",
isShare: false
isShare: false, salaryStartMonth: "", salaryEndMonth: ""
}
})}
/>

View File

@ -1,9 +1,8 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
import { renderLoading, toDecimal_n } from "../../util";
import CustomTab from "../../components/customTab";
import SystemSalaryItemModal from "./systemSalaryItemModal";
import { columns } from "./columns";
import SlideModalTitle from "../../components/slideModalTitle";
@ -12,6 +11,8 @@ import CustomPaginationTable from "../../components/customPaginationTable";
import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog";
import "../socialSecurityBenefits/programme/index.less";
import LogDialog from "../../components/logViewModal";
import SalaryItemImportDialog from "./salaryItemImport";
import * as API from "../../apis/item";
const { getLabel } = WeaLocaleProvider;
@inject("salaryItemStore", "taxAgentStore", "salaryFileStore")
@ -29,7 +30,8 @@ export default class SalaryItem extends React.Component {
searchParams: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [],
syncSalarySetDialog: { visible: false, title: "", id: "" },
logDialogVisible: false, filterConditions: "[]"
logDialogVisible: false, filterConditions: "[]",
salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") }
};
columns.map(item => {
if (item.dataIndex == "refere") {
@ -213,6 +215,19 @@ export default class SalaryItem extends React.Component {
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
});
break;
case "export":
WeaLoadingGlobal.start();
const { selectedRowKeys } = this.state;
const promise = API.exportSalaryitem({ ids: selectedRowKeys });
WeaLoadingGlobal.destroy();
break;
case "import":
this.setState({
salaryItemImpDialog: {
...this.state.salaryItemImpDialog, visible: true
}
});
break;
default:
break;
}
@ -220,12 +235,10 @@ export default class SalaryItem extends React.Component {
render() {
const {
salaryItemStore,
salaryFileStore,
taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
salaryItemStore, salaryFileStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
} = this.props;
const { userStatusList } = salaryFileStore;
const { selectedRowKeys, logDialogVisible, filterConditions } = this.state;
const { selectedRowKeys, logDialogVisible, filterConditions, salaryItemImpDialog } = this.state;
const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
const {
tableDataSource,
@ -257,51 +270,36 @@ export default class SalaryItem extends React.Component {
</Menu>
);
const renderRightOperation = () => {
return (<div style={{ display: "inline-block" }}>
{
(showOperateBtn || showSalaryItemBtn) &&
<Dropdown.Button overlay={menu} type="primary" onClick={() => handleMenuClick({ key: "1" })}
style={{ marginRight: "10px" }}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>
const buttons = [
<Dropdown.Button overlay={menu} type="primary"
onClick={() => handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
<Button type="primary" onClick={() => {
if (!selectedRowKeys.length) {
message.info("未选中任何数据!");
return;
}
{
(showOperateBtn || showSalaryItemBtn) &&
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => {
if (!selectedRowKeys.length) {
message.info("未选中任何数据!");
return;
}
Modal.confirm({
title: "信息确认",
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
onOk: () => {
deleteItemRequest(selectedRowKeys).then(() => {
getTableDatas({ ...this.state.searchParams }).then(res => {
this.setState({
selectedRowKeys: [],
searchParams: {
...this.state.searchParams,
total: res.total
}
});
});
});
}
Modal.confirm({
title: "信息确认",
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
onOk: () => {
deleteItemRequest(selectedRowKeys).then(() => {
getTableDatas({ ...this.state.searchParams }).then(res => {
this.setState({
selectedRowKeys: [],
searchParams: {
...this.state.searchParams,
total: res.total
}
});
});
}}>{getLabel(32136, "批量删除")}</Button>
}
<WeaInputSearch value={this.state.searchValue} placeholder={"请输入名称"} onChange={(value) => {
this.setState({ searchValue: value });
}} onSearch={(value) => {
this.handleSearch(value);
}}/>
</div>);
};
});
}
});
}}>{getLabel(32136, "批量删除")}</Button>,
<WeaInputSearch value={this.state.searchValue} placeholder={getLabel(111, "请输入名称")}
onChange={value => this.setState({ searchValue: value })}
onSearch={value => this.handleSearch(value)}/>
];
// 新建和修改保存的回调
const handleSlideSave = (continueFlag) => {
const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props;
@ -367,23 +365,31 @@ export default class SalaryItem extends React.Component {
};
const rowSelection = {
selectedRowKeys,
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }),
getCheckboxProps: record => ({
disabled: !record.canDelete // Column configuration not to be checked
})
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
// getCheckboxProps: record => ({
// disabled: !record.canDelete // Column configuration not to be checked
// })
};
return (
<div className="mySalaryBenefitsWrapper">
<WeaTop title="薪资项目管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={[
{
key: "import",
icon: <i className="icon-coms02-Template-import1"/>,
content: getLabel(111, "导入")
},
{
key: "export",
icon: <i className="iconfont icon-daochu"/>,
content: getLabel(111, "导出")
},
{
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}
]}
>
<CustomTab searchOperationItem={renderRightOperation()}/>
]} buttons={(showOperateBtn || showSalaryItemBtn) ? buttons : buttons.slice(-1)}>
<div className="tableWrapper">
<WeaNewScroll height="100%">
<CustomPaginationTable
@ -425,6 +431,13 @@ export default class SalaryItem extends React.Component {
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="salaryitem" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
{/* 导入*/}
<SalaryItemImportDialog {...salaryItemImpDialog}
onCancel={callback => {
this.setState({
salaryItemImpDialog: { ...salaryItemImpDialog, visible: false }
}, () => callback && this.handleSearch(this.state.searchValue));
}}/>
{
systemItemVisible &&
<SystemSalaryItemModal

View File

@ -0,0 +1,87 @@
/*
* 薪资项目导入
*
* @Author: 黎永顺
* @Date: 2024/8/7
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import ImportDialog from "../../../components/importDialog";
import * as API from "../../../apis/item";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
importDialog: {
nextloading: false, link: null, importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/salaryitem/preview", hasData: false
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.setState({ importDialog: { ...this.state.importDialog, link: this.handleExportTemp } });
} else {
this.setState({
importDialog: {
nextloading: false, link: null, importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/salaryitem/preview", hasData: false
}
});
}
}
handleExportTemp = () => {
const { importDialog } = this.state;
const { hasData } = importDialog;
WeaLoadingGlobal.start();
const promise = API.downloadTemplate({ hasData });
WeaLoadingGlobal.destroy();
};
handleImport = (payload) => {
const { importDialog } = this.state, { isExtEmp } = this.props;
const { extraPreview } = importDialog;
this.setState({ importDialog: { ...importDialog, nextloading: true } });
API.importSalaryitem({ ...payload, ...extraPreview, isExtEmp }).then(({ data, status }) => {
this.setState({ importDialog: { ...importDialog, nextloading: false } });
if (status) {
this.setState({
importDialog: { ...importDialog, ...payload, importResult: data }
});
}
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
};
render() {
const { importDialog } = this.state;
return (
<ImportDialog
{...this.props} {...importDialog}
onResetImportResult={() => this.setState({
importDialog: { ...importDialog, importResult: {}, imageId: "", link: null }
})}
exportDataDom={
<WeaCheckbox
value={importDialog.hasData ? "1" : "0"}
content={getLabel(543208, "导出现有数据")}
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
onChange={val => {
this.setState({ importDialog: { ...importDialog, hasData: val === "1" } });
}}
/>
}
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,76 @@
/*
* 方案信息确认
* 保存并自动修改基数仅保存方案设置
* @Author: 黎永顺
* @Date: 2024/8/19
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaDialog, WeaLocaleProvider, WeaTransfer } from "ecCom";
import { Alert, Button } from "antd";
const getLabel = WeaLocaleProvider.getLabel;
const WeaTransferList = WeaTransfer.list;
class BaseValidateDialog extends Component {
constructor(props) {
super(props);
this.state = { dataSource: [] };
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.setState({
dataSource: _.filter(_.map(nextProps.baseChangeInfo.split("\n"), (g, gi) => ({
id: gi + 1, name: g
})), k => !!k.name)
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
dataSource: []
});
}
render() {
const { dataSource } = this.state, { onCancel } = this.props;
const scrollHeight = this.baseChangeRef ? this.baseChangeRef.state.height - 118 : 606.6;
const buttons = [
<Button type="primary" onClick={() => onCancel({
validate: false, changeData: true
})}>{getLabel(111, "保存并自动修改基数")}</Button>,
<Button type="ghost" onClick={() => onCancel({
validate: false, changeData: false
})}>{getLabel(111, "仅保存方案设置")}</Button>
];
return (
<WeaDialog
{...this.props} hasScroll className="baseChangeDialog" initLoadCss ref={dom => this.baseChangeRef = dom}
title={getLabel(131329, "信息确认")} buttons={buttons}
style={{
width: 750, height: 606.6, minHeight: 200, minWidth: 380,
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}}
>
<div className="baseChangeContent">
<Alert
message={getLabel(111, "是否需要将社保档案中不满足上下限的基数值,自动设置为对应的上限或下限值?")}
description={getLabel(111, "以下员工的社保福利档案基数大于上限值,或小于下限值:")}
type="warning"/>
{
!_.isEmpty(dataSource) ? <WeaTransferList
data={dataSource} renderItem={(it) => (<div className="detailBox">
<div className="order">{it.id}</div>
<div className="content" title={it.name}>{it.name}</div>
</div>)}
height={scrollHeight} checkedCb={() => ({})} checkedKeys={[]}
/> : <div className="empty">{getLabel(111, "")}</div>
}
</div>
</WeaDialog>
);
}
}
export default BaseValidateDialog;

View File

@ -12,6 +12,7 @@ import { Button, message, Modal } from "antd";
import * as API from "../../../../../apis/welfareScheme";
import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent";
import { getConditionDomkeys, getSearchs } from "../../../../../util";
import BaseValidateDialog from "./baseValidateDialog";
import { planConditons } from "../../config";
import cs from "classnames";
@ -24,7 +25,10 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], selectedKey: "2", planDatas: []
loading: false, conditions: [], selectedKey: "2", planDatas: [],
baseValidateDialog: {
visible: false, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
}
};
}
@ -86,21 +90,37 @@ class Index extends Component {
if (planForm.getFormParams().sharedType === "1" && _.isEmpty(planForm.getFormParams().taxAgentIds)) {
planForm.showError("taxAgentIds", getLabel(111, "\"可见范围\"未填写"));
} else {
const { planDatas } = this.state;
const payload = {
const { planDatas, baseValidateDialog } = this.state;
const { validatePayload } = baseValidateDialog;
let payload = {
insuranceScheme: {
...planForm.getFormParams(), welfareType: welfareTypeEnum, id,
paymentArea: planForm.getFormParams().paymentType
},
insuranceSchemeDetailList: planDatas
};
id && (payload = { ...payload, ...validatePayload });
this.setState({ loading: true });
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, errormsg }) => {
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
setHasBeenModify(false);
this.props.onClose(true);
if (id && Object.prototype.toString.call(data) === "[object String]" && data.indexOf("\n") !== -1) {
this.setState({
baseValidateDialog: {
visible: true, baseChangeInfo: data,
validatePayload: { ...baseValidateDialog.validatePayload, validate: false }
}
});
} else {
message.success(getLabel(30700, "操作成功!"));
setHasBeenModify(false);
this.props.onClose(true);
this.setState({
baseValidateDialog: {
...baseValidateDialog, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
}
});
}
} else {
message.error(errormsg);
}
@ -194,7 +214,7 @@ class Index extends Component {
render() {
const { conditions, planDatas, selectedKey } = this.state;
const { conditions, planDatas, selectedKey, baseValidateDialog } = this.state;
const { programmeStore: { planForm }, showOperateBtn } = this.props;
return (
<WeaSlideModal
@ -207,6 +227,14 @@ class Index extends Component {
<PlanSetTable dataSource={planDatas} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
onPlanSet={this.handleSetPlanDatas}/>
</WeaSearchGroup>
{/* */}
<BaseValidateDialog {...baseValidateDialog}
onCancel={(validatePayload = {}) => this.setState({
baseValidateDialog: {
visible: false, baseChangeInfo: [],
validatePayload: { validate: true, changeData: false, ...validatePayload }
}
}, () => !_.isEmpty(validatePayload) && this.save())}/>
</div>}
/>
);

View File

@ -13,7 +13,6 @@ import WelfarePlanList from "./components/welfarePlanList";
import LogDialog from "../../../components/logViewModal";
import cs from "classnames";
import "./index.less";
import { tabList } from "../welfareArchive/config";
const getLabel = WeaLocaleProvider.getLabel;

View File

@ -269,3 +269,91 @@
}
}
//方案基数变化
.baseChangeDialog {
.wea-dialog-body {
overflow-y: hidden;
}
.baseChangeContent {
background: #F6F6F6;
padding: 16px;
width: 100%;
height: 100%;
.empty {
width: 100%;
display: flex;
height: 100%;
justify-content: center;
align-items: center;
background: #ffff;
}
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
.logTable {
background: #FFFFFF;
}
.wea-transfer-list-wrapper {
border: none;
.ant-tree-switcher {
display: none;
}
.transfer-tree {
background: #FFF;
border: 1px solid #dadada;
padding: 0;
& > li:not(:last-child) {
.detailBox .content {
border-bottom: 1px solid #dadada;
}
}
& > li {
margin: 0 !important;
.detailBox {
display: flex;
align-items: center;
.order {
width: 35px;
color: #999;
text-align: center;
}
.content {
position: relative;
flex: 1;
min-height: 40px;
line-height: 40px;
color: #000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
}
}