测试bug的修复
This commit is contained in:
parent
9ddb243bc4
commit
78adb5cf0d
|
|
@ -76,7 +76,7 @@ export const saveTaxAgent = params => {
|
|||
|
||||
//薪资档案-删除个税扣缴义务人调整
|
||||
export const deleteTaxAgent = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'POST', params);
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'GET', params);
|
||||
}
|
||||
|
||||
//薪资档案操作记录-薪资项目操作记录列表
|
||||
|
|
|
|||
|
|
@ -82,14 +82,7 @@ export const updateItem = params => {
|
|||
|
||||
//薪资项目-薪资项目详情
|
||||
export const getItemForm = params => {
|
||||
return fetch('/api/bs/hrmsalary/salaryitem/getSalaryForm', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSalaryForm', 'GET', params);
|
||||
}
|
||||
|
||||
//薪资项目-添加系统薪资项目
|
||||
|
|
|
|||
|
|
@ -1,242 +1,270 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import {postFetch} from '../util/request'
|
||||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
//薪资帐套列表
|
||||
export const getLedgerList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/list", params)
|
||||
}
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/list", params);
|
||||
};
|
||||
|
||||
//启用/禁用薪资帐套
|
||||
export const changeLedgerStatus = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/disable', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/disable", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//复制薪资帐套
|
||||
export const duplicateLedger = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/duplicate', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
return fetch("/api/bs/hrmsalary/salarysob/duplicate", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//删除薪资帐套
|
||||
export const deleteLedger = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/delete", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套基本信息表单
|
||||
export const getLedgerBasicForm = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/basic/getForm', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/basic/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
// return fetch('/api/bs/hrmsalary/salarysob/basic/getForm', {
|
||||
// method: 'POST',
|
||||
// mode: 'cors',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// body: JSON.stringify(params)
|
||||
// }).then(res => res.json())
|
||||
};
|
||||
|
||||
//保存薪资帐套基本信息
|
||||
export const saveLedgerBasic = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/basic/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/basic/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套人员范围(包含)列表
|
||||
export const getLedgerPersonRangeInclude = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/range/listInclude', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套人员范围(排除)列表
|
||||
export const getLedgerPersonRangeExclude = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/range/listExclude', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/range/listExclude", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套人员范围表单
|
||||
export const getLedgerPersonRangeForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/range/getForm', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/range/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//保存薪资帐套人员范围
|
||||
export const saveLedgerPersonRange = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/range/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/range/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//删除薪资帐套人员范围
|
||||
export const deleteLedgerPersonRange = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/range/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/range/delete", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套项目分组的详情
|
||||
export const getLedgerItemGroupForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/item/group/getForm', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/item/group/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//保存薪资帐套薪资项目
|
||||
export const saveLedgerItem = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/item/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/item/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套薪资项目详情
|
||||
export const getLedgerItemForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/item/getForm', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/item/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//薪资帐套校验规则列表
|
||||
export const getLedgerRuleList = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/checkrule/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/checkrule/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//薪资帐套校验规则表单
|
||||
export const getLedgerRuleForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/checkrule/getForm', 'get', params);
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/checkrule/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//保存薪资帐套校验规则
|
||||
export const saveLedgerRule = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/checkrule/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/checkrule/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
//编辑薪资帐套校验规则公式
|
||||
export const updateLedgerRuleFormula = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/checkrule/formula/update', 'POST', params);
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/checkrule/formula/update",
|
||||
"POST",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//删除薪资帐套校验规则
|
||||
export const deleteLedgerRule = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/checkrule/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/checkrule/delete", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
// 薪资项目可选列表
|
||||
// 薪资项目可选列表
|
||||
export const listSalaryItem = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/item/listSalaryItem', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/item/listSalaryItem", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
// 员工信息字段列表
|
||||
export const empFieldList = () => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salarysob/empField/list', 'GET', {});
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/salarysob/empField/list",
|
||||
"GET",
|
||||
{}
|
||||
);
|
||||
};
|
||||
|
||||
// 调薪计薪规则可选的薪资项目列表
|
||||
export const listSalarySobItem = (params) => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/adjustmentrule/listSalarySobItem', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const listSalarySobItem = params => {
|
||||
return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/listSalarySobItem", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
// 调薪计薪规则保存
|
||||
export const saveAdjustmentRule = (params) => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/adjustmentrule/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const saveAdjustmentRule = params => {
|
||||
return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
// 调薪计薪规则列表
|
||||
export const listAdjustmentRule = params => {
|
||||
return fetch('/api/bs/hrmsalary/salarysob/adjustmentrule/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const exportCurData = params => {
|
|||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.blob().then(blob => {
|
||||
var filename=`福利档案模板.xlsx`
|
||||
var filename=`社保福利档案模板.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,29 @@
|
|||
import React from 'react'
|
||||
import { WeaTable } from 'ecCom'
|
||||
import CustomTable from '../../components/customTable'
|
||||
import React from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import CustomTable from "../../components/customTable";
|
||||
|
||||
export default class CustomPaginationTable extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<CustomTable
|
||||
{...this.props}
|
||||
pagination={{
|
||||
onChange: (value) => {this.props.onPageChange(value)},
|
||||
total: this.props.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
current: this.props.current,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
pageSize: this.props.pageSize,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.props.onShowSizeChange && this.props.onShowSizeChange(current, pageSize);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<CustomTable
|
||||
{...this.props}
|
||||
pagination={{
|
||||
onChange: value => {
|
||||
this.props.onPageChange(value);
|
||||
},
|
||||
total: this.props.total,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
current: this.props.current,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showQuickJumper: true,
|
||||
pageSize: this.props.pageSize,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.props.onShowSizeChange &&
|
||||
this.props.onShowSizeChange(current, pageSize);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +1,76 @@
|
|||
import React from "react"
|
||||
import successImg from "./success.svg"
|
||||
import { Button, Table, Spin } from "antd"
|
||||
import { WeaTable } from 'ecCom'
|
||||
import React from "react";
|
||||
import successImg from "./success.svg";
|
||||
import { Button, Table, Spin } from "antd";
|
||||
import { WeaTable } from "ecCom";
|
||||
|
||||
export default class ModalStep3 extends React.Component {
|
||||
componentWillMount() {
|
||||
this.columns = [
|
||||
{
|
||||
title: "错误信息",
|
||||
dataIndex: "message",
|
||||
key: "message"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.columns = [
|
||||
render() {
|
||||
const { importResult } = this.props;
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
textAlign: "center",
|
||||
marginTop: "10px",
|
||||
overflow: "hidden",
|
||||
height: "550px",
|
||||
display: "flex",
|
||||
flexFlow: "column"
|
||||
}}>
|
||||
<div style={{ flex: "1", display: "flex", flexFlow: "column" }}>
|
||||
{importResult.successCount === undefined
|
||||
? <div style={{ textAlign: "center", marginTop: "20px" }}>
|
||||
<Spin />
|
||||
正在导入请稍后...
|
||||
</div>
|
||||
: <div style={{ marginTop: "20px" }}>
|
||||
<img src={successImg} style={{ marginBottom: "10px" }} />
|
||||
<div style={{ fontSize: "20px", marginBottom: "10px" }}>
|
||||
数据导入完成
|
||||
</div>
|
||||
<div>
|
||||
已导入{" "}
|
||||
<span style={{ color: "green" }}>
|
||||
{" "}{importResult.successCount}{" "}
|
||||
</span>{" "}
|
||||
条数据,失败<span style={{ color: "red" }}>
|
||||
{" "}{importResult.errorCount}{" "}
|
||||
</span>条数据
|
||||
</div>
|
||||
</div>}
|
||||
<div
|
||||
style={{
|
||||
marginTop: "20px",
|
||||
maxHeight: "300px",
|
||||
overflowY: "scroll"
|
||||
}}>
|
||||
{
|
||||
title: "错误信息",
|
||||
dataIndex: 'message',
|
||||
key: 'message',
|
||||
<WeaTable
|
||||
columns={this.columns}
|
||||
dataSource={importResult.errorData}
|
||||
pagination={false}
|
||||
/>
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
render() {
|
||||
const { importResult } = this.props;
|
||||
return (
|
||||
<div style={{textAlign: "center", marginTop: "10px", overflow: "hidden", height: "550px", display:"flex", flexFlow: "column" }}>
|
||||
<div style={{flex: "1",display: "flex", flexFlow: "column"}}>
|
||||
{
|
||||
importResult.successCount === undefined ?
|
||||
<div style={{textAlign: "center", marginTop: "20px"}}>
|
||||
<Spin />
|
||||
正在导入请稍后...
|
||||
</div>
|
||||
: <div style={{marginTop: "20px"}}>
|
||||
<img src={successImg} style={{marginBottom: "10px"}} />
|
||||
<div style={{fontSize: "20px", marginBottom: "10px"}}>数据导入完成</div>
|
||||
<div>已导入 <span style={{color: "red"}}> {importResult.successCount} </span> 条数据,失败<span style={{color: "green"}}> {importResult.errorCount} </span>条数据</div>
|
||||
</div>
|
||||
}
|
||||
<div style={{marginTop: "20px", maxHeight: "300px", overflowY: "scroll"}} >
|
||||
{
|
||||
<WeaTable columns={this.columns} dataSource={importResult.errorData} pagination={false}/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="footerBtnWrapper" style={{height: "30px"}}>
|
||||
<Button type="primary" style={{float: "right"}} onClick={this.props.onFinish}>完成</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="footerBtnWrapper" style={{ height: "30px" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ float: "right" }}
|
||||
onClick={this.props.onFinish}>
|
||||
完成
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export default class baseFormModal extends React.Component {
|
|||
<Col span={8}>薪酬所属月<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<WeaDatePicker
|
||||
style={{width: "200px"}}
|
||||
style={{width: "100%"}}
|
||||
format="yyyy-MM"
|
||||
value={this.state.salaryMonthStr}
|
||||
onChange={value => {this.setState({
|
||||
|
|
@ -96,7 +96,7 @@ export default class baseFormModal extends React.Component {
|
|||
<Col span={16}>
|
||||
{
|
||||
this.state.inited && <Select
|
||||
defaultValue={this.state.salarySob} value={this.state.salarySob} style={{ width: "200px" }} onChange={(value) => this.handleSelectChange(value)}>
|
||||
defaultValue={this.state.salarySob} value={this.state.salarySob} style={{ width: "100%" }} onChange={(value) => this.handleSelectChange(value)}>
|
||||
{this.state.selectOptions.map(item => (
|
||||
<Option value={item.id} key={item.id}>{item.name}</Option>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,32 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal } from 'antd';
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal } from "antd";
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaDatePicker, WeaInputSearch } from 'ecCom';
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaTable,
|
||||
WeaDatePicker,
|
||||
WeaInputSearch
|
||||
} from "ecCom";
|
||||
|
||||
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../components/customTab';
|
||||
import ContentWrapper from '../../components/contentWrapper';
|
||||
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
import ContentWrapper from "../../components/contentWrapper";
|
||||
|
||||
import { columns, dataSource } from './columns';
|
||||
import moment from 'moment';
|
||||
import BaseFormModal from './baseFormModal'
|
||||
import CustomTable from '../../components/customTable'
|
||||
import CustomPaginationTable from '../../components/customPaginationTable'
|
||||
import { columns, dataSource } from "./columns";
|
||||
import moment from "moment";
|
||||
import BaseFormModal from "./baseFormModal";
|
||||
import CustomTable from "../../components/customTable";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
@inject('calculateStore')
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
export default class Calculate extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -27,279 +35,350 @@ export default class Calculate extends React.Component {
|
|||
value: "",
|
||||
selectedKey: "0",
|
||||
searchValue: "",
|
||||
startDate: moment(new Date()).subtract(3,'months').startOf('month').format('YYYY-MM'),
|
||||
endDate: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM'),
|
||||
startDate: moment(new Date())
|
||||
.subtract(5, "months")
|
||||
.startOf("month")
|
||||
.format("YYYY-MM"),
|
||||
endDate: moment(new Date()).startOf("month").format("YYYY-MM"),
|
||||
current: 1,
|
||||
columns: columns.map(item => {
|
||||
if(item.dataIndex == 'cz') {
|
||||
item.render = () => (
|
||||
if (item.dataIndex == "cz") {
|
||||
item.render = () =>
|
||||
<div>
|
||||
<a style={{marginRight:"10px"}}>核算</a>
|
||||
<a style={{marginRight:"10px"}}>归档</a>
|
||||
<a style={{marginRight:"10px"}} onClick={() => window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail")}>查看</a>
|
||||
<a style={{ marginRight: "10px" }}>核算</a>
|
||||
<a style={{ marginRight: "10px" }}>归档</a>
|
||||
<a
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() =>
|
||||
window.open(
|
||||
"/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail"
|
||||
)}>
|
||||
查看
|
||||
</a>
|
||||
<a>删除</a>
|
||||
</div>
|
||||
)
|
||||
</div>;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.pageInfo = { current: 1, pageSize: 10}
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { calculateStore } = this.props;
|
||||
const { getSalaryAcctList } = calculateStore
|
||||
const { getSalaryAcctList } = calculateStore;
|
||||
getSalaryAcctList({
|
||||
name: "",
|
||||
startMonthStr: this.state.startDate,
|
||||
endMonthStr: this.state.endDate
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 搜索
|
||||
handleSearch(value) {
|
||||
const { calculateStore } = this.props;
|
||||
const { getSalaryAcctList } = calculateStore
|
||||
const { getSalaryAcctList } = calculateStore;
|
||||
getSalaryAcctList({
|
||||
name: value,
|
||||
startMonthStr: this.state.startDate,
|
||||
endMonthStr: this.state.endDate,
|
||||
current: this.state.current
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
handleRangePickerChange(value) {
|
||||
let range = value.map(item => moment(item).format("YYYY-MM"))
|
||||
const { calculateStore: {getSalaryAcctList} } = this.props;
|
||||
let range = value.map(item => moment(item).format("YYYY-MM"));
|
||||
const { calculateStore: { getSalaryAcctList } } = this.props;
|
||||
this.setState({
|
||||
startDate: range[0],
|
||||
endDate: range[1]
|
||||
})
|
||||
});
|
||||
getSalaryAcctList({
|
||||
name: this.state.searchValue,
|
||||
startMonthStr: range[0],
|
||||
endMonthStr: range[1]
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 列表项核算回调
|
||||
handleAccount(record) {
|
||||
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + record.id)
|
||||
window.open(
|
||||
"/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" +
|
||||
record.id
|
||||
);
|
||||
}
|
||||
|
||||
// 列表项删除回调
|
||||
handleDeleteItem(record) {
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
const { calculateStore: {deleteSalaryacct}} = this.props;
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
const { calculateStore: { deleteSalaryacct } } = this.props;
|
||||
deleteSalaryacct([record.id]).then(() => {
|
||||
this.handleSearch(this.state.searchValue)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
this.handleSearch(this.state.searchValue);
|
||||
});
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
// 列表项归档回调
|
||||
handleFile(record) {
|
||||
const { calculateStore: {fileSalaryAcct}} = this.props;
|
||||
const { calculateStore: { fileSalaryAcct } } = this.props;
|
||||
fileSalaryAcct(record.id).then(() => {
|
||||
this.handleSearch(this.state.searchValue)
|
||||
})
|
||||
this.handleSearch(this.state.searchValue);
|
||||
});
|
||||
}
|
||||
|
||||
// 重新核算
|
||||
handleReaccount(record) {
|
||||
const { calculateStore: {reAccounting}} = this.props;
|
||||
const { calculateStore: { reAccounting } } = this.props;
|
||||
reAccounting(record.id).then(() => {
|
||||
this.handleSearch(this.state.searchValue)
|
||||
})
|
||||
this.handleSearch(this.state.searchValue);
|
||||
});
|
||||
}
|
||||
|
||||
// 查看详情回调
|
||||
handleDetail(record) {
|
||||
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail?id=" + record.id)
|
||||
window.open(
|
||||
"/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail?id=" +
|
||||
record.id
|
||||
);
|
||||
}
|
||||
|
||||
// 获取列表
|
||||
getColumns() {
|
||||
const {calculateStore: {salaryListColumns}} = this.props;
|
||||
let columns = [...salaryListColumns]
|
||||
const { calculateStore: { salaryListColumns } } = this.props;
|
||||
let columns = [...salaryListColumns];
|
||||
columns.map(item => {
|
||||
if(item.title == "操作") {
|
||||
item.render = (text,record) => {
|
||||
|
||||
if(record.operate) {
|
||||
return (
|
||||
<Dropdown overlay={<Menu>
|
||||
{
|
||||
record.operate && record.operate.map(cz => (
|
||||
<Menu.Item>
|
||||
<a onClick={() => {
|
||||
if(cz.text == "核算") {
|
||||
this.handleAccount(record);
|
||||
} else if(cz.text == "删除") {
|
||||
this.handleDeleteItem(record)
|
||||
} else if(cz.text == "归档") {
|
||||
this.handleFile(record)
|
||||
} else if(cz.text == '重新核算') {
|
||||
this.handleReaccount(record)
|
||||
} else if(cz.text == "查看") {
|
||||
this.handleDetail(record);
|
||||
}
|
||||
|
||||
}}>{cz.text}</a>
|
||||
</Menu.Item>
|
||||
))
|
||||
}
|
||||
</Menu>}>
|
||||
<i className="icon-coms-more"></i>
|
||||
if (item.title == "操作") {
|
||||
item.render = (text, record) => {
|
||||
const accountBtn = _.filter(record.operate, it => it.text == "核算");
|
||||
const notAccountBtn = _.filter(record.operate, it => it.text != "核算");
|
||||
let operateBtn = [];
|
||||
if (!_.isEmpty(accountBtn)) {
|
||||
operateBtn.push(
|
||||
_.map(accountBtn, (it, idx) => {
|
||||
return (
|
||||
<div
|
||||
className="linkWapper"
|
||||
key={idx}
|
||||
style={{ display: "inline-block", marginRight: 8 }}>
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
onClick={() => {
|
||||
if (it.text == "核算") {
|
||||
this.handleAccount(record);
|
||||
}
|
||||
}}>
|
||||
{it.text}
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
if (!_.isEmpty(notAccountBtn)) {
|
||||
operateBtn.push(
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
{notAccountBtn.map(cz =>
|
||||
<Menu.Item>
|
||||
<a
|
||||
onClick={() => {
|
||||
if (cz.text == "核算") {
|
||||
this.handleAccount(record);
|
||||
} else if (cz.text == "删除") {
|
||||
this.handleDeleteItem(record);
|
||||
} else if (cz.text == "归档") {
|
||||
this.handleFile(record);
|
||||
} else if (cz.text == "重新核算") {
|
||||
this.handleReaccount(record);
|
||||
} else if (cz.text == "查看") {
|
||||
this.handleDetail(record);
|
||||
}
|
||||
}}>
|
||||
{cz.text}
|
||||
</a>
|
||||
</Menu.Item>
|
||||
)}
|
||||
</Menu>
|
||||
}>
|
||||
<i className="icon-coms-more" />
|
||||
</Dropdown>
|
||||
);
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
return operateBtn;
|
||||
};
|
||||
}
|
||||
})
|
||||
});
|
||||
return columns;
|
||||
}
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
this.setState({current: value})
|
||||
this.pageInfo.current = value
|
||||
this.setState({ current: value });
|
||||
this.pageInfo.current = value;
|
||||
const { calculateStore } = this.props;
|
||||
const { getSalaryAcctList } = calculateStore
|
||||
const { getSalaryAcctList } = calculateStore;
|
||||
getSalaryAcctList({
|
||||
name: this.state.searchValue,
|
||||
startMonthStr: this.state.startDate,
|
||||
endMonthStr: this.state.endDate,
|
||||
current: value
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
handleShowSizeChange(pageInfo){
|
||||
handleShowSizeChange(pageInfo) {
|
||||
const { calculateStore } = this.props;
|
||||
const { getSalaryAcctList } = calculateStore
|
||||
const { getSalaryAcctList } = calculateStore;
|
||||
getSalaryAcctList({
|
||||
name: this.state.searchValue,
|
||||
startMonthStr: this.state.startDate,
|
||||
endMonthStr: this.state.endDate,
|
||||
...pageInfo
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { calculateStore } = this.props;
|
||||
const { salaryListDataSource, salaryListColumns, loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, salaryListPageInfo } = calculateStore;
|
||||
const { modalParam } = this.state
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
const {
|
||||
salaryListDataSource,
|
||||
salaryListColumns,
|
||||
loading,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
salaryListPageInfo
|
||||
} = calculateStore;
|
||||
const { modalParam } = this.state;
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom" />,
|
||||
content: "显示列定制",
|
||||
onClick: this.showColumn
|
||||
},
|
||||
}
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '薪资核算',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "薪资核算",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
importantlevel: 1,
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
}
|
||||
return <div />;
|
||||
};
|
||||
|
||||
const renderRightOperation = () => {
|
||||
const { startDate, endDate } = this.state;
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary" style={{marginRight: "10px"}}
|
||||
// onClick={() => window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail")}
|
||||
onClick={() => {this.setState({baseFormVisible: true})}}
|
||||
>核算</Button>
|
||||
<div style={{display: "inline-block"}}>
|
||||
<RangePicker defaultValue={[this.state.startDate, this.state.endDate]} picker="month" format="yyyy-MM"
|
||||
onChange={(value) => this.handleRangePickerChange(value)}
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
// onClick={() => window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail")}
|
||||
onClick={() => {
|
||||
this.setState({ baseFormVisible: true });
|
||||
}}>
|
||||
核算
|
||||
</Button>
|
||||
<div
|
||||
style={{ display: "inline-block", position: "relative", top: 2 }}>
|
||||
<RangePicker
|
||||
defaultValue={[this.state.startDate, this.state.endDate]}
|
||||
picker="month"
|
||||
format="yyyy-MM"
|
||||
onChange={value => this.handleRangePickerChange(value)}
|
||||
/>
|
||||
</div>
|
||||
<WeaInputSearch style={{marginLeft: "10px"}} value={this.state.searchValue} onChange={(value) => {this.setState({ searchValue:value })}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
<WeaInputSearch
|
||||
style={{ marginLeft: "10px" }}
|
||||
value={this.state.searchValue}
|
||||
onChange={value => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaRightMenu
|
||||
datas={rightMenu} // 右键菜单
|
||||
collectParams={collectParams} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
collectParams={collectParams}>
|
||||
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
||||
<WeaTop
|
||||
title="薪资核算" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
onChange={(v) => {
|
||||
}}
|
||||
/>
|
||||
|
||||
<CustomPaginationTable
|
||||
dropMenuProps={{ collectParams }}>
|
||||
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
||||
<CustomTab
|
||||
searchOperationItem={renderRightOperation()}
|
||||
onChange={v => {}}
|
||||
/>
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
columns={this.getColumns()}
|
||||
dataSource={salaryListDataSource}
|
||||
total={salaryListPageInfo.total}
|
||||
current={salaryListPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.handleDataPageChange(value)
|
||||
onPageChange={value => {
|
||||
this.handleDataPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = {current, pageSize}
|
||||
this.handleShowSizeChange(this.pageInfo)
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>
|
||||
</WeaTop>
|
||||
{
|
||||
this.state.baseFormVisible && <BaseFormModal
|
||||
visible={this.state.baseFormVisible}
|
||||
onRefresh={() => this.handleSearch(this.state.searchValue)}
|
||||
onCancel={() => {
|
||||
this.setState({baseFormVisible: false})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{this.state.baseFormVisible &&
|
||||
<BaseFormModal
|
||||
visible={this.state.baseFormVisible}
|
||||
onRefresh={() => this.handleSearch(this.state.searchValue)}
|
||||
onCancel={() => {
|
||||
this.setState({ baseFormVisible: false });
|
||||
}}
|
||||
/>}
|
||||
</WeaRightMenu>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,199 +1,212 @@
|
|||
import React from 'react';
|
||||
import UserSure from './userSure'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import CustomTab from '../../components/customTab'
|
||||
import SalaryDetail from './salaryDetail'
|
||||
import { Button, Menu, Dropdown, Modal, message } from 'antd'
|
||||
import { WeaInputSearch } from "ecCom"
|
||||
import { getQueryString } from '../../util/url'
|
||||
import AcctResultImportModal from './acctResult/importModal/acctResultImportModal';
|
||||
import ProgressModal from '../../components/progressModal'
|
||||
import React from "react";
|
||||
import UserSure from "./userSure";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import CustomTab from "../../components/customTab";
|
||||
import SalaryDetail from "./salaryDetail";
|
||||
import { Button, Menu, Dropdown, Modal, message } from "antd";
|
||||
import { WeaInputSearch } from "ecCom";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
|
||||
@inject('calculateStore')
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
export default class CalculateDetail extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
selectedKey: "0",
|
||||
fieldData: {},
|
||||
acctResultImportVisiable: false,
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
}
|
||||
this.id = ""
|
||||
this.timer
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "0",
|
||||
fieldData: {},
|
||||
acctResultImportVisiable: false,
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
};
|
||||
this.id = "";
|
||||
this.timer;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.id = id;
|
||||
const { calculateStore: {checkTaxAgent}} = this.props;
|
||||
checkTaxAgent(this.id)
|
||||
let modalParam = {...this.state.modalParam , salaryAcctRecordId: id}
|
||||
this.setState({modalParam})
|
||||
}
|
||||
|
||||
// 核算点击事件
|
||||
handleAccount() {
|
||||
const { calculateStore } = this.props;
|
||||
const { acctresultAccounting, acctResultList, getCalculateProgress } = calculateStore;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据",
|
||||
onOk: () => {
|
||||
this.setState({progress: 0})
|
||||
acctresultAccounting(this.id).then(() => {
|
||||
this.setState({
|
||||
progressVisible: true
|
||||
})
|
||||
if(this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(this.id).then(data => {
|
||||
let progress = data.progress
|
||||
if(progress == 1 && this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
})
|
||||
message.success("核算完成")
|
||||
acctResultList(this.id)
|
||||
} else if(!data.status) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
})
|
||||
message.success(data.message)
|
||||
}
|
||||
this.setState({progress: Number(progress) * 100})
|
||||
})
|
||||
}, 1000)
|
||||
|
||||
})
|
||||
},
|
||||
onCancel() {}
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.id = id;
|
||||
const { calculateStore: { checkTaxAgent } } = this.props;
|
||||
checkTaxAgent(this.id);
|
||||
let modalParam = { ...this.state.modalParam, salaryAcctRecordId: id };
|
||||
this.setState({ modalParam });
|
||||
}
|
||||
|
||||
// 核算点击事件
|
||||
handleAccount() {
|
||||
const { calculateStore } = this.props;
|
||||
const {
|
||||
acctresultAccounting,
|
||||
acctResultList,
|
||||
getCalculateProgress
|
||||
} = calculateStore;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据",
|
||||
onOk: () => {
|
||||
this.setState({ progress: 0 });
|
||||
acctresultAccounting(this.id).then(() => {
|
||||
this.setState({
|
||||
progressVisible: true
|
||||
});
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(this.id).then(data => {
|
||||
let progress = data.progress;
|
||||
if (progress == 1 && this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
});
|
||||
message.success("核算完成");
|
||||
acctResultList(this.id);
|
||||
} else if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
});
|
||||
message.error(data.message);
|
||||
}
|
||||
this.setState({ progress: Number(progress) * 100 });
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
|
||||
// 更多选项点击
|
||||
handleMenuClick = e => {
|
||||
if (e.key == "1") {
|
||||
// 导入
|
||||
this.setState({
|
||||
acctResultImportVisiable: true
|
||||
});
|
||||
} else if (e.key == "2") {
|
||||
window.open(
|
||||
"/spa/hrmSalary/static/index.html#/main/hrmSalary/compareDetail?id=" +
|
||||
this.id
|
||||
);
|
||||
} else if (e.key == "3") {
|
||||
const { calculateStore: { exportAll } } = this.props;
|
||||
exportAll(this.id);
|
||||
}
|
||||
};
|
||||
|
||||
// 导入表单添加表头回调
|
||||
handleAcctModalAdd(fieldData) {
|
||||
this.setState({
|
||||
fieldData
|
||||
});
|
||||
}
|
||||
|
||||
// 更多选项点击
|
||||
handleMenuClick = (e) => {
|
||||
if(e.key == "1") { // 导入
|
||||
this.setState({
|
||||
acctResultImportVisiable: true
|
||||
})
|
||||
} else if(e.key == "2") {
|
||||
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/compareDetail?id=" + this.id)
|
||||
} else if(e.key == "3") {
|
||||
const {calculateStore: {exportAll}} = this.props;
|
||||
exportAll(this.id)
|
||||
}
|
||||
// 核算结果搜索
|
||||
handleSearch(value) {
|
||||
const { calculateStore: { acctResultList } } = this.props;
|
||||
acctResultList(this.id, value);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// 清除轮询
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
|
||||
// 导入表单添加表头回调
|
||||
handleAcctModalAdd(fieldData) {
|
||||
this.setState({
|
||||
fieldData
|
||||
})
|
||||
}
|
||||
render() {
|
||||
const { selectedKey, modalParam, acctResultImportVisiable } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
const { calculateProgress } = calculateStore;
|
||||
|
||||
// 核算结果搜索
|
||||
handleSearch(value) {
|
||||
const { calculateStore: { acctResultList }} = this.props;
|
||||
acctResultList(this.id, value)
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// 清除轮询
|
||||
if(this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedKey, modalParam, acctResultImportVisiable } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
const { calculateProgress } = calculateStore
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={this.handleMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">导入</Menu.Item>
|
||||
<Menu.Item key="2">线下对比</Menu.Item>
|
||||
<Menu.Item key="3">导出全部</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
if(selectedKey == "1") {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary" style={{marginRight: "10px"}} onClick={() => this.handleAccount()}>核算</Button>
|
||||
{/* <Button type="default" style={{marginRight: "10px"}} onClick={() => this.setState({stepSlideVisible: true})}>校验</Button> */}
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>更多</Dropdown.Button>
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {
|
||||
this.setState({searchValue: value})
|
||||
}}
|
||||
onSearch={(value) => {this.handleSearch(value)}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const topTab = [{
|
||||
title: "人员确认",
|
||||
viewcondition: "0"
|
||||
},
|
||||
{
|
||||
title: "薪资核算",
|
||||
viewcondition: "1"
|
||||
}];
|
||||
const menu = (
|
||||
<Menu onClick={this.handleMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">导入</Menu.Item>
|
||||
<Menu.Item key="2">线下对比</Menu.Item>
|
||||
<Menu.Item key="3">导出全部</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
if (selectedKey == "1") {
|
||||
return (
|
||||
<div style={{overflowY: "scroll", height: "100%"}}>
|
||||
<CustomTab
|
||||
topTab={topTab}
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
onChange={(v) => {
|
||||
this.setState({selectedKey: v})
|
||||
}}
|
||||
/>
|
||||
{
|
||||
selectedKey == 0 && <UserSure />
|
||||
}
|
||||
{
|
||||
selectedKey == 1 && <SalaryDetail employeeName={this.state.searchValue}/>
|
||||
}
|
||||
{
|
||||
acctResultImportVisiable && <AcctResultImportModal
|
||||
visiable={acctResultImportVisiable}
|
||||
fieldData={this.state.fieldData}
|
||||
onAdd={(fieldData) => {
|
||||
this.handleAcctModalAdd(fieldData)
|
||||
}}
|
||||
onCancel={() => this.setState({
|
||||
acctResultImportVisiable: false,
|
||||
fieldData: {}
|
||||
})}
|
||||
id={this.id}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.progressVisible && <ProgressModal
|
||||
visible={this.state.progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({progressVisible: false, progress: 0})
|
||||
}}
|
||||
progress={this.state.progress}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => this.handleAccount()}>
|
||||
核算
|
||||
</Button>
|
||||
{/* <Button type="default" style={{marginRight: "10px"}} onClick={() => this.setState({stepSlideVisible: true})}>校验</Button> */}
|
||||
<Dropdown.Button style={{ marginRight: "10px" }} overlay={menu}>
|
||||
更多
|
||||
</Dropdown.Button>
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={value => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const topTab = [
|
||||
{
|
||||
title: "人员确认",
|
||||
viewcondition: "0"
|
||||
},
|
||||
{
|
||||
title: "薪资核算",
|
||||
viewcondition: "1"
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ overflowY: "scroll", height: "100%" }}>
|
||||
<CustomTab
|
||||
topTab={topTab}
|
||||
searchOperationItem={renderRightOperation()}
|
||||
onChange={v => {
|
||||
this.setState({ selectedKey: v });
|
||||
}}
|
||||
/>
|
||||
{selectedKey == 0 && <UserSure />}
|
||||
{selectedKey == 1 &&
|
||||
<SalaryDetail employeeName={this.state.searchValue} />}
|
||||
{acctResultImportVisiable &&
|
||||
<AcctResultImportModal
|
||||
visiable={acctResultImportVisiable}
|
||||
fieldData={this.state.fieldData}
|
||||
onAdd={fieldData => {
|
||||
this.handleAcctModalAdd(fieldData);
|
||||
}}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
acctResultImportVisiable: false,
|
||||
fieldData: {}
|
||||
})}
|
||||
id={this.id}
|
||||
/>}
|
||||
{this.state.progressVisible &&
|
||||
<ProgressModal
|
||||
visible={this.state.progressVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ progressVisible: false, progress: 0 });
|
||||
}}
|
||||
progress={this.state.progress}
|
||||
/>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
margin-right: 15px;
|
||||
color: #2db7f5;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,323 +1,477 @@
|
|||
import React from 'react'
|
||||
import { Row, Col, Icon, Table, Modal } from 'antd'
|
||||
import { WeaHelpfulTip, WeaInputSearch, WeaBrowser, WeaTable } from 'ecCom'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { dataSource , monthOnMonthColumns, userSureColumns} from './columns'
|
||||
import "./index.less"
|
||||
import { getQueryString } from '../../util/url'
|
||||
import CustomTable from '../../components/customTable'
|
||||
import CustomPaginationTable from '../../components/customPaginationTable';
|
||||
import React from "react";
|
||||
import { Row, Col, Icon, Table, Modal, message } from "antd";
|
||||
import { WeaHelpfulTip, WeaInputSearch, WeaBrowser, WeaTable } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { dataSource, monthOnMonthColumns, userSureColumns } from "./columns";
|
||||
import "./index.less";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import CustomTable from "../../components/customTable";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
|
||||
@inject('calculateStore')
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
export default class UserSure extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
selectedKey: "0",
|
||||
selectedRowKeys: [], // table 选中项
|
||||
userListSearchValue: '',
|
||||
}
|
||||
this.id = ""
|
||||
this.current = 1
|
||||
this.pageInfo = {current: 1, pageSize: 10}
|
||||
this.reducePageInfo = { current: 1, pageSize: 10}
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "0",
|
||||
selectedRowKeys: [], // table 选中项
|
||||
userListSearchValue: ""
|
||||
};
|
||||
this.id = "";
|
||||
this.current = 1;
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
this.reducePageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id")
|
||||
this.id = id;
|
||||
const { calculateStore } = this.props;
|
||||
const { salaryacctGetForm, acctemployeeList, reducedemployeeList, getSalarySobCycle } = calculateStore
|
||||
salaryacctGetForm(id)
|
||||
acctemployeeList({salaryAcctRecordId: id, employeeName: this.state.userListSearchValue, current: 1})
|
||||
reducedemployeeList({salaryAcctRecordId: id, employeeName: this.state.userListSearchValue, current: 1})
|
||||
this.current = 1
|
||||
getSalarySobCycle(id)
|
||||
}
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.id = id;
|
||||
const { calculateStore } = this.props;
|
||||
const {
|
||||
salaryacctGetForm,
|
||||
acctemployeeList,
|
||||
reducedemployeeList,
|
||||
getSalarySobCycle
|
||||
} = calculateStore;
|
||||
salaryacctGetForm(id);
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
this.current = 1;
|
||||
getSalarySobCycle(id);
|
||||
}
|
||||
|
||||
// 添加人员回调
|
||||
handleUserBrowserChange(ids) {
|
||||
if(ids && ids.length > 0) {
|
||||
let idList = ids.split(",");
|
||||
const { calculateStore: { saveAcctemployee, reducedemployeeList, acctemployeeList, checkTaxAgent }} = this.props;
|
||||
saveAcctemployee(this.id, idList).then(() => {
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: 1})
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: 1})
|
||||
this.current = 1
|
||||
checkTaxAgent(this.id)
|
||||
})
|
||||
// 添加人员回调
|
||||
handleUserBrowserChange(ids) {
|
||||
if (ids && ids.length > 0) {
|
||||
let idList = ids.split(",");
|
||||
const {
|
||||
calculateStore: {
|
||||
saveAcctemployee,
|
||||
reducedemployeeList,
|
||||
acctemployeeList,
|
||||
checkTaxAgent
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
handleExport() {
|
||||
const { calculateStore: { exportReducedEmployee, exportAcctEmployee }} = this.props;
|
||||
if(this.state.selectedKey == 0) {
|
||||
exportAcctEmployee(this.id)
|
||||
} else {
|
||||
exportReducedEmployee(this.id)
|
||||
}
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
handleBatchDelete() {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { calculateStore: { deleteAcctemployee, reducedemployeeList, acctemployeeList } } = this.props;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
deleteAcctemployee(this.id, selectedRowKeys).then(() => {
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: this.current})
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: this.current})
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
},
|
||||
} = this.props;
|
||||
saveAcctemployee(this.id, idList).then(() => {
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
}
|
||||
|
||||
// 人员范围列表
|
||||
getUserListColumns = () => {
|
||||
const { calculateStore: {acctemployeeListColumns}} = this.props;
|
||||
let columns = [...acctemployeeListColumns]
|
||||
columns.push({
|
||||
key: "cz",
|
||||
title: "操作",
|
||||
render: (text, record) => {
|
||||
return <a onClick={() => {this.handleDeleteItem(record)}}>删除</a>
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
// 获取人员列表,添加key
|
||||
getUserListDataSource = () => {
|
||||
const { calculateStore: {acctemployeeListDataSource}} = this.props;
|
||||
return acctemployeeListDataSource.map(item => {
|
||||
item = {...item}
|
||||
item.key = item.id
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人员
|
||||
handleDeleteItem = (record) => {
|
||||
const { calculateStore: {deleteAcctemployee, reducedemployeeList, acctemployeeList}} = this.props;
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
deleteAcctemployee(this.id, [record.id]).then(() => {
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: this.current})
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue,current: this.current})
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
},
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 刷新薪资核算人员的个税扣缴义务人
|
||||
handleRefresh = () => {
|
||||
const { calculateStore: {refreshTaxAgent, reducedemployeeList, acctemployeeList } } = this.props;
|
||||
refreshTaxAgent(this.id).then(() => {
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: 1})
|
||||
acctemployeeList({salaryAcctRecordId: this.id , employeeName: this.state.userListSearchValue, current: 1})
|
||||
this.current = 1
|
||||
})
|
||||
this.current = 1;
|
||||
checkTaxAgent(this.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys, userListSearchValue: "" });
|
||||
// 导出
|
||||
handleExport() {
|
||||
const {
|
||||
calculateStore: { exportReducedEmployee, exportAcctEmployee }
|
||||
} = this.props;
|
||||
if (this.state.selectedKey == 0) {
|
||||
exportAcctEmployee(this.id);
|
||||
} else {
|
||||
exportReducedEmployee(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
// 核算人员范围分页
|
||||
handleUserListPageChange(value) {
|
||||
const { calculateStore: {acctemployeeList}} = this.props;
|
||||
this.current = value;
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...this.pageInfo})
|
||||
// 批量删除
|
||||
handleBatchDelete() {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const {
|
||||
calculateStore: {
|
||||
deleteAcctemployee,
|
||||
reducedemployeeList,
|
||||
acctemployeeList
|
||||
}
|
||||
} = this.props;
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
deleteAcctemployee(this.id, selectedRowKeys).then(() => {
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: this.current
|
||||
});
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: this.current
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
handleShowSizeChange(pageInfo) {
|
||||
const { calculateStore: {acctemployeeList}} = this.props;
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...pageInfo})
|
||||
}
|
||||
|
||||
// 环比减少人员分页
|
||||
handleReducedemployeeListPageChange(value) {
|
||||
const { calculateStore: { reducedemployeeList }} = this.props;
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: value})
|
||||
this.current = value
|
||||
}
|
||||
|
||||
handleReduceShowSizeChange(pageInfo) {
|
||||
const { calculateStore: { reducedemployeeList }} = this.props;
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...pageInfo})
|
||||
}
|
||||
// 搜索
|
||||
handleUserListSearch(value) {
|
||||
const { calculateStore: {acctemployeeList, reducedemployeeList}} = this.props;
|
||||
this.pageInfo.current = 1
|
||||
if(this.state.selectedKey == 0) {
|
||||
acctemployeeList({salaryAcctRecordId: this.id, employeeName: value, ...this.pageInfo})
|
||||
this.current = 1
|
||||
} else {
|
||||
reducedemployeeList({salaryAcctRecordId: this.id, employeeName: value, ...this.pageInfo})
|
||||
this.current = 1
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
const { calculateBaseForm,
|
||||
acctemployeeListDataSource,
|
||||
acctemployeeListColumns,
|
||||
reducedemployeeListDataSource,
|
||||
reducedemployeeListColumns,
|
||||
baseSalarySobCycle,
|
||||
acctemployeeListPageInfo,
|
||||
loading,
|
||||
reducedemployeeListPageInfo
|
||||
} = calculateStore
|
||||
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
|
||||
|
||||
// 人员范围列表
|
||||
getUserListColumns = () => {
|
||||
const { calculateStore: { acctemployeeListColumns } } = this.props;
|
||||
let columns = [...acctemployeeListColumns];
|
||||
columns.push({
|
||||
key: "cz",
|
||||
title: "操作",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<div className="userSure">
|
||||
<div className="baseInfo">基本信息</div>
|
||||
<div className="formWrapper">
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={6}>薪资所属月:<WeaHelpfulTip
|
||||
width={100}
|
||||
title={`薪资周期\n
|
||||
${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.fromDate}至${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.endDate}\n
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleDeleteItem(record);
|
||||
}}>
|
||||
删除
|
||||
</a>
|
||||
);
|
||||
}
|
||||
});
|
||||
return columns;
|
||||
};
|
||||
|
||||
// 获取人员列表,添加key
|
||||
getUserListDataSource = () => {
|
||||
const { calculateStore: { acctemployeeListDataSource } } = this.props;
|
||||
return acctemployeeListDataSource.map(item => {
|
||||
item = { ...item };
|
||||
item.key = item.id;
|
||||
return item;
|
||||
});
|
||||
};
|
||||
|
||||
// 删除人员
|
||||
handleDeleteItem = record => {
|
||||
const {
|
||||
calculateStore: {
|
||||
deleteAcctemployee,
|
||||
reducedemployeeList,
|
||||
acctemployeeList
|
||||
}
|
||||
} = this.props;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
deleteAcctemployee(this.id, [record.id]).then(() => {
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: this.current
|
||||
});
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: this.current
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
};
|
||||
|
||||
// 刷新薪资核算人员的个税扣缴义务人
|
||||
handleRefresh = () => {
|
||||
const {
|
||||
calculateStore: { refreshTaxAgent, reducedemployeeList, acctemployeeList }
|
||||
} = this.props;
|
||||
refreshTaxAgent(this.id).then(() => {
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: 1
|
||||
});
|
||||
this.current = 1;
|
||||
});
|
||||
};
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys, userListSearchValue: "" });
|
||||
};
|
||||
|
||||
// 核算人员范围分页
|
||||
handleUserListPageChange(value) {
|
||||
const { calculateStore: { acctemployeeList } } = this.props;
|
||||
this.current = value;
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
...this.pageInfo
|
||||
});
|
||||
}
|
||||
|
||||
handleShowSizeChange(pageInfo) {
|
||||
const { calculateStore: { acctemployeeList } } = this.props;
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
...pageInfo
|
||||
});
|
||||
}
|
||||
|
||||
// 环比减少人员分页
|
||||
handleReducedemployeeListPageChange(value) {
|
||||
const { calculateStore: { reducedemployeeList } } = this.props;
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
current: value
|
||||
});
|
||||
this.current = value;
|
||||
}
|
||||
|
||||
handleReduceShowSizeChange(pageInfo) {
|
||||
const { calculateStore: { reducedemployeeList } } = this.props;
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: this.state.userListSearchValue,
|
||||
...pageInfo
|
||||
});
|
||||
}
|
||||
// 搜索
|
||||
handleUserListSearch(value) {
|
||||
const {
|
||||
calculateStore: { acctemployeeList, reducedemployeeList }
|
||||
} = this.props;
|
||||
this.pageInfo.current = 1;
|
||||
if (this.state.selectedKey == 0) {
|
||||
acctemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: value,
|
||||
...this.pageInfo
|
||||
});
|
||||
this.current = 1;
|
||||
} else {
|
||||
reducedemployeeList({
|
||||
salaryAcctRecordId: this.id,
|
||||
employeeName: value,
|
||||
...this.pageInfo
|
||||
});
|
||||
this.current = 1;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys } = this.state;
|
||||
const { calculateStore } = this.props;
|
||||
const {
|
||||
calculateBaseForm,
|
||||
acctemployeeListDataSource,
|
||||
acctemployeeListColumns,
|
||||
reducedemployeeListDataSource,
|
||||
reducedemployeeListColumns,
|
||||
baseSalarySobCycle,
|
||||
acctemployeeListPageInfo,
|
||||
loading,
|
||||
reducedemployeeListPageInfo
|
||||
} = calculateStore;
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="userSure">
|
||||
<div className="baseInfo">基本信息</div>
|
||||
<div className="formWrapper">
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={6}>
|
||||
薪资所属月:<WeaHelpfulTip
|
||||
width={100}
|
||||
title={`薪资周期\n
|
||||
${baseSalarySobCycle.salaryCycle &&
|
||||
baseSalarySobCycle.salaryCycle
|
||||
.fromDate}至${baseSalarySobCycle.salaryCycle &&
|
||||
baseSalarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${baseSalarySobCycle.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.fromDate}至${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.endDate}\n
|
||||
${baseSalarySobCycle.attendCycle &&
|
||||
baseSalarySobCycle.attendCycle
|
||||
.fromDate}至${baseSalarySobCycle.attendCycle &&
|
||||
baseSalarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${baseSalarySobCycle.socialSecurityCycle}的福利台账数据`}
|
||||
placement="topLeft"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={18}>{calculateBaseForm.formDTO && calculateBaseForm.formDTO.salaryMonth}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={6}>核算账套:
|
||||
</Col>
|
||||
<Col span={18}>{calculateBaseForm.formDTO && calculateBaseForm.formDTO.salarySobName}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
placement="topLeft"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
{calculateBaseForm.formDTO &&
|
||||
calculateBaseForm.formDTO.salaryMonth}
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={6}>核算账套:</Col>
|
||||
<Col span={18}>
|
||||
{calculateBaseForm.formDTO &&
|
||||
calculateBaseForm.formDTO.salarySobName}
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col span={6}>备注:</Col>
|
||||
<Col span={18}>{calculateBaseForm.formDTO && calculateBaseForm.formDTO.description}</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="operateBarWrapper">
|
||||
<div>
|
||||
<div className="crumbsWrapper">
|
||||
<span className={this.state.selectedKey == "0" ? "crumbItem crumbItemSelected": "crumbItem"} onClick={() => {this.setState({selectedKey: "0"})}}>核算人员范围</span>
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="核算完若薪资档案中个税扣缴义务人发生调整,需先刷新【核算人员范围】再到【薪资核算】中重新核算"
|
||||
placement="topLeft"
|
||||
/>
|
||||
{' '}|{' '}
|
||||
<span className={this.state.selectedKey == "1" ? "crumbItem crumbItemSelected": "crumbItem"} onClick={() => {this.setState({selectedKey: "1"})}}>环比上月减少人员</span>
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下减少的人员"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</div>
|
||||
<div className="crumbsOperateWrapper">
|
||||
{
|
||||
this.state.selectedKey == "0" && <div className="headerIcon">
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleBatchDelete()}}/>
|
||||
<WeaBrowser
|
||||
type={17}
|
||||
title="添加人员"
|
||||
isSingle={false}
|
||||
customized
|
||||
onChange={(ids, names, datas) =>
|
||||
this.handleUserBrowserChange(ids)
|
||||
}
|
||||
>
|
||||
<Icon className="iconItem" type="plus-square" />
|
||||
</WeaBrowser>
|
||||
<i className="icon-coms-fawen iconItem" onClick={() => {this.handleExport()}} />
|
||||
<i className="icon-coms-Synchro iconItem" onClick={() => {this.handleRefresh()}}/>
|
||||
</div>
|
||||
}
|
||||
<WeaInputSearch className="searchInput" value={this.state.userListSearchValue} onChange={(value) => {
|
||||
this.setState({userListSearchValue: value})
|
||||
}} onSearch={(value) => {this.handleUserListSearch(value)}}/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className="tableWrapper">
|
||||
{
|
||||
this.state.selectedKey == 0 &&
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={this.getUserListDataSource()}
|
||||
columns={this.getUserListColumns()}
|
||||
total={acctemployeeListPageInfo.total}
|
||||
current={acctemployeeListPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.pageInfo.current = value
|
||||
this.handleUserListPageChange(value)
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = {current, pageSize}
|
||||
this.handleShowSizeChange(this.pageInfo)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.selectedKey == 1 &&
|
||||
<CustomPaginationTable
|
||||
dataSource={reducedemployeeListDataSource}
|
||||
columns={reducedemployeeListColumns}
|
||||
total={reducedemployeeListPageInfo.total}
|
||||
current={reducedemployeeListPageInfo.pageNum}
|
||||
pageSize={this.reducePageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.reducePageInfo.current = value
|
||||
this.handleReducedemployeeListPageChange(value)
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = {current, pageSize}
|
||||
this.handleReduceShowSizeChange(this.pageInfo)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={6}>备注:</Col>
|
||||
<Col span={18}>
|
||||
{calculateBaseForm.formDTO &&
|
||||
calculateBaseForm.formDTO.description}
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="operateBarWrapper">
|
||||
<div>
|
||||
<div className="crumbsWrapper">
|
||||
<span
|
||||
className={
|
||||
this.state.selectedKey == "0"
|
||||
? "crumbItem crumbItemSelected"
|
||||
: "crumbItem"
|
||||
}
|
||||
onClick={() => {
|
||||
this.setState({ selectedKey: "0" });
|
||||
}}>
|
||||
核算人员范围
|
||||
</span>
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="核算完若薪资档案中个税扣缴义务人发生调整,需先刷新【核算人员范围】再到【薪资核算】中重新核算"
|
||||
placement="topLeft"
|
||||
/>
|
||||
{" "}|{" "}
|
||||
<span
|
||||
className={
|
||||
this.state.selectedKey == "1"
|
||||
? "crumbItem crumbItemSelected"
|
||||
: "crumbItem"
|
||||
}
|
||||
onClick={() => {
|
||||
this.setState({ selectedKey: "1" });
|
||||
}}>
|
||||
环比上月减少人员
|
||||
</span>
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下减少的人员"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div className="crumbsOperateWrapper">
|
||||
{this.state.selectedKey == "0" &&
|
||||
<div className="headerIcon">
|
||||
<Icon
|
||||
className="iconItem"
|
||||
type="minus-square"
|
||||
onClick={() => {
|
||||
this.handleBatchDelete();
|
||||
}}
|
||||
title="批量删除"
|
||||
/>
|
||||
<WeaBrowser
|
||||
type={17}
|
||||
title="添加人员"
|
||||
isSingle={false}
|
||||
customized
|
||||
onChange={(ids, names, datas) =>
|
||||
this.handleUserBrowserChange(ids)}>
|
||||
<Icon className="iconItem" type="plus-square" title="新增" />
|
||||
</WeaBrowser>
|
||||
<i
|
||||
className="icon-coms-fawen iconItem"
|
||||
onClick={() => {
|
||||
this.handleExport();
|
||||
}}
|
||||
style={{ fontSize: 20, position: "relative", top: "2px" }}
|
||||
title="导出"
|
||||
/>
|
||||
<i
|
||||
className="icon-coms-Synchro iconItem"
|
||||
onClick={() => {
|
||||
this.handleRefresh();
|
||||
}}
|
||||
style={{ fontSize: 20, position: "relative", top: "2px" }}
|
||||
title="刷新"
|
||||
/>
|
||||
</div>}
|
||||
<WeaInputSearch
|
||||
className="searchInput"
|
||||
value={this.state.userListSearchValue}
|
||||
onChange={value => {
|
||||
this.setState({ userListSearchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleUserListSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="tableWrapper">
|
||||
{this.state.selectedKey == 0 &&
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={this.getUserListDataSource()}
|
||||
columns={this.getUserListColumns()}
|
||||
total={acctemployeeListPageInfo.total}
|
||||
current={acctemployeeListPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={value => {
|
||||
this.pageInfo.current = value;
|
||||
this.handleUserListPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>}
|
||||
{this.state.selectedKey == 1 &&
|
||||
<CustomPaginationTable
|
||||
dataSource={reducedemployeeListDataSource}
|
||||
columns={reducedemployeeListColumns}
|
||||
total={reducedemployeeListPageInfo.total}
|
||||
current={reducedemployeeListPageInfo.pageNum}
|
||||
pageSize={this.reducePageInfo.pageSize}
|
||||
onPageChange={value => {
|
||||
this.reducePageInfo.current = value;
|
||||
this.handleReducedemployeeListPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleReduceShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,15 +438,16 @@ export default class Attendance extends React.Component {
|
|||
}
|
||||
return newColumn;
|
||||
});
|
||||
newColumns.push({
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<a onClick={() => {this.onItemEdit(record)}}>查看明细</a>
|
||||
)
|
||||
}
|
||||
})
|
||||
// 与e10保持一致,先去掉字段管理页面的操作列
|
||||
// newColumns.push({
|
||||
// title: "操作",
|
||||
// dataIndex: "operate",
|
||||
// render: (text, record) => {
|
||||
// return (
|
||||
// <a onClick={() => {this.onItemEdit(record)}}>查看明细</a>
|
||||
// )
|
||||
// }
|
||||
// })
|
||||
return newColumns;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ export default class Ledger extends React.Component {
|
|||
"基础设置",
|
||||
"关联人员",
|
||||
"薪资项目",
|
||||
"调薪记薪规则",
|
||||
"调薪计薪规则",
|
||||
// "校验规则",
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,166 +1,204 @@
|
|||
import React from 'react'
|
||||
import { Button, Icon, Table } from 'antd'
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaSelect } from 'ecCom'
|
||||
import { slideStep3Columns, dataSource} from './columns'
|
||||
import "./index.less"
|
||||
import AddCategoryModal from './step3/AddCategoryModal'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import CanMoveItem from './step3/canMoveItem'
|
||||
import UserInfoSelected from './step3/UserInfoSelect'
|
||||
import PreviewSalaryModal from './step3/previewSalaryModal'
|
||||
import React from "react";
|
||||
import { Button, Icon, Table } from "antd";
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaSelect } from "ecCom";
|
||||
import { slideStep3Columns, dataSource } from "./columns";
|
||||
import "./index.less";
|
||||
import AddCategoryModal from "./step3/AddCategoryModal";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import CanMoveItem from "./step3/canMoveItem";
|
||||
import UserInfoSelected from "./step3/UserInfoSelect";
|
||||
import PreviewSalaryModal from "./step3/previewSalaryModal";
|
||||
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
export default class SalaryItemForm extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
addCategoryVisible: false,
|
||||
previewVisible: false
|
||||
}
|
||||
const { ledgerStore: { empFieldList }} = this.props;
|
||||
empFieldList();
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addCategoryVisible: false,
|
||||
previewVisible: false
|
||||
};
|
||||
const { ledgerStore: { empFieldList } } = this.props;
|
||||
empFieldList();
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const {ledgerStore: {getLedgerItemForm}} = this.props;
|
||||
getLedgerItemForm();
|
||||
}
|
||||
componentWillMount() {
|
||||
const { ledgerStore: { getLedgerItemForm } } = this.props;
|
||||
getLedgerItemForm();
|
||||
}
|
||||
|
||||
handleAddCategorySave(name) {
|
||||
const {ledgerStore: {addItemGroup}} = this.props;
|
||||
addItemGroup(name);
|
||||
}
|
||||
handleAddCategorySave(name) {
|
||||
const { ledgerStore: { addItemGroup } } = this.props;
|
||||
addItemGroup(name);
|
||||
}
|
||||
|
||||
handleCanMoveItemChange(dataSource, item) {
|
||||
const {ledgerStore: {itemGroups, setItemGroups}} = this.props;
|
||||
let groups = [...itemGroups]
|
||||
groups.map(i => {
|
||||
if(i.title == item.title) {
|
||||
item.items = dataSource
|
||||
}
|
||||
})
|
||||
setItemGroups(groups)
|
||||
}
|
||||
handleCanMoveItemChange(dataSource, item) {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
let groups = [...itemGroups];
|
||||
groups.map(i => {
|
||||
if (i.title == item.title) {
|
||||
item.items = dataSource;
|
||||
}
|
||||
});
|
||||
setItemGroups(groups);
|
||||
}
|
||||
|
||||
// 薪资项目
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
const { ledgerStore: {itemGroups, setItemGroups} } = this.props;
|
||||
let newItemGroups = [...itemGroups]
|
||||
newItemGroups.map(group => {
|
||||
if(group.id == item.id) {
|
||||
group.items = dataSource
|
||||
}
|
||||
})
|
||||
setItemGroups(newItemGroups)
|
||||
}
|
||||
// 薪资项目
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
let newItemGroups = [...itemGroups];
|
||||
newItemGroups.map(group => {
|
||||
if (group.id == item.id) {
|
||||
group.items = dataSource;
|
||||
}
|
||||
});
|
||||
setItemGroups(newItemGroups);
|
||||
}
|
||||
|
||||
// 预览点击事件
|
||||
handlePreview() {
|
||||
this.setState({previewVisible: true})
|
||||
}
|
||||
// 预览点击事件
|
||||
handlePreview() {
|
||||
this.setState({ previewVisible: true });
|
||||
}
|
||||
|
||||
// 修改薪资分类标题回调
|
||||
handleItemTitleChange(item, value) {
|
||||
const { ledgerStore: {itemGroups, setItemGroups} } = this.props;
|
||||
let newItemGroups = [...itemGroups]
|
||||
newItemGroups.map(group => {
|
||||
if(group.id == item.id) {
|
||||
group.name = value
|
||||
}
|
||||
})
|
||||
setItemGroups(newItemGroups)
|
||||
}
|
||||
// 修改薪资分类标题回调
|
||||
handleItemTitleChange(item, value) {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
let newItemGroups = [...itemGroups];
|
||||
newItemGroups.map(group => {
|
||||
if (group.id == item.id) {
|
||||
group.name = value;
|
||||
}
|
||||
});
|
||||
setItemGroups(newItemGroups);
|
||||
}
|
||||
|
||||
// 删除分类回调
|
||||
handleGroupDelete(item) {
|
||||
const { ledgerStore: {itemGroups, setItemGroups} } = this.props;
|
||||
let newItemGroups = [...itemGroups]
|
||||
newItemGroups = newItemGroups.filter(group => group.id !== item.id)
|
||||
setItemGroups(newItemGroups)
|
||||
}
|
||||
// 删除分类回调
|
||||
handleGroupDelete(item) {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
let newItemGroups = [...itemGroups];
|
||||
newItemGroups = newItemGroups.filter(group => group.id !== item.id);
|
||||
setItemGroups(newItemGroups);
|
||||
}
|
||||
|
||||
// 修改列表数据顺序
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
const { ledgerStore: {itemGroups, setItemGroups} } = this.props;
|
||||
dataSource.map((data, index) => {
|
||||
data.sortedIndex = index
|
||||
})
|
||||
let itemResultGroups = itemGroups ? [...itemGroups] : []
|
||||
itemResultGroups.map(groupItem => {
|
||||
if(groupItem.id == item.id) {
|
||||
groupItem.items = dataSource
|
||||
}
|
||||
})
|
||||
setItemGroups(itemResultGroups)
|
||||
}
|
||||
// 修改列表数据顺序
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
dataSource.map((data, index) => {
|
||||
data.sortedIndex = index;
|
||||
});
|
||||
let itemResultGroups = itemGroups ? [...itemGroups] : [];
|
||||
itemResultGroups.map(groupItem => {
|
||||
if (groupItem.id == item.id) {
|
||||
groupItem.items = dataSource;
|
||||
}
|
||||
});
|
||||
setItemGroups(itemResultGroups);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible, baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
const { previewVisible } = this.state;
|
||||
|
||||
render() {
|
||||
const {
|
||||
ledgerStore: {
|
||||
itemGroups,
|
||||
salaryItems,
|
||||
empBrowserList,
|
||||
setAddCategoryVisible,
|
||||
addCategoryVisible,
|
||||
baseInfoRequest
|
||||
}
|
||||
} = this.props;
|
||||
const { canEdit = "true" } = baseInfoRequest;
|
||||
const { previewVisible } = this.state;
|
||||
|
||||
return (
|
||||
<div className="salaryItemForm">
|
||||
<div className="btnBar">
|
||||
<div className="btns">
|
||||
<Button type="default" onClick={() => {setAddCategoryVisible(true)}} disabled={canEdit !== 'true'}>新增分类</Button>
|
||||
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {this.handlePreview()}} disabled={canEdit !== "true"}>预览</Button>
|
||||
</div>
|
||||
{/* <div className="searchInputWrapper">
|
||||
return (
|
||||
<div className="salaryItemForm">
|
||||
<div className="btnBar">
|
||||
<div className="btns">
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
setAddCategoryVisible(true);
|
||||
}}
|
||||
disabled={canEdit !== "true"}>
|
||||
新增分类
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
style={{ marginLeft: "10px" }}
|
||||
onClick={() => {
|
||||
this.handlePreview();
|
||||
}}
|
||||
disabled={canEdit !== "true"}>
|
||||
预览
|
||||
</Button>
|
||||
</div>
|
||||
{/* <div className="searchInputWrapper">
|
||||
<WeaInputSearch style={{width: "150px"}} />
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="userInfoWrapper">
|
||||
<div>
|
||||
<span>
|
||||
员工信息 <WeaHelpfulTip
|
||||
style={{marginLeft: "10px"}}
|
||||
width={100}
|
||||
title="姓名、部门、个税扣缴义务人为必须项,不可删除"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</span>
|
||||
<div className="rightBtnsWrapper">
|
||||
<Icon type="down" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<UserInfoSelected />
|
||||
</div>
|
||||
{
|
||||
itemGroups && itemGroups.map(item => {
|
||||
if(item.items) {
|
||||
return (
|
||||
<CanMoveItem disabled={canEdit !== "true"} dataSource={toJS(item.items)}
|
||||
onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}}
|
||||
title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
)
|
||||
}
|
||||
{
|
||||
addCategoryVisible &&
|
||||
<AddCategoryModal onSave={(value) => {this.handleAddCategorySave(value)}} visible={addCategoryVisible} onCancel={() => {
|
||||
setAddCategoryVisible(false)
|
||||
}} />
|
||||
}
|
||||
|
||||
{
|
||||
previewVisible &&
|
||||
<PreviewSalaryModal
|
||||
visible={previewVisible}
|
||||
onCancel={() => {this.setState({previewVisible: false})}}
|
||||
/>
|
||||
}
|
||||
<div className="userInfoWrapper">
|
||||
<div>
|
||||
<span>
|
||||
员工信息{" "}
|
||||
<WeaHelpfulTip
|
||||
style={{ marginLeft: "10px" }}
|
||||
width={100}
|
||||
title="姓名、部门、个税扣缴义务人为必须项,不可删除"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</span>
|
||||
<div className="rightBtnsWrapper">
|
||||
<Icon type="down" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<UserInfoSelected />
|
||||
</div>
|
||||
{itemGroups &&
|
||||
itemGroups.map(item => {
|
||||
if (item.items) {
|
||||
return (
|
||||
<CanMoveItem
|
||||
disabled={canEdit !== "true"}
|
||||
dataSource={toJS(item.items)}
|
||||
onDataSourceChange={dataSource => {
|
||||
this.handleItemDataSourceChange(dataSource, item);
|
||||
}}
|
||||
title={item.name}
|
||||
onGroupDelete={() => {
|
||||
this.handleGroupDelete(item);
|
||||
}}
|
||||
onTitleChange={value => {
|
||||
this.handleItemTitleChange(item, value);
|
||||
}}
|
||||
onChange={dataSource => {
|
||||
this.handleCanMoveItemChange(dataSource, item);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return "";
|
||||
})}
|
||||
{addCategoryVisible &&
|
||||
<AddCategoryModal
|
||||
onSave={value => {
|
||||
this.handleAddCategorySave(value);
|
||||
}}
|
||||
visible={addCategoryVisible}
|
||||
onCancel={() => {
|
||||
setAddCategoryVisible(false);
|
||||
}}
|
||||
/>}
|
||||
|
||||
{previewVisible &&
|
||||
<PreviewSalaryModal
|
||||
visible={previewVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ previewVisible: false });
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
getCurrentYearMonth,
|
||||
getCurrentMonth,
|
||||
getSubtractMonthYearMonth,
|
||||
getAddMonthYearMonth,
|
||||
getAddMonthYearMonth
|
||||
} from "../../util/date";
|
||||
|
||||
@inject("ledgerStore", "taxAgentStore")
|
||||
|
|
@ -21,18 +21,14 @@ export default class SlideBaseForm extends React.Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
name: "",
|
||||
taxableItems: 1,
|
||||
taxableItems: 1
|
||||
};
|
||||
}
|
||||
componentWillMount() {
|
||||
const { edit } = this.props;
|
||||
const {
|
||||
ledgerStore: { initBaseInfoRequest },
|
||||
} = this.props;
|
||||
const { ledgerStore: { initBaseInfoRequest } } = this.props;
|
||||
if (edit) {
|
||||
const {
|
||||
ledgerStore: { getLedgerBasicForm },
|
||||
} = this.props;
|
||||
const { ledgerStore: { getLedgerBasicForm } } = this.props;
|
||||
getLedgerBasicForm();
|
||||
} else {
|
||||
initBaseInfoRequest();
|
||||
|
|
@ -40,11 +36,9 @@ export default class SlideBaseForm extends React.Component {
|
|||
}
|
||||
|
||||
handleChange(params) {
|
||||
const {
|
||||
ledgerStore: { baseInfoRequest, setBaseInfoRequest },
|
||||
} = this.props;
|
||||
const { ledgerStore: { baseInfoRequest, setBaseInfoRequest } } = this.props;
|
||||
let request = { ...baseInfoRequest };
|
||||
Object.keys(params).map((key) => {
|
||||
Object.keys(params).map(key => {
|
||||
request[key] = params[key];
|
||||
});
|
||||
setBaseInfoRequest(request);
|
||||
|
|
@ -85,7 +79,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
attendCycleType,
|
||||
attendCycleFromDay,
|
||||
socialSecurityCycleType,
|
||||
description,
|
||||
description
|
||||
} = baseInfoRequest;
|
||||
return (
|
||||
<div className="slideBaseForm">
|
||||
|
|
@ -102,7 +96,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
disabled={canEdit !== "true"}
|
||||
style={{ width: "190px" }}
|
||||
value={name}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ name: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -115,12 +109,12 @@ export default class SlideBaseForm extends React.Component {
|
|||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true" || (taxAgentId ? edit : false)}
|
||||
disabled={taxAgentId ? edit : false}
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 190 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={(v) => {
|
||||
onChange={v => {
|
||||
this.handleChange({ taxAgentId: v });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -138,12 +132,12 @@ export default class SlideBaseForm extends React.Component {
|
|||
{
|
||||
key: "1",
|
||||
selected: true,
|
||||
showname: "正常工资薪金所得",
|
||||
},
|
||||
showname: "正常工资薪金所得"
|
||||
}
|
||||
]}
|
||||
style={{ width: "190px" }}
|
||||
value={taxableItems}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ taxableItems: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -160,7 +154,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={salaryCycleType}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ salaryCycleType: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -169,7 +163,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={daysOptions}
|
||||
style={{ width: "90px", marginLeft: "10px" }}
|
||||
value={salaryCycleFromDay}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ salaryCycleFromDay: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -187,7 +181,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={taxCycleType}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ taxCycleType: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -204,7 +198,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={attendCycleType}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ attendCycleType: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -213,7 +207,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={daysOptions}
|
||||
style={{ width: "90px", marginLeft: "10px" }}
|
||||
value={attendCycleFromDay}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ attendCycleFromDay: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -231,7 +225,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={socialSecurityCycleType}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ socialSecurityCycleType: value });
|
||||
}}
|
||||
/>
|
||||
|
|
@ -258,7 +252,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
disabled={canEdit !== "true"}
|
||||
style={{ width: "190px" }}
|
||||
value={description}
|
||||
onChange={(value) => {
|
||||
onChange={value => {
|
||||
this.handleChange({ description: value });
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,113 +1,186 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { Icon, Table, message, Modal } from 'antd';
|
||||
import { WeaInputSearch } from "ecCom"
|
||||
import { slideStep2Columns, dataSource } from './columns'
|
||||
import AddUserModal from './addUserModal'
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Icon, Table, message, Modal } from "antd";
|
||||
import { WeaInputSearch } from "ecCom";
|
||||
import { slideStep2Columns, dataSource } from "./columns";
|
||||
import AddUserModal from "./addUserModal";
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
export default class SlideRefereUser extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
addUserModalVisible: false,
|
||||
selectedRowKeys: [],
|
||||
searchValue: ""
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addUserModalVisible: false,
|
||||
selectedRowKeys: [],
|
||||
searchValue: ""
|
||||
};
|
||||
}
|
||||
|
||||
handleTabClick(tab) {
|
||||
const {
|
||||
ledgerStore: {
|
||||
setIncludeType,
|
||||
getLedgerPersonRangeInclude,
|
||||
salarySobId,
|
||||
getLedgerPersonRangeExclude
|
||||
}
|
||||
} = this.props;
|
||||
setIncludeType(tab);
|
||||
if (tab == 1) {
|
||||
getLedgerPersonRangeInclude({ salarySobId: salarySobId });
|
||||
} else {
|
||||
getLedgerPersonRangeExclude({ salarySobId: salarySobId });
|
||||
}
|
||||
}
|
||||
|
||||
handleTabClick(tab) {
|
||||
const { ledgerStore: {setIncludeType, getLedgerPersonRangeInclude, salarySobId, getLedgerPersonRangeExclude}} = this.props;
|
||||
setIncludeType(tab)
|
||||
if(tab == 1) {
|
||||
getLedgerPersonRangeInclude({salarySobId: salarySobId})
|
||||
} else {
|
||||
getLedgerPersonRangeExclude({salarySobId: salarySobId})
|
||||
}
|
||||
componentWillMount() {
|
||||
const { edit } = this.props;
|
||||
const {
|
||||
ledgerStore: {
|
||||
getLedgerPersonRangeInclude,
|
||||
salarySobId,
|
||||
getLedgerBasicForm
|
||||
}
|
||||
} = this.props;
|
||||
getLedgerPersonRangeInclude({ salarySobId: salarySobId });
|
||||
if (edit) getLedgerBasicForm();
|
||||
}
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
|
||||
handleTabDelete = () => {
|
||||
const { ledgerStore: { deleteLedgerPersonRange } } = this.props;
|
||||
if (this.state.selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
deleteLedgerPersonRange(this.state.selectedRowKeys);
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
const { ledgerStore: {getLedgerPersonRangeInclude, salarySobId}} = this.props;
|
||||
getLedgerPersonRangeInclude({salarySobId: salarySobId})
|
||||
handleSearch = value => {
|
||||
const {
|
||||
ledgerStore: {
|
||||
includeType,
|
||||
salarySobId,
|
||||
getLedgerPersonRangeInclude,
|
||||
getLedgerPersonRangeExclude
|
||||
}
|
||||
} = this.props;
|
||||
if (includeType == 1) {
|
||||
getLedgerPersonRangeInclude({
|
||||
salarySobId: salarySobId,
|
||||
targetName: value
|
||||
});
|
||||
} else {
|
||||
getLedgerPersonRangeExclude({
|
||||
salarySobId: salarySobId,
|
||||
targetName: value
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
ledgerStore: {
|
||||
includeType,
|
||||
userTableStore,
|
||||
addUserModalVisible,
|
||||
setAddUserModalVisible,
|
||||
baseInfoRequest
|
||||
}
|
||||
} = this.props;
|
||||
const { canEdit = "true" } = baseInfoRequest;
|
||||
let { columns, list } = userTableStore;
|
||||
const { selectedRowKeys } = this.state;
|
||||
columns = columns || [];
|
||||
list = list || [];
|
||||
|
||||
list.map(item => (item.key = item.id));
|
||||
|
||||
handleTabDelete = () => {
|
||||
const {ledgerStore: {deleteLedgerPersonRange}} = this.props;
|
||||
if(this.state.selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
deleteLedgerPersonRange(this.state.selectedRowKeys)
|
||||
},
|
||||
onCancel: () => {
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange
|
||||
};
|
||||
|
||||
handleSearch = (value) => {
|
||||
const { ledgerStore: {includeType, salarySobId, getLedgerPersonRangeInclude, getLedgerPersonRangeExclude}} = this.props;
|
||||
if(includeType == 1) {
|
||||
getLedgerPersonRangeInclude({salarySobId: salarySobId, targetName: value})
|
||||
} else {
|
||||
getLedgerPersonRangeExclude({salarySobId: salarySobId, targetName: value})
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className="slideRefereUser">
|
||||
<div className="refereUserHeader">
|
||||
<div className="headerLeft">
|
||||
<span
|
||||
className={includeType == 1 ? "selectedCrumbs" : "tabItem"}
|
||||
onClick={() => {
|
||||
this.handleTabClick(1);
|
||||
}}>
|
||||
关联人员范围
|
||||
</span>{" "}
|
||||
{" "} | {" "}{" "}
|
||||
<span
|
||||
className={includeType == 0 ? "selectedCrumbs" : "tabItem"}
|
||||
onClick={() => {
|
||||
this.handleTabClick(0);
|
||||
}}>
|
||||
从范围中排除
|
||||
</span>
|
||||
</div>
|
||||
<WeaInputSearch
|
||||
className="searchInput"
|
||||
value={this.state.searchValue}
|
||||
onChange={value => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={value => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
{canEdit === "true" &&
|
||||
<div className="headerIcon">
|
||||
<Icon
|
||||
className="iconItem"
|
||||
type="minus-square"
|
||||
onClick={() => {
|
||||
this.handleTabDelete();
|
||||
}}
|
||||
/>
|
||||
<Icon
|
||||
className="iconItem"
|
||||
type="plus-square"
|
||||
onClick={() => {
|
||||
setAddUserModalVisible(true);
|
||||
}}
|
||||
/>
|
||||
</div>}
|
||||
</div>
|
||||
<div>
|
||||
<Table
|
||||
rowSelection={rowSelection}
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
pagination={{
|
||||
total: userTableStore.total,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
current: userTableStore.pageNum
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
render() {
|
||||
const { ledgerStore: {includeType, userTableStore, addUserModalVisible, setAddUserModalVisible, baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
let { columns, list} = userTableStore
|
||||
const { selectedRowKeys } = this.state
|
||||
columns = columns || []
|
||||
list = list || []
|
||||
|
||||
list.map(item => item.key = item.id)
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="slideRefereUser">
|
||||
<div className="refereUserHeader">
|
||||
<div className="headerLeft"><span className={includeType == 1 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(1)}}>关联人员范围</span> {' '} | {' '} <span className={includeType == 0 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(0)}}>从范围中排除</span></div>
|
||||
<WeaInputSearch className="searchInput" value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
{
|
||||
canEdit === 'true' &&
|
||||
<div className="headerIcon">
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleTabDelete()}}/>
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => {setAddUserModalVisible(true)}}/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<Table rowSelection={rowSelection} dataSource={list} columns={columns} pagination={{
|
||||
total: userTableStore.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
current: userTableStore.pageNum
|
||||
}}/>
|
||||
</div>
|
||||
|
||||
{
|
||||
addUserModalVisible && <AddUserModal
|
||||
visible={addUserModalVisible}
|
||||
onCancel={() => {setAddUserModalVisible(false)}}
|
||||
/>
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
{addUserModalVisible &&
|
||||
<AddUserModal
|
||||
visible={addUserModalVisible}
|
||||
onCancel={() => {
|
||||
setAddUserModalVisible(false);
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,216 +1,259 @@
|
|||
import React,{ Fragment } from 'react'
|
||||
import { Icon, Table, message, Modal } from 'antd'
|
||||
import { WeaTable } from 'ecCom'
|
||||
import { slideStep3Columns } from '../columns'
|
||||
import AddSalaryItemModal from './AddSalaryItemModal'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import FormalFormModal from '../../salaryItem/formalFormModal'
|
||||
import AddCategoryModal from '../step3/AddCategoryModal'
|
||||
import { toJS } from 'mobx';
|
||||
import React, { Fragment } from "react";
|
||||
import { Icon, Table, message, Modal } from "antd";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { slideStep3Columns } from "../columns";
|
||||
import AddSalaryItemModal from "./AddSalaryItemModal";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import FormalFormModal from "../../salaryItem/formalFormModal";
|
||||
import AddCategoryModal from "../step3/AddCategoryModal";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
export default class CanMoveItem extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
let columns = slideStep3Columns
|
||||
.map(item => {
|
||||
item = {...item}
|
||||
if(item.key == "formulaContent") {
|
||||
item.render = (text, record) => {
|
||||
if(record.canEdit) {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.handleFormulaClick(record.formulaId, record)
|
||||
}}>{text}</a>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<span>{text}</span>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
})
|
||||
this.state = {
|
||||
addItemVisible: false,
|
||||
showContent: true,
|
||||
selectedRowKeys: [],
|
||||
columns,
|
||||
formalModalVisible: false,
|
||||
addCategoryVisible: false
|
||||
}
|
||||
|
||||
this.formulaId = ""
|
||||
this.record = {}
|
||||
this.title = ""
|
||||
}
|
||||
|
||||
// 编辑公式
|
||||
handleFormulaClick(formulaId, record) {
|
||||
this.formulaId = formulaId
|
||||
this.record = record
|
||||
this.setState({
|
||||
formalModalVisible: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
handleTiggleContent() {
|
||||
this.setState({showContent: !this.state.showContent})
|
||||
}
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
constructor(props) {
|
||||
super(props);
|
||||
let columns = slideStep3Columns.map(item => {
|
||||
item = { ...item };
|
||||
if (item.key == "formulaContent") {
|
||||
item.render = (text, record) => {
|
||||
if (record.canEdit) {
|
||||
return (
|
||||
<span className="linkWapper">
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleFormulaClick(record.formulaId, record);
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<span>
|
||||
{text}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
this.state = {
|
||||
addItemVisible: false,
|
||||
showContent: true,
|
||||
selectedRowKeys: [],
|
||||
columns,
|
||||
formalModalVisible: false,
|
||||
addCategoryVisible: false
|
||||
};
|
||||
|
||||
// 删除
|
||||
handleDelete = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("为选择任何条目")
|
||||
return
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
const {dataSource} = this.props;
|
||||
let result = [...dataSource]
|
||||
this.props.onChange(result.filter(item => selectedRowKeys.indexOf(item.key) < 0))
|
||||
},
|
||||
onCancel: () => {
|
||||
this.formulaId = "";
|
||||
this.record = {};
|
||||
this.title = "";
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
// 编辑公式
|
||||
handleFormulaClick(formulaId, record) {
|
||||
this.formulaId = formulaId;
|
||||
this.record = record;
|
||||
this.setState({
|
||||
formalModalVisible: true
|
||||
});
|
||||
}
|
||||
|
||||
handleTiggleContent() {
|
||||
this.setState({ showContent: !this.state.showContent });
|
||||
}
|
||||
|
||||
onSelectChange = selectedRowKeys => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
|
||||
// 删除
|
||||
handleDelete = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("为选择任何条目");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
const { dataSource } = this.props;
|
||||
let result = [...dataSource];
|
||||
this.props.onChange(
|
||||
result.filter(item => selectedRowKeys.indexOf(item.key) < 0)
|
||||
);
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
};
|
||||
|
||||
// 保存
|
||||
handleSaveFormal(data) {
|
||||
let record = {...this.record}
|
||||
record.formulaId = data.id
|
||||
let dataSource = [...this.props.dataSource]
|
||||
dataSource.map(item => {
|
||||
if(item.id == record.id) {
|
||||
item.formulaId = data.id
|
||||
item.formulaContent = data.formula
|
||||
}
|
||||
})
|
||||
this.props.onDataSourceChange(dataSource)
|
||||
}
|
||||
// 保存
|
||||
handleSaveFormal(data) {
|
||||
let record = { ...this.record };
|
||||
record.formulaId = data.id;
|
||||
let dataSource = [...this.props.dataSource];
|
||||
dataSource.map(item => {
|
||||
if (item.id == record.id) {
|
||||
item.formulaId = data.id;
|
||||
item.formulaContent = data.formula;
|
||||
}
|
||||
});
|
||||
this.props.onDataSourceChange(dataSource);
|
||||
}
|
||||
|
||||
// 编辑分类名称
|
||||
handleUpdateCategorySave(name) {
|
||||
this.props.onTitleChange && this.props.onTitleChange(name)
|
||||
this.setState({
|
||||
addCategoryVisible: false
|
||||
})
|
||||
}
|
||||
// 编辑分类名称
|
||||
handleUpdateCategorySave(name) {
|
||||
this.props.onTitleChange && this.props.onTitleChange(name);
|
||||
this.setState({
|
||||
addCategoryVisible: false
|
||||
});
|
||||
}
|
||||
|
||||
// 修改分类名称,弹出修改弹出
|
||||
handleEditGroupIconClick(title) {
|
||||
this.title = title
|
||||
this.setState({addCategoryVisible : true})
|
||||
}
|
||||
// 修改分类名称,弹出修改弹出
|
||||
handleEditGroupIconClick(title) {
|
||||
this.title = title;
|
||||
this.setState({ addCategoryVisible: true });
|
||||
}
|
||||
|
||||
// 删除分类回调
|
||||
handleDeleteGroupIconClick() {
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
this.props.onGroupDelete && this.props.onGroupDelete()
|
||||
},
|
||||
onCancel: () => {
|
||||
},
|
||||
});
|
||||
}
|
||||
// 删除分类回调
|
||||
handleDeleteGroupIconClick() {
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
this.props.onGroupDelete && this.props.onGroupDelete();
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const {disabled, ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
|
||||
const { selectedRowKeys, formalModalVisible, addCategoryVisible } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
getCheckboxProps: (record) => ({
|
||||
disabled: !record.canDelete,
|
||||
}),
|
||||
};
|
||||
render() {
|
||||
const {
|
||||
disabled,
|
||||
ledgerStore: { setAddItemVisible, addItemVisible }
|
||||
} = this.props;
|
||||
const {
|
||||
selectedRowKeys,
|
||||
formalModalVisible,
|
||||
addCategoryVisible
|
||||
} = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
getCheckboxProps: record => ({
|
||||
disabled: !record.canDelete
|
||||
})
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="tableItemWrapper">
|
||||
<div style={{padding: "10px"}}>
|
||||
<span className="itemTitle">{this.props.title}
|
||||
{
|
||||
this.props.title !== "未分类" && <span>
|
||||
{
|
||||
!disabled &&
|
||||
<Fragment>
|
||||
<i className="icon-coms-edit" style={{marginLeft: "10px", marginRight: "10px", cursor:"pointer"}} onClick={() => {this.handleEditGroupIconClick(this.props.title)}}/>
|
||||
<i className="icon-coms-Delete" style={{cursor:"pointer"}} onClick={() => {this.handleDeleteGroupIconClick()}}/>
|
||||
</Fragment>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
||||
</span>
|
||||
<span className="rightBtnsWrapper">
|
||||
{
|
||||
!disabled &&
|
||||
<Fragment>
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleDelete()}}/>
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => { this.setState({addItemVisible: true}) }}/>
|
||||
</Fragment>
|
||||
}
|
||||
<Icon type={this.state.showContent ? "down" : 'left'} style={{cursor: "pointer"}} onClick={() => {this.handleTiggleContent()}}/>
|
||||
</span>
|
||||
</div>
|
||||
{
|
||||
this.state.showContent && <WeaTable
|
||||
rowSelection={rowSelection}
|
||||
dataSource={this.props.dataSource}
|
||||
columns={this.state.columns}
|
||||
onRow={(record, index) => ({
|
||||
index,
|
||||
moveRow: record,
|
||||
})}
|
||||
pagination={false}
|
||||
onDrop={(datas) => this.props.onDataSourceChange(datas)}
|
||||
draggable={true}
|
||||
|
||||
return (
|
||||
<div className="tableItemWrapper">
|
||||
<div style={{ padding: "10px" }}>
|
||||
<span className="itemTitle">
|
||||
{this.props.title}
|
||||
{this.props.title !== "未分类" &&
|
||||
<span>
|
||||
{!disabled &&
|
||||
<Fragment>
|
||||
<i
|
||||
className="icon-coms-edit"
|
||||
style={{
|
||||
marginLeft: "10px",
|
||||
marginRight: "10px",
|
||||
cursor: "pointer"
|
||||
}}
|
||||
onClick={() => {
|
||||
this.handleEditGroupIconClick(this.props.title);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.addItemVisible && <AddSalaryItemModal
|
||||
visible={this.state.addItemVisible}
|
||||
title={this.props.title}
|
||||
onCancel={() => { this.setState({addItemVisible: false})}}
|
||||
<i
|
||||
className="icon-coms-Delete"
|
||||
style={{ cursor: "pointer" }}
|
||||
onClick={() => {
|
||||
this.handleDeleteGroupIconClick();
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</Fragment>}
|
||||
</span>}
|
||||
</span>
|
||||
<span className="rightBtnsWrapper">
|
||||
{!disabled &&
|
||||
<Fragment>
|
||||
<Icon
|
||||
className="iconItem"
|
||||
type="minus-square"
|
||||
onClick={() => {
|
||||
this.handleDelete();
|
||||
}}
|
||||
/>
|
||||
<Icon
|
||||
className="iconItem"
|
||||
type="plus-square"
|
||||
onClick={() => {
|
||||
this.setState({ addItemVisible: true });
|
||||
}}
|
||||
/>
|
||||
</Fragment>}
|
||||
<Icon
|
||||
type={this.state.showContent ? "down" : "left"}
|
||||
style={{ cursor: "pointer" }}
|
||||
onClick={() => {
|
||||
this.handleTiggleContent();
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
{this.state.showContent &&
|
||||
<WeaTable
|
||||
rowSelection={rowSelection}
|
||||
dataSource={this.props.dataSource}
|
||||
columns={this.state.columns}
|
||||
onRow={(record, index) => ({
|
||||
index,
|
||||
moveRow: record
|
||||
})}
|
||||
pagination={false}
|
||||
onDrop={datas => this.props.onDataSourceChange(datas)}
|
||||
draggable={true}
|
||||
/>}
|
||||
{this.state.addItemVisible &&
|
||||
<AddSalaryItemModal
|
||||
visible={this.state.addItemVisible}
|
||||
title={this.props.title}
|
||||
onCancel={() => {
|
||||
this.setState({ addItemVisible: false });
|
||||
}}
|
||||
/>}
|
||||
|
||||
{
|
||||
formalModalVisible &&
|
||||
<FormalFormModal
|
||||
formulaId={this.formulaId}
|
||||
visible={formalModalVisible}
|
||||
onSaveFormal={(data) => {
|
||||
this.handleSaveFormal(data)
|
||||
}}
|
||||
onCancel={() => this.setState({
|
||||
formalModalVisible: false
|
||||
})}
|
||||
/>
|
||||
}
|
||||
|
||||
{/* 编辑分类名称 */}
|
||||
{
|
||||
addCategoryVisible &&
|
||||
<AddCategoryModal title={this.title} onSave={(value) => {this.handleUpdateCategorySave(value)}} visible={addCategoryVisible} onCancel={() => {
|
||||
this.setState({addCategoryVisible: false})
|
||||
}} />
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
{formalModalVisible &&
|
||||
<FormalFormModal
|
||||
formulaId={this.formulaId}
|
||||
visible={formalModalVisible}
|
||||
onSaveFormal={data => {
|
||||
this.handleSaveFormal(data);
|
||||
}}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
formalModalVisible: false
|
||||
})}
|
||||
/>}
|
||||
|
||||
{/* 编辑分类名称 */}
|
||||
{addCategoryVisible &&
|
||||
<AddCategoryModal
|
||||
title={this.title}
|
||||
onSave={value => {
|
||||
this.handleUpdateCategorySave(value);
|
||||
}}
|
||||
visible={addCategoryVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ addCategoryVisible: false });
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ export default class SalaryFile extends React.Component {
|
|||
onCancel() {},
|
||||
});
|
||||
} else {
|
||||
this.setState({ importType: e.key, isInit: false, modalVisiable: true, step: 0 });
|
||||
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,234 +1,267 @@
|
|||
import React from 'react'
|
||||
import { WeaSelect, WeaInput } from 'ecCom'
|
||||
import { Table, Row, Col, Switch } from 'antd'
|
||||
import { insertUpdateColumns } from './columns'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import SmallTab from '../../../components/smallTab'
|
||||
import "./index.less"
|
||||
import RequiredLabelTip from '../../../components/requiredLabelTip';
|
||||
import React from "react";
|
||||
import { WeaSelect, WeaInput } from "ecCom";
|
||||
import { Table, Row, Col, Switch } from "antd";
|
||||
import { insertUpdateColumns } from "./columns";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import SmallTab from "../../../components/smallTab";
|
||||
import "./index.less";
|
||||
import RequiredLabelTip from "../../../components/requiredLabelTip";
|
||||
|
||||
@inject('programmeStore')
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
export default class DefaultSlideForm extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
value: "SCHEME_TOWN",
|
||||
selectItem: "个人",
|
||||
dataSource: {}
|
||||
}
|
||||
insertUpdateColumns.map(item => {
|
||||
if(item.dataIndex == "isPayment") {
|
||||
item.render = (text, record) => {
|
||||
return (<Switch checked={text} onChange={(e) => {
|
||||
this.updateDataSource(record, e, "isPayment")
|
||||
}}/>)
|
||||
}
|
||||
} else if(item.dataIndex == "validNum") {
|
||||
let options = [
|
||||
{
|
||||
key: "0",
|
||||
selected: false,
|
||||
showname: "0"
|
||||
},
|
||||
{
|
||||
key: "1",
|
||||
selected: false,
|
||||
showname: "1"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
selected: true,
|
||||
showname: "2"
|
||||
}
|
||||
]
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaSelect
|
||||
options={options}
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "validNum")
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
} else if(item.dataIndex == "rententionRule") {
|
||||
let options = [
|
||||
{
|
||||
key: "1",
|
||||
selected: false,
|
||||
showname: "原始数据"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
selected: false,
|
||||
showname: "四舍五入"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
selected: false,
|
||||
showname: "向上舍入"
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
selected: false,
|
||||
showname: "向下舍入"
|
||||
},
|
||||
]
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaSelect
|
||||
options={options}
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "rententionRule")
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
} else if(item.dataIndex == "paymentProportion") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaInput value={text} onChange={(v) => {
|
||||
this.updateDataSource(record, v, "paymentProportion")
|
||||
}}/>
|
||||
)
|
||||
}
|
||||
} else if(item.dataIndex == "fixedCost") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaInput value={text} onChange={(v) => {
|
||||
this.updateDataSource(record, v, "fixedCost")
|
||||
}} />
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "SCHEME_TOWN",
|
||||
selectItem: "个人",
|
||||
dataSource: {}
|
||||
};
|
||||
insertUpdateColumns.map(item => {
|
||||
if (item.dataIndex == "isPayment") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<Switch
|
||||
checked={text}
|
||||
onChange={e => {
|
||||
this.updateDataSource(record, e, "isPayment");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "validNum") {
|
||||
let options = [
|
||||
{
|
||||
key: "0",
|
||||
selected: false,
|
||||
showname: "0"
|
||||
},
|
||||
{
|
||||
key: "1",
|
||||
selected: false,
|
||||
showname: "1"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
selected: true,
|
||||
showname: "2"
|
||||
}
|
||||
];
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaSelect
|
||||
options={options}
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "validNum");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "rententionRule") {
|
||||
let options = [
|
||||
{
|
||||
key: "1",
|
||||
selected: false,
|
||||
showname: "原始数据"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
selected: false,
|
||||
showname: "四舍五入"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
selected: false,
|
||||
showname: "向上舍入"
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
selected: false,
|
||||
showname: "向下舍入"
|
||||
}
|
||||
];
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaSelect
|
||||
options={options}
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "rententionRule");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "paymentProportion") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaInput
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "paymentProportion");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "fixedCost") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<WeaInput
|
||||
value={text}
|
||||
onChange={v => {
|
||||
this.updateDataSource(record, v, "fixedCost");
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateDataSource(record, e, key) {
|
||||
const {
|
||||
programmeStore: {
|
||||
defaultCompanyDataSource,
|
||||
defaultPersonDataSource,
|
||||
setDefaultPersonDataSource,
|
||||
setDefaultCompanyDataSource
|
||||
}
|
||||
} = this.props;
|
||||
let result = { ...record };
|
||||
result[key] = e;
|
||||
if (this.state.selectItem == "个人") {
|
||||
let dataSource = [...defaultPersonDataSource];
|
||||
dataSource = dataSource.map(item => {
|
||||
if (item.id == result.id) return result;
|
||||
else return item;
|
||||
});
|
||||
setDefaultPersonDataSource(dataSource);
|
||||
} else {
|
||||
let dataSource = [...defaultCompanyDataSource];
|
||||
dataSource = dataSource.map(item => {
|
||||
if (item.id == result.id) return result;
|
||||
else return item;
|
||||
});
|
||||
setDefaultCompanyDataSource(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
updateDataSource(record, e, key) {
|
||||
const { programmeStore: {defaultCompanyDataSource, defaultPersonDataSource, setDefaultPersonDataSource, setDefaultCompanyDataSource}} = this.props;
|
||||
let result = {...record}
|
||||
result[key] = e
|
||||
if(this.state.selectItem == "个人") {
|
||||
let dataSource = [...defaultPersonDataSource];
|
||||
dataSource = dataSource.map(item => {
|
||||
if(item.id == result.id)
|
||||
return result;
|
||||
else
|
||||
return item;
|
||||
})
|
||||
setDefaultPersonDataSource(dataSource)
|
||||
} else {
|
||||
let dataSource = [...defaultCompanyDataSource];
|
||||
dataSource = dataSource.map(item => {
|
||||
if(item.id == result.id)
|
||||
return result;
|
||||
else
|
||||
return item;
|
||||
})
|
||||
setDefaultCompanyDataSource(dataSource)
|
||||
}
|
||||
}
|
||||
componentWillMount() {
|
||||
const { programmeStore } = this.props;
|
||||
const { getForm, selectedKey, defaultPersonDataSource } = programmeStore;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { programmeStore } = this.props;
|
||||
const { getForm, selectedKey, defaultPersonDataSource } = programmeStore
|
||||
}
|
||||
render() {
|
||||
const { programmeStore } = this.props;
|
||||
const {
|
||||
defaultPersonDataSource,
|
||||
defaultCompanyDataSource,
|
||||
selectedKey
|
||||
} = programmeStore;
|
||||
const { dataSource } = this.state;
|
||||
const options = [
|
||||
{
|
||||
key: "SCHEME_TOWN",
|
||||
selected: true,
|
||||
showname: "城镇"
|
||||
},
|
||||
{
|
||||
key: "SCHEME_VILLAGE",
|
||||
selected: false,
|
||||
showname: "农村"
|
||||
}
|
||||
];
|
||||
|
||||
render() {
|
||||
const { programmeStore } = this.props;
|
||||
const { defaultPersonDataSource, defaultCompanyDataSource, selectedKey } = programmeStore
|
||||
const { dataSource } = this.state;
|
||||
const options = [
|
||||
{
|
||||
key: "SCHEME_TOWN",
|
||||
selected: true,
|
||||
showname: "城镇"
|
||||
},
|
||||
{
|
||||
key: "SCHEME_VILLAGE",
|
||||
selected: false,
|
||||
showname: "农村"
|
||||
}
|
||||
]
|
||||
const handleSmallTabChange = item => {
|
||||
// let paymentArea = item == "paymentArea" ? "1": "2"
|
||||
// let requestParams = {...this.props.requestParams}
|
||||
// requestParams.paymentArea = paymentArea
|
||||
this.setState({
|
||||
selectItem: item.value
|
||||
});
|
||||
// this.props.onChange(requestParams)
|
||||
};
|
||||
|
||||
const handleSmallTabChange = (item) => {
|
||||
// let paymentArea = item == "paymentArea" ? "1": "2"
|
||||
// let requestParams = {...this.props.requestParams}
|
||||
// requestParams.paymentArea = paymentArea
|
||||
this.setState({
|
||||
selectItem: item.value,
|
||||
})
|
||||
// this.props.onChange(requestParams)
|
||||
}
|
||||
return (
|
||||
<div className="defaultSlideForm">
|
||||
<div>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={6}>
|
||||
缴纳类型<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
style={{ width: "200px" }}
|
||||
options={options}
|
||||
value={this.props.requestParams.paymentType}
|
||||
onChange={(v, showname) => {
|
||||
let requestParams = { ...this.props.requestParams };
|
||||
requestParams.paymentType = v;
|
||||
this.props.onChange(requestParams);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
return (
|
||||
<div className="defaultSlideForm">
|
||||
<div>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
缴纳类型<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
style={{width: "200px"}}
|
||||
options={options}
|
||||
value={this.props.requestParams.paymentType}
|
||||
onChange={(v, showname) => {
|
||||
let requestParams = {...this.props.requestParams}
|
||||
requestParams.paymentType = v
|
||||
this.props.onChange(requestParams)
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={6}>
|
||||
方案名称<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
value={this.props.requestParams.schemeName}
|
||||
onChange={value => {
|
||||
let requestParams = { ...this.props.requestParams };
|
||||
requestParams.schemeName = value;
|
||||
this.props.onChange(requestParams);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
方案名称<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.props.requestParams.schemeName} onChange={(value) => {
|
||||
let requestParams = {...this.props.requestParams}
|
||||
requestParams.schemeName = value
|
||||
this.props.onChange(requestParams)
|
||||
}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={6}>备注</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
value={this.props.requestParams.remarks}
|
||||
onChange={value => {
|
||||
let requestParams = { ...this.props.requestParams };
|
||||
requestParams.remarks = value;
|
||||
this.props.onChange(requestParams);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
备注
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.props.requestParams.remarks} onChange={(value) => {
|
||||
let requestParams = {...this.props.requestParams}
|
||||
requestParams.remarks = value
|
||||
this.props.onChange(requestParams)
|
||||
}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="tableBar">
|
||||
<div>
|
||||
<SmallTab
|
||||
items={[
|
||||
{ title: "个人", value: "个人" },
|
||||
{ title: "公司", value: "公司" }
|
||||
]}
|
||||
onChange={item => {
|
||||
handleSmallTabChange(item);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="tableBar">
|
||||
<div>
|
||||
<SmallTab items={[{title: "个人", value: "个人"}, {title: '公司', value: '公司'}]} onChange={(item) => {handleSmallTabChange(item)}} />
|
||||
</div>
|
||||
|
||||
<div className="tableWrapper">
|
||||
{
|
||||
this.state.selectItem == "个人" ?
|
||||
<Table dataSource={defaultPersonDataSource} columns={insertUpdateColumns} pagination={false}/>
|
||||
:
|
||||
<Table dataSource={defaultCompanyDataSource} columns={insertUpdateColumns} pagination={false}/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div className="tableWrapper">
|
||||
{this.state.selectItem == "个人"
|
||||
? <Table
|
||||
dataSource={defaultPersonDataSource}
|
||||
columns={insertUpdateColumns}
|
||||
pagination={false}
|
||||
/>
|
||||
: <Table
|
||||
dataSource={defaultCompanyDataSource}
|
||||
columns={insertUpdateColumns}
|
||||
pagination={false}
|
||||
/>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,59 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
import { Button, Table, DatePicker, Row, Col, Switch, Modal, Dropdown, Menu } from 'antd';
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Row,
|
||||
Col,
|
||||
Switch,
|
||||
Modal,
|
||||
Dropdown,
|
||||
Menu
|
||||
} from "antd";
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaSlideModal, WeaSelect, WeaTable } from 'ecCom';
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaInputSearch,
|
||||
WeaSlideModal,
|
||||
WeaSelect,
|
||||
WeaTable
|
||||
} from "ecCom";
|
||||
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import CustomTable from '../../../components/customTable'
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import CustomTable from "../../../components/customTable";
|
||||
import "./index.less";
|
||||
const WeaMobxTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../../components/customTab';
|
||||
import ContentWrapper from '../../../components/contentWrapper';
|
||||
import SlideModalTitle from '../../../components/slideModalTitle';
|
||||
import TipLabel from '../../../components/TipLabel'
|
||||
import DefaultSlideForm from './defaultSlideForm'
|
||||
import CustomNewModal from './customNewModal'
|
||||
import { welfareTypeEnum, paymentScopeEnum } from './enum';
|
||||
import CustomPaginationTable from '../../../components/customPaginationTable'
|
||||
|
||||
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import ContentWrapper from "../../../components/contentWrapper";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import TipLabel from "../../../components/TipLabel";
|
||||
import DefaultSlideForm from "./defaultSlideForm";
|
||||
import CustomNewModal from "./customNewModal";
|
||||
import { welfareTypeEnum, paymentScopeEnum } from "./enum";
|
||||
import CustomPaginationTable from "../../../components/customPaginationTable";
|
||||
|
||||
import {
|
||||
socialSecurityColumns,
|
||||
accumulationFundColumns,
|
||||
otherBenefitsColumns,
|
||||
CustomBenefitsColumns, dataSource
|
||||
} from './columns';
|
||||
CustomBenefitsColumns,
|
||||
dataSource
|
||||
} from "./columns";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import TwoColContent from '../../../components/twoColContent';
|
||||
import CopySchemaModal from './copySchemaModal';
|
||||
import TwoColContent from "../../../components/twoColContent";
|
||||
import CopySchemaModal from "./copySchemaModal";
|
||||
|
||||
@inject('programmeStore')
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
export default class Programme extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -48,35 +67,48 @@ export default class Programme extends React.Component {
|
|||
copyId: "",
|
||||
customNewVisible: false,
|
||||
customEdit: false
|
||||
}
|
||||
};
|
||||
|
||||
this.pageInfo = {current: 1, pageSize: 10}
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { programmeStore } = this.props;
|
||||
const {doInit} = programmeStore;
|
||||
const { doInit } = programmeStore;
|
||||
doInit();
|
||||
}
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = columns.filter(item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea")
|
||||
|
||||
getColumns = columns => {
|
||||
let newColumns = columns.filter(
|
||||
item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea"
|
||||
);
|
||||
|
||||
newColumns = newColumns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
if(newColumn.dataIndex == "id") {
|
||||
newColumn.display = false
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
if (newColumn.dataIndex == "id") {
|
||||
newColumn.display = false;
|
||||
}
|
||||
switch(newColumn.dataIndex) {
|
||||
switch (newColumn.dataIndex) {
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onEdit(record)}}>编辑</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
编辑
|
||||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
|
||||
|
|
@ -84,138 +116,202 @@ export default class Programme extends React.Component {
|
|||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
render: (text, record) => {
|
||||
return <a onClick={() => {this.onEdit(record)}}>编辑</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
编辑
|
||||
</a>
|
||||
);
|
||||
}
|
||||
})
|
||||
newColumns.push(
|
||||
{
|
||||
title : '',
|
||||
key: "moreOperate",
|
||||
dataIndex: "moreOperate",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<Dropdown overlay={<Menu>
|
||||
<Menu.Item>
|
||||
<a onClick={() => {
|
||||
this.onCopy(record);
|
||||
}}>复制</a>
|
||||
</Menu.Item>
|
||||
</Menu>}>
|
||||
<i className="icon-coms-more"></i>
|
||||
</Dropdown>
|
||||
|
||||
);
|
||||
}
|
||||
})
|
||||
});
|
||||
newColumns.push({
|
||||
title: "",
|
||||
key: "moreOperate",
|
||||
dataIndex: "moreOperate",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onCopy(record);
|
||||
}}>
|
||||
复制
|
||||
</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<i className="icon-coms-more" />
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
handleCategoryStatusChange(record, value) {
|
||||
const {programmeStore: { updateCustomCategoryStatus }} = this.props;
|
||||
const { programmeStore: { updateCustomCategoryStatus } } = this.props;
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: `确认要${value ? '启用' : '停用'}吗`,
|
||||
onOk:() => {
|
||||
updateCustomCategoryStatus(record.id, value)
|
||||
},
|
||||
onCancel: () => {
|
||||
|
||||
title: "信息确认",
|
||||
content: `确认要${value ? "启用" : "停用"}吗`,
|
||||
onOk: () => {
|
||||
updateCustomCategoryStatus(record.id, value);
|
||||
},
|
||||
onCancel: () => {}
|
||||
});
|
||||
}
|
||||
|
||||
getCustomColumns = (columns) => {
|
||||
let newColumns = '';
|
||||
getCustomColumns = columns => {
|
||||
let newColumns = "";
|
||||
newColumns = columns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onCustomEdit(record)}}>编辑</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onCustomEdit(record);
|
||||
}}>
|
||||
编辑
|
||||
</a>
|
||||
);
|
||||
case "is_use":
|
||||
return <Switch checked={text == 1} onChange={(value) => {this.handleCategoryStatusChange(record, value)}}/>
|
||||
return (
|
||||
<Switch
|
||||
checked={text == 1}
|
||||
onChange={value => {
|
||||
this.handleCategoryStatusChange(record, value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
onEdit(record) {
|
||||
let id = record.id;
|
||||
const { programmeStore } = this.props
|
||||
const { getForm, selectedKey } = programmeStore
|
||||
const { programmeStore } = this.props;
|
||||
const { getForm, selectedKey } = programmeStore;
|
||||
getForm({
|
||||
welfareTypeEnum: selectedKey,
|
||||
id
|
||||
})
|
||||
this.setState({slideVisiable: true, currentOperate: "update"})
|
||||
});
|
||||
this.setState({ slideVisiable: true, currentOperate: "update" });
|
||||
}
|
||||
|
||||
onCopy(record) {
|
||||
this.setState({
|
||||
copyId: record.id,
|
||||
copyModalVisible: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onCustomOperatesClick(record, index, operate, flag) {
|
||||
switch(operate.text.toString()){
|
||||
case '编辑': // 编辑
|
||||
switch (operate.text.toString()) {
|
||||
case "编辑": // 编辑
|
||||
this.onCustomEdit(record);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
onCustomEdit(record) {
|
||||
const { programmeStore: {getCustomForm, setCustomNewVisible, setCustomRequest}} = this.props;
|
||||
getCustomForm()
|
||||
setCustomNewVisible(true)
|
||||
onCustomEdit(record) {
|
||||
const {
|
||||
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest }
|
||||
} = this.props;
|
||||
getCustomForm();
|
||||
setCustomNewVisible(true);
|
||||
this.setState({
|
||||
customEdit: true
|
||||
})
|
||||
});
|
||||
setCustomRequest({
|
||||
insuranceName: record['insurance_name'],
|
||||
insuranceName: record["insurance_name"],
|
||||
id: record.id,
|
||||
isUse: record.is_use,
|
||||
paymentScope: record.payment_scope.split(",").map(item => paymentScopeEnum[item]),
|
||||
paymentScope: record.payment_scope
|
||||
.split(",")
|
||||
.map(item => paymentScopeEnum[item]),
|
||||
welfareType: welfareTypeEnum[record.welfare_type]
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// 页面跳转
|
||||
handlePageChange(value) {
|
||||
const { programmeStore: {form, getTableDatas, selectedKey} } = this.props;
|
||||
this.pageInfo.current = value
|
||||
getTableDatas(selectedKey, this.pageInfo)
|
||||
// 页面跳转
|
||||
handlePageChange(value) {
|
||||
const { programmeStore: { form, getTableDatas, selectedKey } } = this.props;
|
||||
this.pageInfo.current = value;
|
||||
getTableDatas(selectedKey, this.pageInfo);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { programmeStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = programmeStore;
|
||||
const { selectedKey, setSelectedKey, getCustomCategoryList, customTableStore,
|
||||
customSelectkey, setCustomSelectkey, requestParams, setRequestParams, formCondition,
|
||||
setCustomNewVisible, customNewVisible, tableDataSource, tableColumns, tablePageInfo } = programmeStore;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
const {
|
||||
loading,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd
|
||||
} = programmeStore;
|
||||
const {
|
||||
selectedKey,
|
||||
setSelectedKey,
|
||||
getCustomCategoryList,
|
||||
customTableStore,
|
||||
customSelectkey,
|
||||
setCustomSelectkey,
|
||||
requestParams,
|
||||
setRequestParams,
|
||||
formCondition,
|
||||
setCustomNewVisible,
|
||||
customNewVisible,
|
||||
tableDataSource,
|
||||
tableColumns,
|
||||
tablePageInfo
|
||||
} = programmeStore;
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '社保福利方案',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "社保福利方案",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
importantlevel: 1,
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
|
|
@ -237,51 +333,66 @@ export default class Programme extends React.Component {
|
|||
}
|
||||
];
|
||||
|
||||
const options = [
|
||||
const options = [
|
||||
{
|
||||
showname: "全部",
|
||||
key: ""
|
||||
},
|
||||
{
|
||||
showname: "社保",
|
||||
key: "SOCIAL_SECURITY"
|
||||
key: "SOCIAL_SECURITY"
|
||||
},
|
||||
{
|
||||
showname: "公积金",
|
||||
key: "ACCUMULATION_FUND"
|
||||
key: "ACCUMULATION_FUND"
|
||||
},
|
||||
{
|
||||
showname: "企业年金及其他福利",
|
||||
key: "OTHER"
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
const handleNewClick = () => {
|
||||
const { programmeStore: {initSlideParms, getForm, selectedKey}} = this.props;
|
||||
const {
|
||||
programmeStore: { initSlideParms, getForm, selectedKey }
|
||||
} = this.props;
|
||||
initSlideParms();
|
||||
this.setState({ slideVisiable: true, currentOperate: "add" })
|
||||
getForm({welfareTypeEnum: selectedKey})
|
||||
}
|
||||
this.setState({ slideVisiable: true, currentOperate: "add" });
|
||||
getForm({ welfareTypeEnum: selectedKey });
|
||||
};
|
||||
|
||||
const handleCustomNewClick = () => {
|
||||
const { programmeStore : { getCustomForm, getCumCustomForm, setCustomNewVisible, setCustomRequest }} = this.props;
|
||||
getCustomForm()
|
||||
setCustomRequest({})
|
||||
setCustomNewVisible(true)
|
||||
this.setState({customEdit: false})
|
||||
|
||||
}
|
||||
const {
|
||||
programmeStore: {
|
||||
getCustomForm,
|
||||
getCumCustomForm,
|
||||
setCustomNewVisible,
|
||||
setCustomRequest
|
||||
}
|
||||
} = this.props;
|
||||
getCustomForm();
|
||||
setCustomRequest({});
|
||||
setCustomNewVisible(true);
|
||||
this.setState({ customEdit: false });
|
||||
};
|
||||
|
||||
// const renderSearchOperationItem = () => {
|
||||
// const { programmeStore: {setCustomSelectkey, getCustomCategoryList}} = this.props;
|
||||
// return
|
||||
// return
|
||||
// }
|
||||
|
||||
const handleOnSave = () => {
|
||||
const { programmeStore } = this.props
|
||||
const { currentOperate } = this.state
|
||||
const { selectedKey, defaultPersonDataSource, defaultCompanyDataSource, createScheme, requestParams, updateScheme } = programmeStore
|
||||
let { schemeName, remarks, paymentArea, paymentType } = requestParams
|
||||
const { programmeStore } = this.props;
|
||||
const { currentOperate } = this.state;
|
||||
const {
|
||||
selectedKey,
|
||||
defaultPersonDataSource,
|
||||
defaultCompanyDataSource,
|
||||
createScheme,
|
||||
requestParams,
|
||||
updateScheme
|
||||
} = programmeStore;
|
||||
let { schemeName, remarks, paymentArea, paymentType } = requestParams;
|
||||
let request = {
|
||||
insuranceScheme: {
|
||||
paymentType,
|
||||
|
|
@ -290,174 +401,195 @@ export default class Programme extends React.Component {
|
|||
remarks,
|
||||
paymentArea
|
||||
},
|
||||
insuranceSchemeDetailList: [...defaultPersonDataSource, ...defaultCompanyDataSource]
|
||||
insuranceSchemeDetailList: [
|
||||
...defaultPersonDataSource,
|
||||
...defaultCompanyDataSource
|
||||
]
|
||||
};
|
||||
|
||||
if (currentOperate == "add") {
|
||||
createScheme(request);
|
||||
} else if (currentOperate == "update") {
|
||||
request.insuranceScheme.id = requestParams.id;
|
||||
updateScheme(request);
|
||||
}
|
||||
|
||||
if(currentOperate == "add") {
|
||||
createScheme(request)
|
||||
} else if(currentOperate == "update"){
|
||||
request.insuranceScheme.id = requestParams.id
|
||||
updateScheme(request)
|
||||
}
|
||||
this.setState({slideVisiable: false})
|
||||
}
|
||||
this.setState({ slideVisiable: false });
|
||||
};
|
||||
|
||||
const renderCustomRightContent = () => {
|
||||
let tipList = [
|
||||
"1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项,如:残疾保险等",
|
||||
"2、新增自定义福利默认启用,社保福利方案中的自定义福利项均未开启缴纳,当前页面的自定义福利项才可以停用;停用后再新增方案时没有该福利项",
|
||||
"3、自定义福利若要缴纳,需要在方案里填写缴纳相关数据"
|
||||
]
|
||||
return (<TipLabel tipList={tipList} />)
|
||||
}
|
||||
];
|
||||
return <TipLabel tipList={tipList} />;
|
||||
};
|
||||
|
||||
const handleCopyModalSave = () => {
|
||||
const { programmeStore: {copyScheme}} = this.props;
|
||||
const { programmeStore: { copyScheme } } = this.props;
|
||||
const { copyId, copyModalValue } = this.state;
|
||||
copyScheme({id:copyId, schemeName: copyModalValue})
|
||||
this.setState({copyModalVisible : false})
|
||||
}
|
||||
copyScheme({ id: copyId, schemeName: copyModalValue });
|
||||
this.setState({ copyModalVisible: false });
|
||||
};
|
||||
|
||||
const handleSlideClose = () => {
|
||||
this.setState({ slideVisiable: false })
|
||||
const { programmeStore: {initSlideParms} } = this.props;
|
||||
initSlideParms()
|
||||
}
|
||||
this.setState({ slideVisiable: false });
|
||||
const { programmeStore: { initSlideParms } } = this.props;
|
||||
initSlideParms();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaRightMenu
|
||||
datas={rightMenu} // 右键菜单
|
||||
collectParams={collectParams} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
collectParams={collectParams}>
|
||||
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
||||
<WeaTop
|
||||
title="社保福利方案" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab topTab={topTab}
|
||||
dropMenuProps={{ collectParams }}>
|
||||
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
||||
<CustomTab
|
||||
topTab={topTab}
|
||||
searchOperationItem={
|
||||
<div>
|
||||
<Button type="primary" style={{ marginRight: '10px' }} onClick={() => {
|
||||
if(selectedKey == "custom") {
|
||||
handleCustomNewClick()
|
||||
} else {
|
||||
handleNewClick()
|
||||
}
|
||||
|
||||
}}>新建</Button>
|
||||
|
||||
{
|
||||
selectedKey == "custom" && <WeaSelect
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
if (selectedKey == "custom") {
|
||||
handleCustomNewClick();
|
||||
} else {
|
||||
handleNewClick();
|
||||
}
|
||||
}}>
|
||||
新建
|
||||
</Button>
|
||||
|
||||
{selectedKey == "custom" &&
|
||||
<WeaSelect
|
||||
options={options}
|
||||
value={customSelectkey}
|
||||
style={{width: "150px"}}
|
||||
onChange={(v) => {
|
||||
setCustomSelectkey(v)
|
||||
getCustomCategoryList(v)
|
||||
console.log("v:", v)
|
||||
style={{ width: "150px" }}
|
||||
onChange={v => {
|
||||
setCustomSelectkey(v);
|
||||
getCustomCategoryList(v);
|
||||
console.log("v:", v);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>}
|
||||
</div>
|
||||
}
|
||||
onChange={(v) => {
|
||||
setSelectedKey(v)
|
||||
if(v == "custom") { // 自定义福利
|
||||
getCustomCategoryList()
|
||||
onChange={v => {
|
||||
setSelectedKey(v);
|
||||
if (v == "custom") {
|
||||
// 自定义福利
|
||||
getCustomCategoryList();
|
||||
} else {
|
||||
getTableDatas(v)
|
||||
getTableDatas(v);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{
|
||||
selectedKey == "custom" ?
|
||||
<TwoColContent
|
||||
leftContent={
|
||||
<WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getCustomColumns}
|
||||
onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
||||
/>
|
||||
}
|
||||
rightContent={
|
||||
renderCustomRightContent()
|
||||
}
|
||||
/> :
|
||||
|
||||
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
dataSource={tableDataSource}
|
||||
total={tablePageInfo.total}
|
||||
current={tablePageInfo.pageNum}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value)
|
||||
}}
|
||||
onShowSizeChange={(current,pageSize) => {
|
||||
this.pageInfo = {current, pageSize}
|
||||
const { programmeStore: {form, getTableDatas, selectedKey} } = this.props;
|
||||
getTableDatas(selectedKey, this.pageInfo)
|
||||
}}
|
||||
/>
|
||||
|
||||
}
|
||||
{selectedKey == "custom"
|
||||
? <TwoColContent
|
||||
leftContent={
|
||||
<WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getCustomColumns}
|
||||
onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
||||
/>
|
||||
}
|
||||
rightContent={renderCustomRightContent()}
|
||||
/>
|
||||
: <CustomPaginationTable
|
||||
loading={loading}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
dataSource={tableDataSource}
|
||||
total={tablePageInfo.total}
|
||||
current={tablePageInfo.pageNum}
|
||||
onPageChange={value => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
const {
|
||||
programmeStore: { form, getTableDatas, selectedKey }
|
||||
} = this.props;
|
||||
getTableDatas(selectedKey, this.pageInfo);
|
||||
}}
|
||||
/>}
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{
|
||||
this.state.slideVisiable && <WeaSlideModal visible={this.state.slideVisiable}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={this.state.customEdit ? "修改": "新增"}
|
||||
subTabs={[{title: "基础设置"}]}
|
||||
editable={true}
|
||||
onSave={() => {
|
||||
handleOnSave();
|
||||
}}
|
||||
/>
|
||||
}
|
||||
content={(<DefaultSlideForm requestParams={requestParams} onChange={(requestParams) => {
|
||||
console.log("requestParams:", requestParams);
|
||||
setRequestParams(requestParams)
|
||||
}}/>)}
|
||||
onClose={() => {handleSlideClose()}}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => {handleSlideClose()}}
|
||||
onAnimationEnd={() => console.log('onAnimationEnd')} />
|
||||
}
|
||||
|
||||
{
|
||||
this.state.copyModalVisible && <CopySchemaModal
|
||||
visible={this.state.copyModalVisible}
|
||||
value={this.state.copyModalValue}
|
||||
onChange={(value) => this.setState({copyModalValue: value})}
|
||||
onCancel={() => {this.setState({copyModalVisible: false})}}
|
||||
footer={<Button type="primary" onClick={() => {handleCopyModalSave()}}>保存</Button>
|
||||
{this.state.slideVisiable &&
|
||||
<WeaSlideModal
|
||||
visible={this.state.slideVisiable}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={this.state.customEdit ? "修改" : "新增"}
|
||||
subTabs={[{ title: "基础设置" }]}
|
||||
editable={true}
|
||||
onSave={() => {
|
||||
handleOnSave();
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<DefaultSlideForm
|
||||
requestParams={requestParams}
|
||||
onChange={requestParams => {
|
||||
setRequestParams(requestParams);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
onClose={() => {
|
||||
handleSlideClose();
|
||||
}}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => {
|
||||
handleSlideClose();
|
||||
}}
|
||||
onAnimationEnd={() => console.log("onAnimationEnd")}
|
||||
/>}
|
||||
|
||||
{
|
||||
customNewVisible && <CustomNewModal
|
||||
visible={customNewVisible}
|
||||
condition={formCondition}
|
||||
form={form}
|
||||
edit={this.state.customEdit}
|
||||
onCancel={() => {setCustomNewVisible(false)}}
|
||||
/>
|
||||
}
|
||||
{this.state.copyModalVisible &&
|
||||
<CopySchemaModal
|
||||
visible={this.state.copyModalVisible}
|
||||
value={this.state.copyModalValue}
|
||||
onChange={value => this.setState({ copyModalValue: value })}
|
||||
onCancel={() => {
|
||||
this.setState({ copyModalVisible: false });
|
||||
}}
|
||||
footer={
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleCopyModalSave();
|
||||
}}>
|
||||
保存
|
||||
</Button>
|
||||
}
|
||||
/>}
|
||||
|
||||
{customNewVisible &&
|
||||
<CustomNewModal
|
||||
visible={customNewVisible}
|
||||
condition={formCondition}
|
||||
form={form}
|
||||
edit={this.state.customEdit}
|
||||
onCancel={() => {
|
||||
setCustomNewVisible(false);
|
||||
}}
|
||||
/>}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@ export class LedgerStore {
|
|||
@observable includeType = 1; // 0:排除、1:包含
|
||||
@observable userTableStore = {};
|
||||
@observable addUserModalVisible = false;
|
||||
@observable itemGroups = [
|
||||
@observable
|
||||
itemGroups = [
|
||||
{
|
||||
id: "default",
|
||||
name: "未分类",
|
||||
items: [],
|
||||
},
|
||||
items: []
|
||||
}
|
||||
];
|
||||
@observable salaryItemTableStore = new TableStore();
|
||||
@observable empBrowserList = [];
|
||||
|
|
@ -54,8 +55,8 @@ export class LedgerStore {
|
|||
{
|
||||
id: "default",
|
||||
name: "未分类",
|
||||
items: [],
|
||||
},
|
||||
items: []
|
||||
}
|
||||
];
|
||||
this.empBrowserList = [];
|
||||
this.empFields = [];
|
||||
|
|
@ -70,66 +71,61 @@ export class LedgerStore {
|
|||
@observable pageObj = {}; //列表数据
|
||||
@observable dataSource = []; //列表数据
|
||||
|
||||
@action
|
||||
setColumns = (columns) => (this.columns = columns);
|
||||
@action setColumns = columns => (this.columns = columns);
|
||||
|
||||
@action
|
||||
setPageObj = (pageObj) => (this.pageObj = pageObj);
|
||||
@action setPageObj = pageObj => (this.pageObj = pageObj);
|
||||
|
||||
@action
|
||||
setDataSource = (dataSource) => (this.dataSource = dataSource);
|
||||
@action setDataSource = dataSource => (this.dataSource = dataSource);
|
||||
|
||||
// 设置员工字段
|
||||
@action
|
||||
setEmpFields = (empFields) => (this.empFields = empFields);
|
||||
@action setEmpFields = empFields => (this.empFields = empFields);
|
||||
|
||||
@action
|
||||
setUserSelectedList = (userSelectedList) =>
|
||||
setUserSelectedList = userSelectedList =>
|
||||
(this.userSelectedList = userSelectedList);
|
||||
|
||||
@action
|
||||
setBaseInfoRequest = (baseInfoRequest) =>
|
||||
setBaseInfoRequest = baseInfoRequest =>
|
||||
(this.baseInfoRequest = baseInfoRequest);
|
||||
|
||||
@action
|
||||
setSobItemRuleDataSource = (sobItemRuleDataSource) =>
|
||||
setSobItemRuleDataSource = sobItemRuleDataSource =>
|
||||
(this.sobItemRuleDataSource = sobItemRuleDataSource);
|
||||
|
||||
@action
|
||||
setAddCategoryVisible = (addCategoryVisible) =>
|
||||
setAddCategoryVisible = addCategoryVisible =>
|
||||
(this.addCategoryVisible = addCategoryVisible);
|
||||
|
||||
@action
|
||||
setExcludeIds = (excludeIds) => (this.excludeIds = excludeIds);
|
||||
@action setExcludeIds = excludeIds => (this.excludeIds = excludeIds);
|
||||
|
||||
@action
|
||||
addExcludeIds = (id) => {
|
||||
addExcludeIds = id => {
|
||||
let excludeIds = [...this.excludeIds];
|
||||
excludeIds.push(id);
|
||||
this.excludeIds = excludeIds;
|
||||
};
|
||||
|
||||
@action
|
||||
addEmpFields = (fieldId) => {
|
||||
addEmpFields = fieldId => {
|
||||
let sortedIndex = 1;
|
||||
if (this.empFields.length > 0) {
|
||||
let lastSortedIndex =
|
||||
this.empFields[this.empFields.length - 1].sortedIndex;
|
||||
let lastSortedIndex = this.empFields[this.empFields.length - 1]
|
||||
.sortedIndex;
|
||||
sortedIndex = parseInt(lastSortedIndex) + 1;
|
||||
}
|
||||
let item = {
|
||||
fieldId,
|
||||
sortedIndex,
|
||||
canDelete: true,
|
||||
canDelete: true
|
||||
};
|
||||
let result = [...this.empFields];
|
||||
result.push(item);
|
||||
this.empFields = result;
|
||||
this.userSelectedList = this.empFields.map((item) => {
|
||||
this.userSelectedList = this.empFields.map(item => {
|
||||
item = { ...item };
|
||||
item.key = item.fieldId;
|
||||
if (!item.showname || item.showname == "") {
|
||||
this.empBrowserList.map((bitem) => {
|
||||
this.empBrowserList.map(bitem => {
|
||||
if (bitem.key == item.fieldId) {
|
||||
item.showname = bitem.showname;
|
||||
}
|
||||
|
|
@ -140,25 +136,29 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
@action
|
||||
setItemGroups = (itemGroups) => {
|
||||
itemGroups = itemGroups ? [...itemGroups] : []
|
||||
itemGroups && itemGroups.map(item => {
|
||||
if(item.items) {
|
||||
item.items && item.items.map(i => {i.key = i.id})
|
||||
}
|
||||
})
|
||||
this.itemGroups = itemGroups
|
||||
setItemGroups = itemGroups => {
|
||||
itemGroups = itemGroups ? [...itemGroups] : [];
|
||||
itemGroups &&
|
||||
itemGroups.map(item => {
|
||||
if (item.items) {
|
||||
item.items &&
|
||||
item.items.map(i => {
|
||||
i.key = i.id;
|
||||
});
|
||||
}
|
||||
});
|
||||
this.itemGroups = itemGroups;
|
||||
};
|
||||
|
||||
@action
|
||||
addItemGroup = (name) => {
|
||||
addItemGroup = name => {
|
||||
if (!name || name == "" || name.trim() == "") {
|
||||
message.warning("分类名称不能为空");
|
||||
return;
|
||||
}
|
||||
let itemGroups = [...this.itemGroups];
|
||||
let flag = false;
|
||||
itemGroups.map((item) => {
|
||||
itemGroups.map(item => {
|
||||
if (item.name == name) {
|
||||
flag = true;
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ export class LedgerStore {
|
|||
@action
|
||||
addItemsToGroup = (title, list) => {
|
||||
let itemGroups = [...this.itemGroups];
|
||||
itemGroups.map((item) => {
|
||||
itemGroups.map(item => {
|
||||
if (item.name == title) {
|
||||
item.items = item.items ? item.items.concat(list) : list;
|
||||
}
|
||||
|
|
@ -186,32 +186,29 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
@action
|
||||
addCategoryList = (item) => {
|
||||
addCategoryList = item => {
|
||||
let list = [...this.categoryList];
|
||||
list.push(item);
|
||||
this.categoryList = list;
|
||||
};
|
||||
|
||||
@action
|
||||
removeCategoryList = (item) => {
|
||||
removeCategoryList = item => {
|
||||
let list = [...this.categoryList];
|
||||
list.filter((i) => item.name != i.name);
|
||||
list.filter(i => item.name != i.name);
|
||||
this.categoryList = list;
|
||||
};
|
||||
|
||||
@action
|
||||
setAddUserModalVisible = (addUserModalVisible) =>
|
||||
setAddUserModalVisible = addUserModalVisible =>
|
||||
(this.addUserModalVisible = addUserModalVisible);
|
||||
|
||||
@action
|
||||
setUserTableStore = (userTableStore) =>
|
||||
(this.userTableStore = userTableStore);
|
||||
setUserTableStore = userTableStore => (this.userTableStore = userTableStore);
|
||||
|
||||
@action
|
||||
setIncludeType = (includeType) => (this.includeType = includeType);
|
||||
@action setIncludeType = includeType => (this.includeType = includeType);
|
||||
|
||||
@action
|
||||
setSalarySobId = (salarySobId) => (this.salarySobId = salarySobId);
|
||||
@action setSalarySobId = salarySobId => (this.salarySobId = salarySobId);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
|
|
@ -222,13 +219,13 @@ export class LedgerStore {
|
|||
this.setBaseInfoRequest({
|
||||
name: "",
|
||||
taxableItems: "1",
|
||||
salaryCycleType: "1",
|
||||
salaryCycleType: "3",
|
||||
salaryCycleFromDay: "1",
|
||||
taxCycleType: "1",
|
||||
attendCycleType: "1",
|
||||
taxCycleType: "3",
|
||||
attendCycleType: "3",
|
||||
attendCycleFromDay: "1",
|
||||
socialSecurityCycleType: "1",
|
||||
description: "",
|
||||
socialSecurityCycleType: "3",
|
||||
description: ""
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -237,13 +234,13 @@ export class LedgerStore {
|
|||
this.setBaseInfoRequest({
|
||||
name: "",
|
||||
taxableItems: "1",
|
||||
salaryCycleType: "1",
|
||||
salaryCycleType: "3",
|
||||
salaryCycleFromDay: "1",
|
||||
taxCycleType: "1",
|
||||
attendCycleType: "1",
|
||||
taxCycleType: "3",
|
||||
attendCycleType: "3",
|
||||
attendCycleFromDay: "1",
|
||||
socialSecurityCycleType: "1",
|
||||
description: "",
|
||||
socialSecurityCycleType: "3",
|
||||
description: ""
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -251,7 +248,7 @@ export class LedgerStore {
|
|||
@action
|
||||
getCondition = () => {
|
||||
API.getCondition().then(
|
||||
action((res) => {
|
||||
action(res => {
|
||||
if (res.api_status) {
|
||||
// 接口请求成功/失败处理
|
||||
this.condition = res.condition;
|
||||
|
|
@ -265,7 +262,7 @@ export class LedgerStore {
|
|||
|
||||
// 渲染table数据
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
getTableDatas = params => {
|
||||
this.loading = true;
|
||||
API.getLedgerList(params).then(
|
||||
action(({ status, data, errormsg }) => {
|
||||
|
|
@ -278,13 +275,13 @@ export class LedgerStore {
|
|||
this.setPageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
pageSize
|
||||
});
|
||||
} else {
|
||||
this.setDataSource([]);
|
||||
this.setPageObj({
|
||||
...this.pageObj,
|
||||
total: 0,
|
||||
total: 0
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
|
|
@ -292,19 +289,20 @@ export class LedgerStore {
|
|||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
@action setShowSearchAd = bool => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
@action
|
||||
doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
};
|
||||
|
||||
// 复制
|
||||
@action doCopy = (id, name) => {
|
||||
@action
|
||||
doCopy = (id, name) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.duplicateLedger({ id, name }).then((res) => {
|
||||
API.duplicateLedger({ id, name }).then(res => {
|
||||
if (res.status) {
|
||||
message.success("复制成功");
|
||||
this.getTableDatas({});
|
||||
|
|
@ -320,7 +318,7 @@ export class LedgerStore {
|
|||
//启用/禁用薪资帐套
|
||||
@action
|
||||
changeLedgerStatus = (id, disable) => {
|
||||
API.changeLedgerStatus({ id, disable }).then((res) => {
|
||||
API.changeLedgerStatus({ id, disable }).then(res => {
|
||||
if (res.status) {
|
||||
this.getTableDatas({});
|
||||
message.success("修改成功");
|
||||
|
|
@ -376,12 +374,12 @@ export class LedgerStore {
|
|||
|
||||
//保存薪资帐套基本信息
|
||||
@action
|
||||
saveLedgerBasic = (params) => {
|
||||
saveLedgerBasic = params => {
|
||||
if (!this.validateBaseFrom(params)) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveLedgerBasic(params).then((res) => {
|
||||
API.saveLedgerBasic(params).then(res => {
|
||||
if (res.status) {
|
||||
this.salarySobId = res.data;
|
||||
resolve();
|
||||
|
|
@ -397,8 +395,8 @@ export class LedgerStore {
|
|||
|
||||
//删除薪资帐套
|
||||
@action
|
||||
deleteLedger = (params) => {
|
||||
API.deleteLedger(params).then((res) => {
|
||||
deleteLedger = params => {
|
||||
API.deleteLedger(params).then(res => {
|
||||
if (res.status) {
|
||||
message.success("删除成功");
|
||||
this.getTableDatas({});
|
||||
|
|
@ -428,11 +426,11 @@ export class LedgerStore {
|
|||
|
||||
//保存薪资帐套人员范围
|
||||
@action
|
||||
saveLedgerPersonRange = (params) => {
|
||||
saveLedgerPersonRange = params => {
|
||||
if (!this.validateLedgerPersonRange(params)) {
|
||||
return;
|
||||
}
|
||||
API.saveLedgerPersonRange(params).then((res) => {
|
||||
API.saveLedgerPersonRange(params).then(res => {
|
||||
if (res.status) {
|
||||
if (this.includeType == 1) {
|
||||
this.getLedgerPersonRangeInclude({ salarySobId: this.salarySobId });
|
||||
|
|
@ -448,8 +446,8 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
//薪资帐套人员范围(包含)列表
|
||||
getLedgerPersonRangeInclude = (params) => {
|
||||
API.getLedgerPersonRangeInclude(params).then((res) => {
|
||||
getLedgerPersonRangeInclude = params => {
|
||||
API.getLedgerPersonRangeInclude(params).then(res => {
|
||||
if (res.status) {
|
||||
this.setUserTableStore(res.data);
|
||||
} else {
|
||||
|
|
@ -459,8 +457,8 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
//薪资帐套人员范围(排除)列表
|
||||
getLedgerPersonRangeExclude = (params) => {
|
||||
API.getLedgerPersonRangeExclude(params).then((res) => {
|
||||
getLedgerPersonRangeExclude = params => {
|
||||
API.getLedgerPersonRangeExclude(params).then(res => {
|
||||
if (res.status) {
|
||||
this.setUserTableStore(res.data);
|
||||
} else {
|
||||
|
|
@ -470,8 +468,8 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
//删除薪资帐套人员范围
|
||||
deleteLedgerPersonRange = (params) => {
|
||||
API.deleteLedgerPersonRange(params).then((res) => {
|
||||
deleteLedgerPersonRange = params => {
|
||||
API.deleteLedgerPersonRange(params).then(res => {
|
||||
if (res.status) {
|
||||
if (this.includeType == 1) {
|
||||
this.getLedgerPersonRangeInclude({ salarySobId: this.salarySobId });
|
||||
|
|
@ -489,41 +487,41 @@ export class LedgerStore {
|
|||
@action
|
||||
listSalaryItem = (searchValue = "", current = 1) => {
|
||||
let excludeIds = [];
|
||||
this.itemGroups && this.itemGroups.map((item) => {
|
||||
item.items && item.items.map((i) => {
|
||||
excludeIds.push(i.salaryItemId);
|
||||
this.itemGroups &&
|
||||
this.itemGroups.map(item => {
|
||||
item.items &&
|
||||
item.items.map(i => {
|
||||
excludeIds.push(i.salaryItemId);
|
||||
});
|
||||
});
|
||||
});
|
||||
this.loading = true;
|
||||
API.listSalaryItem({ name: searchValue, excludeIds, current }).then(
|
||||
(res) => {
|
||||
if (res.status) {
|
||||
if (res.data.list) {
|
||||
this.addSalaryItemDataSource = res.data.list.map((item) => {
|
||||
item = { ...item };
|
||||
item.key = item.id;
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.addSalaryItemDataSource = [];
|
||||
}
|
||||
|
||||
this.addSalaryItemColumns = res.data.columns;
|
||||
this.addSalaryItemPageInfo = res.data;
|
||||
// this.salaryItemTableStore.getDatas(res.data.datas);
|
||||
API.listSalaryItem({ name: searchValue, excludeIds, current }).then(res => {
|
||||
if (res.status) {
|
||||
if (res.data.list) {
|
||||
this.addSalaryItemDataSource = res.data.list.map(item => {
|
||||
item = { ...item };
|
||||
item.key = item.id;
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败");
|
||||
this.addSalaryItemDataSource = [];
|
||||
}
|
||||
this.loading = false;
|
||||
|
||||
this.addSalaryItemColumns = res.data.columns;
|
||||
this.addSalaryItemPageInfo = res.data;
|
||||
// this.salaryItemTableStore.getDatas(res.data.datas);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败");
|
||||
}
|
||||
);
|
||||
this.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
@action
|
||||
empFieldList = () => {
|
||||
API.empFieldList().then((res) => {
|
||||
API.empFieldList().then(res => {
|
||||
if (res.status) {
|
||||
this.empBrowserList = res.data.map((item) => {
|
||||
this.empBrowserList = res.data.map(item => {
|
||||
return { showname: item.name, key: item.id, selected: false };
|
||||
});
|
||||
} else {
|
||||
|
|
@ -536,27 +534,27 @@ export class LedgerStore {
|
|||
saveLedgerItem = () => {
|
||||
let itemGroups = [...this.itemGroups];
|
||||
itemGroups = itemGroups
|
||||
.map((item) => {
|
||||
.map(item => {
|
||||
let result = { ...item };
|
||||
if (result.items) {
|
||||
result.items = result.items.map((i, index) => ({
|
||||
salaryItemId: i.salaryItemId,
|
||||
sortedIndex: index + 1,
|
||||
formulaId: i.formulaId,
|
||||
formulaId: i.formulaId
|
||||
}));
|
||||
return result;
|
||||
}
|
||||
})
|
||||
.filter((item) => item);
|
||||
.filter(item => item);
|
||||
|
||||
let params = {
|
||||
salarySobId: this.salarySobId,
|
||||
empFields: this.empFields,
|
||||
itemGroups: itemGroups.filter((item) => item.id != "default"),
|
||||
items: itemGroups.filter((item) => item.id == "default")[0].items,
|
||||
itemGroups: itemGroups.filter(item => item.id != "default"),
|
||||
items: itemGroups.filter(item => item.id == "default")[0].items
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveLedgerItem(params).then((res) => {
|
||||
API.saveLedgerItem(params).then(res => {
|
||||
if (res.status) {
|
||||
resolve();
|
||||
message.success("保存成功");
|
||||
|
|
@ -574,17 +572,17 @@ export class LedgerStore {
|
|||
let params = {
|
||||
salarySobId: this.salarySobId,
|
||||
excludeSalaryItemIds: this.sobItemRuleDataSource.map(
|
||||
(item) => item.salaryItemId
|
||||
),
|
||||
item => item.salaryItemId
|
||||
)
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.listSalarySobItem(params).then((res) => {
|
||||
API.listSalarySobItem(params).then(res => {
|
||||
if (res.status) {
|
||||
this.ruleOptionList = res.data.map((item) => {
|
||||
this.ruleOptionList = res.data.map(item => {
|
||||
return {
|
||||
key: item.salaryItemId.toString(),
|
||||
showname: item.salaryItemName,
|
||||
selected: false,
|
||||
selected: false
|
||||
};
|
||||
});
|
||||
resolve();
|
||||
|
|
@ -601,10 +599,10 @@ export class LedgerStore {
|
|||
saveAdjustmentRule = () => {
|
||||
let params = {
|
||||
salarySobId: this.salarySobId,
|
||||
ruleParams: this.sobItemRuleDataSource,
|
||||
ruleParams: this.sobItemRuleDataSource
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveAdjustmentRule(params).then((res) => {
|
||||
API.saveAdjustmentRule(params).then(res => {
|
||||
if (res.status) {
|
||||
resolve();
|
||||
message.success("保存成功");
|
||||
|
|
@ -619,9 +617,9 @@ export class LedgerStore {
|
|||
@action
|
||||
listAdjustmentRule = () => {
|
||||
let params = {
|
||||
salarySobId: this.salarySobId,
|
||||
salarySobId: this.salarySobId
|
||||
};
|
||||
API.listAdjustmentRule(params).then((res) => {
|
||||
API.listAdjustmentRule(params).then(res => {
|
||||
if (res.status) {
|
||||
this.sobItemRuleDataSource = res.data;
|
||||
}
|
||||
|
|
@ -630,9 +628,9 @@ export class LedgerStore {
|
|||
|
||||
// 保存薪资帐套校验规则
|
||||
@action
|
||||
saveLedgerRule = (params) => {
|
||||
saveLedgerRule = params => {
|
||||
params.salarySobId = this.salarySobId;
|
||||
API.saveLedgerRule(params).then((res) => {
|
||||
API.saveLedgerRule(params).then(res => {
|
||||
if (res.status) {
|
||||
this.getLedgerRuleList();
|
||||
message.success("保存成功");
|
||||
|
|
@ -647,9 +645,9 @@ export class LedgerStore {
|
|||
getLedgerRuleList = (name = "") => {
|
||||
let params = {
|
||||
salarySobId: this.salarySobId,
|
||||
name,
|
||||
name
|
||||
};
|
||||
API.getLedgerRuleList(params).then((res) => {
|
||||
API.getLedgerRuleList(params).then(res => {
|
||||
if (res.status) {
|
||||
this.ledgerRuleList = res.data;
|
||||
} else {
|
||||
|
|
@ -660,8 +658,8 @@ export class LedgerStore {
|
|||
|
||||
//删除薪资帐套校验规则
|
||||
@action
|
||||
deleteLedgerRule = (ids) => {
|
||||
API.deleteLedgerRule(ids).then((res) => {
|
||||
deleteLedgerRule = ids => {
|
||||
API.deleteLedgerRule(ids).then(res => {
|
||||
if (res.status) {
|
||||
message.success("删除成功");
|
||||
this.getLedgerRuleList();
|
||||
|
|
@ -674,11 +672,11 @@ export class LedgerStore {
|
|||
// 获取基本信息
|
||||
@action
|
||||
getLedgerBasicForm = () => {
|
||||
API.getLedgerBasicForm(this.salarySobId).then((res) => {
|
||||
API.getLedgerBasicForm({ id: this.salarySobId }).then(res => {
|
||||
if (res.status) {
|
||||
let basicForm = res.data.basicForm;
|
||||
Object.keys(basicForm).map((key) => {
|
||||
if (basicForm[key]) {
|
||||
Object.keys(basicForm).map(key => {
|
||||
if (basicForm[key] || typeof basicForm[key] === "boolean") {
|
||||
basicForm[key] = basicForm[key].toString();
|
||||
}
|
||||
});
|
||||
|
|
@ -692,33 +690,32 @@ export class LedgerStore {
|
|||
//薪资帐套薪资项目详情
|
||||
@action
|
||||
getLedgerItemForm = () => {
|
||||
API.getLedgerItemForm({ salarySobId: this.salarySobId }).then((res) => {
|
||||
API.getLedgerItemForm({ salarySobId: this.salarySobId }).then(res => {
|
||||
if (res.status) {
|
||||
this.empFields = res.data.empFields;
|
||||
let itemGroups = res.data.itemGroups;
|
||||
let defaultItems = {
|
||||
id: "default",
|
||||
name: "未分类",
|
||||
items: res.data.items,
|
||||
items: res.data.items
|
||||
};
|
||||
itemGroups.unshift(defaultItems);
|
||||
this.setItemGroups(itemGroups)
|
||||
API.empFieldList().then((ires) => {
|
||||
itemGroups.push(defaultItems);
|
||||
this.setItemGroups(itemGroups);
|
||||
API.empFieldList().then(ires => {
|
||||
if (res.status) {
|
||||
this.empBrowserList = ires.data.map((item) => {
|
||||
this.empBrowserList = ires.data.map(item => {
|
||||
return { showname: item.name, key: item.id, selected: false };
|
||||
});
|
||||
this.userSelectedList = this.empFields.map((item) => {
|
||||
this.userSelectedList = this.empFields.map(item => {
|
||||
item = { ...item };
|
||||
item.key = item.fieldId;
|
||||
this.empBrowserList.map((bitem) => {
|
||||
this.empBrowserList.map(bitem => {
|
||||
if (bitem.key == item.fieldId) {
|
||||
item.showname = bitem.showname;
|
||||
}
|
||||
});
|
||||
return item;
|
||||
});
|
||||
console.log("this.userSelectedList: ", toJS(this.userSelectedList));
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,11 @@ export class ProgrammeStore {
|
|||
API.getForm(params).then(res => {
|
||||
if(res.status) {
|
||||
let resultList = res.data.form.schemeDetailList;
|
||||
resultList= _.map(resultList, it => ({
|
||||
...it,
|
||||
rententionRule: it.rententionRule ? it.rententionRule : "2",
|
||||
validNum: it.validNum ? it.validNum : "2"
|
||||
}))
|
||||
this.defaultPersonDataSource = resultList.filter(item => item.paymentScope == "个人")
|
||||
this.defaultCompanyDataSource = resultList.filter(item => item.paymentScope == "公司")
|
||||
let defaultRequest = {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export class SalaryItemStore {
|
|||
//薪资项目-薪资项目详情
|
||||
@action
|
||||
getItemForm = (id) => {
|
||||
API.getItemForm(id).then(res => {
|
||||
API.getItemForm({id}).then(res => {
|
||||
if(res.status) {
|
||||
let data = res.data;
|
||||
Object.keys(data).map(key => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue