Merge branch 'feature/v2-专项附加扣除-1103' into develop
This commit is contained in:
commit
5508fcb9da
|
|
@ -123,3 +123,7 @@ export const deleteSelectAddUpDeduction = (params) => {
|
|||
export const deleteAllAddUpDeduction = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params);
|
||||
}
|
||||
//一键累计
|
||||
export const autoAddAll = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpDeduction/autoAddAll', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
//高级搜索条件
|
||||
export const getSearchCondition = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/specialAddDeduction/getSearchCondition", "GET", params);
|
||||
};
|
||||
// 获取专项附加扣除列表
|
||||
export const specialAddDeductionList = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/list', params);
|
||||
}
|
||||
// 新增专项附加扣除
|
||||
export const specialAddDeductionCreateData = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/createData', params);
|
||||
}
|
||||
// 编辑专项附加扣除
|
||||
export const specialAddDeductionEditData = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/editData', params);
|
||||
}
|
||||
// 查看明细
|
||||
export const specialAddDeductionGetDetailList = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/getDetailList', params);
|
||||
}
|
||||
// 批量专项附加扣除
|
||||
export const specialAddDeductionDeleteSelectData = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/deleteSelectData', params);
|
||||
}
|
||||
// 一键清空
|
||||
export const specialAddDeductionDeleteAllData = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/deleteAllData', params);
|
||||
}
|
||||
// 查看单条信息
|
||||
export const getSpecialAddDeduction = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/getSpecialAddDeduction', params);
|
||||
}
|
||||
// 导入预览
|
||||
export const specialAddDeductionPreview = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/preview', params);
|
||||
}
|
||||
// 导入预览结果
|
||||
export const specialAddDeductionImportData = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/specialAddDeduction/importData', params);
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import CumDeduct from "./pages/dataAcquisition/cumDeduct";
|
|||
import OtherDeduct from "./pages/dataAcquisition/otherDeduct";
|
||||
import CumSituation from "./pages/dataAcquisition/cumSituation";
|
||||
import Attendance from "./pages/dataAcquisition/attendance";
|
||||
import SpecialAddDeduction from './pages/dataAcquisition/specialAddDeduction';
|
||||
import Ledger from "./pages/ledger";
|
||||
import Calculate from "./pages/calculate";
|
||||
import Payroll from "./pages/payroll";
|
||||
|
|
@ -61,6 +62,7 @@ const DataAcquisition = (props) => props.children;
|
|||
// otherDeduct 其他免税扣除
|
||||
// cumSituation 往期累计情况
|
||||
// attendance 考勤引用
|
||||
// specialAddDeduction 专项附件扣除
|
||||
// ledger 薪资账套
|
||||
// calculate 薪资核算
|
||||
// calculateDetail 核算详情
|
||||
|
|
@ -111,6 +113,7 @@ const Routes = (
|
|||
<Route key="otherDeduct" path="otherDeduct" component={OtherDeduct} />
|
||||
<Route key="cumSituation" path="cumSituation" component={CumSituation} />
|
||||
<Route key="attendance" path="attendance" component={Attendance} />
|
||||
<Route key="specialAddDeduction" path="specialAddDeduction" component={SpecialAddDeduction} />
|
||||
</Route>
|
||||
<Route key="ledger" path="ledger" component={Ledger} />
|
||||
<Route key="calculate" path="calculate" component={Calculate} />
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ class AddItems extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { taxAgentOption = [], form, condition = [], isCum, editId } = this.props;
|
||||
const { taxAgentOption = [], form, condition = [], isCum, isSpecial, editId } = this.props;
|
||||
const { baseInfo } = this.state;
|
||||
const items = [
|
||||
let items = [
|
||||
{
|
||||
com: PickDate({
|
||||
label: "税款所属期",
|
||||
|
|
@ -161,7 +161,7 @@ class AddItems extends Component {
|
|||
})
|
||||
}
|
||||
];
|
||||
|
||||
isSpecial && items.shift();
|
||||
return (
|
||||
<div className="addItemsWrapper">
|
||||
<WeaSearchGroup
|
||||
|
|
|
|||
|
|
@ -139,6 +139,78 @@ export const modalColumns = [
|
|||
key: "addUpIllnessMedical"
|
||||
}
|
||||
];
|
||||
export const specialModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "子女教育",
|
||||
dataIndex: "childrenEducation",
|
||||
key: "childrenEducation"
|
||||
},
|
||||
{
|
||||
title: "继续教育",
|
||||
dataIndex: "continuingEducation",
|
||||
key: "continuingEducation"
|
||||
},
|
||||
{
|
||||
title: "住房贷款利息",
|
||||
dataIndex: "housingLoanInterest",
|
||||
key: "housingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "住房租金",
|
||||
dataIndex: "housingRent",
|
||||
key: "housingRent"
|
||||
},
|
||||
{
|
||||
title: "赡养老人",
|
||||
dataIndex: "supportingElder",
|
||||
key: "supportingElder"
|
||||
},
|
||||
{
|
||||
title: "婴幼儿照护",
|
||||
dataIndex: "infantCare",
|
||||
key: "infantCare"
|
||||
},
|
||||
{
|
||||
title: "大病医疗",
|
||||
dataIndex: "seriousIllnessTreatment",
|
||||
key: "seriousIllnessTreatment"
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
export const dataSource = [];
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default class CumDeduct extends React.Component {
|
|||
addVisible: false,
|
||||
editId: {},
|
||||
saveLoading: false,
|
||||
addAllLoading: false,
|
||||
value: "",
|
||||
selectedKey: [],
|
||||
slideSelectedKey: [], //详情表格的选中项
|
||||
|
|
@ -411,9 +412,35 @@ export default class CumDeduct extends React.Component {
|
|||
});
|
||||
}
|
||||
};
|
||||
autoAddAll = () => {
|
||||
const { monthValue: declareMonth, taxAgentId } = this.state;
|
||||
const { cumDeductStore: { doSearch } } = this.props;
|
||||
this.setState({ addAllLoading: true });
|
||||
API.autoAddAll({}).then(({ status, errormsg }) => {
|
||||
this.setState({ addAllLoading: false });
|
||||
if (status) {
|
||||
message.success("操作成功");
|
||||
doSearch({
|
||||
declareMonth: [declareMonth],
|
||||
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg || "操作失败");
|
||||
}
|
||||
}).catch(() => this.setState({ addAllLoading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state;
|
||||
const {
|
||||
modalParam,
|
||||
slideSelectedKey,
|
||||
monthValue,
|
||||
taxAgentId,
|
||||
addVisible,
|
||||
editId,
|
||||
saveLoading,
|
||||
addAllLoading
|
||||
} = this.state;
|
||||
const { cumDeductStore, taxAgentStore } = this.props;
|
||||
const {
|
||||
loading,
|
||||
|
|
@ -546,7 +573,13 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
type="ghost">
|
||||
一键清空
|
||||
</Dropdown.Button>
|
||||
</Dropdown.Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
loading={addAllLoading}
|
||||
onClick={this.autoAddAll}>
|
||||
一键累计
|
||||
</Button>
|
||||
];
|
||||
|
||||
const handleExportAllDetailClick = () => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
export const condition = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["childrenEducation"],
|
||||
fieldcol: 14,
|
||||
label: "子女教育",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["continuingEducation"],
|
||||
fieldcol: 14,
|
||||
label: "继续教育",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["housingLoanInterest"],
|
||||
fieldcol: 14,
|
||||
label: "住房贷款利息",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["housingRent"],
|
||||
fieldcol: 14,
|
||||
label: "住房租金",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["supportingElder"],
|
||||
fieldcol: 14,
|
||||
label: "赡养老人",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["seriousIllnessTreatment"],
|
||||
fieldcol: 14,
|
||||
label: "大病医疗",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["infantCare"],
|
||||
fieldcol: 14,
|
||||
label: "婴幼儿照护",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: '数据采集',
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import React, { Component } from "react";
|
||||
import { Form } from "antd";
|
||||
import { WeaSelect } from "ecCom";
|
||||
import { optionAddWhole } from "../../../../util/options";
|
||||
|
||||
class InlineForm extends Component {
|
||||
|
||||
render() {
|
||||
const { taxAgentOption = [], form, onChange } = this.props;
|
||||
return (
|
||||
<Form inline>
|
||||
<Form.Item label="个税扣缴义务人">
|
||||
<WeaSelect
|
||||
style={{ width: 200 }}
|
||||
showSearch // 设置select可搜索
|
||||
options={optionAddWhole(taxAgentOption)}
|
||||
{...form.getFieldProps("taxAgentId", { initialValue: "", onChange })}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Form.create()(InlineForm);
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import * as API from "../../../../apis/special";
|
||||
|
||||
class SpecialAddContent extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.specialId !== this.props.specialId) {
|
||||
nextProps.specialId && this.specialAddDeductionGetDetailList({ specialAddDeductionId: nextProps.specialId });
|
||||
}
|
||||
}
|
||||
|
||||
specialAddDeductionGetDetailList = (payload) => {
|
||||
this.setState({ loading: { ...this.state.loading, query: true } });
|
||||
API.specialAddDeductionGetDetailList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...this.state.loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageSize, pageNum, total } = data;
|
||||
this.setState({
|
||||
columns, dataSource,
|
||||
pageInfo: {
|
||||
...this.pageInfo,
|
||||
pageSize, pageNum, total
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { columns, dataSource, pageInfo, selectedRowKeys, loading } = this.state;
|
||||
const { specialId } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.specialAddDeductionGetDetailList({ specialAddDeductionId: specialId, current, pageSize });
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.specialAddDeductionGetDetailList({ specialAddDeductionId: specialId, current });
|
||||
});
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SpecialAddContent;
|
||||
|
|
@ -0,0 +1,645 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Col, Dropdown, Menu, message, Modal, Popover, Row } from "antd";
|
||||
import { WeaPopoverHrm, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTools, WeaTop } from "ecCom";
|
||||
import InlineForm from "./components/inlineForm";
|
||||
import { getSearchs, renderLoading } from "../../../util";
|
||||
import * as API from "../../../apis/special";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import AddItems from "../addItems";
|
||||
import SpecialAddContent from "./components/specialAddContent";
|
||||
import { condition } from "./components/condition";
|
||||
import ImportModal from "../../../components/importModal";
|
||||
import { specialModalColumns } from "../cumDeduct/columns";
|
||||
import "./index.less";
|
||||
|
||||
@inject("specialAddStore", "taxAgentStore")
|
||||
@observer
|
||||
class SpecialAddDeduction extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
advanceParams: { //高级搜索参数
|
||||
visible: false,
|
||||
condition: []
|
||||
},
|
||||
drawerParams: { //抽屜弹框参数
|
||||
visible: false, title: "新建",
|
||||
loading: false, isView: true,
|
||||
editId: {}
|
||||
},
|
||||
importParams: { //导入弹框参数
|
||||
visible: false, step: 0,
|
||||
importResult: [],
|
||||
payload: { taxAgentId: "" }
|
||||
},
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
};
|
||||
this.inlineForm = null;
|
||||
this.addItemRef = null;
|
||||
this.specialContentRef = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore: { getTaxAgentSelectListAsAdmin }, specialAddStore: { addForm } } = this.props;
|
||||
addForm.initFormFields(condition);
|
||||
getTaxAgentSelectListAsAdmin();
|
||||
this.getSearchCondition();
|
||||
this.specialAddDeductionList();
|
||||
}
|
||||
|
||||
getSearchCondition = () => {
|
||||
const { specialAddStore: { advanceForm } } = this.props;
|
||||
const { advanceParams } = this.state;
|
||||
API.getSearchCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { condition } = data;
|
||||
this.setState({
|
||||
advanceParams: {
|
||||
...advanceParams,
|
||||
condition: condition
|
||||
}
|
||||
}, () => advanceForm.initFormFields(this.state.advanceParams.condition));
|
||||
}
|
||||
});
|
||||
};
|
||||
specialAddDeductionList = (params = {}) => {
|
||||
const { loading, pageInfo } = this.state;
|
||||
const { specialAddStore: { advanceForm } } = this.props;
|
||||
const queryParams = advanceForm.getFormParams();
|
||||
const extraParams = this.inlineForm ? this.inlineForm.getFieldsValue() : {};
|
||||
const payload = {
|
||||
...pageInfo,
|
||||
...queryParams,
|
||||
...extraParams,
|
||||
...params
|
||||
};
|
||||
this.setState({ loading: { ...loading, query: true } });
|
||||
API.specialAddDeductionList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
const { userid } = WeaTools.ls.getJSONObj("theme-account") || {};
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns: _.map(columns, item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => {
|
||||
this.setState({
|
||||
drawerParams: {
|
||||
...this.state.drawerParams,
|
||||
visible: true,
|
||||
isView: true,
|
||||
title: "专项附加扣除记录",
|
||||
editId: record
|
||||
}
|
||||
});
|
||||
}}>
|
||||
查看明细
|
||||
</a>
|
||||
{
|
||||
(!this.props.taxAgentStore.showOperateBtn && userid == record.employeeId) &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => this.handleOperate(e, record)}>
|
||||
<Menu.Item key="edit">编辑</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
{
|
||||
this.props.taxAgentStore.showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => this.handleOperate(e, record)}>
|
||||
<Menu.Item key="edit">编辑</Menu.Item>
|
||||
<Menu.Item key="delete">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleSaveSpecialList = (payload) => {
|
||||
const { drawerParams } = this.state;
|
||||
this.setState({ drawerParams: { ...drawerParams, loading: true } });
|
||||
if (!_.isEmpty(drawerParams.editId)) {
|
||||
API.specialAddDeductionEditData({ ...payload, id: drawerParams.editId.id }).then(({ status, errormsg }) => {
|
||||
this.setState({ drawerParams: { ...drawerParams, loading: false } });
|
||||
if (status) {
|
||||
message.success("编辑成功");
|
||||
this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
}, () => {
|
||||
const { specialAddStore: { addForm } } = this.props;
|
||||
this.specialAddDeductionList();
|
||||
addForm.resetForm();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg || "编辑失败");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
API.specialAddDeductionCreateData(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ drawerParams: { ...drawerParams, loading: false } });
|
||||
if (status) {
|
||||
message.success("新增成功");
|
||||
this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
}, () => {
|
||||
const { specialAddStore: { addForm } } = this.props;
|
||||
this.specialAddDeductionList();
|
||||
addForm.resetForm();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg || "新增失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
handleOperate = ({ key }, row) => {
|
||||
const { drawerParams } = this.state;
|
||||
if (key === "edit") {
|
||||
this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: true,
|
||||
isView: false,
|
||||
title: "编辑"
|
||||
}
|
||||
}, () => {
|
||||
const { drawerParams: params } = this.state;
|
||||
API.getSpecialAddDeduction({ id: row.id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
drawerParams: {
|
||||
...params,
|
||||
editId: data
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (key === "delete") {
|
||||
const payload = {
|
||||
ids: [row.id]
|
||||
};
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定删除${row.departmentName}${row.username}的专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
|
||||
onOk: () => {
|
||||
API.specialAddDeductionDeleteSelectData(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
this.specialAddDeductionList();
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
deleteSelectAddUpDeduction = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
ids: selectedRowKeys
|
||||
};
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。",
|
||||
onOk: () => {
|
||||
API.specialAddDeductionDeleteSelectData(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
this.specialAddDeductionList();
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
specialAddDeductionDeleteAllData = () => {
|
||||
const extraParams = this.inlineForm ? this.inlineForm.getFieldsValue() : {};
|
||||
const payload = {
|
||||
...extraParams
|
||||
};
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定清空所有专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
|
||||
onOk: () => {
|
||||
API.specialAddDeductionDeleteAllData(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
this.specialAddDeductionList();
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
specialAddDeductionPreview = (payload) => {
|
||||
const { importParams } = this.state;
|
||||
API.specialAddDeductionPreview(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { preview: slideDataSource } = data;
|
||||
this.setState({
|
||||
importParams: {
|
||||
...importParams,
|
||||
slideDataSource
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
specialAddDeductionImportData = (payload) => {
|
||||
const { importParams } = this.state;
|
||||
API.specialAddDeductionImportData(payload).then(({ status, data: importResult }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
importParams: {
|
||||
...importParams,
|
||||
step: 2,
|
||||
importResult
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
specialAddDeductionExport = () => {
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${this.inlineForm.getFieldsValue().taxAgentId}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
specialAddDeductionExportSelect = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${selectedRowKeys.join(",")}&taxAgentId=${this.inlineForm.getFieldsValue().taxAgentId}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
handleExportAllSpecialDetail = () => {
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
handleExportSelectSpecialDetail = () => {
|
||||
const { state: { selectedRowKeys } } = this.specialContentRef;
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${selectedRowKeys.join(",")}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
getSearchsAdQuick = (isAd) => {
|
||||
const { advanceParams } = this.state;
|
||||
const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props;
|
||||
return isAd ? getSearchs(advanceForm, advanceParams.condition, 2)
|
||||
: <InlineForm
|
||||
ref={dom => this.inlineForm = dom}
|
||||
taxAgentOption={taxAgentAdminOption}
|
||||
onChange={(taxAgentId)=>this.specialAddDeductionList({taxAgentId})}
|
||||
/>;
|
||||
};
|
||||
renderImportormComponent = () => {
|
||||
const { importParams } = this.state;
|
||||
const { taxAgentStore: { taxAgentAdminOption } } = this.props;
|
||||
return (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span
|
||||
className="formLabel"
|
||||
style={{ lineHeight: "30px", marginRight: "10px" }}>
|
||||
个税扣缴义务人
|
||||
</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 200, display: "inline-block" }}
|
||||
options={taxAgentAdminOption}
|
||||
value={importParams.payload.taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.setState({ importParams: { ...importParams, payload: { taxAgentId: v } } });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
advanceParams,
|
||||
dataSource,
|
||||
columns,
|
||||
loading,
|
||||
selectedRowKeys,
|
||||
pageInfo,
|
||||
drawerParams,
|
||||
importParams
|
||||
} = this.state;
|
||||
const { userid } = WeaTools.ls.getJSONObj("theme-account") || {};
|
||||
const { taxAgentStore, specialAddStore: { advanceForm, addForm } } = this.props;
|
||||
const { showOperateBtn, taxAgentAdminOption } = taxAgentStore;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
const customBtns = [
|
||||
<Dropdown.Button
|
||||
onClick={this.handleExportAllSpecialDetail}
|
||||
overlay={
|
||||
<Menu onClick={this.handleExportSelectSpecialDetail}>
|
||||
<Menu.Item key="select">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="primary"
|
||||
>
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
];
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => {
|
||||
this.setState({
|
||||
importParams: {
|
||||
...importParams,
|
||||
step: 0, visible: true,
|
||||
slideDataSource: [], importResult: []
|
||||
}
|
||||
});
|
||||
}}>导入</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={this.specialAddDeductionExport}
|
||||
overlay={
|
||||
<Menu onClick={this.specialAddDeductionExportSelect}>
|
||||
<Menu.Item key="select">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost"
|
||||
>
|
||||
导出全部
|
||||
</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: true,
|
||||
isView: false,
|
||||
editId: {}
|
||||
}
|
||||
})}>新建</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={this.specialAddDeductionDeleteAllData}
|
||||
overlay={
|
||||
<Menu onClick={this.deleteSelectAddUpDeduction}>
|
||||
<Menu.Item key="select">删除所选</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost"
|
||||
>
|
||||
一键清空
|
||||
</Dropdown.Button>
|
||||
];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.specialAddDeductionList({
|
||||
current,
|
||||
pageSize
|
||||
});
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.specialAddDeductionList({
|
||||
current
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
//加载数据
|
||||
if (_.isEmpty(columns)) {
|
||||
// 无权限处理
|
||||
return renderLoading();
|
||||
}
|
||||
return (
|
||||
<div className="specialAddWrapper">
|
||||
<WeaTop
|
||||
title="专项附加扣除"
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
buttons={showOperateBtn ? btns : []}
|
||||
>
|
||||
<div className="specialAddContent">
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]}
|
||||
searchsBasePlaceHolder="请输入姓名"
|
||||
showSearchAd={advanceParams.visible}
|
||||
searchsBaseValue={advanceForm.getFormParams().username}
|
||||
onSearchChange={(v) => advanceForm.updateFields({ username: v })}
|
||||
onAdReset={() => advanceForm.reset()}
|
||||
onAdSearch={() => this.specialAddDeductionList()}
|
||||
onSearch={() => this.specialAddDeductionList()}
|
||||
searchsAdQuick={this.getSearchsAdQuick()}
|
||||
searchsAd={this.getSearchsAdQuick(true)}
|
||||
setShowSearchAd={bool => this.setState({ advanceParams: { ...advanceParams, visible: bool } })}
|
||||
/>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
/>
|
||||
<WeaSlideModal
|
||||
className="specialAddSlideWrapper"
|
||||
{...drawerParams}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction="right"
|
||||
measure="%"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={drawerParams.title}
|
||||
loading={drawerParams.loading}
|
||||
onSave={() => {
|
||||
const { baseInfo } = this.addItemRef.state;
|
||||
const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !_.isEmpty(v));
|
||||
if (!bool && _.isEmpty(drawerParams.editId)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]),
|
||||
...addForm.getFormParams()
|
||||
};
|
||||
this.handleSaveSpecialList(payload);
|
||||
}}
|
||||
editable={(showOperateBtn && !drawerParams.isView)}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={(showOperateBtn && drawerParams.isView) ? customBtns : (!showOperateBtn && userid == drawerParams.editId.employeeId) ? [
|
||||
<Button type="primary" className="saveBtn" onClick={() => {
|
||||
const { baseInfo } = this.addItemRef.state;
|
||||
const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !_.isEmpty(v));
|
||||
if (!bool && _.isEmpty(drawerParams.editId)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]),
|
||||
...addForm.getFormParams()
|
||||
};
|
||||
this.handleSaveSpecialList(payload);
|
||||
}} loading={drawerParams.loading}>保存</Button>
|
||||
] : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
!drawerParams.isView ?
|
||||
<AddItems
|
||||
ref={(dom) => this.addItemRef = dom}
|
||||
taxAgentOption={taxAgentAdminOption}
|
||||
form={addForm}
|
||||
isSpecial
|
||||
editId={drawerParams.editId}
|
||||
condition={condition}
|
||||
/> :
|
||||
<SpecialAddContent ref={dom => this.specialContentRef = dom} specialId={drawerParams.editId.id}/>
|
||||
}
|
||||
onClose={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
})}
|
||||
/>
|
||||
{/*人员卡片*/}
|
||||
<WeaPopoverHrm/>
|
||||
{/* 导入模板*/}
|
||||
{
|
||||
importParams.visible &&
|
||||
<ImportModal
|
||||
needimportSelected //下载模板需要带上导入所选项
|
||||
params={importParams.payload}
|
||||
columns={specialModalColumns}
|
||||
step={importParams.step}
|
||||
setStep={(step) => this.setState({ importParams: { ...importParams, step } })}
|
||||
slideDataSource={importParams.slideDataSource}
|
||||
importResult={importParams.importResult}
|
||||
onFinish={() => {
|
||||
this.setState({ importParams: { ...importParams, step: 0, visible: false } }, () => {
|
||||
this.specialAddDeductionList();
|
||||
localStorage.removeItem("fileList");
|
||||
});
|
||||
}}
|
||||
previewImport={this.specialAddDeductionPreview}
|
||||
importFile={this.specialAddDeductionImportData}
|
||||
templateLink="/api/bs/hrmsalary/specialAddDeduction/downloadTemplate"
|
||||
renderFormComponent={this.renderImportormComponent}
|
||||
visiable={importParams.visible}
|
||||
onCancel={() => {
|
||||
localStorage.removeItem("fileList");
|
||||
this.setState({
|
||||
importParams: {
|
||||
...importParams,
|
||||
step: 0, visible: false,
|
||||
slideDataSource: [], importResult: [],
|
||||
payload: { taxAgentId: "" }
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</WeaTop>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SpecialAddDeduction;
|
||||
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
.specialAddWrapper {
|
||||
height: 100%;
|
||||
|
||||
.wea-new-top-wapper {
|
||||
.specialAddContent {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.wea-tab-search-ad-quick {
|
||||
.wea-tab-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wea-tab-right {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.wea-search-container-search-ad-quick {
|
||||
top: 47px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.linkWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.moreIconWrapper {
|
||||
.ant-popover-inner {
|
||||
min-width: 106px
|
||||
}
|
||||
|
||||
.ant-popover-inner-content {
|
||||
padding: 0;
|
||||
|
||||
.ant-menu {
|
||||
.ant-menu-item {
|
||||
border-right: none;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.specialAddSlideWrapper {
|
||||
.wea-slide-modal-title {
|
||||
height: initial;
|
||||
line-height: initial;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.rodal-close {
|
||||
z-index: 99;
|
||||
top: 10px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1260px) {
|
||||
.specialAddSlideWrapper {
|
||||
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1060px) and (max-width: 1260px) {
|
||||
.specialAddSlideWrapper {
|
||||
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
|
||||
max-width: calc(100% - 96px) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -16,7 +16,8 @@ import { payrollStore } from "./payroll";
|
|||
import { calculateStore } from "./calculate";
|
||||
import { DeclareStore } from "./declare";
|
||||
import { StandingBookStore } from "./StandingBook";
|
||||
import {PayrollFilesStore} from './payrollFiles';
|
||||
import { PayrollFilesStore } from "./payrollFiles";
|
||||
import { SpecialAddStore } from "./specialAdd";
|
||||
|
||||
module.exports = {
|
||||
baseFormStore: new BaseFormStore(),
|
||||
|
|
@ -38,4 +39,5 @@ module.exports = {
|
|||
declareStore: new DeclareStore(),
|
||||
standingBookStore: new StandingBookStore(),
|
||||
payrollFilesStore: new PayrollFilesStore(),
|
||||
specialAddStore: new SpecialAddStore()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { WeaForm } from 'comsMobx';
|
||||
|
||||
export class SpecialAddStore {
|
||||
@observable advanceForm = new WeaForm();
|
||||
@observable addForm = new WeaForm();
|
||||
}
|
||||
|
|
@ -7,4 +7,13 @@ export const optionAddAll = (options) => {
|
|||
selected: false
|
||||
})
|
||||
return results;
|
||||
}
|
||||
}
|
||||
export const optionAddWhole = (options) => {
|
||||
let results = [...options];
|
||||
results.unshift({
|
||||
key: "",
|
||||
showname: "全部",
|
||||
selected: false
|
||||
})
|
||||
return results;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue