Merge branch 'feature/2.9.42309.01-社保福利档案添加非系统人员列表' into feature/2.9.42309.01-薪资核算详情页面列表改造(页面编辑)

This commit is contained in:
黎永顺 2023-09-18 18:42:37 +08:00
commit cf38c91be8
6 changed files with 100 additions and 26 deletions

View File

@ -13,6 +13,10 @@ export const getCondition = params => {
export const queryList = (params) => {
return postFetch("/api/bs/hrmsalary/archives/getTable", params);
};
//社保福利档案_非系统人员列表
export const getExtTable = (params) => {
return postFetch("/api/bs/hrmsalary/archives/getExtTable", params);
};
//社保福利档案列表
export const queryInsuranceTabTotal = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params);

View File

@ -26,5 +26,12 @@ export const tabCondition = [
showcount: true,
title: "停缴员工",
viewcondition: "stop"
}
},
{
color: "#000000",
groupid: "ext",
showcount: true,
title: "非系统人员",
viewcondition: "ext"
},
];

View File

@ -2,7 +2,7 @@ import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
import { WeaCheckbox, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
import { getSearchs, renderLoading } from "../../../util";
import BaseForm from "./baseForm";
import SlideModalTitle from "../../../components/slideModalTitle";
@ -14,11 +14,16 @@ import * as API from "../../../apis/welfareArchive";
import ImportModal from "../../../components/importModal";
import TipLabel from "../../../components/TipLabel";
import UnifiedTable from "../../../components/UnifiedTable";
import { convertToUrlString } from "../../../util/url";
import { convertToUrlString, getURLParameters } from "../../../util/url";
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
import ImportDialog from "../../../components/importDialog";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
const APILIST = {
runStatuses: API["queryList"],
extWelArchiveList: API["getExtTable"]
};
@inject("archivesStore", "taxAgentStore")
@observer
export default class Archives extends React.Component {
@ -46,14 +51,20 @@ export default class Archives extends React.Component {
stayAdd: 0,
paying: 0,
stayDel: 0,
stopPay: 0
stopPay: 0,
ext: 0
},
pageInfo: {
current: 1,
pageSize: 10,
total: 0
},
salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0 否, 1
salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0 否, 1
importDialog: {
visible: false, title: "", nextloading: false,
link: "", importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/scheme/preview"
}
};
this.record = {};
}
@ -78,7 +89,7 @@ export default class Archives extends React.Component {
const formParams = form.getFormParams() || {};
const payload = { ...pageInfo };
this.setState({ loading: { ...loading, query: true } });
API.queryList({ ...formParams, ...payload, ...params }).then(({ data, status }) => {
APILIST[_.keys(params)[0]]({ ...formParams, ...payload, ...params }).then(({ data, status }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageInfo: paganition, columns, datas: dataSource } = data;
@ -309,8 +320,19 @@ export default class Archives extends React.Component {
// 导入
handleImport = (params) => {
const { archivesStore: { importBatch } } = this.props;
const { runStatus } = this.state;
importBatch({ ...params, runStatus });
const { runStatus, importDialog } = this.state;
this.setState(({
importDialog: {
...importDialog, nextloading: true, ...params
}
}));
importBatch({ ...params, runStatus }).then(({ status, data }) => {
this.setState(({
importDialog: {
...importDialog, nextloading: false, importResult: data, ...params
}
}));
});
};
// 导入完成
@ -375,9 +397,12 @@ export default class Archives extends React.Component {
case "suspend":
this.queryList({ runStatuses: ["3"] });
break;
default:
case "stop":
this.queryList({ runStatuses: ["4", "5"] });
break;
default:
this.queryList({ extWelArchiveList: true });
break;
}
};
handleMenuBtnClick = () => {
@ -564,13 +589,15 @@ export default class Archives extends React.Component {
{/*<div>4、数据进入【待减员】规则的第四种情况下若还需要在当前个税扣缴义务人下进行缴纳的话当前该员工的【待减员】数据进行【删除待办】操作即可若不在该个税扣缴义务人下继续缴纳维护好最后缴纳月后进行【减员】操作员工进入【停缴员工】</div>*/}
</div>;
break;
default:
case "stop":
dom = <div>
<div>1不需要缴纳社保福利的员工保存在停缴员工</div>
{/*<div>2、【停缴员工】点击取消停缴数据会回退到上次的位置从【待减员】减员到停缴员工的点击停缴返回到【在缴员工】不返回到【待减员】</div>*/}
{/*<div>3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后员工进入待【在缴员工】而在原个税扣缴义务人下的【停缴员工】中该员工数据将会被删除是否开启分权员工的档案数据都只保存一份</div>*/}
</div>;
break;
default:
break;
}
return dom;
};
@ -584,7 +611,8 @@ export default class Archives extends React.Component {
dataSource: dataSourceActive,
pageInfo,
tabCount,
loading
loading,
importDialog
} = this.state;
const {
form, condition, showSearchAd, setShowSearchAd,
@ -719,7 +747,7 @@ export default class Archives extends React.Component {
} type="ghost">
导出全部
</Dropdown.Button>
] : [
] : selectedKey === "stop" ? [
<WeaHelpfulTip
width={300}
title={<CancelHelpfulDiv/>}
@ -733,6 +761,15 @@ export default class Archives extends React.Component {
} type="ghost">
导出全部
</Dropdown.Button>
] : [<Button type="primary"
onClick={() => this.setState(({
runStatus: "2",
importDialog: {
...importDialog,
visible: true, title: getLabel(111, "非系统人员导入"),
link: "/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true"
}
}))}>导入</Button>
];
const pagination = {
@ -775,6 +812,7 @@ export default class Archives extends React.Component {
keyParam="viewcondition" //主键
selectedKey={selectedKey}
onChange={this.handleChangeTab}
autoCalculateWidth
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
@ -807,7 +845,7 @@ export default class Archives extends React.Component {
xWidth={this.getColumns().length * 120}
/>
{
!_.isEmpty(this.getColumns()) &&
!_.isEmpty(this.getColumns()) && selectedKey !== "ext" &&
<TipLabel>{this.getTipChildren()}</TipLabel>
}
</WeaNewScroll>
@ -878,6 +916,36 @@ export default class Archives extends React.Component {
this.setState({ selectedTab: "0" });
})}/>
}
<ImportDialog
{...importDialog}
onCancel={(isFresh) => this.setState({
importDialog: {
...importDialog,
visible: false, title: "", nextloading: false,
link: "", importResult: {}, imageId: ""
}
}, () => isFresh && this.query())}
onResetImportResult={() => this.setState(({
importDialog: { ...importDialog, importResult: {}, imageId: "" }
}))}
exportDataDom={
<WeaCheckbox content={getLabel(543208, "导出现有数据")}
value={getURLParameters(importDialog.link).exportData === "true" ? "1" : "0"}
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
onChange={val => {
const formParams = form.getFormParams() || {};
const payload = { exportData: val === "1", ...formParams };
this.setState(({
importDialog: {
...importDialog,
link: `/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true&${convertToUrlString(payload)}`
}
}));
}}
/>
}
nextCallback={imageId => this.handleImport({ imageId })}
/>
{
this.state.importVisible && <ImportModal
init={() => {

View File

@ -4,10 +4,6 @@
height: 100%;
background: #f6f6f6;
.wea-new-top-req-wapper .wea-new-top-req-main {
background: #f6f6f6 !important;
}
.wea-new-top-req-wapper .wea-new-top-req {
z-index: 0 !important;
}

View File

@ -336,7 +336,7 @@ export class ArchivesStore {
API.importBatch(params).then(res => {
if (res.status) {
this.importResult = res.data;
resolve();
resolve(res);
} else {
message.error(res.errormsg || "导入失败", 1);
reject();

View File

@ -1,11 +1,10 @@
// export const getQueryString = (name) => {
// let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
// let r = window.location.hash.split("?")[1].match(reg);
// if (r != null) {
// return decodeURIComponent(r[2]);
// };
// return null;
// }
export const getURLParameters = (url) =>
(url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
(a, v) => (
(a[v.slice(0, v.indexOf("="))] = v.slice(v.indexOf("=") + 1)), a
),
{}
);
export const getQueryString = (variable) => {
let split = window.location.hash.split("?");