2022-06-17 16:53:27 +08:00
|
|
|
|
import React from "react";
|
|
|
|
|
|
import { inject, observer } from "mobx-react";
|
|
|
|
|
|
import { toJS } from "mobx";
|
2022-09-09 10:29:12 +08:00
|
|
|
|
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
|
2022-12-01 14:28:30 +08:00
|
|
|
|
import { WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
|
2022-06-17 16:53:27 +08:00
|
|
|
|
import { WeaTableNew } from "comsMobx";
|
2022-07-28 17:16:40 +08:00
|
|
|
|
import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
2022-06-17 16:53:27 +08:00
|
|
|
|
import CustomTab from "../../../components/customTab";
|
|
|
|
|
|
import SlideModalTitle from "../../../components/slideModalTitle";
|
|
|
|
|
|
import TipLabel from "../../../components/TipLabel";
|
|
|
|
|
|
import DefaultSlideForm from "./defaultSlideForm";
|
|
|
|
|
|
import CustomNewModal from "./customNewModal";
|
2022-07-28 17:16:40 +08:00
|
|
|
|
import { paymentScopeEnum, welfareTypeEnum } from "./enum";
|
2022-06-17 16:53:27 +08:00
|
|
|
|
import CustomPaginationTable from "../../../components/customPaginationTable";
|
2022-07-28 17:16:40 +08:00
|
|
|
|
import TwoColContent from "../../../components/twoColContent";
|
|
|
|
|
|
import CopySchemaModal from "./copySchemaModal";
|
2022-09-15 11:08:13 +08:00
|
|
|
|
import "./index.less";
|
2022-02-25 09:24:56 +08:00
|
|
|
|
|
2022-07-28 17:16:40 +08:00
|
|
|
|
const WeaMobxTable = WeaTableNew.WeaTable;
|
2022-02-25 09:24:56 +08:00
|
|
|
|
|
2022-08-25 17:54:18 +08:00
|
|
|
|
@inject("programmeStore", "taxAgentStore", "salaryFileStore")
|
2022-02-25 09:24:56 +08:00
|
|
|
|
@observer
|
|
|
|
|
|
export default class Programme extends React.Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
|
super(props);
|
|
|
|
|
|
this.state = {
|
|
|
|
|
|
value: "",
|
|
|
|
|
|
searchValue: "",
|
2022-03-21 17:43:26 +08:00
|
|
|
|
slideVisiable: false,
|
2022-03-21 19:54:16 +08:00
|
|
|
|
currentOperate: "add",
|
|
|
|
|
|
copyModalValue: "",
|
|
|
|
|
|
copyId: "",
|
2022-04-01 15:02:18 +08:00
|
|
|
|
customNewVisible: false,
|
|
|
|
|
|
customEdit: false
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-06-07 09:08:36 +08:00
|
|
|
|
|
2022-06-17 16:53:27 +08:00
|
|
|
|
this.pageInfo = { current: 1, pageSize: 10 };
|
2022-02-25 09:24:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-12 17:07:11 +08:00
|
|
|
|
componentWillMount() {
|
2022-08-25 17:54:18 +08:00
|
|
|
|
const { programmeStore, salaryFileStore } = this.props;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { doInit } = programmeStore;
|
2022-03-12 17:07:11 +08:00
|
|
|
|
doInit();
|
2022-08-25 17:54:18 +08:00
|
|
|
|
const { commonEnumList } = salaryFileStore;
|
|
|
|
|
|
commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
|
2022-03-12 17:07:11 +08:00
|
|
|
|
}
|
2022-03-21 19:54:16 +08:00
|
|
|
|
|
|
|
|
|
|
// 增加编辑功能,重写columns绑定事件
|
2022-06-17 16:53:27 +08:00
|
|
|
|
getColumns = columns => {
|
|
|
|
|
|
let newColumns = columns.filter(
|
|
|
|
|
|
item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea"
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2022-04-22 17:00:10 +08:00
|
|
|
|
newColumns = newColumns.map(column => {
|
2022-03-21 19:54:16 +08:00
|
|
|
|
let newColumn = column;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
newColumn.render = (text, record, index) => {
|
|
|
|
|
|
//前端元素转义
|
|
|
|
|
|
let valueSpan =
|
|
|
|
|
|
record[newColumn.dataIndex + "span"] !== undefined
|
|
|
|
|
|
? record[newColumn.dataIndex + "span"]
|
|
|
|
|
|
: record[newColumn.dataIndex];
|
|
|
|
|
|
if (newColumn.dataIndex == "id") {
|
|
|
|
|
|
newColumn.display = false;
|
2022-04-22 17:00:10 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
switch (newColumn.dataIndex) {
|
2022-03-21 19:54:16 +08:00
|
|
|
|
case "operate":
|
2022-06-17 16:53:27 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<a
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
this.onEdit(record);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
编辑
|
|
|
|
|
|
</a>
|
|
|
|
|
|
);
|
2022-03-21 19:54:16 +08:00
|
|
|
|
default:
|
2022-07-28 17:16:40 +08:00
|
|
|
|
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
2022-03-21 19:54:16 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-21 19:54:16 +08:00
|
|
|
|
return newColumn;
|
|
|
|
|
|
});
|
2022-04-22 17:00:10 +08:00
|
|
|
|
|
|
|
|
|
|
newColumns.push({
|
|
|
|
|
|
title: "操作",
|
|
|
|
|
|
dataIndex: "operate",
|
|
|
|
|
|
render: (text, record) => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<a
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
this.onEdit(record);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
编辑
|
|
|
|
|
|
</a>
|
|
|
|
|
|
);
|
2022-04-22 17:00:10 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
});
|
|
|
|
|
|
newColumns.push({
|
|
|
|
|
|
key: "moreOperate",
|
|
|
|
|
|
dataIndex: "moreOperate",
|
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Dropdown
|
|
|
|
|
|
overlay={
|
|
|
|
|
|
<Menu>
|
|
|
|
|
|
<Menu.Item>
|
|
|
|
|
|
<a
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
this.onCopy(record);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
复制
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</Menu.Item>
|
2022-07-28 17:26:20 +08:00
|
|
|
|
{/*暂时隐藏*/}
|
2022-08-02 18:16:49 +08:00
|
|
|
|
<Menu.Item>
|
|
|
|
|
|
<a
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
this.onDelete(record);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
删除
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</Menu.Item>
|
2022-06-17 16:53:27 +08:00
|
|
|
|
</Menu>
|
|
|
|
|
|
}>
|
2022-11-02 15:18:03 +08:00
|
|
|
|
<a href="javascript:void(0)" style={{ textDecoration: "none" }}>
|
|
|
|
|
|
<i
|
|
|
|
|
|
className="icon-coms-more"
|
|
|
|
|
|
style={{ fontSize: 18 }}>
|
|
|
|
|
|
</i>
|
|
|
|
|
|
</a>
|
2022-06-17 16:53:27 +08:00
|
|
|
|
</Dropdown>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2022-03-21 19:54:16 +08:00
|
|
|
|
return newColumns;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-21 19:54:16 +08:00
|
|
|
|
|
2022-04-01 09:28:05 +08:00
|
|
|
|
handleCategoryStatusChange(record, value) {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { programmeStore: { updateCustomCategoryStatus } } = this.props;
|
2022-04-01 09:28:05 +08:00
|
|
|
|
Modal.confirm({
|
2022-06-17 16:53:27 +08:00
|
|
|
|
title: "信息确认",
|
|
|
|
|
|
content: `确认要${value ? "启用" : "停用"}吗`,
|
|
|
|
|
|
onOk: () => {
|
|
|
|
|
|
updateCustomCategoryStatus(record.id, value);
|
2022-04-01 09:28:05 +08:00
|
|
|
|
},
|
2022-07-28 17:16:40 +08:00
|
|
|
|
onCancel: () => {
|
|
|
|
|
|
}
|
2022-04-01 09:28:05 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-17 16:53:27 +08:00
|
|
|
|
getCustomColumns = columns => {
|
2022-06-21 17:35:19 +08:00
|
|
|
|
const { taxAgentStore: { showOperateBtn } } = this.props;
|
|
|
|
|
|
let newColumns = [];
|
2022-10-17 10:03:01 +08:00
|
|
|
|
newColumns = columns.map(column => {
|
2022-03-22 18:53:05 +08:00
|
|
|
|
let newColumn = column;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
newColumn.render = (text, record, index) => {
|
|
|
|
|
|
//前端元素转义
|
|
|
|
|
|
let valueSpan =
|
|
|
|
|
|
record[newColumn.dataIndex + "span"] !== undefined
|
|
|
|
|
|
? record[newColumn.dataIndex + "span"]
|
|
|
|
|
|
: record[newColumn.dataIndex];
|
|
|
|
|
|
switch (newColumn.dataIndex) {
|
2022-03-22 18:53:05 +08:00
|
|
|
|
case "operate":
|
2022-06-17 16:53:27 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<a
|
2022-10-17 10:03:01 +08:00
|
|
|
|
href="javascript:void(0);"
|
2022-06-17 16:53:27 +08:00
|
|
|
|
onClick={() => {
|
|
|
|
|
|
this.onCustomEdit(record);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
编辑
|
|
|
|
|
|
</a>
|
|
|
|
|
|
);
|
2022-04-01 09:28:05 +08:00
|
|
|
|
case "is_use":
|
2022-06-17 16:53:27 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<Switch
|
2022-06-21 17:35:19 +08:00
|
|
|
|
disabled={!showOperateBtn}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
checked={text == 1}
|
|
|
|
|
|
onChange={value => {
|
|
|
|
|
|
this.handleCategoryStatusChange(record, value);
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
);
|
2022-03-22 18:53:05 +08:00
|
|
|
|
default:
|
2022-07-28 17:16:40 +08:00
|
|
|
|
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
2022-03-22 18:53:05 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-22 18:53:05 +08:00
|
|
|
|
return newColumn;
|
|
|
|
|
|
});
|
|
|
|
|
|
return newColumns;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-22 18:53:05 +08:00
|
|
|
|
|
2022-03-21 19:54:16 +08:00
|
|
|
|
onEdit(record) {
|
|
|
|
|
|
let id = record.id;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { programmeStore } = this.props;
|
|
|
|
|
|
const { getForm, selectedKey } = programmeStore;
|
2022-03-21 19:54:16 +08:00
|
|
|
|
getForm({
|
|
|
|
|
|
welfareTypeEnum: selectedKey,
|
|
|
|
|
|
id
|
2022-06-17 16:53:27 +08:00
|
|
|
|
});
|
2022-08-25 17:54:18 +08:00
|
|
|
|
this.setState({ slideVisiable: true, customEdit: true, currentOperate: "update" });
|
2022-03-21 19:54:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onCopy(record) {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
copyId: record.id,
|
2022-07-28 17:16:40 +08:00
|
|
|
|
copyModalValue: record.schemeName,
|
2022-03-21 19:54:16 +08:00
|
|
|
|
copyModalVisible: true
|
2022-06-17 16:53:27 +08:00
|
|
|
|
});
|
2022-03-21 19:54:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-28 17:16:40 +08:00
|
|
|
|
onDelete = (record) => {
|
2022-08-25 17:54:18 +08:00
|
|
|
|
const { programmeStore: { deleteScheme, deleteLoading, selectedKey } } = this.props;
|
2022-07-28 17:16:40 +08:00
|
|
|
|
Modal.confirm({
|
|
|
|
|
|
title: "确认信息",
|
|
|
|
|
|
content: "确认删除本条数据吗?",
|
|
|
|
|
|
confirmLoading: deleteLoading,
|
|
|
|
|
|
onOk: () => {
|
2022-08-25 17:54:18 +08:00
|
|
|
|
deleteScheme({ ids: [record.id], welfareTypeEnum: selectedKey });
|
2022-07-28 17:16:40 +08:00
|
|
|
|
},
|
|
|
|
|
|
onCancel: () => {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-03-22 18:53:05 +08:00
|
|
|
|
onCustomOperatesClick(record, index, operate, flag) {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
switch (operate.text.toString()) {
|
|
|
|
|
|
case "编辑": // 编辑
|
2022-03-22 18:53:05 +08:00
|
|
|
|
this.onCustomEdit(record);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-01 15:50:54 +08:00
|
|
|
|
onCustomEdit = (record) => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const {
|
2022-06-21 17:35:19 +08:00
|
|
|
|
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest },
|
|
|
|
|
|
taxAgentStore: { showOperateBtn }
|
2022-06-17 16:53:27 +08:00
|
|
|
|
} = this.props;
|
2022-07-28 17:16:40 +08:00
|
|
|
|
if (!showOperateBtn) {
|
2022-06-21 17:35:19 +08:00
|
|
|
|
message.warning("请设置编辑权限!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
getCustomForm();
|
|
|
|
|
|
setCustomNewVisible(true);
|
2022-04-01 15:02:18 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
customEdit: true
|
2022-06-17 16:53:27 +08:00
|
|
|
|
});
|
2022-04-01 15:02:18 +08:00
|
|
|
|
setCustomRequest({
|
2022-06-17 16:53:27 +08:00
|
|
|
|
insuranceName: record["insurance_name"],
|
2022-04-01 15:02:18 +08:00
|
|
|
|
id: record.id,
|
|
|
|
|
|
isUse: record.is_use,
|
2022-11-01 15:50:54 +08:00
|
|
|
|
paymentScope: record["payment_scope"].split(",").map(item => paymentScopeEnum[item]).join(","),
|
2022-04-01 15:02:18 +08:00
|
|
|
|
welfareType: welfareTypeEnum[record.welfare_type]
|
2022-06-17 16:53:27 +08:00
|
|
|
|
});
|
2022-11-01 15:50:54 +08:00
|
|
|
|
};
|
2022-03-22 18:53:05 +08:00
|
|
|
|
|
2022-06-17 16:53:27 +08:00
|
|
|
|
// 页面跳转
|
|
|
|
|
|
handlePageChange(value) {
|
|
|
|
|
|
const { programmeStore: { form, getTableDatas, selectedKey } } = this.props;
|
|
|
|
|
|
this.pageInfo.current = value;
|
|
|
|
|
|
getTableDatas(selectedKey, this.pageInfo);
|
2022-05-18 17:10:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-12 17:07:11 +08:00
|
|
|
|
render() {
|
2022-06-21 11:33:00 +08:00
|
|
|
|
const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const {
|
|
|
|
|
|
loading,
|
|
|
|
|
|
hasRight,
|
|
|
|
|
|
form,
|
|
|
|
|
|
condition,
|
|
|
|
|
|
tableStore,
|
|
|
|
|
|
showSearchAd,
|
|
|
|
|
|
getTableDatas,
|
|
|
|
|
|
doSearch,
|
|
|
|
|
|
setShowSearchAd
|
|
|
|
|
|
} = programmeStore;
|
|
|
|
|
|
const {
|
|
|
|
|
|
selectedKey,
|
|
|
|
|
|
setSelectedKey,
|
|
|
|
|
|
getCustomCategoryList,
|
|
|
|
|
|
customTableStore,
|
|
|
|
|
|
customSelectkey,
|
|
|
|
|
|
setCustomSelectkey,
|
|
|
|
|
|
requestParams,
|
|
|
|
|
|
setRequestParams,
|
|
|
|
|
|
formCondition,
|
|
|
|
|
|
setCustomNewVisible,
|
|
|
|
|
|
customNewVisible,
|
|
|
|
|
|
tableDataSource,
|
|
|
|
|
|
tableColumns,
|
|
|
|
|
|
tablePageInfo
|
|
|
|
|
|
} = programmeStore;
|
|
|
|
|
|
if (!hasRight && !loading) {
|
|
|
|
|
|
// 无权限处理
|
2022-02-25 09:24:56 +08:00
|
|
|
|
return renderNoright();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const rightMenu = [
|
|
|
|
|
|
// 右键菜单
|
2022-02-25 09:24:56 +08:00
|
|
|
|
];
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const collectParams = {
|
|
|
|
|
|
// 收藏功能配置
|
|
|
|
|
|
favname: "社保福利方案",
|
2022-02-25 09:24:56 +08:00
|
|
|
|
favouritetype: 1,
|
|
|
|
|
|
objid: 0,
|
2022-06-17 16:53:27 +08:00
|
|
|
|
link: "wui/index.html#/ns_demo03/index",
|
|
|
|
|
|
importantlevel: 1
|
2022-02-25 09:24:56 +08:00
|
|
|
|
};
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const adBtn = [
|
|
|
|
|
|
// 高级搜索内部按钮
|
|
|
|
|
|
<Button type="primary" onClick={doSearch}>
|
|
|
|
|
|
搜索
|
|
|
|
|
|
</Button>,
|
|
|
|
|
|
<Button type="ghost" onClick={() => form.resetForm()}>
|
|
|
|
|
|
重置
|
|
|
|
|
|
</Button>,
|
|
|
|
|
|
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
2022-02-25 09:24:56 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const topTab = [
|
2022-02-28 09:29:46 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: "社保",
|
2022-03-12 17:07:11 +08:00
|
|
|
|
viewcondition: "SOCIAL_SECURITY"
|
2022-02-28 09:29:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: "公积金",
|
2022-03-12 17:07:11 +08:00
|
|
|
|
viewcondition: "ACCUMULATION_FUND"
|
2022-02-28 09:29:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: "企业年金及其他福利",
|
2022-03-12 17:07:11 +08:00
|
|
|
|
viewcondition: "OTHER"
|
2022-02-28 09:29:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: "自定义福利",
|
2022-03-12 17:07:11 +08:00
|
|
|
|
viewcondition: "custom"
|
2022-02-28 09:29:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
];
|
2022-02-25 09:24:56 +08:00
|
|
|
|
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const options = [
|
2022-04-01 10:39:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
showname: "全部",
|
|
|
|
|
|
key: ""
|
|
|
|
|
|
},
|
2022-03-14 11:07:17 +08:00
|
|
|
|
{
|
|
|
|
|
|
showname: "社保",
|
2022-06-17 16:53:27 +08:00
|
|
|
|
key: "SOCIAL_SECURITY"
|
2022-03-14 11:07:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
showname: "公积金",
|
2022-06-17 16:53:27 +08:00
|
|
|
|
key: "ACCUMULATION_FUND"
|
2022-03-14 11:07:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
showname: "企业年金及其他福利",
|
2022-03-21 19:54:16 +08:00
|
|
|
|
key: "OTHER"
|
2022-03-14 11:07:17 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
];
|
2022-03-14 11:07:17 +08:00
|
|
|
|
|
2022-03-21 17:43:26 +08:00
|
|
|
|
const handleNewClick = () => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const {
|
|
|
|
|
|
programmeStore: { initSlideParms, getForm, selectedKey }
|
|
|
|
|
|
} = this.props;
|
2022-03-28 10:53:19 +08:00
|
|
|
|
initSlideParms();
|
2022-06-17 16:53:27 +08:00
|
|
|
|
this.setState({ slideVisiable: true, currentOperate: "add" });
|
|
|
|
|
|
getForm({ welfareTypeEnum: selectedKey });
|
|
|
|
|
|
};
|
2022-03-21 17:43:26 +08:00
|
|
|
|
|
2022-03-22 16:53:39 +08:00
|
|
|
|
const handleCustomNewClick = () => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const {
|
|
|
|
|
|
programmeStore: {
|
|
|
|
|
|
getCustomForm,
|
|
|
|
|
|
setCustomNewVisible,
|
|
|
|
|
|
setCustomRequest
|
|
|
|
|
|
}
|
|
|
|
|
|
} = this.props;
|
|
|
|
|
|
getCustomForm();
|
|
|
|
|
|
setCustomRequest({});
|
|
|
|
|
|
setCustomNewVisible(true);
|
|
|
|
|
|
this.setState({ customEdit: false });
|
|
|
|
|
|
};
|
2022-03-22 16:53:39 +08:00
|
|
|
|
|
2022-05-30 17:30:53 +08:00
|
|
|
|
// const renderSearchOperationItem = () => {
|
|
|
|
|
|
// const { programmeStore: {setCustomSelectkey, getCustomCategoryList}} = this.props;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
// return
|
2022-05-30 17:30:53 +08:00
|
|
|
|
// }
|
2022-02-28 09:29:46 +08:00
|
|
|
|
|
2022-03-21 17:43:26 +08:00
|
|
|
|
const handleOnSave = () => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { programmeStore } = this.props;
|
|
|
|
|
|
const { currentOperate } = this.state;
|
|
|
|
|
|
const {
|
|
|
|
|
|
selectedKey,
|
|
|
|
|
|
defaultPersonDataSource,
|
|
|
|
|
|
defaultCompanyDataSource,
|
|
|
|
|
|
createScheme,
|
|
|
|
|
|
requestParams,
|
|
|
|
|
|
updateScheme
|
|
|
|
|
|
} = programmeStore;
|
2022-08-25 17:54:18 +08:00
|
|
|
|
let { schemeName, remarks, paymentArea, paymentType, sharedType, taxAgentIds } = requestParams;
|
2022-03-21 17:43:26 +08:00
|
|
|
|
let request = {
|
|
|
|
|
|
insuranceScheme: {
|
2022-05-18 17:10:12 +08:00
|
|
|
|
paymentType,
|
2022-03-21 17:43:26 +08:00
|
|
|
|
welfareType: selectedKey,
|
|
|
|
|
|
schemeName,
|
|
|
|
|
|
remarks,
|
2022-08-25 17:54:18 +08:00
|
|
|
|
paymentArea,
|
|
|
|
|
|
sharedType,
|
|
|
|
|
|
taxAgentIds
|
2022-03-21 17:43:26 +08:00
|
|
|
|
},
|
2022-06-17 16:53:27 +08:00
|
|
|
|
insuranceSchemeDetailList: [
|
|
|
|
|
|
...defaultPersonDataSource,
|
|
|
|
|
|
...defaultCompanyDataSource
|
|
|
|
|
|
]
|
|
|
|
|
|
};
|
|
|
|
|
|
if (currentOperate == "add") {
|
2022-08-25 17:54:18 +08:00
|
|
|
|
createScheme(request).then(res => {
|
|
|
|
|
|
if (res.status) this.setState({ slideVisiable: false });
|
|
|
|
|
|
});
|
2022-06-17 16:53:27 +08:00
|
|
|
|
} else if (currentOperate == "update") {
|
|
|
|
|
|
request.insuranceScheme.id = requestParams.id;
|
2022-08-25 17:54:18 +08:00
|
|
|
|
updateScheme(request).then(res => {
|
|
|
|
|
|
if (res.status) this.setState({ slideVisiable: false });
|
|
|
|
|
|
});
|
2022-03-21 17:43:26 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-02-25 09:24:56 +08:00
|
|
|
|
|
2022-03-12 17:07:11 +08:00
|
|
|
|
const renderCustomRightContent = () => {
|
|
|
|
|
|
let tipList = [
|
|
|
|
|
|
"1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项,如:残疾保险等",
|
|
|
|
|
|
"2、新增自定义福利默认启用,社保福利方案中的自定义福利项均未开启缴纳,当前页面的自定义福利项才可以停用;停用后再新增方案时没有该福利项",
|
|
|
|
|
|
"3、自定义福利若要缴纳,需要在方案里填写缴纳相关数据"
|
2022-06-17 16:53:27 +08:00
|
|
|
|
];
|
2022-07-28 17:16:40 +08:00
|
|
|
|
return <TipLabel tipList={tipList}/>;
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-12 17:07:11 +08:00
|
|
|
|
|
2022-03-21 19:54:16 +08:00
|
|
|
|
const handleCopyModalSave = () => {
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { programmeStore: { copyScheme } } = this.props;
|
2022-03-21 19:54:16 +08:00
|
|
|
|
const { copyId, copyModalValue } = this.state;
|
2022-10-17 10:03:01 +08:00
|
|
|
|
if (_.isEmpty(this.refs.copyRef.state.value)) {
|
2022-09-09 10:29:12 +08:00
|
|
|
|
this.refs.copyRef.refs.weaError.showError();
|
2022-10-17 10:03:01 +08:00
|
|
|
|
} else {
|
2022-09-13 16:39:15 +08:00
|
|
|
|
copyScheme({ id: copyId, schemeName: copyModalValue }).then(() => {
|
|
|
|
|
|
this.setState({ copyModalVisible: false });
|
2022-10-17 10:03:01 +08:00
|
|
|
|
});
|
2022-09-09 10:29:12 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
};
|
2022-03-21 19:54:16 +08:00
|
|
|
|
|
2022-03-28 10:53:19 +08:00
|
|
|
|
const handleSlideClose = () => {
|
2022-08-25 17:54:18 +08:00
|
|
|
|
this.setState({ slideVisiable: false, customEdit: false });
|
2022-06-17 16:53:27 +08:00
|
|
|
|
const { programmeStore: { initSlideParms } } = this.props;
|
|
|
|
|
|
initSlideParms();
|
|
|
|
|
|
};
|
2022-03-28 10:53:19 +08:00
|
|
|
|
|
2022-02-25 09:24:56 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<div className="mySalaryBenefitsWrapper">
|
2022-12-01 14:28:30 +08:00
|
|
|
|
<WeaTop
|
|
|
|
|
|
title="社保福利方案" // 文字
|
|
|
|
|
|
icon={<i className="icon-coms-fa"/>} // 左侧图标
|
|
|
|
|
|
iconBgcolor="#F14A2D" // 左侧图标背景色
|
|
|
|
|
|
showDropIcon={false} // 是否显示下拉按钮
|
|
|
|
|
|
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
|
|
|
|
|
dropMenuProps={{ collectParams }}>
|
2022-06-17 16:53:27 +08:00
|
|
|
|
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
2022-12-01 14:28:30 +08:00
|
|
|
|
<CustomTab
|
|
|
|
|
|
topTab={topTab}
|
|
|
|
|
|
searchOperationItem={
|
|
|
|
|
|
<div>
|
|
|
|
|
|
{/* 操作按钮权限 */}
|
|
|
|
|
|
{showOperateBtn &&
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
style={{ marginRight: "10px" }}
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
if (selectedKey == "custom") {
|
|
|
|
|
|
handleCustomNewClick();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
handleNewClick();
|
|
|
|
|
|
}
|
|
|
|
|
|
}}>
|
|
|
|
|
|
新建
|
|
|
|
|
|
</Button>}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
|
2022-12-01 14:28:30 +08:00
|
|
|
|
{selectedKey == "custom" &&
|
|
|
|
|
|
<WeaSelect
|
|
|
|
|
|
options={options}
|
|
|
|
|
|
value={customSelectkey}
|
|
|
|
|
|
style={{ width: "150px" }}
|
|
|
|
|
|
onChange={v => {
|
|
|
|
|
|
setCustomSelectkey(v);
|
|
|
|
|
|
getCustomCategoryList(v);
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
onChange={v => {
|
|
|
|
|
|
setSelectedKey(v);
|
|
|
|
|
|
handleSlideClose();
|
|
|
|
|
|
if (v == "custom") {
|
|
|
|
|
|
// 自定义福利
|
|
|
|
|
|
getCustomCategoryList();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
getTableDatas(v);
|
2022-02-25 09:24:56 +08:00
|
|
|
|
}
|
2022-12-01 14:28:30 +08:00
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
{selectedKey == "custom"
|
|
|
|
|
|
? <TwoColContent
|
|
|
|
|
|
leftContent={
|
|
|
|
|
|
<WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
|
|
|
|
|
comsWeaTableStore={tableStore} // table store
|
|
|
|
|
|
hasOrder={true} // 是否启用排序
|
|
|
|
|
|
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
|
|
|
|
|
getColumns={this.getCustomColumns}
|
|
|
|
|
|
onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
|
|
|
|
|
rightContent={renderCustomRightContent()}
|
2022-02-25 09:24:56 +08:00
|
|
|
|
/>
|
2022-12-01 14:28:30 +08:00
|
|
|
|
: <CustomPaginationTable
|
|
|
|
|
|
loading={loading}
|
|
|
|
|
|
columns={this.getColumns(tableColumns)}
|
|
|
|
|
|
dataSource={tableDataSource}
|
|
|
|
|
|
total={toJS(tablePageInfo).total}
|
|
|
|
|
|
current={toJS(tablePageInfo).pageNum}
|
|
|
|
|
|
pageSize={this.pageInfo.pageSize}
|
|
|
|
|
|
onPageChange={value => {
|
|
|
|
|
|
this.handlePageChange(value);
|
|
|
|
|
|
}}
|
|
|
|
|
|
onShowSizeChange={(current, pageSize) => {
|
|
|
|
|
|
this.pageInfo = { current, pageSize };
|
|
|
|
|
|
const {
|
|
|
|
|
|
programmeStore: { form, getTableDatas, selectedKey }
|
|
|
|
|
|
} = this.props;
|
|
|
|
|
|
getTableDatas(selectedKey, this.pageInfo);
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>}
|
|
|
|
|
|
</WeaTop>
|
2022-08-25 17:54:18 +08:00
|
|
|
|
<WeaSlideModal
|
2022-09-13 16:39:15 +08:00
|
|
|
|
className="slideOuterWrapper"
|
2022-08-25 17:54:18 +08:00
|
|
|
|
visible={this.state.slideVisiable}
|
|
|
|
|
|
top={0}
|
2022-10-31 14:49:24 +08:00
|
|
|
|
width={60}
|
2022-08-25 17:54:18 +08:00
|
|
|
|
height={100}
|
|
|
|
|
|
direction={"right"}
|
|
|
|
|
|
measure={"%"}
|
|
|
|
|
|
title={
|
|
|
|
|
|
<SlideModalTitle
|
|
|
|
|
|
subtitle={this.state.customEdit ? "修改" : "新增"}
|
|
|
|
|
|
subTabs={[{ title: "基础设置" }]}
|
|
|
|
|
|
editable={true}
|
|
|
|
|
|
showOperateBtn={showOperateBtn}
|
|
|
|
|
|
onSave={() => {
|
|
|
|
|
|
handleOnSave();
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
|
|
|
|
|
content={
|
2022-11-01 15:50:54 +08:00
|
|
|
|
this.state.slideVisiable ?
|
|
|
|
|
|
<DefaultSlideForm
|
|
|
|
|
|
customEditVisible={this.state.customEdit}
|
|
|
|
|
|
requestParams={requestParams}
|
|
|
|
|
|
onChange={requestParams => {
|
|
|
|
|
|
setRequestParams(requestParams);
|
|
|
|
|
|
}}
|
|
|
|
|
|
/> : null
|
2022-08-25 17:54:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
onClose={() => {
|
|
|
|
|
|
handleSlideClose();
|
|
|
|
|
|
}}
|
|
|
|
|
|
showMask={true}
|
|
|
|
|
|
closeMaskOnClick={() => {
|
|
|
|
|
|
handleSlideClose();
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
2022-06-17 16:53:27 +08:00
|
|
|
|
|
|
|
|
|
|
{this.state.copyModalVisible &&
|
|
|
|
|
|
<CopySchemaModal
|
2022-10-17 10:03:01 +08:00
|
|
|
|
ref="copyRef"
|
2022-07-28 17:16:40 +08:00
|
|
|
|
title={_.filter(topTab, it => it.viewcondition === selectedKey)[0].title}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
visible={this.state.copyModalVisible}
|
|
|
|
|
|
value={this.state.copyModalValue}
|
|
|
|
|
|
onChange={value => this.setState({ copyModalValue: value })}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
this.setState({ copyModalVisible: false });
|
|
|
|
|
|
}}
|
|
|
|
|
|
footer={
|
2022-09-09 10:29:12 +08:00
|
|
|
|
[<Button
|
2022-06-17 16:53:27 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
handleCopyModalSave();
|
|
|
|
|
|
}}>
|
|
|
|
|
|
保存
|
2022-09-09 10:29:12 +08:00
|
|
|
|
</Button>]
|
2022-03-21 19:54:16 +08:00
|
|
|
|
}
|
2022-06-17 16:53:27 +08:00
|
|
|
|
/>}
|
|
|
|
|
|
|
|
|
|
|
|
{customNewVisible &&
|
|
|
|
|
|
<CustomNewModal
|
|
|
|
|
|
visible={customNewVisible}
|
|
|
|
|
|
condition={formCondition}
|
|
|
|
|
|
form={form}
|
|
|
|
|
|
edit={this.state.customEdit}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
setCustomNewVisible(false);
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>}
|
2022-02-25 09:24:56 +08:00
|
|
|
|
</div>
|
2022-06-17 16:53:27 +08:00
|
|
|
|
);
|
2022-02-25 09:24:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|