个税义务人调整
This commit is contained in:
parent
cec7489a85
commit
59dd3a95c7
|
|
@ -212,4 +212,9 @@ export const singleTaxAgentList = (params) => {
|
|||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
// 调整-义务扣缴人-通过薪资档案的个税扣缴义务人id获取个税扣缴义务人调整表单
|
||||
export const getTaxAgentFormBySalaryArchiveTaxAgentId = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId', 'GET', params);
|
||||
}
|
||||
|
|
@ -18,8 +18,9 @@ export default class EditAgentModal extends React.Component {
|
|||
adjustReason: 'INIT',
|
||||
taxAgentId: ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
getAdjustReasonList() {
|
||||
|
|
@ -45,14 +46,6 @@ export default class EditAgentModal extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {salaryArchiveTaxAgentForm, getTaxAgentForm}} = this.props;
|
||||
getTaxAgentForm(this.props.currentId).then(() => {
|
||||
this.setState({initSelected: true})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
const { salaryFileStore: {saveTaxAgent}} = this.props;
|
||||
saveTaxAgent(this.state.request).then(() => {
|
||||
|
|
@ -68,6 +61,27 @@ export default class EditAgentModal extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {salaryArchiveTaxAgentForm, getTaxAgentForm, fetchSingleTaxAgentList, getTaxAgentFormByTaxAgentId}} = this.props;
|
||||
if(this.props.recordId) { // 点击条目进入
|
||||
getTaxAgentFormByTaxAgentId(this.props.recordId).then(() => {
|
||||
this.setState({
|
||||
// taxAgentId: "25",
|
||||
taxAgentId: salaryArchiveTaxAgentForm.ad1justAfter != undefined ? salaryArchiveTaxAgentForm.adjustAfter + "": "",
|
||||
adjustReason:salaryArchiveTaxAgentForm.adjustReason != undefined ? salaryArchiveTaxAgentForm.adjustReason : ""
|
||||
}, () => {
|
||||
this.setState({
|
||||
initSelected: true
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
getTaxAgentForm(this.props.currentId).then(() => {
|
||||
this.setState({initSelected: true})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { salaryArchiveTaxAgentForm } = salaryFileStore
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ export default class SalaryFile extends React.Component {
|
|||
modalVisiable: false,
|
||||
step: 0,
|
||||
recordSlideVisible: false,
|
||||
currentId: "",
|
||||
selectedRowKeys: []
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +100,7 @@ export default class SalaryFile extends React.Component {
|
|||
return tableStore.columns.filter(item => item.hide == "false").map(item => {
|
||||
if(item.dataIndex == "operate") {
|
||||
item.render = (text, record) => (
|
||||
<a onClick={() => this.handleEdit(record)}>编辑</a>
|
||||
<a onClick={() => this.handleEdit(record)}>查看</a>
|
||||
)
|
||||
}
|
||||
return item
|
||||
|
|
@ -110,7 +109,9 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
// 编辑行
|
||||
handleEdit(record) {
|
||||
this.setState({editSlideVisible: true, currentId: record.id})
|
||||
this.setState({editSlideVisible: true})
|
||||
const { salaryFileStore: {setCurrentId}} = this.props;
|
||||
setCurrentId(record.id)
|
||||
}
|
||||
|
||||
// 显示调整个税扣缴义务人表单
|
||||
|
|
@ -138,7 +139,7 @@ export default class SalaryFile extends React.Component {
|
|||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryFileStore;
|
||||
const { importType, previewColumns, previewDataSource, dataSource } = salaryFileStore;
|
||||
const { importType, previewColumns, previewDataSource, dataSource, currentId, editAgentVisible, setEditAgentVisible } = salaryFileStore;
|
||||
const { selectedTab, step, selectedRowKeys } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
return renderNoright();
|
||||
|
|
@ -303,17 +304,17 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
{
|
||||
this.state.changeSalaryVisible && <ChangeSalaryModal
|
||||
currentId={this.state.currentId}
|
||||
currentId={currentId}
|
||||
visible={this.state.changeSalaryVisible}
|
||||
onCancel={() => {this.setState({changeSalaryVisible: false})}}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
this.state.editAgentVisible && <EditAgentModal
|
||||
currentId={this.state.currentId}
|
||||
visible={this.state.editAgentVisible}
|
||||
onCancel={() => {this.setState({editAgentVisible: false})}}
|
||||
editAgentVisible && <EditAgentModal
|
||||
currentId={currentId}
|
||||
visible={editAgentVisible}
|
||||
onCancel={() => {setEditAgentVisible(false)}}
|
||||
/>
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +366,7 @@ export default class SalaryFile extends React.Component {
|
|||
customOperate={this.renderEditSlideOperate()}
|
||||
/>
|
||||
}
|
||||
content={<SalaryFileViewSlide id={this.state.currentId} />}
|
||||
content={<SalaryFileViewSlide id={currentId} />}
|
||||
onClose={() => this.setState({editSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import React from 'react';
|
||||
import { Table } from 'antd'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
@inject('salaryFileStore')
|
||||
@observer
|
||||
export default class SalaryItemChangeList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: { fetchSingleSalaryItemList }} = this.props;
|
||||
fetchSingleSalaryItemList({salaryArchiveId: this.props.id})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { singleSalaryItemList } = salaryFileStore
|
||||
return (
|
||||
<div>
|
||||
<Table dataSource={singleSalaryItemList.list ? singleSalaryItemList.list: []} columns={singleSalaryItemList.columns ? singleSalaryItemList.columns: []} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ import GroupCard from "../../components/groupCard"
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import "./index.less"
|
||||
import SelectedTab from '../../components/selectedTab'
|
||||
import SalaryItemChangeList from "./salaryItemChangeList";
|
||||
import TaxAgentChangeList from "./taxAgentChangeList";
|
||||
|
||||
const selectedTabItems = [
|
||||
{
|
||||
|
|
@ -111,8 +113,9 @@ export default class SalaryFileViewSlide extends React.Component {
|
|||
}
|
||||
|
||||
<WeaSearchGroup title={<SelectedTab items={selectedTabItems} onChange={(item) => {this.handleTabChange(item)}}/>} items={[]} onVisibleChange={(value) => {this.setState({salaryItemVisible: value})}}/>
|
||||
|
||||
|
||||
{
|
||||
this.state.selectedTab == "0" ? <SalaryItemChangeList id={this.props.id}/> : <TaxAgentChangeList id={this.props.id}/>
|
||||
}
|
||||
<div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
import React from 'react';
|
||||
import { Table } from 'antd'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import EditAgentModal from './editAgentModal'
|
||||
|
||||
@inject('salaryFileStore')
|
||||
@observer
|
||||
export default class TaxAgentChangeList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
recordId: '',
|
||||
editAgentVisible: false
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: { fetchSingleTaxAgentList }} = this.props;
|
||||
fetchSingleTaxAgentList({salaryArchiveId: this.props.id})
|
||||
}
|
||||
|
||||
// 编辑回调
|
||||
handleEdit(record) {
|
||||
const { salaryFileStore: {setEditAgentVisible} } = this.props;
|
||||
this.setState({
|
||||
recordId: record.id,
|
||||
editAgentVisible: true
|
||||
})
|
||||
}
|
||||
|
||||
// 获取Columns
|
||||
getColumns() {
|
||||
const { salaryFileStore: {singleTaxAgentList} } = this.props;
|
||||
let columns = []
|
||||
if(singleTaxAgentList.columns) {
|
||||
columns = [...singleTaxAgentList.columns]
|
||||
}
|
||||
if(columns.length > 0) {
|
||||
columns.push({
|
||||
title: '操作',
|
||||
key: "cz",
|
||||
dataIndex: "cz",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<a onClick={() => {this.handleEdit(record)}}>编辑</a>
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
return columns
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { singleTaxAgentList } = salaryFileStore
|
||||
return (
|
||||
<div>
|
||||
<Table dataSource={singleTaxAgentList.list ? singleTaxAgentList.list: []} columns={this.getColumns()} />
|
||||
{
|
||||
this.state.editAgentVisible && <EditAgentModal
|
||||
currentId={this.props.id}
|
||||
recordId={this.state.recordId}
|
||||
visible={this.state.editAgentVisible}
|
||||
onCancel={() => {this.setState({editAgentVisible: false})}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import moment from 'moment'
|
||||
|
||||
import * as API from '../apis/archive'; // 引入API接口文件
|
||||
import { notNull } from '../util/validate'
|
||||
|
|
@ -27,6 +28,11 @@ export class salaryFileStore {
|
|||
@observable singleSalaryItemList = []
|
||||
@observable singleTaxAgentList = []
|
||||
|
||||
@observable currentId = ""
|
||||
@observable editAgentVisible = false
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
|
|
@ -295,15 +301,38 @@ export class salaryFileStore {
|
|||
API.singleTaxAgentList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.singleTaxAgentList = res.data
|
||||
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 设置当前查看的数据id
|
||||
@action
|
||||
setCurrentId = (id) => this.currentId = id
|
||||
|
||||
// 设置编辑个税义务人修改表modal
|
||||
@action
|
||||
setEditAgentVisible = editAgentVisible => this.editAgentVisible = editAgentVisible;
|
||||
|
||||
// 通过个税义务人编辑进入列表
|
||||
@action
|
||||
getTaxAgentFormByTaxAgentId = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentFormBySalaryArchiveTaxAgentId({salaryArchiveTaxAgentId: id}).then(res => {
|
||||
if(res.status) {
|
||||
let form = res.data.salaryArchiveTaxAgentForm
|
||||
form.effectiveTime = moment(new Date(form.effectiveTime)).format("YYYY-MM-DD")
|
||||
this.salaryArchiveTaxAgentForm = form
|
||||
resolve()
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue