测试bug的修复

This commit is contained in:
liyongshun 2022-06-29 17:04:01 +08:00
parent 5f66d08a39
commit 65be568847
9 changed files with 737 additions and 569 deletions

View File

@ -1,265 +1,315 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
//工资单-工资单发放列表
export const getPayrollList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-获取table提示信息
export const getPayrollInfo = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/send/getBaseInfo', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/send/getBaseInfo",
"get",
params
);
};
//工资单-获取工资单发放高级搜索
export const getPaySa = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/send/getInfoSearchCondition', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/send/getInfoSearchCondition",
"get",
params
);
};
//工资单-工资单发放
export const grantPayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/grant', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/grant", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-工资单撤回
export const withdrawPayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/withdraw', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/withdraw", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-工资单发放详情列表
export const getPayrollDetailList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/detailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/detailList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-工资单发放详情列表的高级搜索
export const getPayrollDetailSa = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/getDetailSearchCondition', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/getDetailSearchCondition", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-导出-工资单发放信息列表
export const exportPayroll = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/send/exportInfoList', 'POST', params);
}
fetch("/api/bs/hrmsalary/salaryBill/send/exportInfoList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res =>
res.blob().then(blob => {
var filename = `工资单发放.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
//工资单-工资单模板列表
export const getPayrollTemplateList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-获取薪资账套下拉列表
export const getPayrollTemplateLedgerList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/selectSalarySobList', 'POST', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/selectSalarySobList",
"POST",
params
);
};
//工资单-获取工资单基础设置表单
export const getPayrollBaseForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/getBaseForm', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/getBaseForm",
"get",
params
);
};
//工资单-获取工资单显示设置表单
export const getPayrollShowForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/getShowForm', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/getShowForm",
"get",
params
);
};
//工资单-获取工资单薪资项目设置
export const getPayrollItemList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/getSalaryItemSet', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/getSalaryItemSet",
"get",
params
);
};
//工资单-更改默认使用
export const changePayrollDefaultUse = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/defaultUse', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/defaultUse", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-新建工资单
export const savePayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/save', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/save", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-编辑工资单
export const updatePayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/update', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/update", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-编辑工资单-编辑基础设置
export const updatePayrollBase = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/updateBase', 'POST', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/updateBase",
"POST",
params
);
};
//工资单-编辑工资单-编辑显示设置
export const updatePayrollShow = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/updateShow', 'POST', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/updateShow",
"POST",
params
);
};
//工资单-复制工资单
export const duplicatePayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/copy', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/copy", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-删除工资单
export const deletePayroll = params => {
return fetch('/api/bs/hrmsalary/salaryBill/template/delete', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/template/delete", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//工资单-获取租户名
export const getTenantName = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/template/getTenantName', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/template/getTenantName",
"get",
params
);
};
// 工资单发放-工资单发放信息列表
export const getInfoList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/infoList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/infoList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 工资单发放-导出-工资单发放详情列表
export const exportDetailList = params => {
fetch('/api/bs/hrmsalary/salaryBill/send/exportDetailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.blob().then(blob => {
var filename=`工资单发放详情列表.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
fetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res =>
res.blob().then(blob => {
var filename = `工资单发放详情列表.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
// 工资单发放-工资单批量发放信息列表
export const batchSendInfoList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/batchSendInfoList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/batchSendInfoList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 工资单发放-工资单批量撤回信息列表
export const batchWithdrawInfoList = params => {
return fetch('/api/bs/hrmsalary/salaryBill/send/batchWithdrawInfoList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/send/batchWithdrawInfoList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 工资单发放-按钮状态
export const getSendBtnStatus = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/send/getSendBtnStatus', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/salaryBill/send/getSendBtnStatus",
"get",
params
);
};
// 工资单发放-扩展按钮点击
export const grantProxy = params => {
return fetch('/api/bs/hrmsalary/salaryBill/grantProxy', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryBill/grantProxy", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};

View File

@ -96,7 +96,7 @@ export const importBatch = (params) => {
// 导出档案
export const exportArchives = (ids) => {
fetch('/api/bs/hrmsalary/scheme/export?ids=' + ids).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;

View File

@ -255,7 +255,7 @@ export default class Calculate extends React.Component {
};
}
});
return columns;
return showOperateBtn ? columns : _.filter(columns, it => it.title != "操作");
}
// 分页

View File

@ -11,7 +11,7 @@ import {
WeaRangePicker,
WeaInputSearch,
WeaSlideModal,
WeaTable,
WeaTable
} from "ecCom";
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
@ -45,55 +45,49 @@ export default class Ledger extends React.Component {
selectedTab: 0,
currentReocrd: {},
searchValue: "",
step1Request: {},
step1Request: {}
};
}
handleSearch(value) {
const {
ledgerStore: { getTableDatas },
} = this.props;
const { ledgerStore: { getTableDatas } } = this.props;
getTableDatas({ name: value });
}
refereUser() {
this.setState({
editSlideVisible: true,
selectedTab: 1,
selectedTab: 1
});
}
onEdit() {
this.setState({
editSlideVisible: true,
editSlideVisible: true
});
}
componentWillMount() {
const {
ledgerStore: { doInit },
taxAgentStore: { fetchTaxAgentOption },
taxAgentStore: { fetchTaxAgentOption }
} = this.props;
doInit();
fetchTaxAgentOption();
}
handleItemStatusChange(value, record) {
const {
ledgerStore: { changeLedgerStatus },
} = this.props;
const { ledgerStore: { changeLedgerStatus } } = this.props;
changeLedgerStatus(record.id, value ? 0 : 1);
}
handleItemClick(record, selectedTab = 0) {
const {
ledgerStore: { setSalarySobId },
} = this.props;
const { ledgerStore: { setSalarySobId } } = this.props;
setSalarySobId(record.id);
this.setState({
selectedTab,
editSlideVisible: true,
request: record,
request: record
});
}
@ -105,8 +99,8 @@ export default class Ledger extends React.Component {
saveLedgerItem,
saveAdjustmentRule,
saveLedgerBasic,
baseInfoRequest,
},
baseInfoRequest
}
} = this.props;
if (selectedTab == 0) {
saveLedgerBasic(baseInfoRequest);
@ -118,9 +112,9 @@ export default class Ledger extends React.Component {
}
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
getColumns = columns => {
let newColumns = "";
newColumns = columns.map((column) => {
newColumns = columns.map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => {
//前端元素转义
@ -142,7 +136,7 @@ export default class Ledger extends React.Component {
return (
<Switch
checked={text == 0}
onChange={(value) => {
onChange={value => {
this.handleItemStatusChange(value, record);
}}
/>
@ -166,9 +160,7 @@ export default class Ledger extends React.Component {
};
onOperatesClick = (record, type) => {
const {
ledgerStore: { deleteLedger },
} = this.props;
const { ledgerStore: { deleteLedger } } = this.props;
switch (type.toString()) {
case "0": // 编辑
this.handleItemClick(record);
@ -176,7 +168,7 @@ export default class Ledger extends React.Component {
case "1": // 复制
this.setState({
copyFormVisible: true,
currentReocrd: record,
currentReocrd: record
});
break;
case "3": // 关联人员
@ -189,26 +181,22 @@ export default class Ledger extends React.Component {
onOk: () => {
deleteLedger([record.id]);
},
onCancel: () => {},
onCancel: () => {}
});
break;
}
};
handleCopySave = (value) => {
const {
ledgerStore: { doCopy },
} = this.props;
doCopy({id:this.state.currentReocrd.id, ...value}).then(() => {
handleCopySave = value => {
const { ledgerStore: { doCopy } } = this.props;
doCopy({ id: this.state.currentReocrd.id, ...value }).then(() => {
this.setState({ copyFormVisible: false });
});
};
handleNew = () => {
const {
ledgerStore: { initSlideData },
} = this.props;
const { ledgerStore: { initSlideData } } = this.props;
initSlideData();
this.setState({ stepSlideVisible: true, currentStep: 0 });
};
@ -229,9 +217,9 @@ export default class Ledger extends React.Component {
getTableDatas,
doSearch,
setShowSearchAd,
baseInfoRequest,
baseInfoRequest
} = ledgerStore;
const { showOperateBtn }= taxAgentStore;
const { showOperateBtn } = taxAgentStore;
const { canEdit } = baseInfoRequest;
const { currentStep, selectedTab } = this.state;
if (!hasRight && !loading) {
@ -245,8 +233,8 @@ export default class Ledger extends React.Component {
key: "BTN_COLUMN",
icon: <i className="icon-coms-Custom" />,
content: "显示列定制",
onClick: this.showColumn,
},
onClick: this.showColumn
}
];
const collectParams = {
// 收藏功能配置
@ -254,7 +242,7 @@ export default class Ledger extends React.Component {
favouritetype: 1,
objid: 0,
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1,
importantlevel: 1
};
const adBtn = [
// 高级搜索内部按钮
@ -266,7 +254,7 @@ export default class Ledger extends React.Component {
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
</Button>
];
const topTab = [];
@ -274,21 +262,19 @@ export default class Ledger extends React.Component {
const renderRightOperation = () => {
return (
<div style={{ display: "inline-block" }}>
{
showOperateBtn &&
{showOperateBtn &&
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleNew()}>
新建
</Button>
}
</Button>}
<WeaInputSearch
value={this.state.searchValue}
onChange={(value) => {
onChange={value => {
this.setState({ searchValue: value });
}}
onSearch={(value) => {
onSearch={value => {
this.handleSearch(value);
}}
/>
@ -309,24 +295,20 @@ export default class Ledger extends React.Component {
"基础设置",
"关联人员",
"薪资项目",
"调薪计薪规则",
"调薪计薪规则"
// "校验规则",
];
const handleStep1Save = () => {
const { step1Request } = this.state;
const {
ledgerStore: { saveLedgerBasic, baseInfoRequest },
} = this.props;
const { ledgerStore: { saveLedgerBasic, baseInfoRequest } } = this.props;
saveLedgerBasic(baseInfoRequest).then(() => {
nextStep();
});
};
const handleStep3Save = () => {
const {
ledgerStore: { saveAdjustmentRule },
} = this.props;
const { ledgerStore: { saveAdjustmentRule } } = this.props;
saveAdjustmentRule().then(() => {
nextStep();
});
@ -339,8 +321,8 @@ export default class Ledger extends React.Component {
saveLedgerBasic,
saveLedgerItem,
saveAdjustmentRule,
baseInfoRequest,
},
baseInfoRequest
}
} = this.props;
if (currentStep == 0) {
saveLedgerBasic(baseInfoRequest).then(() => {
@ -361,27 +343,27 @@ export default class Ledger extends React.Component {
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
showTotal: total => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({ current, pageSize, name: this.state.searchValue });
},
onChange: (current) => {
onChange: current => {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
name: this.state.searchValue,
name: this.state.searchValue
});
},
}
};
const newColumns = _.map([...columns], (item) => {
const newColumns = _.map([...columns], item => {
if (item.dataIndex === "name") {
return {
...item,
render: (text, record) => (
render: (text, record) =>
<div className="linkWapper">
<a
href="javaScript:void(0);"
@ -391,25 +373,23 @@ export default class Ledger extends React.Component {
{text}
</a>
</div>
),
};
} else if (item.dataIndex === "disable") {
return {
...item,
render: (text, record) => (
render: (text, record) =>
<Switch
checked={text == 0}
disabled={!showOperateBtn}
onChange={(value) => {
onChange={value => {
this.handleItemStatusChange(value, record);
}}
/>
),
};
} else if (item.dataIndex === "operate" && showOperateBtn) {
return {
...item,
render: (text, record) => (
render: (text, record) =>
<div className="linkWapper">
<a
onClick={() => {
@ -420,7 +400,7 @@ export default class Ledger extends React.Component {
<Dropdown
overlay={
<Menu
onClick={(item) => this.onOperatesClick(record, item.key)}>
onClick={item => this.onOperatesClick(record, item.key)}>
<Menu.Item key="0">编辑</Menu.Item>
<Menu.Item key="1">复制</Menu.Item>
<Menu.Item key="3">关联人员</Menu.Item>
@ -432,7 +412,6 @@ export default class Ledger extends React.Component {
</a>
</Dropdown>
</div>
),
};
} else {
return { ...item };
@ -443,29 +422,31 @@ export default class Ledger extends React.Component {
<div className="mySalaryBenefitsWrapper">
<WeaRightMenu
datas={rightMenu} // 右键菜单
collectParams={collectParams} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
collectParams={collectParams}>
<WeaTop
title="薪资账套" // 文字
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
dropMenuProps={{ collectParams }}>
<CustomTab
searchOperationItem={renderRightOperation()}
onChange={(v) => {}}
onChange={v => {}}
/>
<WeaTable
rowKey="id"
columns={newColumns}
columns={
showOperateBtn
? newColumns
: _.filter(newColumns, it => it.dataIndex !== "operate")
}
dataSource={dataSource}
pagination={pagination}
loading={loading}
scroll={{ x: 1300 }}
/>
{this.state.stepSlideVisible && (
{this.state.stepSlideVisible &&
<StepSlide
visible={this.state.stepSlideVisible}
steps={steps}
@ -475,16 +456,15 @@ export default class Ledger extends React.Component {
}}
customOperate={
<div style={{ display: "inline-block" }}>
{currentStep == 0 && (
{currentStep == 0 &&
<Button
type="primary"
onClick={() => {
handleStep1Save();
}}>
保存并进入下一步
</Button>
)}
{currentStep == 1 && (
</Button>}
{currentStep == 1 &&
<div style={{ display: "inline-block" }}>
<Button
type="default"
@ -501,9 +481,8 @@ export default class Ledger extends React.Component {
}}>
下一步
</Button>
</div>
)}
{currentStep == 2 && (
</div>}
{currentStep == 2 &&
<div>
<Button
type="default"
@ -528,9 +507,8 @@ export default class Ledger extends React.Component {
}}>
保存并进入下一步
</Button>
</div>
)}
{currentStep == 3 && (
</div>}
{currentStep == 3 &&
<div>
<Button
type="default"
@ -547,8 +525,7 @@ export default class Ledger extends React.Component {
}}>
完成
</Button>
</div>
)}
</div>}
</div>
}
title="新建账套"
@ -563,10 +540,8 @@ export default class Ledger extends React.Component {
} */}
</div>
}
/>
)}
{this.state.editSlideVisible && (
/>}
{this.state.editSlideVisible &&
<WeaSlideModal
visible={this.state.editSlideVisible}
top={0}
@ -581,13 +556,13 @@ export default class Ledger extends React.Component {
{ title: "基础设置", key: 0 },
{ title: "关联人员", key: 1 },
{ title: "薪资项目", key: 2 },
{ title: "调薪计薪规则", key: 3 },
{ title: "调薪计薪规则", key: 3 }
]}
showOperateBtn={showOperateBtn}
editable={canEdit === "true"}
selectedTab={selectedTab}
onSave={() => this.handleEditSlideSave()}
subItemChange={(item) => {
subItemChange={item => {
this.setState({ selectedTab: item.key });
}}
/>
@ -606,23 +581,20 @@ export default class Ledger extends React.Component {
onClose={() => this.setState({ editSlideVisible: false })}
showMask={true}
closeMaskOnClick={() =>
this.setState({ editSlideVisible: false })
}
/>
)}
this.setState({ editSlideVisible: false })}
/>}
</WeaTop>
</WeaRightMenu>
{this.state.copyFormVisible && (
{this.state.copyFormVisible &&
<CopyFormModal
taxAgentStore={taxAgentStore}
visible={this.state.copyFormVisible}
onSave={(value) => this.handleCopySave(value)}
onSave={value => this.handleCopySave(value)}
onCancel={() => {
this.setState({ copyFormVisible: false });
}}
/>
)}
/>}
</div>
);
}

View File

@ -1,289 +1,423 @@
import React from 'react'
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import { WeaInputSearch, WeaHelpfulTip, WeaTable, WeaTop, WeaTab } from 'ecCom'
import { dataSource, payrollColumns } from '../columns';
import { Menu, Button, Dropdown, Table } from 'antd'
import CustomTab from '../../../components/customTab'
import "./index.less"
import PayrollGrantModal from './payrollGrantModal'
import PayrollWithdrawModal from './payrollWithdrawModal'
import { getQueryString } from '../../../util/url'
import { renderNoright, getSearchs } from '../../../util';
import CustomPaginationTable from '../../../components/customPaginationTable';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { WeaInputSearch, WeaHelpfulTip, WeaTable, WeaTop, WeaTab } from "ecCom";
import { dataSource, payrollColumns } from "../columns";
import { Menu, Button, Dropdown, message } from "antd";
import CustomTab from "../../../components/customTab";
import "./index.less";
import PayrollGrantModal from "./payrollGrantModal";
import PayrollWithdrawModal from "./payrollWithdrawModal";
import { getQueryString } from "../../../util/url";
import { renderNoright, getSearchs } from "../../../util";
import CustomPaginationTable from "../../../components/customPaginationTable";
@inject('payrollStore')
@inject("payrollStore")
@observer
export default class PayrollGrant extends React.Component {
constructor(props) {
super(props);
this.state = {
payrollGrantVisible: false,
payrollWithdrawVisible: false,
currentId: "",
btnStatus: {
can_send: true,
show_workflow_status: false
}
}
this.pageInfo = {current : 1, pageSize: 10}
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
payrollGrantVisible: false,
payrollWithdrawVisible: false,
currentId: "",
btnStatus: {
can_send: true,
show_workflow_status: false
}
};
this.pageInfo = { current: 1, pageSize: 10 };
}
componentWillMount() {
let id = getQueryString("id");
this.setState({ currentId: id });
const {
payrollStore: { getPayrollInfo, getInfoList, getPaySa }
} = this.props;
this.getSendBtnStatus(id);
getPayrollInfo(id);
getInfoList({
salarySendId: id
});
getPaySa();
}
getSendBtnStatus(id) {
const { payrollStore: { getSendBtnStatus } } = this.props;
getSendBtnStatus({ id })
.then(data => {
this.setState({
btnStatus: {
can_send: data.can_send,
show_workflow_status: data.show_workflow_status
}
});
})
.catch(() => {});
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, getInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId: this.state.currentId
});
});
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll, getInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId: this.state.currentId
});
});
}
// 全部发送
handleGrantAll() {
const { payrollStore } = this.props;
const { grantPayroll, getInfoList } = payrollStore;
grantPayroll({
ids: [],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId: this.state.currentId
});
});
}
// 全部撤回
handleWithdrawAll() {
const { payrollStore } = this.props;
const { withdrawPayroll, getInfoList } = payrollStore;
withdrawPayroll({
ids: [],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId: this.state.currentId
});
});
}
getColumns() {
const { payrollStore } = this.props;
const { salaryGrantTableStore: columns } = payrollStore;
let result = [
...columns,
{ title: "操作", key: "operation", dataIndex: "operation" }
].map(item => {
item = { ...item };
if (item.dataIndex == "operation") {
item.render = (text, record) => {
if (record.sendStatus == "已发放") {
return (
<a
onClick={() => {
this.handleWithdraw(record);
}}>
撤回
</a>
);
} else {
return (
<a
onClick={() => {
this.handleGrant(record);
}}>
发送
</a>
);
}
};
}
return item;
});
return result;
}
getSearchsAdQuick() {
const handleMenuClick = e => {
switch (e.key) {
case "1":
this.setState({ payrollGrantVisible: true });
break;
case "2":
this.setState({ payrollWithdrawVisible: true });
break;
case "3":
this.handleExportAll();
break;
case "4":
this.handleExportSelect();
break;
default:
break;
}
};
const menu = (
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">批量发放</Menu.Item>
<Menu.Item key="2">批量撤回</Menu.Item>
<Menu.Item key="3">全部导出</Menu.Item>
<Menu.Item key="4">导出选中</Menu.Item>
{/* <Menu.Item key="3">自定义列</Menu.Item> */}
</Menu>
);
return (
<div style={{ display: "inline-block" }}>
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => {
this.handleGrantAll();
}}
disabled={!this.state.btnStatus.can_send}>
全部发放
</Button>
{this.state.btnStatus.show_workflow_status &&
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => {
this.handleGrantProxy();
}}>
发起流程
</Button>}
<Button
type="default"
style={{ marginRight: "10px" }}
onClick={() => {
this.handleWithdrawAll();
}}>
全部撤回
</Button>
<Dropdown.Button style={{ marginRight: "10px" }} overlay={menu}>
更多
</Dropdown.Button>
</div>
);
}
handleExportAll = () => {
const { payrollStore: { exportPayroll } } = this.props;
exportPayroll({
salarySendId: this.state.currentId
});
};
handleExportSelect = () => {
const { selectedRowKeys, currentId } = this.state;
const { payrollStore: { exportPayroll } } = this.props;
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
exportPayroll({
ids: selectedRowKeys,
salarySendId: currentId
});
};
componentWillMount() {
let id = getQueryString("id")
this.setState({currentId: id})
const { payrollStore: {getPayrollInfo, getInfoList, getPaySa, } } = this.props;
this.getSendBtnStatus(id)
getPayrollInfo(id)
getInfoList({
salarySendId:id
})
getPaySa()
}
// 分页
handleDataPageChange(value) {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId: this.state.currentId,
...this.pageInfo
});
}
getSendBtnStatus(id) {
const { payrollStore : {getSendBtnStatus}} = this.props;
getSendBtnStatus({id}).then((data) => {
this.setState({
btnStatus: {
can_send: data.can_send,
show_workflow_status: data.show_workflow_status
}
})
}).catch(() => {
})
}
handleShowSizeChange(pageInfo) {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId: this.state.currentId,
...pageInfo
});
}
handleSearch() {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId: this.state.currentId,
...this.pageInfo
});
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, getInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId:this.state.currentId
})
})
}
handleGrantProxy() {
const { payrollStore: { grantProxy } } = this.props;
grantProxy({
salarySendId: this.state.currentId
}).then(data => {
this.getSendBtnStatus(this.state.currentId);
console.log(
`/spa/workflow/static4form/index.html#/main/workflow/req?requestid=` +
data.requestId
);
window.open(
`/spa/workflow/static4form/index.html#/main/workflow/req?requestid=` +
data.requestId,
"_blank"
);
});
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll, getInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId:this.state.currentId
})
})
}
onSelectChange = value => {
this.setState({
selectedRowKeys: value
});
};
// 全部发送
handleGrantAll() {
const { payrollStore } = this.props;
const { grantPayroll, getInfoList } = payrollStore;
grantPayroll({
ids: [],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId:this.state.currentId
})
})
}
render() {
const { payrollStore } = this.props;
const {
salarySendDetailBaseInfo,
salaryGrantDataSource,
getInfoList,
grantListShowSearchAd,
grantListConditionForm,
grantListCondition,
setGrantListShowSearchAd,
salaryGrantPageInfo
} = payrollStore;
const { selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange
};
return (
<div className="payrollGrant">
<WeaTop
title="工资单发放" // 文字
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
buttons={[this.getSearchsAdQuick()]}
/>
// 全部撤回
handleWithdrawAll() {
const { payrollStore } = this.props;
const { withdrawPayroll, getInfoList } = payrollStore;
withdrawPayroll({
ids: [],
salarySendId: this.state.currentId
}).then(() => {
getInfoList({
salarySendId:this.state.currentId
})
})
}
getColumns() {
const { payrollStore } = this.props;
const { salaryGrantTableStore: columns } = payrollStore
let result = [...columns, {title: "操作",key: "operation",dataIndex: "operation"}].map(item => {
item = {...item}
if(item.dataIndex == "operation") {
item.render = (text,record) => {
if(record.sendStatus == '已发放') {
return (
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
)
} else {
return (
<a onClick={() => {this.handleGrant(record)}}>发送</a>
)
}
}
}
return item;
})
return result;
}
getSearchsAdQuick() {
const handleMenuClick = (e) => {
switch(e.key) {
case "1":
this.setState({payrollGrantVisible: true})
break;
case "2":
this.setState({payrollWithdrawVisible: true})
break;
}
}
const menu = (
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">批量发放</Menu.Item>
<Menu.Item key="2">批量撤回</Menu.Item>
{/* <Menu.Item key="3"></Menu.Item>
<Menu.Item key="3">导出选中</Menu.Item> */}
{/* <Menu.Item key="3">自定义列</Menu.Item> */}
</Menu>
);
return (
<div style={{display: "inline-block"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleGrantAll()}} disabled={!this.state.btnStatus.can_send}>全部发放</Button>
{
this.state.btnStatus.show_workflow_status && <Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleGrantProxy()}}>发起流程</Button>
}
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Button>
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>更多</Dropdown.Button>
</div>
)
}
// 分页
handleDataPageChange(value) {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId:this.state.currentId,
...this.pageInfo
})
}
handleShowSizeChange(pageInfo) {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId:this.state.currentId,
...pageInfo
})
}
handleSearch() {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId:this.state.currentId,
...this.pageInfo
})
}
handleGrantProxy() {
const { payrollStore: {grantProxy} } = this.props;
grantProxy({
salarySendId: this.state.currentId
}).then((data) => {
this.getSendBtnStatus(this.state.currentId)
console.log(`/spa/workflow/static4form/index.html#/main/workflow/req?requestid=` + data.requestId)
window.open(`/spa/workflow/static4form/index.html#/main/workflow/req?requestid=` + data.requestId, "_blank");
})
}
render() {
const {payrollStore} = this.props;
const { salarySendDetailBaseInfo, salaryGrantDataSource, getInfoList, grantListShowSearchAd, grantListConditionForm, grantListCondition, setGrantListShowSearchAd, salaryGrantPageInfo } = payrollStore;
return (
<div className="payrollGrant">
<WeaTop
title="工资单发放" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
buttons={[this.getSearchsAdQuick()]}
></WeaTop>
<WeaTab
searchType={['base', 'advanced']} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={grantListShowSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setGrantListShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(grantListConditionForm, toJS(grantListCondition), 2)} // 高级搜索内部数据
// buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
// searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v => grantListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={grantListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
<div className="titleBar">
<div className="titleBarLeft">
<span>薪资所属月{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
<WeaHelpfulTip
style={{marginLeft: '1rem', marginRight: "1rem"}}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate} ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={grantListShowSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setGrantListShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(
grantListConditionForm,
toJS(grantListCondition),
2
)} // 高级搜索内部数据
// buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
// searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v =>
grantListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={grantListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
<div className="titleBar">
<div className="titleBarLeft">
<span>
薪资所属月{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth
.year}-{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth.monthValue}
</span>
<WeaHelpfulTip
style={{ marginLeft: "1rem", marginRight: "1rem" }}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle
.fromDate} ${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
税款所属期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.taxCycle}\n
考勤取值周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle
.fromDate}至${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
福利台账月份\n
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>工资单模板{salarySendDetailBaseInfo.template}</span>
</div>
引用${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>
工资单模板{salarySendDetailBaseInfo.template}
</span>
</div>
<div className="titleBarRight">
<span>已发放{salarySendDetailBaseInfo.sendNum}/<span style={{color: "red"}}>{salarySendDetailBaseInfo.sendTotal}</span></span>
</div>
</div>
<div className="titleBarRight">
<span>
已发放{salarySendDetailBaseInfo.sendNum}/<span
style={{ color: "red" }}>
{salarySendDetailBaseInfo.sendTotal}
</span>
</span>
</div>
</div>
<div className="tableWrapper">
<CustomPaginationTable
dataSource={salaryGrantDataSource} columns={this.getColumns()}
total={salaryGrantPageInfo.total}
current={salaryGrantPageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
onPageChange={(value) => {
this.pageInfo.current = value
this.handleDataPageChange(value)
}}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = {current, pageSize}
this.handleShowSizeChange(this.pageInfo)
}}
/>
</div>
{
this.state.payrollGrantVisible && <PayrollGrantModal
sendId={this.state.currentId}
visible={this.state.payrollGrantVisible}
onCancel={() => {this.setState({payrollGrantVisible: false})}}/>
}
<div className="tableWrapper">
<CustomPaginationTable
rowKey="id"
rowSelection={rowSelection}
dataSource={salaryGrantDataSource}
columns={this.getColumns()}
total={salaryGrantPageInfo.total}
current={salaryGrantPageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
onPageChange={value => {
this.pageInfo.current = value;
this.handleDataPageChange(value);
}}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = { current, pageSize };
this.handleShowSizeChange(this.pageInfo);
}}
/>
</div>
{this.state.payrollGrantVisible &&
<PayrollGrantModal
sendId={this.state.currentId}
visible={this.state.payrollGrantVisible}
onCancel={() => {
this.setState({ payrollGrantVisible: false });
}}
/>}
{
this.state.payrollWithdrawVisible && <PayrollWithdrawModal
sendId={this.state.currentId}
visible={this.state.payrollWithdrawVisible}
onCancel={() => {this.setState({payrollWithdrawVisible: false})}}
/>
}
</div>
)
}
}
{this.state.payrollWithdrawVisible &&
<PayrollWithdrawModal
sendId={this.state.currentId}
visible={this.state.payrollWithdrawVisible}
onCancel={() => {
this.setState({ payrollWithdrawVisible: false });
}}
/>}
</div>
);
}
}

View File

@ -1,13 +1,17 @@
.payrollGrant {
padding: 20px;
.titleBar {
height: 47px;
line-height: 47px;
.titleBarLeft {
float: left;
}
.titleBarRight {
float: right;
}
padding: 20px;
.titleBar {
height: 47px;
line-height: 47px;
.titleBarLeft {
float: left;
}
}
.titleBarRight {
float: right;
}
}
.tableWrapper {
height: calc(100vh - 180.22px);
overflow: auto;
}
}

View File

@ -228,6 +228,7 @@ export default class payrollGrantModal extends React.Component {
<div
style={{ marginTop: "10px", height: "500px", overflowY: "scroll" }}>
<WeaTable
rowKey="id"
rowSelection={rowSelection}
dataSource={canGrantDataSource}
columns={this.getColumns()}

View File

@ -227,6 +227,7 @@ export default class PayrollWithdrawModal extends React.Component {
</div>
<div style={{ marginTop: "10px", height: "500px", scrollY: "scroll" }}>
<WeaTable
rowKey="id"
rowSelection={rowSelection}
dataSource={canWithdrawDataSource}
columns={this.getColumns()}

View File

@ -452,6 +452,12 @@ export class payrollStore {
exportDetailList = (params = {}) => {
API.exportDetailList(params);
};
// 工资单发放-导出-工资单发放列表
@action
exportPayroll = (params = {}) => {
API.exportPayroll(params);
};
// 工资单-获取工资单发放高级搜索
@action