操作菜单权限得bug修复
This commit is contained in:
parent
60a97f9736
commit
e3d30694c3
|
|
@ -31,7 +31,7 @@ export default class ItemMangeFormModal extends React.Component {
|
|||
this.setState({request: result})
|
||||
}
|
||||
|
||||
convertFieldType(fileTypeStr) {
|
||||
convertFieldType=(fileTypeStr)=> {
|
||||
if(fileTypeStr == "数值") {
|
||||
return "1"
|
||||
} else if(fileTypeStr == "文本"){
|
||||
|
|
@ -57,7 +57,7 @@ export default class ItemMangeFormModal extends React.Component {
|
|||
]
|
||||
const { request } = this.state;
|
||||
const {fieldName, fieldType, enableStatus, description} = request
|
||||
let fileTypeKey = convertFieldType(fieldType)
|
||||
let fileTypeKey = this.convertFieldType(fieldType)
|
||||
const { attendanceStore : {currentItemOperate}} = this.props;
|
||||
return (
|
||||
<Modal width={600} visible={this.props.visible} onCancel={this.props.onCancel}
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ export default class CumDeduct extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
taxAgentId: taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
@ -444,7 +444,7 @@ export default class CumDeduct extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
taxAgentId: taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ export default class CumSituation extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
@ -450,7 +450,7 @@ export default class CumSituation extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ export default class OtherDeduct extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
taxAgentIdL:taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
@ -446,7 +446,7 @@ export default class OtherDeduct extends React.Component {
|
|||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -582,6 +582,7 @@ export default class Ledger extends React.Component {
|
|||
{ title: "薪资项目", key: 2 },
|
||||
{ title: "调薪计薪规则", key: 3 },
|
||||
]}
|
||||
showOperateBtn={showOperateBtn}
|
||||
editable={canEdit === "true"}
|
||||
selectedTab={selectedTab}
|
||||
onSave={() => this.handleEditSlideSave()}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import moment from "moment";
|
|||
import CustomTable from "../../components/customTable";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
|
||||
@inject("payrollStore")
|
||||
@inject("payrollStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class SalarySendList extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -52,7 +52,7 @@ export default class SalarySendList extends React.Component {
|
|||
getColumns() {
|
||||
const {
|
||||
payrollStore: { salarySendTableStore },
|
||||
showOperateBtn
|
||||
taxAgentStore: { showOperateBtn }
|
||||
} = this.props;
|
||||
const { columns } = salarySendTableStore;
|
||||
if (!columns) {
|
||||
|
|
@ -80,7 +80,7 @@ export default class SalarySendList extends React.Component {
|
|||
}
|
||||
});
|
||||
showOperateBtn
|
||||
? result.concat([
|
||||
? (result = result.concat([
|
||||
{
|
||||
title: "操作",
|
||||
key: "operate",
|
||||
|
|
@ -128,8 +128,8 @@ export default class SalarySendList extends React.Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
])
|
||||
: result.concat([
|
||||
]))
|
||||
: (result = result.concat([
|
||||
{
|
||||
title: "操作",
|
||||
key: "operate",
|
||||
|
|
@ -144,7 +144,7 @@ export default class SalarySendList extends React.Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
]);
|
||||
]));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,6 @@ export default class Payroll extends React.Component {
|
|||
{
|
||||
this.state.selectedKey == 0 &&
|
||||
<SalarySendList
|
||||
showOperateBtn={showOperateBtn}
|
||||
onEditTemplate={(record) => {
|
||||
this.handleTemplateListEdit(record)
|
||||
}}
|
||||
|
|
@ -432,6 +431,7 @@ export default class Payroll extends React.Component {
|
|||
tabs={[{title: '基础设置', key: 0}, {title: "显示设置", key: 1}]}
|
||||
editable={false}
|
||||
selectedTab={selectedTab}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={<span>
|
||||
{
|
||||
selectedTab == 0 && <Button type="primary" onClick={() => {this.handleUpdateSave()}}>保存</Button>
|
||||
|
|
|
|||
|
|
@ -95,17 +95,13 @@ export default class PayrollGrant extends React.Component {
|
|||
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { salaryGrantTableStore } = payrollStore
|
||||
const { columns } = salaryGrantTableStore;
|
||||
if(!columns) {
|
||||
return []
|
||||
}
|
||||
const { salaryGrantTableStore: columns } = payrollStore
|
||||
|
||||
let result = columns.filter(item => item.hide == "false").map(item => {
|
||||
let result = [...columns, {title: "操作",key: "operation",dataIndex: "operation"}].map(item => {
|
||||
item = {...item}
|
||||
if(item.dataIndex == "operation") {
|
||||
item.render = (text,record) => {
|
||||
if(text == 'ALREADYSEND') {
|
||||
if(record.sendStatus == '已发放') {
|
||||
return (
|
||||
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
|
||||
)
|
||||
|
|
@ -144,9 +140,9 @@ export default class PayrollGrant extends React.Component {
|
|||
);
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleGrantAll()}}>全部发放</Button>
|
||||
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Button>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>更多</Dropdown.Button>
|
||||
<Button type="primary" style={{marginRight: "1rem"}} onClick={() => {this.handleGrantAll()}}>全部发放</Button>
|
||||
<Button type="default" style={{marginRight: "1rem"}} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Button>
|
||||
<Dropdown.Button style={{marginRight: "1rem"}} overlay={menu}>更多</Dropdown.Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -205,7 +201,7 @@ export default class PayrollGrant extends React.Component {
|
|||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
|
||||
<WeaHelpfulTip
|
||||
style={{marginLeft: '10px', marginRight: "10px"}}
|
||||
style={{marginLeft: '1rem', marginRight: "1rem"}}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
|
|
|
|||
|
|
@ -1,181 +1,246 @@
|
|||
import React from 'react'
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom"
|
||||
import { payrollGrantColumns, dataSource } from "../columns"
|
||||
import { Menu, Button,Table, Modal, Dropdown,message } from "antd"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import React from "react";
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom";
|
||||
import { payrollGrantColumns, dataSource } from "../columns";
|
||||
import { Menu, Button, Table, Modal, Dropdown, message } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
||||
@inject('payrollStore')
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
export default class payrollGrantModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: [],
|
||||
current: 1,
|
||||
searchValue: ""
|
||||
}
|
||||
}
|
||||
// 撤回
|
||||
handleWithdraw(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { withdrawPayroll, batchSendInfoList } = payrollStore;
|
||||
withdrawPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchSendInfoList({salarySendId: this.props.sendId})
|
||||
})
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: [],
|
||||
current: 1,
|
||||
searchValue: ""
|
||||
};
|
||||
}
|
||||
// 撤回
|
||||
handleWithdraw(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { withdrawPayroll, batchSendInfoList } = payrollStore;
|
||||
withdrawPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchSendInfoList({ salarySendId: this.props.sendId });
|
||||
});
|
||||
}
|
||||
|
||||
// 发送
|
||||
handleGrant(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { grantPayroll, batchSendInfoList } = payrollStore;
|
||||
grantPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchSendInfoList({salarySendId: this.props.sendId})
|
||||
})
|
||||
}
|
||||
// 发送
|
||||
handleGrant(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { grantPayroll, batchSendInfoList } = payrollStore;
|
||||
grantPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchSendInfoList({ salarySendId: this.props.sendId });
|
||||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({salarySendId: this.props.sendId})
|
||||
}
|
||||
componentWillMount() {
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({ salarySendId: this.props.sendId });
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { canGrantColumns } = payrollStore
|
||||
if(!canGrantColumns) {
|
||||
return []
|
||||
}
|
||||
return canGrantColumns.map(item => {
|
||||
let result = {}
|
||||
result.title = item.text;
|
||||
result.dataIndex = item.column;
|
||||
result.key = item.column;
|
||||
result.width = item.width;
|
||||
if(result.key == "operation") {
|
||||
result.render = (text,record) => {
|
||||
if(text == 'ALREADYSEND') {
|
||||
return (
|
||||
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a onClick={() => {this.handleGrant(record)}}>发送</a>
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.dataIndex = item.column;
|
||||
}
|
||||
return result;
|
||||
})
|
||||
}
|
||||
|
||||
onSelectChange = (value) => {
|
||||
this.setState({
|
||||
selectedRowKeys: value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 发放
|
||||
fetchGrantPayRoll(payload) {
|
||||
const { payrollStore: { grantPayroll }} = this.props;
|
||||
grantPayroll(payload).then(() => {
|
||||
const { payrollStore: {getInfoList}} = this.props;
|
||||
getInfoList({
|
||||
salarySendId:this.props.sendId
|
||||
})
|
||||
this.props.onCancel && this.props.onCancel()
|
||||
})
|
||||
}
|
||||
|
||||
handleMenuClick(e) {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { payrollStore: { grantPayroll }} = this.props;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return
|
||||
}
|
||||
this.fetchGrantPayRoll({ids: selectedRowKeys, salarySendId: this.props.sendId})
|
||||
}
|
||||
|
||||
handleGrantAll() {
|
||||
this.fetchGrantPayRoll({salarySendId: this.props.sendId})
|
||||
}
|
||||
|
||||
handleSearch(value) {
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({salarySendId: this.props.sendId, keyword: value, current: this.state.current})
|
||||
}
|
||||
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
this.setState({current: value})
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({salarySendId: this.props.sendId, current: value})
|
||||
}
|
||||
|
||||
render() {
|
||||
const menu = (
|
||||
<Menu onClick={(e) => this.handleMenuClick(e)}>
|
||||
<Menu.Item key="1">发放所选</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const {payrollStore} = this.props;
|
||||
const { salarySendDetailBaseInfo, canGrantDataSource, canGrantPageInfo } = payrollStore;
|
||||
const { selectedRowKeys } = this.state;
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange.bind(this),
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { canGrantColumns } = payrollStore;
|
||||
return [
|
||||
...canGrantColumns,
|
||||
{ title: "操作", key: "operation", dataIndex: "operation" }
|
||||
].map(item => {
|
||||
if (item.key == "operation") {
|
||||
item.render = (text, record) => {
|
||||
if (record.sendStatus == "已发放") {
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleWithdraw(record);
|
||||
}}>
|
||||
撤回
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleGrant(record);
|
||||
}}>
|
||||
发送
|
||||
</a>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal width={800} visible={this.props.visible} onCancel={() => {this.props.onCancel()}}>
|
||||
<div style={{padding: "0px 10px", height: "47px", lineHeight: "47px"}}>
|
||||
<span style={{fontSize: "14px", color: '#666'}}>批量发放</span>
|
||||
<div style={{float: "right", marginRight: "40px"}}>
|
||||
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleGrantAll()}}>全部发放</Dropdown.Button>
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{height: "40px", lineHeight: "40px"}}>
|
||||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
|
||||
<WeaHelpfulTip
|
||||
style={{marginLeft: '10px', marginRight: "10px"}}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>工资单模板:{salarySendDetailBaseInfo.template}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{marginTop: "10px", height: "500px", overflowY: "scroll"}}>
|
||||
<WeaTable rowSelection={rowSelection} dataSource={canGrantDataSource} columns={this.getColumns()}
|
||||
pagination={{
|
||||
onChange: (value) => {this.handleDataPageChange(value)},
|
||||
total: canGrantPageInfo.total,
|
||||
current: canGrantPageInfo.pageNum,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
onSelectChange = value => {
|
||||
this.setState({
|
||||
selectedRowKeys: value
|
||||
});
|
||||
};
|
||||
|
||||
// 发放
|
||||
fetchGrantPayRoll(payload) {
|
||||
const { payrollStore: { grantPayroll } } = this.props;
|
||||
grantPayroll(payload).then(() => {
|
||||
const { payrollStore: { getInfoList } } = this.props;
|
||||
getInfoList({
|
||||
salarySendId: this.props.sendId
|
||||
});
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
});
|
||||
}
|
||||
|
||||
handleMenuClick(e) {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { payrollStore: { grantPayroll } } = this.props;
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.fetchGrantPayRoll({
|
||||
ids: selectedRowKeys,
|
||||
salarySendId: this.props.sendId
|
||||
});
|
||||
}
|
||||
|
||||
handleGrantAll() {
|
||||
this.fetchGrantPayRoll({ salarySendId: this.props.sendId });
|
||||
}
|
||||
|
||||
handleSearch(value) {
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({
|
||||
salarySendId: this.props.sendId,
|
||||
keyword: value,
|
||||
current: this.state.current
|
||||
});
|
||||
}
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
this.setState({ current: value });
|
||||
const { payrollStore: { batchSendInfoList } } = this.props;
|
||||
batchSendInfoList({ salarySendId: this.props.sendId, current: value });
|
||||
}
|
||||
|
||||
render() {
|
||||
const menu = (
|
||||
<Menu onClick={e => this.handleMenuClick(e)}>
|
||||
<Menu.Item key="1">发放所选</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const { payrollStore } = this.props;
|
||||
const {
|
||||
salarySendDetailBaseInfo,
|
||||
canGrantDataSource,
|
||||
canGrantPageInfo
|
||||
} = payrollStore;
|
||||
const { selectedRowKeys } = this.state;
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange.bind(this)
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
width={800}
|
||||
visible={this.props.visible}
|
||||
onCancel={() => {
|
||||
this.props.onCancel();
|
||||
}}>
|
||||
<div
|
||||
style={{ padding: "0px 10px", height: "47px", lineHeight: "47px" }}>
|
||||
<span style={{ fontSize: "14px", color: "#666" }}>批量发放</span>
|
||||
<div style={{ float: "right", marginRight: "40px" }}>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu}
|
||||
onClick={() => {
|
||||
this.handleGrantAll();
|
||||
}}>
|
||||
全部发放
|
||||
</Dropdown.Button>
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={value => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ height: "40px", lineHeight: "40px" }}>
|
||||
<div className="titleBarLeft">
|
||||
<span>
|
||||
薪资所属月:{salarySendDetailBaseInfo.salaryMonth &&
|
||||
salarySendDetailBaseInfo.salaryMonth
|
||||
.year}-{salarySendDetailBaseInfo.salaryMonth &&
|
||||
salarySendDetailBaseInfo.salaryMonth.monthValue}
|
||||
</span>
|
||||
<WeaHelpfulTip
|
||||
style={{ marginLeft: "10px", marginRight: "10px" }}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.salaryCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.salaryCycle
|
||||
.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.salaryCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.attendCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.attendCycle
|
||||
.fromDate}至${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.attendCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>
|
||||
工资单模板:{salarySendDetailBaseInfo.template}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style={{ marginTop: "10px", height: "500px", overflowY: "scroll" }}>
|
||||
<WeaTable
|
||||
rowSelection={rowSelection}
|
||||
dataSource={canGrantDataSource}
|
||||
columns={this.getColumns()}
|
||||
pagination={{
|
||||
onChange: value => {
|
||||
this.handleDataPageChange(value);
|
||||
},
|
||||
total: canGrantPageInfo.total,
|
||||
current: canGrantPageInfo.pageNum,
|
||||
showTotal: total => `共 ${total} 条`
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,188 +1,245 @@
|
|||
import React from 'react'
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom"
|
||||
import { payrollGrantColumns, dataSource } from "../columns"
|
||||
import { Menu, Button,Table, Modal, Dropdown } from "antd"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import React from "react";
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom";
|
||||
import { payrollGrantColumns, dataSource } from "../columns";
|
||||
import { Menu, Button, Table, Modal, Dropdown } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
||||
|
||||
@inject('payrollStore')
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
export default class PayrollWithdrawModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: [],
|
||||
current: 1,
|
||||
}
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: [],
|
||||
current: 1
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { payrollStore } = this.props
|
||||
const { batchWithdrawInfoList } = payrollStore
|
||||
batchWithdrawInfoList({salarySendId:this.props.sendId})
|
||||
}
|
||||
componentWillMount() {
|
||||
const { payrollStore } = this.props;
|
||||
const { batchWithdrawInfoList } = payrollStore;
|
||||
batchWithdrawInfoList({ salarySendId: this.props.sendId });
|
||||
}
|
||||
|
||||
// 撤回
|
||||
handleWithdraw(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { withdrawPayroll, batchWithdrawInfoList } = payrollStore;
|
||||
withdrawPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchWithdrawInfoList({salarySendId:this.props.sendId})
|
||||
})
|
||||
}
|
||||
// 撤回
|
||||
handleWithdraw(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { withdrawPayroll, batchWithdrawInfoList } = payrollStore;
|
||||
withdrawPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchWithdrawInfoList({ salarySendId: this.props.sendId });
|
||||
});
|
||||
}
|
||||
|
||||
// 发送
|
||||
handleGrant(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { grantPayroll,batchWithdrawInfoList } = payrollStore;
|
||||
grantPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchWithdrawInfoList({salarySendId:this.props.sendId})
|
||||
})
|
||||
}
|
||||
// 发送
|
||||
handleGrant(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { grantPayroll, batchWithdrawInfoList } = payrollStore;
|
||||
grantPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.props.sendId
|
||||
}).then(() => {
|
||||
batchWithdrawInfoList({ salarySendId: this.props.sendId });
|
||||
});
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { canWidthdrawColumns } = payrollStore
|
||||
if(!canWidthdrawColumns) {
|
||||
return []
|
||||
}
|
||||
return canWidthdrawColumns.map(item => {
|
||||
let result = {}
|
||||
result.title = item.text;
|
||||
result.key = item.column;
|
||||
result.dataIndex = item.column;
|
||||
result.width = item.width;
|
||||
if(result.key == "operation") {
|
||||
result.render = (text,record) => {
|
||||
if(text == 'ALREADYSEND') {
|
||||
return (
|
||||
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a onClick={() => {this.handleGrant(record)}}>发送</a>
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.dataIndex = item.column;
|
||||
}
|
||||
return result;
|
||||
})
|
||||
}
|
||||
|
||||
onSelectChange = (value) => {
|
||||
this.setState({
|
||||
selectedRowKeys: value
|
||||
})
|
||||
}
|
||||
|
||||
// 撤回
|
||||
fetchWithdrawPayroll(payload) {
|
||||
const { payrollStore: { grantPayroll, withdrawPayroll }} = this.props;
|
||||
withdrawPayroll(payload).then(() => {
|
||||
const { payrollStore: {getInfoList}} = this.props;
|
||||
getInfoList({
|
||||
salarySendId:this.props.sendId
|
||||
})
|
||||
this.props.onCancel && this.props.onCancel()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
handleMenuClick(e) {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { payrollStore: { grantPayroll }} = this.props;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return
|
||||
}
|
||||
this.fetchWithdrawPayroll({ids: selectedRowKeys, salarySendId: this.props.sendId})
|
||||
}
|
||||
|
||||
|
||||
handleWithdrawAll() {
|
||||
this.fetchWithdrawPayroll({salarySendId: this.props.sendId})
|
||||
}
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
this.setState({current: value})
|
||||
const { payrollStore } = this.props
|
||||
const { batchWithdrawInfoList } = payrollStore
|
||||
batchWithdrawInfoList({salarySendId:this.props.sendId, current: value})
|
||||
}
|
||||
|
||||
|
||||
|
||||
handleSearch(value) {
|
||||
const { payrollStore: { batchWithdrawInfoList } } = this.props;
|
||||
batchWithdrawInfoList({salarySendId: this.props.sendId, keyword: value, current: this.state.current})
|
||||
}
|
||||
|
||||
render() {
|
||||
const menu = (
|
||||
<Menu onClick={(e) => this.handleMenuClick(e)}>
|
||||
<Menu.Item key="1">撤回所选</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const {payrollStore} = this.props;
|
||||
const { salarySendDetailBaseInfo, canWidthdrawColumns, canWithdrawDataSource, canWithdrawPageInfo } = payrollStore;
|
||||
const { selectedRowKeys } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange.bind(this),
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { canWidthdrawColumns } = payrollStore;
|
||||
return [
|
||||
...canWidthdrawColumns,
|
||||
{ title: "操作", key: "operation", dataIndex: "operation" }
|
||||
].map(item => {
|
||||
if (item.key == "operation") {
|
||||
item.render = (text, record) => {
|
||||
if (record.sendStatus == "已发放") {
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleWithdraw(record);
|
||||
}}>
|
||||
撤回
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleGrant(record);
|
||||
}}>
|
||||
发送
|
||||
</a>
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
onSelectChange = value => {
|
||||
this.setState({
|
||||
selectedRowKeys: value
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal width={800} visible={this.props.visible} onCancel={() => {this.props.onCancel()}}>
|
||||
<div style={{padding: "0px 10px", height: "47px", lineHeight: "47px"}}>
|
||||
<span style={{fontSize: "14px", color: '#666'}}>批量撤回</span>
|
||||
<div style={{float: "right", marginRight: "40px"}}>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Dropdown.Button>
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{height: "40px", lineHeight: "40px"}}>
|
||||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
|
||||
<WeaHelpfulTip
|
||||
style={{marginLeft: '10px', marginRight: "10px"}}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>工资单模板:{salarySendDetailBaseInfo.template}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{marginTop: "10px", height: "500px", scrollY: "scroll"}}>
|
||||
<WeaTable
|
||||
rowSelection={rowSelection}
|
||||
dataSource={canWithdrawDataSource}
|
||||
columns={this.getColumns()}
|
||||
pagination={{
|
||||
onChange: (value) => {this.handleDataPageChange(value)},
|
||||
total: canWithdrawPageInfo.total,
|
||||
current: canWithdrawPageInfo.pageNum,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
// 撤回
|
||||
fetchWithdrawPayroll(payload) {
|
||||
const { payrollStore: { grantPayroll, withdrawPayroll } } = this.props;
|
||||
withdrawPayroll(payload).then(() => {
|
||||
const { payrollStore: { getInfoList } } = this.props;
|
||||
getInfoList({
|
||||
salarySendId: this.props.sendId
|
||||
});
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
});
|
||||
}
|
||||
|
||||
handleMenuClick(e) {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { payrollStore: { grantPayroll } } = this.props;
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.fetchWithdrawPayroll({
|
||||
ids: selectedRowKeys,
|
||||
salarySendId: this.props.sendId
|
||||
});
|
||||
}
|
||||
|
||||
handleWithdrawAll() {
|
||||
this.fetchWithdrawPayroll({ salarySendId: this.props.sendId });
|
||||
}
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
this.setState({ current: value });
|
||||
const { payrollStore } = this.props;
|
||||
const { batchWithdrawInfoList } = payrollStore;
|
||||
batchWithdrawInfoList({ salarySendId: this.props.sendId, current: value });
|
||||
}
|
||||
|
||||
handleSearch(value) {
|
||||
const { payrollStore: { batchWithdrawInfoList } } = this.props;
|
||||
batchWithdrawInfoList({
|
||||
salarySendId: this.props.sendId,
|
||||
keyword: value,
|
||||
current: this.state.current
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const menu = (
|
||||
<Menu onClick={e => this.handleMenuClick(e)}>
|
||||
<Menu.Item key="1">撤回所选</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const { payrollStore } = this.props;
|
||||
const {
|
||||
salarySendDetailBaseInfo,
|
||||
canWidthdrawColumns,
|
||||
canWithdrawDataSource,
|
||||
canWithdrawPageInfo
|
||||
} = payrollStore;
|
||||
const { selectedRowKeys } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange.bind(this)
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
width={800}
|
||||
visible={this.props.visible}
|
||||
onCancel={() => {
|
||||
this.props.onCancel();
|
||||
}}>
|
||||
<div
|
||||
style={{ padding: "0px 10px", height: "47px", lineHeight: "47px" }}>
|
||||
<span style={{ fontSize: "14px", color: "#666" }}>批量撤回</span>
|
||||
<div style={{ float: "right", marginRight: "40px" }}>
|
||||
<Dropdown.Button
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu}
|
||||
onClick={() => {
|
||||
this.handleWithdrawAll();
|
||||
}}>
|
||||
全部撤回
|
||||
</Dropdown.Button>
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={value => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ height: "40px", lineHeight: "40px" }}>
|
||||
<div className="titleBarLeft">
|
||||
<span>
|
||||
薪资所属月:{salarySendDetailBaseInfo.salaryMonth &&
|
||||
salarySendDetailBaseInfo.salaryMonth
|
||||
.year}-{salarySendDetailBaseInfo.salaryMonth &&
|
||||
salarySendDetailBaseInfo.salaryMonth.monthValue}
|
||||
</span>
|
||||
<WeaHelpfulTip
|
||||
style={{ marginLeft: "10px", marginRight: "10px" }}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.salaryCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.salaryCycle
|
||||
.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.salaryCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.attendCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.attendCycle
|
||||
.fromDate}至${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.attendCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${salarySendDetailBaseInfo.salarySobCycle &&
|
||||
salarySendDetailBaseInfo.salarySobCycle
|
||||
.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>
|
||||
工资单模板:{salarySendDetailBaseInfo.template}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ marginTop: "10px", height: "500px", scrollY: "scroll" }}>
|
||||
<WeaTable
|
||||
rowSelection={rowSelection}
|
||||
dataSource={canWithdrawDataSource}
|
||||
columns={this.getColumns()}
|
||||
pagination={{
|
||||
onChange: value => {
|
||||
this.handleDataPageChange(value);
|
||||
},
|
||||
total: canWithdrawPageInfo.total,
|
||||
current: canWithdrawPageInfo.pageNum,
|
||||
showTotal: total => `共 ${total} 条`
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ export default class SalaryFile extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { salaryFileStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const {
|
||||
loading,
|
||||
hasRight,
|
||||
|
|
@ -355,7 +355,6 @@ export default class SalaryFile extends React.Component {
|
|||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return (
|
||||
<div
|
||||
style={{ display: "inline-block", position: "relative" }}
|
||||
|
|
@ -555,6 +554,7 @@ export default class SalaryFile extends React.Component {
|
|||
{ title: "个税扣缴义务人", key: 1 },
|
||||
]}
|
||||
editable={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
selectedTab={selectedTab}
|
||||
customOperate={() => {
|
||||
renderCustomOperate();
|
||||
|
|
|
|||
|
|
@ -352,6 +352,7 @@ export default class SalaryItem extends React.Component {
|
|||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
editable={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={showOperateBtn ? renderCustomOperate() : null}
|
||||
subItemChange={
|
||||
(item) => {this.setState({selectedTab: item.key})}
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ export default class Archives extends React.Component {
|
|||
tabs={[{title: '基础设置', key: 0}, {title: "社保", key: 1}, {title: "公积金", key: 2}, {title: '企业年金及其他福利', key: 3}]}
|
||||
editable={false}
|
||||
selectedTab={selectedTab}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={
|
||||
<div>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -545,6 +545,7 @@ export default class Programme extends React.Component {
|
|||
subtitle={this.state.customEdit ? "修改" : "新增"}
|
||||
subTabs={[{ title: "基础设置" }]}
|
||||
editable={true}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onSave={() => {
|
||||
handleOnSave();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from '../apis/payroll'; // 引入API接口文件
|
||||
import { notNull } from '../util/validate';
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
import * as API from "../apis/payroll"; // 引入API接口文件
|
||||
import { notNull } from "../util/validate";
|
||||
import { removePropertyCondition } from "../util/response";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -16,20 +16,19 @@ export class payrollStore {
|
|||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
|
||||
// **** 模板页面 ****
|
||||
// **** 模板页面 ****
|
||||
@observable templateStore = new TableStore(); // 模板设置列表
|
||||
// 基础设置表单
|
||||
@observable templateBaseData = {} // 基础信息表单数据
|
||||
@observable salarySobOptions = [] // 账套列表
|
||||
@observable templateBaseData = {}; // 基础信息表单数据
|
||||
@observable salarySobOptions = []; // 账套列表
|
||||
// 显示设置表单
|
||||
@observable salaryTemplateShowSet = {} // 显示设置基础表单
|
||||
@observable salaryItemSet = [] // 显示设置薪资项
|
||||
|
||||
@observable salaryTemplateShowSet = {}; // 显示设置基础表单
|
||||
@observable salaryItemSet = []; // 显示设置薪资项
|
||||
|
||||
// **** 工资单页面 ****
|
||||
@observable salarySendTableStore = new TableStore(); // 工资单列表
|
||||
@observable salarySendDataSource = [];
|
||||
@observable pageInfo = {}
|
||||
@observable pageInfo = {};
|
||||
|
||||
// **** 工资单详情页 ****
|
||||
@observable salarySendDetailBaseInfo = {}; // 工资单详情基础信息
|
||||
|
|
@ -38,483 +37,503 @@ export class payrollStore {
|
|||
@observable detailListConditionForm = new WeaForm(); // 详情页搜索条件
|
||||
@observable detailListShowSearchAd = false; // 详情页是否展开搜索面板
|
||||
@observable detailListCondition = []; // 详情页搜索条件
|
||||
@observable salarySendDetailPageInfo ={}
|
||||
@observable salarySendDetailPageInfo = {};
|
||||
|
||||
// **** 工资单发放页 ****
|
||||
@observable salaryGrantDataSource = [];
|
||||
@observable salaryGrantPageInfo ={};
|
||||
@observable salaryGrantTableStore = new TableStore();
|
||||
@observable salaryGrantPageInfo = {};
|
||||
@observable salaryGrantTableStore = [];
|
||||
@observable grantListConditionForm = new WeaForm(); // 详情页搜索条件
|
||||
@observable grantListShowSearchAd = false; // 详情页是否展开搜索面板
|
||||
@observable grantListCondition = []; // 详情页搜索条件
|
||||
@observable canGrantDataSource = []; // 可以发送的列表
|
||||
@observable canGrantColumns = []; // 可以发送的列名
|
||||
@observable canGrantColumns = []; // 可以发送的列名
|
||||
@observable canGrantPageInfo = {}; // 可以发送列表分页对象
|
||||
@observable canWithdrawDataSource = []; // 可以撤回的列表
|
||||
@observable canWidthdrawColumns = []; // 可以撤回的列表列名
|
||||
@observable canWithdrawPageInfo = {}; // 可以撤回列表分页对象
|
||||
|
||||
@action
|
||||
setGrantListShowSearchAd = (grantListShowSearchAd) => this.grantListShowSearchAd = grantListShowSearchAd
|
||||
setGrantListShowSearchAd = grantListShowSearchAd =>
|
||||
(this.grantListShowSearchAd = grantListShowSearchAd);
|
||||
|
||||
// 详情页是否展开搜索面板
|
||||
@action
|
||||
setDetailListShowSearchAd = (detailListShowSearchAd) => this.detailListShowSearchAd = detailListShowSearchAd
|
||||
setDetailListShowSearchAd = detailListShowSearchAd =>
|
||||
(this.detailListShowSearchAd = detailListShowSearchAd);
|
||||
|
||||
// 基础信息表单数据
|
||||
@action
|
||||
setTemplateBaseData = (templateBaseData) => this.templateBaseData = templateBaseData
|
||||
setTemplateBaseData = templateBaseData =>
|
||||
(this.templateBaseData = templateBaseData);
|
||||
|
||||
// 显示设置基础表单
|
||||
@action
|
||||
setSalaryTemplateShowSet = (salaryTemplateShowSet) => this.salaryTemplateShowSet = salaryTemplateShowSet
|
||||
setSalaryTemplateShowSet = salaryTemplateShowSet =>
|
||||
(this.salaryTemplateShowSet = salaryTemplateShowSet);
|
||||
|
||||
@action
|
||||
setSalaryItemSet = (salaryItemSet) => this.salaryItemSet = salaryItemSet
|
||||
setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
// this.getCondition();
|
||||
// this.getTableDatas();
|
||||
}
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCondition().then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.condition);
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
API.getCondition().then(
|
||||
action(res => {
|
||||
if (res.api_status) {
|
||||
// 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.condition);
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
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;
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
API.getTableDatas(params).then(
|
||||
action(res => {
|
||||
if (res.api_status) {
|
||||
// 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.datas); // table 请求数据
|
||||
this.hasRight = res.hasRight;
|
||||
} else {
|
||||
message.error(res.msg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
@action setShowSearchAd = bool => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
@action
|
||||
doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 工资单模板-工资单模板列表
|
||||
@action
|
||||
getPayrollTemplateList = (params = {}) => {
|
||||
this.loading = true
|
||||
this.loading = true;
|
||||
API.getPayrollTemplateList(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
this.templateStore.getDatas(res.data.datas);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-获取工资单模板基础设置表单
|
||||
@action
|
||||
getPayrollBaseForm = (id = "") => {
|
||||
let params = {
|
||||
id
|
||||
}
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getPayrollBaseForm(params).then(res => {
|
||||
if(res.status) {
|
||||
let response = res.data.salaryTemplateBaseSet
|
||||
let templateBaseData = response.data
|
||||
templateBaseData.salarySob = templateBaseData.salarySob != undefined ? templateBaseData.salarySob + "": null;
|
||||
this.templateBaseData = templateBaseData // 基础信息表单数据
|
||||
|
||||
this.salarySobOptions = response.salarySobOptions ?
|
||||
response.salarySobOptions.map(item => {
|
||||
let result = {}
|
||||
result.showname = item.name;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
}) : []
|
||||
if (res.status) {
|
||||
let response = res.data.salaryTemplateBaseSet;
|
||||
let templateBaseData = response.data;
|
||||
templateBaseData.salarySob =
|
||||
templateBaseData.salarySob != undefined
|
||||
? templateBaseData.salarySob + ""
|
||||
: null;
|
||||
this.templateBaseData = templateBaseData; // 基础信息表单数据
|
||||
|
||||
this.salarySobOptions = response.salarySobOptions
|
||||
? response.salarySobOptions.map(item => {
|
||||
let result = {};
|
||||
result.showname = item.name;
|
||||
result.key = item.id + "";
|
||||
result.selected = false;
|
||||
return result;
|
||||
})
|
||||
: [];
|
||||
resolve({
|
||||
templateBaseData: this.templateBaseData,
|
||||
salarySobOptions: this.salarySobOptions
|
||||
});
|
||||
} else {
|
||||
message.errro(res.errormsg || "获取失败");
|
||||
reject()
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-获取工资单模板显示设置表单
|
||||
@action
|
||||
getPayrollShowForm = (id = "") => {
|
||||
let params = {
|
||||
id
|
||||
}
|
||||
};
|
||||
API.getPayrollShowForm(params).then(res => {
|
||||
if(res.status) {
|
||||
if(id !== "") {
|
||||
this.salaryItemSet = res.data.salaryTemplateSalaryItemSet
|
||||
if (res.status) {
|
||||
if (id !== "") {
|
||||
this.salaryItemSet = res.data.salaryTemplateSalaryItemSet;
|
||||
}
|
||||
this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data
|
||||
this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-获取薪资项目设置
|
||||
@action
|
||||
getPayrollItemList = (salarySobId = "") => {
|
||||
let params = {
|
||||
salarySobId
|
||||
}
|
||||
};
|
||||
API.getPayrollItemList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryItemSet = res.data
|
||||
if (res.status) {
|
||||
this.salaryItemSet = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化显示设置表单
|
||||
@action
|
||||
initShowSettingForm = (id = "") => {
|
||||
this.getPayrollShowForm(id);
|
||||
if(id == "") {
|
||||
this.getPayrollItemList(this.templateBaseData.salarySob)
|
||||
if (id == "") {
|
||||
this.getPayrollItemList(this.templateBaseData.salarySob);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 校验显示设置表单
|
||||
validateSalaryTemplateShowSet = () => {
|
||||
if(!notNull(this.salaryTemplateShowSet.theme)) {
|
||||
if (!notNull(this.salaryTemplateShowSet.theme)) {
|
||||
message.warning("工资单主题不能为空");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// 拼装保存参数
|
||||
convertParams = () => {
|
||||
let params = {...this.templateBaseData, ...this.salaryTemplateShowSet}
|
||||
params.salarySobId = params.salarySob
|
||||
let params = { ...this.templateBaseData, ...this.salaryTemplateShowSet };
|
||||
params.salarySobId = params.salarySob;
|
||||
params.emailStatus = params.emailStatus ? params.emailStatus : false;
|
||||
params.msgStatus = params.msgStatus ? params.msgStatus : false
|
||||
params.salaryItemNullStatus = params.salaryItemNullStatus ? params.salaryItemNullStatus : false;
|
||||
params.salaryItemZeroStatus = params.salaryItemZeroStatus ? params.salaryItemZeroStatus : false;
|
||||
params.salaryItemSetting = this.salaryItemSet
|
||||
return params
|
||||
}
|
||||
|
||||
params.msgStatus = params.msgStatus ? params.msgStatus : false;
|
||||
params.salaryItemNullStatus = params.salaryItemNullStatus
|
||||
? params.salaryItemNullStatus
|
||||
: false;
|
||||
params.salaryItemZeroStatus = params.salaryItemZeroStatus
|
||||
? params.salaryItemZeroStatus
|
||||
: false;
|
||||
params.salaryItemSetting = this.salaryItemSet;
|
||||
return params;
|
||||
};
|
||||
|
||||
// 工资单模板-新建工资单模板
|
||||
@action
|
||||
fetchSavePayroll = () => {
|
||||
if(!(this.validateSalaryTemplateShowSet())) {
|
||||
return false
|
||||
if (!this.validateSalaryTemplateShowSet()) {
|
||||
return false;
|
||||
}
|
||||
let params = this.convertParams()
|
||||
let params = this.convertParams();
|
||||
return new Promise((resolve, reject) => {
|
||||
API.savePayroll(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
this.getPayrollTemplateList();
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
reject()
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-更新工资单模板
|
||||
@action
|
||||
fetchUpdatePayroll = (id) => {
|
||||
if(!(this.validateSalaryTemplateShowSet())) {
|
||||
return false
|
||||
fetchUpdatePayroll = id => {
|
||||
if (!this.validateSalaryTemplateShowSet()) {
|
||||
return false;
|
||||
}
|
||||
let params = this.convertParams()
|
||||
params.id = id
|
||||
let params = this.convertParams();
|
||||
params.id = id;
|
||||
return new Promise((resolve, reject) => {
|
||||
API.updatePayroll(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
this.getPayrollTemplateList();
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
reject()
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
//工资单-获取薪资账套下拉列表
|
||||
@action
|
||||
getPayrollTemplateLedgerList = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getPayrollTemplateLedgerList().then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
this.payrollTemplateLedgerList = res.data.map(item => {
|
||||
let result = {}
|
||||
let result = {};
|
||||
result.showname = item.content;
|
||||
result.selected = false;
|
||||
result.key = item.id
|
||||
result.key = item.id;
|
||||
return result;
|
||||
})
|
||||
resolve(this.payrollTemplateLedgerList)
|
||||
});
|
||||
resolve(this.payrollTemplateLedgerList);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject()
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-工资单模板默认使用
|
||||
@action
|
||||
changePayrollDefaultUse(id = "") {
|
||||
if(id == "") {
|
||||
if (id == "") {
|
||||
message.warning("id必填");
|
||||
return
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
id
|
||||
}
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.changePayrollDefaultUse(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("设置成功");
|
||||
resolve()
|
||||
resolve();
|
||||
} else {
|
||||
message.success(res.errormsg || "设置失败")
|
||||
reject()
|
||||
message.success(res.errormsg || "设置失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 工资单模板-复制工资单模板
|
||||
@action
|
||||
duplicatePayroll = (id, name) => {
|
||||
let params = {
|
||||
id, name
|
||||
}
|
||||
id,
|
||||
name
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.duplicatePayroll(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("复制成功")
|
||||
this.getPayrollTemplateList()
|
||||
resolve()
|
||||
if (res.status) {
|
||||
message.success("复制成功");
|
||||
this.getPayrollTemplateList();
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "复制失败")
|
||||
message.error(res.errormsg || "复制失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单模板-删除工资单模板
|
||||
@action
|
||||
deletePayroll = (ids) => {
|
||||
deletePayroll = ids => {
|
||||
API.deletePayroll(ids).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("删除成功");
|
||||
this.getPayrollTemplateList()
|
||||
this.getPayrollTemplateList();
|
||||
} else {
|
||||
message.error(res.errormsg || "删除失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单-工资单发放列表
|
||||
@action
|
||||
getPayrollList = (parmas = {salaryYearMonth: []}) => {
|
||||
this.loading = true
|
||||
getPayrollList = (parmas = { salaryYearMonth: [] }) => {
|
||||
this.loading = true;
|
||||
API.getPayrollList(parmas).then(res => {
|
||||
if(res.status) {
|
||||
this.salarySendDataSource = res.data.datas
|
||||
this.salarySendTableStore.getDatas(res.data.dataKey.datas)
|
||||
this.pageInfo = res.data.pageInfo
|
||||
if (res.status) {
|
||||
this.salarySendDataSource = res.data.datas;
|
||||
this.salarySendTableStore.getDatas(res.data.dataKey.datas);
|
||||
this.pageInfo = res.data.pageInfo;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单发放-工资单发放基本信息
|
||||
@action
|
||||
getPayrollInfo = (id) => {
|
||||
API.getPayrollInfo({id}).then(res => {
|
||||
if(res.status) {
|
||||
this.salarySendDetailBaseInfo = res.data
|
||||
getPayrollInfo = id => {
|
||||
API.getPayrollInfo({ id }).then(res => {
|
||||
if (res.status) {
|
||||
this.salarySendDetailBaseInfo = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单发放-工资单发放信息列表
|
||||
@action
|
||||
getInfoList = (params = {}) => {
|
||||
let form = this.grantListConditionForm.getFormParams();
|
||||
params = {...form, ...params}
|
||||
params = { ...form, ...params };
|
||||
API.getInfoList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryGrantTableStore.getDatas(res.data.dataKey.datas)
|
||||
this.salaryGrantDataSource = res.data.datas
|
||||
this.salaryGrantPageInfo = res.data.pageInfo
|
||||
if (res.status) {
|
||||
this.salaryGrantTableStore = res.data.columns;
|
||||
this.salaryGrantDataSource = res.data.list;
|
||||
this.salaryGrantPageInfo = {
|
||||
total: res.data.total,
|
||||
pageNum: res.data.pageNum
|
||||
};
|
||||
this.getPayrollInfo(params.salarySendId);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单-工资单发放详情列表
|
||||
@action
|
||||
getPayrollDetailList = (params) => {
|
||||
let form = this.detailListConditionForm.getFormParams() || {}
|
||||
params = {...form, ...params}
|
||||
getPayrollDetailList = params => {
|
||||
let form = this.detailListConditionForm.getFormParams() || {};
|
||||
params = { ...form, ...params };
|
||||
API.getPayrollDetailList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas)
|
||||
this.salarySendDetailDataSource = res.data.datas
|
||||
this.salarySendDetailPageInfo = res.data.pageInfo
|
||||
if (res.status) {
|
||||
this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas);
|
||||
this.salarySendDetailDataSource = res.data.datas;
|
||||
this.salarySendDetailPageInfo = res.data.pageInfo;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单详情页 - 获得高级搜索表单数据
|
||||
@action
|
||||
getPayrollDetailSa = (params = {}) => {
|
||||
API.getPayrollDetailSa(params).then(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition);
|
||||
this.detailListCondition = condition
|
||||
this.detailListCondition = condition;
|
||||
this.detailListConditionForm.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 工资单发放-导出-工资单发放详情列表
|
||||
@action
|
||||
exportDetailList = (params = {}) => {
|
||||
API.exportDetailList(params)
|
||||
}
|
||||
API.exportDetailList(params);
|
||||
};
|
||||
|
||||
// 工资单-获取工资单发放高级搜索
|
||||
@action
|
||||
getPaySa = (params = {}) => {
|
||||
API.getPaySa(params).then(res => {
|
||||
if(res.status) {
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
if (res.status) {
|
||||
let condition = removePropertyCondition(res.data.condition);
|
||||
this.grantListCondition = condition;
|
||||
this.grantListConditionForm.initFormFields(condition);
|
||||
this.grantListConditionForm.initFormFields(condition);
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败")
|
||||
message.error(res.errormsg || "接口调用失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单发放-工资单批量发放信息列表
|
||||
@action
|
||||
batchSendInfoList = (params = {}) => {
|
||||
API.batchSendInfoList(params).then(res => {
|
||||
if(res.status) {
|
||||
let datas = res.data.datas || [];
|
||||
datas.map(item => {
|
||||
item.key = item.id
|
||||
})
|
||||
this.canGrantDataSource = datas
|
||||
if (res.status) {
|
||||
this.canGrantDataSource = res.data.list;
|
||||
this.canGrantColumns = res.data.columns;
|
||||
this.canGrantPageInfo = res.data.pageInfo
|
||||
// alert("this.canGrantColumns:" + JSON.stringify(this.canGrantColumns))
|
||||
this.canGrantPageInfo = {
|
||||
total: res.data.total,
|
||||
pageNum: res.data.pageNum
|
||||
};
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单发放-工资单批量撤回信息列表
|
||||
@action
|
||||
batchWithdrawInfoList = (params = {}) => {
|
||||
API.batchWithdrawInfoList(params).then(res => {
|
||||
if(res.status) {
|
||||
let datas = res.data.datas || [];
|
||||
if (res.status) {
|
||||
let datas = res.data.list || [];
|
||||
datas.map(item => {
|
||||
item.key = item.id
|
||||
})
|
||||
this.canWithdrawDataSource = datas
|
||||
this.canWidthdrawColumns = res.data.columns
|
||||
this.canWithdrawPageInfo = res.data.pageInfo
|
||||
item.key = item.id;
|
||||
});
|
||||
this.canWithdrawDataSource = datas;
|
||||
this.canWidthdrawColumns = res.data.columns;
|
||||
this.canWithdrawPageInfo = {
|
||||
total: res.data.total,
|
||||
pageNum: res.data.pageNum
|
||||
};
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//工资单-工资单发放
|
||||
@action
|
||||
grantPayroll = (params = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.grantPayroll(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("发送成功");
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "发送失败")
|
||||
message.error(res.errormsg || "发送失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 工资单-工资单撤回
|
||||
@action
|
||||
withdrawPayroll = (params = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.withdrawPayroll(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("撤回成功");
|
||||
resolve()
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "撤回失败")
|
||||
message.error(res.errormsg || "撤回失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue