专项附加扣除接口联调
This commit is contained in:
parent
b2164dbb46
commit
ca04e5405d
|
|
@ -9,6 +9,22 @@ export const getSearchCondition = (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 importSalaryArchive = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', params);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
];
|
||||
|
|
@ -14,8 +14,7 @@ class InlineForm extends Component {
|
|||
style={{ width: 200 }}
|
||||
showSearch // 设置select可搜索
|
||||
options={optionAddWhole(taxAgentOption)}
|
||||
onChange={onChange}
|
||||
{...form.getFieldProps("taxAgentId", { initialValue: "" })}
|
||||
{...form.getFieldProps("taxAgentId", { initialValue: "", onChange })}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
import React, { Component } from "react";
|
||||
|
||||
class SpecialAddContent extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SpecialAddContent;
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import { WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom";
|
||||
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
|
||||
import { WeaPopoverHrm, WeaSlideModal, WeaTab, WeaTable, 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 "./index.less";
|
||||
|
||||
@inject("specialAddStore", "taxAgentStore")
|
||||
|
|
@ -22,7 +25,9 @@ class SpecialAddDeduction extends Component {
|
|||
condition: []
|
||||
},
|
||||
drawerParams: { //抽屜弹框参数
|
||||
visible: false, title: '新建'
|
||||
visible: false, title: "新建",
|
||||
loading: false, isView: true,
|
||||
editId: {}
|
||||
},
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
|
|
@ -32,10 +37,12 @@ class SpecialAddDeduction extends Component {
|
|||
}
|
||||
};
|
||||
this.inlineForm = null;
|
||||
this.addItemRef = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props;
|
||||
const { taxAgentStore: { getTaxAgentSelectListAsAdmin }, specialAddStore: { addForm } } = this.props;
|
||||
addForm.initFormFields(condition);
|
||||
getTaxAgentSelectListAsAdmin();
|
||||
this.getSearchCondition();
|
||||
this.specialAddDeductionList();
|
||||
|
|
@ -48,12 +55,11 @@ class SpecialAddDeduction extends Component {
|
|||
if (status) {
|
||||
const { condition } = data;
|
||||
this.setState({
|
||||
advanceParams: {
|
||||
...advanceParams,
|
||||
condition: condition
|
||||
}
|
||||
}, () => advanceForm.initFormFields(this.state.advanceParams.condition)
|
||||
);
|
||||
advanceParams: {
|
||||
...advanceParams,
|
||||
condition: condition
|
||||
}
|
||||
}, () => advanceForm.initFormFields(this.state.advanceParams.condition));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -74,14 +80,145 @@ class SpecialAddDeduction extends Component {
|
|||
API.specialAddDeductionList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, dataSource, pageNum: current, pageSize, total } = data;
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns, dataSource
|
||||
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={() => {
|
||||
}}>
|
||||
查看明细
|
||||
</a>
|
||||
{
|
||||
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,
|
||||
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,
|
||||
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.specialAddDeductionGetDetailList({ specialAddDeductionId: 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 || "删除失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
getSearchsAdQuick = (isAd) => {
|
||||
const { advanceParams } = this.state;
|
||||
const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props;
|
||||
|
|
@ -95,8 +232,8 @@ class SpecialAddDeduction extends Component {
|
|||
|
||||
render() {
|
||||
const { advanceParams, dataSource, columns, loading, selectedRowKeys, pageInfo, drawerParams } = this.state;
|
||||
const { taxAgentStore, specialAddStore: { advanceForm } } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const { taxAgentStore, specialAddStore: { advanceForm, addForm } } = this.props;
|
||||
const { showOperateBtn, taxAgentAdminOption } = taxAgentStore;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
|
|
@ -131,7 +268,14 @@ class SpecialAddDeduction extends Component {
|
|||
>
|
||||
导出全部
|
||||
</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ drawerParams: { ...drawerParams, visible: true } })}>新建</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: true,
|
||||
isView: false,
|
||||
editId: {}
|
||||
}
|
||||
})}>新建</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={() => {
|
||||
}}
|
||||
|
|
@ -192,6 +336,7 @@ class SpecialAddDeduction extends Component {
|
|||
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)}
|
||||
|
|
@ -216,21 +361,60 @@ class SpecialAddDeduction extends Component {
|
|||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={drawerParams.title}
|
||||
loading={drawerParams.loading}
|
||||
onSave={() => {
|
||||
// this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
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={false}
|
||||
editable={!drawerParams.isView}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={showOperateBtn ? customBtns : []}
|
||||
customOperate={(showOperateBtn && !drawerParams.isView) ? customBtns : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div>123</div>
|
||||
!drawerParams.isView ?
|
||||
<AddItems
|
||||
ref={(dom) => this.addItemRef = dom}
|
||||
taxAgentOption={taxAgentAdminOption}
|
||||
form={addForm}
|
||||
isSpecial
|
||||
editId={drawerParams.editId}
|
||||
condition={condition}
|
||||
/> :
|
||||
<SpecialAddContent/>
|
||||
}
|
||||
onClose={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })}
|
||||
onClose={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })}
|
||||
closeMaskOnClick={() => this.setState({
|
||||
drawerParams: {
|
||||
...drawerParams,
|
||||
visible: false,
|
||||
isView: true,
|
||||
editId: {}
|
||||
}
|
||||
})}
|
||||
/>
|
||||
{/*人员卡片*/}
|
||||
<WeaPopoverHrm/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,32 +23,69 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.linkWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.specialAddSlideWrapper{
|
||||
.wea-slide-modal-title{
|
||||
.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{
|
||||
|
||||
.rodal-close {
|
||||
z-index: 99;
|
||||
top: 10px!important;
|
||||
top: 10px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1260px){
|
||||
.specialAddSlideWrapper{
|
||||
.reqTopWrapper .wea-new-top-req-title>div:first-child>div{
|
||||
max-width: 100%!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;
|
||||
.specialAddSlideWrapper {
|
||||
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
|
||||
max-width: calc(100% - 96px) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue