专项附加扣除模块
This commit is contained in:
parent
c4c24dd159
commit
72478c3fd8
|
|
@ -0,0 +1,63 @@
|
|||
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 importSalaryArchive = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', params);
|
||||
}
|
||||
// 薪资档案预览
|
||||
export const salaryArchivePreview = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/preview', params);
|
||||
}
|
||||
// 公共枚举接口
|
||||
export const commonEnumList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params);
|
||||
}
|
||||
// 获取导入类型
|
||||
export const getImportTypes = () => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {});
|
||||
}
|
||||
// 发起调薪地址
|
||||
export const salaryAdjustmentInfo = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/process/salaryAdjustmentInfo', 'GET', params);
|
||||
}
|
||||
// 一键全部设为定薪员工
|
||||
export const allGotoFixed = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/allGotoFixed', params);
|
||||
}
|
||||
// 设为定薪员工
|
||||
export const gotoFixed = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/gotoFixed', params);
|
||||
}
|
||||
// 停薪
|
||||
export const gotoStop = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/gotoStop', params);
|
||||
}
|
||||
//全部停薪
|
||||
export const allGotoStop = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/allGotoStop', params);
|
||||
}
|
||||
// 取消停薪
|
||||
export const cancelStop = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/cancelStop', params);
|
||||
}
|
||||
// 保存发薪设置
|
||||
export const savePaySet = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/savePaySet', params);
|
||||
}
|
||||
// 待定薪删除待办
|
||||
export const deletePendingTodo = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/deletePendingTodo', params);
|
||||
}
|
||||
// 待停薪删除待办
|
||||
export const deleteSuspendTodo = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSuspendTodo', 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} />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
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)}
|
||||
onChange={onChange}
|
||||
{...form.getFieldProps("taxAgentId", { initialValue: "" })}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Form.create()(InlineForm);
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
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 InlineForm from "./components/inlineForm";
|
||||
import { getSearchs, renderLoading } from "../../../util";
|
||||
import * as API from "../../../apis/special";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
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: '新建'
|
||||
},
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
};
|
||||
this.inlineForm = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props;
|
||||
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
|
||||
};
|
||||
console.log(queryParams, payload);
|
||||
console.log(this.inlineForm);
|
||||
this.setState({ loading: { ...loading, query: true } });
|
||||
API.specialAddDeductionList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
if (status) {
|
||||
const { columns, dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns, dataSource
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
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={this.specialAddDeductionList}
|
||||
/>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { advanceParams, dataSource, columns, loading, selectedRowKeys, pageInfo, drawerParams } = this.state;
|
||||
const { taxAgentStore, specialAddStore: { advanceForm } } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
const customBtns = [
|
||||
<Dropdown.Button
|
||||
onClick={() => {
|
||||
}}
|
||||
overlay={
|
||||
<Menu onClick={() => {
|
||||
}}>
|
||||
<Menu.Item key="select">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="primary"
|
||||
>
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
];
|
||||
const btns = [
|
||||
<Button type="primary">导入</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={() => {
|
||||
}}
|
||||
overlay={
|
||||
<Menu onClick={() => {
|
||||
}}>
|
||||
<Menu.Item key="select">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost"
|
||||
>
|
||||
导出全部
|
||||
</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ drawerParams: { ...drawerParams, visible: true } })}>新建</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={() => {
|
||||
}}
|
||||
overlay={
|
||||
<Menu onClick={() => {
|
||||
}}>
|
||||
<Menu.Item key="select">删除所选</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost"
|
||||
>
|
||||
一键清空
|
||||
</Dropdown.Button>
|
||||
];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: 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()}
|
||||
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}
|
||||
onSave={() => {
|
||||
// this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={showOperateBtn ? customBtns : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div>123</div>
|
||||
}
|
||||
onClose={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })}
|
||||
/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SpecialAddDeduction;
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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