薪资方案
This commit is contained in:
parent
3ee405ec39
commit
32d0578be2
|
|
@ -7,7 +7,7 @@ import { WeaTools } from 'ecCom';
|
|||
|
||||
//薪资档案-薪资档案列表
|
||||
export const getArchiveList = params => {
|
||||
return fetch('/api/bs/hrmsalary/archives/getTable', {
|
||||
return fetch('/api/bs/hrmsalary/salaryArchive/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
|
|
@ -36,7 +36,7 @@ export const getImportArchiveParam = params => {
|
|||
|
||||
//薪资档案-获取薪资档案详情表单
|
||||
export const getArchiveForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getForm', 'GET', params);
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getForm', 'get', params);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -57,7 +57,14 @@ export const getTaxAgentForm = params => {
|
|||
|
||||
//薪资档案-保存个税扣缴义务人调整
|
||||
export const saveTaxAgent = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/saveTaxAgent', 'POST', params);
|
||||
return fetch('/api/bs/hrmsalary/salaryArchive/saveTaxAgent', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
//薪资档案-删除个税扣缴义务人调整
|
||||
|
|
@ -65,8 +72,6 @@ export const deleteTaxAgent = params => {
|
|||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'POST', params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//薪资档案操作记录-薪资项目操作记录列表
|
||||
export const getItemAdjustList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params);
|
||||
|
|
@ -159,4 +164,4 @@ export const exportSalaryArchive = (ids = "") => {
|
|||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,14 @@ export const getCondition = params => {
|
|||
};
|
||||
|
||||
export const getTable = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/archives/getTable', 'post', params);
|
||||
return fetch('/api/bs/hrmsalary/archives/getTable', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
||||
export const getBaseForm = params => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
import React from 'react'
|
||||
import { Icon } from 'antd'
|
||||
import "./index.less"
|
||||
|
||||
export default class GroupCard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
showContent: true
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="groupCard">
|
||||
<div className="titleWrapper">
|
||||
<span className="groupTitle">{this.props.title}</span>
|
||||
<div className="tipWrapper">{this.props.tips}</div>
|
||||
<div className="operateIconWrapper" onClick={() => {this.setState({showContent: !this.state.showContent})}}>
|
||||
{
|
||||
this.state.showContent ? <Icon type="down" /> : <Icon type="left" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
this.state.showContent && <div className="contentWrapper">
|
||||
{this.props.children}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
.groupCard {
|
||||
margin: 10px 20px;
|
||||
.titleWrapper {
|
||||
overflow: hidden;
|
||||
.tipWrapper {
|
||||
margin-left: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
.operateIconWrapper {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
width: 20px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
border-radius: 5px;
|
||||
background-color: #eee;
|
||||
}
|
||||
}
|
||||
.contentWrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
|
@ -325,20 +325,9 @@ export default class Ledger extends React.Component {
|
|||
content={
|
||||
<div>
|
||||
{
|
||||
currentStep == 0 && <SlideBaseForm />
|
||||
}
|
||||
{
|
||||
currentStep == 1 && <SlideRefereUser />
|
||||
}
|
||||
{
|
||||
currentStep == 2 && <SalaryItemForm />
|
||||
}
|
||||
{
|
||||
currentStep == 3 && <CalRulesForm />
|
||||
}
|
||||
{
|
||||
currentStep == 4 && <ValidRulesForm />
|
||||
currentStep == 0 && <BaseForm />
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
export const adjustResion = {
|
||||
"ADJUSTMENT": "调动",
|
||||
"CHANGE": "变更",
|
||||
"ONBOARD": "入职",
|
||||
"DIMISSION": "离职",
|
||||
"OTHER": "其他",
|
||||
"INIT": "初始化",
|
||||
}
|
||||
|
|
@ -1,34 +1,101 @@
|
|||
import React from 'react'
|
||||
import { Modal, Row, Col } from "antd"
|
||||
import { Modal, Row, Col, Button } from "antd"
|
||||
import { WeaDatePicker, WeaSelect } from "ecCom"
|
||||
import { adjustResion } from './adjustReason'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import moment from 'moment'
|
||||
|
||||
@inject('taxAgentStore', "salaryFileStore")
|
||||
@observer
|
||||
export default class EditAgentModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
initSelected: false,
|
||||
request: {
|
||||
salaryArchiveId: this.props.currentId,
|
||||
effectiveTime: moment(new Date()).format("YYYY-MM-DD"),
|
||||
adjustReason: 'INIT',
|
||||
taxAgentId: ""
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { taxAgentStore: {fetchTaxAgentOption}} = this.props;
|
||||
fetchTaxAgentOption().then(() => {
|
||||
this.setState({initSelected: true})
|
||||
})
|
||||
}
|
||||
|
||||
getResionOptions() {
|
||||
return Object.keys(adjustResion).map(key => {
|
||||
let item = {}
|
||||
item.showname = adjustResion[key]
|
||||
item.key = key
|
||||
item.selected = false
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
handleSave() {
|
||||
const { salaryFileStore: {saveTaxAgent}} = this.props;
|
||||
saveTaxAgent(this.state.request)
|
||||
}
|
||||
|
||||
handleChange(params) {
|
||||
const {request} = this.state;
|
||||
params = {...request, ...params}
|
||||
this.setState({
|
||||
request: params
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { taxAgentOption } = taxAgentStore
|
||||
const { request } = this.state;
|
||||
const {
|
||||
salaryArchiveId,
|
||||
effectiveTime,
|
||||
adjustReason,
|
||||
taxAgentId
|
||||
} = request;
|
||||
return (
|
||||
<Modal title="个税扣缴义务人调整" width={800} visible={this.props.visible} onClose={this.props.onCancel}>
|
||||
<div className="editAgentModal">
|
||||
<Modal title="个税扣缴义务人调整" width={800} visible={this.props.visible} onClose={this.props.onCancel}
|
||||
footer={
|
||||
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
|
||||
}
|
||||
>
|
||||
<div className="editAgentModal" style={{padding: "20px"}}>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>生效日期</Col>
|
||||
<Col span={16}>
|
||||
<WeaDatePicker />
|
||||
<WeaDatePicker value={effectiveTime} onChange={(value) => {this.handleChange({effectiveTime: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整原因</Col>
|
||||
<Col span={16}>
|
||||
<WeaSelect />
|
||||
<WeaSelect style={{width:"200px"}} options={this.getResionOptions()} value={adjustReason} onChange={(value) => {
|
||||
this.handleChange({adjustReason: value})
|
||||
}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整前</Col>
|
||||
<Col span={16}>
|
||||
义务人一
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整后</Col>
|
||||
<Col span={16}>
|
||||
<WeaSelect />
|
||||
{
|
||||
this.state.initSelected && <WeaSelect style={{width: '200px'}} options={taxAgentOption} value={taxAgentId} onChange={(value) => {
|
||||
this.handleChange({taxAgentId: value})
|
||||
}} />
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu } from 'antd';
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, message } from 'antd';
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable,
|
||||
WeaInputSearch, WeaSlideModal, WeaCheckbox, WeaHelpfulTip } from 'ecCom';
|
||||
|
|
@ -19,7 +19,7 @@ import SlideModalTitle from '../../components/slideModalTitle'
|
|||
import SlideSalaryItem from './slideSalaryItem'
|
||||
import SlideAgent from './slideAgent'
|
||||
import ImportModal from '../../components/importModal'
|
||||
|
||||
import SalaryFileViewSlide from './saralyFileViewSlide'
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
|
@ -37,13 +37,16 @@ export default class SalaryFile extends React.Component {
|
|||
editSlideVisible: false,
|
||||
importType: "",
|
||||
modalVisiable: false,
|
||||
step: 0
|
||||
step: 0,
|
||||
recordSlideVisible: false,
|
||||
currentId: "",
|
||||
selectedRowKeys: []
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {getImportTypes} } = this.props;
|
||||
getImportTypes();
|
||||
const { salaryFileStore: {doInit} } = this.props;
|
||||
doInit();
|
||||
}
|
||||
|
||||
// 设置导入步数
|
||||
|
|
@ -92,12 +95,51 @@ export default class SalaryFile extends React.Component {
|
|||
exportSalaryArchive();
|
||||
}
|
||||
|
||||
// 定制列
|
||||
getColumns() {
|
||||
const { salaryFileStore: {tableStore}} = this.props;
|
||||
return tableStore.columns.filter(item => item.hide == "false").map(item => {
|
||||
if(item.dataIndex == "operate") {
|
||||
item.render = (text, record) => (
|
||||
<a onClick={() => this.handleEdit(record)}>编辑</a>
|
||||
)
|
||||
}
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑行
|
||||
handleEdit(record) {
|
||||
this.setState({editSlideVisible: true, currentId: record.id})
|
||||
}
|
||||
|
||||
// 显示调整个税扣缴义务人表单
|
||||
handSildeOptionMenuClick(e) {
|
||||
this.setState({editAgentVisible: true})
|
||||
}
|
||||
|
||||
// 查看 Slide 头部操作按钮
|
||||
renderEditSlideOperate() {
|
||||
return <div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button type="primary" overlay={
|
||||
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
|
||||
</Menu>
|
||||
} onClick={() => {this.setState({changeSalaryVisible: true})}}>调薪</Dropdown.Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
// table选中条目
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryFileStore;
|
||||
const { importType, previewColumns, previewDataSource } = salaryFileStore;
|
||||
const { selectedTab, step } = this.state;
|
||||
const { importType, previewColumns, previewDataSource, dataSource } = salaryFileStore;
|
||||
const { selectedTab, step, selectedRowKeys } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
|
@ -127,7 +169,6 @@ export default class SalaryFile extends React.Component {
|
|||
];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +177,13 @@ export default class SalaryFile extends React.Component {
|
|||
}
|
||||
|
||||
const handleMenuClick2 = () => {
|
||||
|
||||
const { electedRowKeys } = this.state;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
}
|
||||
const { salaryFileStore: {exportSalaryArchive}} = this.props;
|
||||
exportSalaryArchive(selectedRowKeys.join(","))
|
||||
}
|
||||
|
||||
const menu = (
|
||||
|
|
@ -173,7 +220,7 @@ export default class SalaryFile extends React.Component {
|
|||
/>
|
||||
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu}>导入</Dropdown.Button>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu2} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
|
||||
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.setState({editSlideVisible: true})}}>调薪记录</Button>
|
||||
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.setState({recordSlideVisible: true})}}>调薪记录</Button>
|
||||
<WeaInputSearch />
|
||||
</div>
|
||||
)
|
||||
|
|
@ -198,6 +245,12 @@ export default class SalaryFile extends React.Component {
|
|||
)
|
||||
}
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaRightMenu
|
||||
|
|
@ -217,7 +270,11 @@ export default class SalaryFile extends React.Component {
|
|||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
<WeaTable columns={columns} dataSource={dataSource}/>
|
||||
<WeaTable
|
||||
rowSelection={rowSelection}
|
||||
columns={this.getColumns()}
|
||||
dataSource={dataSource}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
|
|
@ -253,14 +310,15 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
{
|
||||
this.state.editAgentVisible && <EditAgentModal
|
||||
currentId={this.state.currentId}
|
||||
visible={this.state.editAgentVisible}
|
||||
onCancel={() => {this.setState({editAgentVisible: false})}}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
this.state.editSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.editSlideVisible}
|
||||
this.state.recordSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.recordSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
|
|
@ -286,10 +344,30 @@ export default class SalaryFile extends React.Component {
|
|||
selectedTab == 1 && <SlideAgent />
|
||||
}
|
||||
</div>}
|
||||
onClose={() => this.setState({recordSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({recordSlideVisible: false})} />
|
||||
}
|
||||
|
||||
{
|
||||
this.state.editSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"员工薪资档案"}
|
||||
editable={false}
|
||||
customOperate={this.renderEditSlideOperate()}
|
||||
/>
|
||||
}
|
||||
content={<SalaryFileViewSlide id={this.state.currentId} />}
|
||||
onClose={() => this.setState({editSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
import React from "react"
|
||||
import { Row, Col } from 'antd'
|
||||
import { WeaHelpfulTip } from 'ecCom'
|
||||
import GroupCard from "../../components/groupCard"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
@inject('salaryFileStore')
|
||||
@observer
|
||||
export default class SalaryFileViewSlide extends React.Component {
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {getArchiveForm} } = this.props;
|
||||
getArchiveForm(this.props.id)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore: {detailForm} } = this.props;
|
||||
const { baseInfo, adjustSalaryItems } = detailForm;
|
||||
return (
|
||||
<div>
|
||||
<GroupCard title="基本信息" >
|
||||
<Row className="formRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">姓名</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.username}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">部门</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.department}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">岗位</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.position}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="formRow">
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">入职时间</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.hiredate}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">手机号</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.mobile}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Row>
|
||||
<Col span={6} className="formTitle">个税扣缴义务人</Col>
|
||||
<Col span={18}>{baseInfo && baseInfo.employee && baseInfo.employee.taxAgent}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
</GroupCard>
|
||||
|
||||
<GroupCard title="薪资档案" tips={
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="提示:显示已生效的最新数据"
|
||||
placement="topLeft"
|
||||
/>
|
||||
}>
|
||||
<div style={{lineHeight: '40px'}}>
|
||||
{
|
||||
|
||||
adjustSalaryItems && adjustSalaryItems.map(item => (
|
||||
<div style={{display: "inline-block", width: '50%' }}>
|
||||
<div style={{display:'inline-block', width: '50%'}}>{item.name}</div>
|
||||
<div style={{display:'inline-block', width: '50%'}}>{item.value}</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</GroupCard>
|
||||
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import React from 'react'
|
||||
import GroupCard from '../../../components/groupCard'
|
||||
import { Row, Col } from 'antd'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
@inject('archivesStore')
|
||||
@observer
|
||||
export default class BaseForm extends React.Component {
|
||||
|
||||
componentWillMount() {
|
||||
const {archivesStore: {getBaseForm}} = this.props;
|
||||
getBaseForm(this.props.employeeId)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { archivesStore: {baseFormData}} = this.props;
|
||||
return (
|
||||
<div>
|
||||
<GroupCard title="基本信息" >
|
||||
<Row>
|
||||
<Col span={4}>姓名</Col>
|
||||
<Col span={4}>{baseFormData.username}</Col>
|
||||
<Col span={4}>部门</Col>
|
||||
<Col span={4}>{baseFormData.department}</Col>
|
||||
<Col span={4}>岗位</Col>
|
||||
<Col span={4}>{baseFormData.position}</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col span={4}>入职日期</Col>
|
||||
<Col span={4}>{baseFormData.hiredate}</Col>
|
||||
<Col span={4}>手机号</Col>
|
||||
<Col span={4}>{baseFormData.telephone}</Col>
|
||||
<Col span={4}>离职时间</Col>
|
||||
<Col span={4}>{baseFormData.dimissionDate}</Col>
|
||||
</Row>
|
||||
</GroupCard>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,16 +2,17 @@ import React from 'react';
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
|
||||
import { Button, Table, DatePicker } from 'antd';
|
||||
import { Button, Table, DatePicker, Dropdown, Menu } from 'antd';
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable } from 'ecCom';
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaSlideModal } from 'ecCom';
|
||||
// import { WeaTableNew } from "comsMobx"
|
||||
// const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../../components/customTab';
|
||||
import ContentWrapper from '../../../components/contentWrapper';
|
||||
|
||||
import BaseForm from './baseForm'
|
||||
import SlideModalTitle from '../../../components/slideModalTitle'
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
|
@ -22,7 +23,10 @@ export default class Archives extends React.Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0"
|
||||
selectedKey: "0",
|
||||
selectedTab: 0,
|
||||
editSlideVisible: false,
|
||||
employeeId: ""
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -31,8 +35,27 @@ export default class Archives extends React.Component {
|
|||
doInit()
|
||||
}
|
||||
|
||||
handleEdit(record) {
|
||||
this.setState({employeeId: record.employeeId, editSlideVisible: true})
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { archivesStore: {tableStore}} = this.props;
|
||||
let columns = [...tableStore.columns]
|
||||
columns = columns.filter(item => item.hide == "false")
|
||||
columns.push({
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
render: (text, record) => {
|
||||
return (<a onClick={() => {this.handleEdit(record)}}>编辑</a>)
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { archivesStore } = this.props;
|
||||
const { selectedTab } = this.state;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = archivesStore;
|
||||
const { dataSource } = archivesStore
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
|
|
@ -63,6 +86,21 @@ export default class Archives extends React.Component {
|
|||
const topTab = [
|
||||
];
|
||||
|
||||
const handleButtonClick = () => {}
|
||||
const handleMenuClick = () => {}
|
||||
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
]
|
||||
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
|
||||
|
|
@ -81,6 +119,7 @@ export default class Archives extends React.Component {
|
|||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}
|
||||
>
|
||||
|
||||
<WeaTab
|
||||
|
|
@ -103,13 +142,43 @@ export default class Archives extends React.Component {
|
|||
/> */}
|
||||
|
||||
<WeaTable
|
||||
columns={tableStore.columns.filter(item => item.hide == "false")}
|
||||
columns={this.getColumns()}
|
||||
dataSource={dataSource}
|
||||
|
||||
/>
|
||||
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
{
|
||||
this.state.editSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"员工福利档案"}
|
||||
tabs={[{title: '基础设置', key: 0}, {title: "社保", key: 1}, {title: "公积金", key: 2}, {title: '企业年金及其他福利', key: 3}]}
|
||||
editable={true}
|
||||
selectedTab={selectedTab}
|
||||
onSave={() => this.handleEditSlideSave()}
|
||||
subItemChange={
|
||||
(item) => {this.setState({selectedTab: item.key})}
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={<div>
|
||||
{
|
||||
selectedTab == 0 && <BaseForm employeeId={this.state.employeeId}/>
|
||||
}
|
||||
|
||||
</div>}
|
||||
onClose={() => this.setState({editSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { observable, action, toJS } from 'mobx';
|
|||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
|
||||
import * as API from '../apis/archive'; // 引入API接口文件
|
||||
import * as API from '../apis/welfareArchive'; // 引入API接口文件
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -20,10 +20,13 @@ export class ArchivesStore {
|
|||
|
||||
@observable dataSource = [];
|
||||
|
||||
@observable baseFormData = {}
|
||||
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getCondition();
|
||||
// this.getCondition();
|
||||
this.getTableDatas();
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +49,7 @@ export class ArchivesStore {
|
|||
this.loading = true;
|
||||
const formParams = this.form.getFormParams() || {};
|
||||
params = params || formParams;
|
||||
API.getArchiveList(params).then(action(res => {
|
||||
API.getTable(params).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.dataSource = res.data.datas;
|
||||
// this.columns = res.data.columns;
|
||||
|
|
@ -67,4 +70,16 @@ export class ArchivesStore {
|
|||
this.showSearchAd = false;
|
||||
}
|
||||
|
||||
// 查询档案基本信息表单
|
||||
@action
|
||||
getBaseForm = (employeeId) => {
|
||||
API.getBaseForm({employeeId}).then(res => {
|
||||
if(res.status) {
|
||||
this.baseFormData = res.data.data
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,13 +17,15 @@ export class salaryFileStore {
|
|||
@observable importType = [];
|
||||
@observable previewColumns = [];
|
||||
@observable previewDataSource = [];
|
||||
@observable dataSource = [];
|
||||
@observable detailForm= {}
|
||||
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
// this.getCondition();
|
||||
// this.getTableDatas();
|
||||
this.getTableDatas();
|
||||
this.getImportTypes();
|
||||
}
|
||||
|
||||
|
|
@ -52,18 +54,21 @@ export class salaryFileStore {
|
|||
}));
|
||||
}
|
||||
|
||||
// 渲染table数据
|
||||
// 渲染table数据1
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
this.loading = true;
|
||||
const formParams = this.form.getFormParams() || {};
|
||||
params = params || formParams;
|
||||
API.getTableDatas(params).then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.datas); // table 请求数据
|
||||
this.hasRight = res.hasRight;
|
||||
API.getArchiveList(params).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.data.dataKey.datas); // table 请求数据
|
||||
this.dataSource = res.data.pageInfo.list.map(item => {
|
||||
item.key = item.id
|
||||
return item;
|
||||
})
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
|
|
@ -125,4 +130,28 @@ export class salaryFileStore {
|
|||
API.exportSalaryArchive(ids)
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
@action
|
||||
getArchiveForm = (salaryArchiveId) => {
|
||||
API.getArchiveForm({salaryArchiveId}).then(res => {
|
||||
if(res.status) {
|
||||
this.detailForm = res.data
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 薪资档案-保存个税扣缴义务人调整
|
||||
@action
|
||||
saveTaxAgent = (params) => {
|
||||
API.saveTaxAgent(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功");
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -120,11 +120,18 @@ export class TaxAgentStore {
|
|||
}
|
||||
|
||||
@action fetchTaxAgentOption = () => {
|
||||
API.getTaxAgentSelectList().then(action(res => {
|
||||
if(res.status) {
|
||||
this.taxAgentOption = res.data.list.map(item => {return {key: item.id, showname: item.content}})
|
||||
}
|
||||
}))
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentSelectList().then(action(res => {
|
||||
if(res.status) {
|
||||
resolve()
|
||||
this.taxAgentOption = res.data.list.map(item => {return {key: item.id, showname: item.content}})
|
||||
} else {
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败")
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,18 @@
|
|||
}
|
||||
|
||||
|
||||
// 表单
|
||||
.formItem {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.formRow {
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.formTitle {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue