Merge branch 'release/2.10.1.2401.02-个税' into custom-艾志工业-合并个税
This commit is contained in:
commit
382c9b556e
|
|
@ -5,6 +5,10 @@ import { postFetch } from "../util/request";
|
|||
export const getArchiveList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryArchive/list", params);
|
||||
};
|
||||
//薪资档案的高级搜索
|
||||
export const getSaCondition = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params);
|
||||
};
|
||||
//薪资档案-获取薪资档案详情表单
|
||||
export const getArchiveForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params);
|
||||
|
|
@ -100,7 +104,3 @@ export const getSingleSalaryItemInfo = (params) => {
|
|||
export const editSingleSalaryItem = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", params);
|
||||
};
|
||||
// 基数调整记录列表
|
||||
export const getAdjustHistoryList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -108,14 +108,14 @@ export const deleteSalaryacct = (params) => {
|
|||
|
||||
// 薪资记录--归档薪资核算记录
|
||||
export const fileSalaryAcct = (params) => {
|
||||
return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params);
|
||||
// return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, {
|
||||
// method: "GET",
|
||||
// mode: "cors",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json"
|
||||
// }
|
||||
// }).then(res => res.json());
|
||||
// return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params);
|
||||
return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 薪资记录-回算
|
||||
export const backCalculate = (params) => {
|
||||
|
|
@ -246,3 +246,7 @@ export const getExportField = params => {
|
|||
export const customCacheExportField = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", params);
|
||||
};
|
||||
//薪资核算-批量更新
|
||||
export const salaryacctBatchUpdate = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/batchUpdate", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postExportFetch, postFetch } from "../util/request";
|
||||
import { convertToUrlString } from "../util/url";
|
||||
|
||||
//个税申报表-个税申报表列表
|
||||
export const getDeclareList = params => {
|
||||
|
|
@ -230,7 +231,10 @@ export const taxdeclarationEdit = (params) => {
|
|||
};
|
||||
//个税申报表申报数据-详情
|
||||
export const getTaxdeclarationDetailInfo = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/detailInfo", "GET", params);
|
||||
return fetch(`/api/bs/hrmsalary/taxdeclaration/detailInfo?${convertToUrlString(params)}`, {
|
||||
method: "GET",
|
||||
mode: "cors"
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
//个税申报表申报数据-下载模板
|
||||
export const taxdeclarationExportTemplate = params => {
|
||||
|
|
@ -260,3 +264,11 @@ export const addTaxDeclaration = (params) => {
|
|||
export const deleteTaxDeclaration = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/deleteTaxDeclaration", params);
|
||||
};
|
||||
//个税申报表-删除申报表
|
||||
export const deleteInfo = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/deleteInfo", params);
|
||||
};
|
||||
//个税申报表-对比申报结果
|
||||
export const getTaxdeclarationContrastList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxdeclaration/contrast", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@ import { convertToUrlString } from "../util/url";
|
|||
export const mySalaryBillList = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList", params);
|
||||
};
|
||||
// 人事卡片-工资单列表
|
||||
export const mySalaryBillList4Card = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList4Card", params);
|
||||
};
|
||||
// 人事卡片-调薪记录列表
|
||||
export const mySalaryRecordList4Card = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/report/record/list4Card", "GET", params);
|
||||
};
|
||||
|
||||
// 调薪记录列表
|
||||
export const recordList = params => {
|
||||
|
|
|
|||
|
|
@ -105,5 +105,8 @@ export const exportArchives = (ids) => {
|
|||
window.URL.revokeObjectURL(url);
|
||||
}));
|
||||
};
|
||||
|
||||
// 基数调整记录列表
|
||||
export const getAdjustHistoryList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
|
||||
//台账
|
||||
export const getRecordList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/batch/list', 'get', params);
|
||||
};
|
||||
export const getCalcForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/accountForm', 'get', params);
|
||||
};
|
||||
export const save = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/save', 'post', params);
|
||||
};
|
||||
export const doArchive = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/file', 'post', params);
|
||||
};
|
||||
export const deleteRecord = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/delete', 'post', params);
|
||||
};
|
||||
|
||||
//核算
|
||||
export const getCalcTabs = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/tabList', 'get', params);
|
||||
};
|
||||
export const getNormalForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/commonForm', 'get', params);
|
||||
};
|
||||
export const saveNormalForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/common/save', 'post', params);
|
||||
};
|
||||
export const deleteNormal = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/common/delete', 'post', params);
|
||||
};
|
||||
export const getSupplementaryForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/querySupplementaryForm', 'get', params);
|
||||
};
|
||||
export const saveSupplementaryForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/supplementary/save', 'post', params);
|
||||
};
|
||||
export const deleteSupplementary = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/siaccount/supplementary/delete', 'post', params);
|
||||
};
|
||||
|
||||
// 导出正常缴纳核算
|
||||
export const exportNormalPaymentAccount = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/common/export', 'post', params);
|
||||
};
|
||||
|
||||
// 导出总览
|
||||
export const exportOverView = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/overview/export', 'post', params);
|
||||
};
|
||||
|
||||
// 导出补缴核算
|
||||
export const exportSupplementaryAccount = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/supplementary/export', 'post', params);
|
||||
};
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 554 B |
|
|
@ -40,8 +40,11 @@ class ImpStep2 extends Component {
|
|||
|
||||
render() {
|
||||
const { dataSource, columns, loading } = this.state;
|
||||
const { scrollHeight } = this.props;
|
||||
return (
|
||||
<WeaTable dataSource={dataSource} columns={columns} pagination={false} loading={loading} scroll={{ x: 800 }}/>
|
||||
<WeaTable
|
||||
dataSource={dataSource} columns={columns} loading={loading} scroll={{ x: 800, y: `${scrollHeight}px` }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class ImpStep3 extends Component {
|
|||
</div>
|
||||
}
|
||||
{
|
||||
!_.isEmpty(importResult.errorData) &&
|
||||
(!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) &&
|
||||
<WeaTable
|
||||
columns={[
|
||||
{
|
||||
|
|
@ -39,7 +39,7 @@ class ImpStep3 extends Component {
|
|||
dataIndex: "message"
|
||||
}
|
||||
]}
|
||||
dataSource={importResult.errorData} pagination={false}
|
||||
dataSource={importResult.errorData || importResult.errorNotice} pagination={false}
|
||||
scroll={{ y: `calc(100vh - 387px)` }}
|
||||
/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
renderChildren = () => {
|
||||
const { current } = this.state;
|
||||
const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props;
|
||||
const { current } = this.state, { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props;
|
||||
const scrollHeight = this.importRef ? this.importRef.state.height - 232 : 606.6;
|
||||
let CurrentDom = null;
|
||||
switch (current) {
|
||||
case 0:
|
||||
|
|
@ -45,7 +45,7 @@ class Index extends Component {
|
|||
ref={dom => this.step1Ref = dom}/>;
|
||||
break;
|
||||
case 1:
|
||||
CurrentDom = <ImpStep2 {...this.props}/>;
|
||||
CurrentDom = <ImpStep2 {...this.props} scrollHeight={scrollHeight}/>;
|
||||
if (excludeKey) {
|
||||
CurrentDom = <ImpStep3 importResult={importResult}/>;
|
||||
}
|
||||
|
|
@ -128,9 +128,10 @@ class Index extends Component {
|
|||
loading={this.props.nextloading}>{getLabel(1402, "下一步")}</Button>,
|
||||
<Button type="primary" onClick={() => this.props.onCancel(true)}>{getLabel(555, "完成")}</Button>
|
||||
];
|
||||
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props}
|
||||
{...this.props} ref={dom => this.importRef = dom}
|
||||
scalable hasScroll className="importBox" initLoadCss
|
||||
buttons={current === 0 ? _.nth(btns, 1) : (!this.props.excludeKey && current === 1) ? _.take(btns, 2) : _.takeRight(btns)}
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -7,32 +7,31 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { dealTemplate } from "../pcTemplate";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { theme, background, tip, tipPosi, itemTypeList } = this.props;
|
||||
const { theme, background, tip, tipPosi, itemTypeList, title } = this.props;
|
||||
const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile");
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="pbmc-head">{getLabel(111, "薪酬预览")}</div>
|
||||
{/*<div className="pbmc-head">{title || getLabel(111, "薪酬预览")}</div>*/}
|
||||
<div className="pbmc-body">
|
||||
<div className="weapp-salary-payroll-mobile-preview">
|
||||
<div className="bill-container">
|
||||
<div className="bill-info-header">
|
||||
<div className="title">{theme || ""}</div>
|
||||
<div className="time">{moment().format("YYYY-MM-DD HH:mm:ss")}</div>
|
||||
{
|
||||
background &&
|
||||
<div className="img"><img src={`${background}`} alt="logo"/></div>
|
||||
}
|
||||
{/*<div className="time">{moment().format("YYYY-MM-DD HH:mm:ss")}</div>*/}
|
||||
{/*{*/}
|
||||
{/* background &&*/}
|
||||
{/* <div className="img"><img src={`${background}`} alt="logo"/></div>*/}
|
||||
{/*}*/}
|
||||
</div>
|
||||
{
|
||||
!onlyOneGrup && tipPosi === "1" && tip &&
|
||||
<div className="corporate-culture-text top" title={tip}>{tip}</div>
|
||||
!onlyOneGrup && tipPosi.toString() === "1" && tip &&
|
||||
<div className="corporate-culture-text top" title={tip} dangerouslySetInnerHTML={{ __html: tip }}/>
|
||||
}
|
||||
<div className="salary-detail-table-container">
|
||||
{
|
||||
|
|
@ -46,10 +45,11 @@ class Index extends Component {
|
|||
}
|
||||
<div className="group-list">
|
||||
{
|
||||
(onlyOneGrup && tipPosi === "1" && tip) && (<div className="list-item send-tip top">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
(onlyOneGrup && tipPosi.toString() === "1" && tip) && (
|
||||
<div className="list-item send-tip top">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
{
|
||||
items.map((templatItem, index) => {
|
||||
|
|
@ -57,15 +57,16 @@ class Index extends Component {
|
|||
return <div className="list-item" key={index}>
|
||||
<div className="item-name" title={salaryItemShowName || name}><span
|
||||
className="text">{salaryItemShowName || name || ""}</span></div>
|
||||
<div className="item-count">{salaryItemValue || "100"}</div>
|
||||
<div className="item-count">{salaryItemValue}</div>
|
||||
</div>;
|
||||
})
|
||||
}
|
||||
{
|
||||
(onlyOneGrup && tipPosi === "2" && tip) && (<div className="list-item send-tip bottom">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
(onlyOneGrup && tipPosi.toString() === "2" && tip) && (
|
||||
<div className="list-item send-tip bottom">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
</div>
|
||||
</div>);
|
||||
|
|
@ -73,9 +74,10 @@ class Index extends Component {
|
|||
}
|
||||
</div>
|
||||
{
|
||||
!onlyOneGrup && tipPosi === "2" && tip &&
|
||||
<div className="corporate-culture-text footer" title={tip}>{tip}</div>
|
||||
!onlyOneGrup && tipPosi.toString() === "2" && tip &&
|
||||
<div className="corporate-culture-text footer" title={tip} dangerouslySetInnerHTML={{ __html: tip }}/>
|
||||
}
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
}
|
||||
|
||||
.pbmc-body {
|
||||
height: calc(100% - 150px);
|
||||
height: calc(100% - 50px);
|
||||
background: #f6f6f6;
|
||||
overflow: auto;
|
||||
|
||||
|
|
@ -20,6 +20,18 @@
|
|||
.bill-container {
|
||||
background: #f6f6f6;
|
||||
|
||||
.space {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.ant-btn {
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bill-info-header {
|
||||
padding-top: 16px;
|
||||
|
||||
|
|
@ -28,6 +40,7 @@
|
|||
font-size: 19px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.time {
|
||||
|
|
@ -55,7 +68,6 @@
|
|||
}
|
||||
|
||||
.corporate-culture-text {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
color: #111;
|
||||
padding: 8px 16px;
|
||||
|
|
@ -72,15 +84,13 @@
|
|||
|
||||
.group-title {
|
||||
background: #fff;
|
||||
background: var(--base-white);
|
||||
display: flex;
|
||||
color: #2780c4;
|
||||
align-items: center;
|
||||
min-height: 45px;
|
||||
padding: 0 16px;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
font-weight: bolder;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.group-list {
|
||||
|
|
@ -92,16 +102,13 @@
|
|||
background: #fff;
|
||||
|
||||
.item-name {
|
||||
font-size: 16px;
|
||||
padding: 8px 16px;
|
||||
width: 40%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fbfbfb;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
flex-shrink: 0;
|
||||
color: #2780c4;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.item-count {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { dealTemplate } from "./index";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Content extends Component {
|
||||
render() {
|
||||
const { theme, background, tip, tipPosi, itemTypeList, sendTime = new Date() } = this.props;
|
||||
const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc");
|
||||
return (
|
||||
<div className="salary-preview-container">
|
||||
<div style={{ border: "10px solid #F3F9FF" }}>
|
||||
<div className="edition-center">
|
||||
<div className="header">
|
||||
<div className="header-title">{theme || ""}</div>
|
||||
{/*<div className="header-salary-date-time">{moment(sendTime).format("YYYY-MM-DD HH:mm:ss")}</div>*/}
|
||||
</div>
|
||||
<div className="body">
|
||||
{/*{*/}
|
||||
{/* background &&*/}
|
||||
{/* <div className="comp-img"><img src={`${background}`} alt="logo"/></div>*/}
|
||||
{/*}*/}
|
||||
{
|
||||
!onlyOneGrup && tipPosi.toString() === "1" && tip &&
|
||||
<div className="corporate-culture-text" title={tip} dangerouslySetInnerHTML={{ __html: tip }}/>
|
||||
}
|
||||
<div className="data-detail">
|
||||
{
|
||||
showData.map((groupItem, index) => {
|
||||
// 如果当前组下没有条目 当前组直接不展示。
|
||||
if (!groupItem) return null;
|
||||
const { groupId, groupName, items = [] } = groupItem;
|
||||
return (
|
||||
<div className="salary-group" key={groupId || index}>
|
||||
{
|
||||
groupName ? <div className="group-title">
|
||||
<img src={require("../../common/titleLogo.png")} alt=""/>
|
||||
<span>{groupName}</span>
|
||||
</div> : null
|
||||
}
|
||||
<div className="group-list">
|
||||
{
|
||||
(onlyOneGrup && tipPosi.toString() === "1" && tip) && (<div className="send-tip top">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
{
|
||||
items.map((templatItem, index) => {
|
||||
const { salaryItemValue, name, salaryItemShowName, id } = templatItem || {};
|
||||
return <div key={index} style={{ display: id ? "flex" : "none" }}
|
||||
className={`list-item ${index % 2 === 0 ? "even" : "odd"} ${index === 0 ? "zero" : ""} ${index === 1 ? "first" : ""}`}>
|
||||
<div className="item-name" title={salaryItemShowName || name}>
|
||||
<span className="text">{salaryItemShowName || name || ""}</span>
|
||||
</div>
|
||||
<div className="item-count">{salaryItemValue || ""}</div>
|
||||
</div>;
|
||||
|
||||
})
|
||||
}
|
||||
{
|
||||
(onlyOneGrup && tipPosi.toString() === "2" && tip) && (<div className="send-tip bottom">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
</div>
|
||||
</div>);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
{
|
||||
!onlyOneGrup && tipPosi.toString() === "2" && tip &&
|
||||
<div className="corporate-culture-text" title={tip} dangerouslySetInnerHTML={{ __html: tip }}/>
|
||||
}
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Content;
|
||||
|
|
@ -1,82 +1,15 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import moment from "moment";
|
||||
import Content from "./content";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { theme, background, tip, tipPosi, itemTypeList } = this.props;
|
||||
const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc");
|
||||
return (
|
||||
<div className="pbpc-content">
|
||||
<div className="weapp-salary-sp weapp-salary-payroll-pc-preview">
|
||||
<div className="salary-preview-container">
|
||||
<div className="edition-center">
|
||||
<div className="header">
|
||||
<div className="header-title">{theme || ""}</div>
|
||||
<div className="header-salary-date-time">{moment().format("YYYY-MM-DD HH:mm:ss")}</div>
|
||||
</div>
|
||||
<div className="body">
|
||||
{
|
||||
background &&
|
||||
<div className="comp-img"><img src={`${background}`} alt="logo"/></div>
|
||||
}
|
||||
{
|
||||
!onlyOneGrup && tipPosi === "1" && tip &&
|
||||
<div className="corporate-culture-text" title={tip}>{tip}</div>
|
||||
}
|
||||
<div className="data-detail">
|
||||
{
|
||||
showData.map((groupItem, index) => {
|
||||
// 如果当前组下没有条目 当前组直接不展示。
|
||||
if (!groupItem) return null;
|
||||
const { groupId, groupName, items = [] } = groupItem;
|
||||
return (
|
||||
<div className="salary-group" key={groupId || index}>
|
||||
{
|
||||
groupName ? <div className="group-title">{groupName}</div> : null
|
||||
}
|
||||
<div className="group-list">
|
||||
{
|
||||
(onlyOneGrup && tipPosi === "1" && tip) && (<div className="send-tip top">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
{
|
||||
items.map((templatItem, index) => {
|
||||
const { salaryItemValue, name, salaryItemShowName } = templatItem || {};
|
||||
return <div key={index}
|
||||
className={`list-item ${index % 2 === 0 ? "even" : "odd"} ${index === 0 ? "zero" : ""} ${index === 1 ? "first" : ""}`}>
|
||||
<div className="item-name" title={salaryItemShowName || name}>
|
||||
<span className="text">{salaryItemShowName || name || ""}</span>
|
||||
</div>
|
||||
<div className="item-count">{salaryItemValue || ""}</div>
|
||||
</div>;
|
||||
|
||||
})
|
||||
}
|
||||
{
|
||||
(onlyOneGrup && tipPosi === "2" && tip) && (<div className="send-tip bottom">
|
||||
<div className="label">{getLabel(111, "发放说明")}</div>
|
||||
<div className="detail">{tip}</div>
|
||||
</div>)
|
||||
}
|
||||
</div>
|
||||
</div>);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
{
|
||||
!onlyOneGrup && tipPosi === "2" && tip &&
|
||||
<div className="corporate-culture-text" title={tip}>{tip}</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="weapp-salary-sp weapp-salary-payroll-pc-preview"><Content {...this.props}/></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -91,15 +24,15 @@ export const dealTemplate = (itemTypeList, type) => {
|
|||
const { items, groupName, groupId } = group;
|
||||
if (items.length !== 0) {
|
||||
items.forEach((item) => {
|
||||
item.salaryItemValue = "100";
|
||||
item.salaryItemValue = !_.isNil(item.salaryItemValue) ? item.salaryItemValue : "100";
|
||||
});
|
||||
if (items.length % 2 && type === "pc") items.push({});
|
||||
// 未分类不展示标题
|
||||
if (!groupId.includes("222222222222222222")) {
|
||||
// if (!groupId.includes("222222222222222222")) {
|
||||
showData.push({ groupId, groupName, items });
|
||||
} else {
|
||||
showData.push({ items });
|
||||
}
|
||||
// } else {
|
||||
// showData.push({ items });
|
||||
// }
|
||||
}
|
||||
});
|
||||
if (cloneItemTypeList.length === 1) {
|
||||
|
|
|
|||
|
|
@ -4,145 +4,7 @@
|
|||
overflow-y: auto;
|
||||
|
||||
.weapp-salary-sp {
|
||||
background: #f6f6f6;
|
||||
|
||||
.salary-preview-container {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
.edition-center {
|
||||
max-width: 1000px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-bottom: 32px;
|
||||
|
||||
.header {
|
||||
height: 48px;
|
||||
padding: 0 16px;
|
||||
font-size: 12px;
|
||||
color: #111;
|
||||
|
||||
.header-title {
|
||||
height: 22px;
|
||||
font-size: 17px;
|
||||
color: #111;
|
||||
line-height: 22px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header-salary-date-time {
|
||||
margin-top: 16px;
|
||||
text-align: center;
|
||||
height: 14px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 14px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
width: 100%;
|
||||
margin-top: 32px;
|
||||
|
||||
.comp-img {
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.corporate-culture-text {
|
||||
width: 100%;
|
||||
margin-top: 16px;
|
||||
text-align: center;
|
||||
min-height: 12px;
|
||||
font-size: 12px;
|
||||
color: #111;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.data-detail {
|
||||
margin-top: 16px;
|
||||
|
||||
.salary-group {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.group-title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.group-list {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.even {
|
||||
border-left: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.zero, .first {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
min-height: 40px;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
|
||||
.item-name {
|
||||
flex-basis: 170px;
|
||||
box-sizing: border-box;
|
||||
width: 170px;
|
||||
padding: 0 16px;
|
||||
height: 100%;
|
||||
background: #fbfbfb;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.text {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.item-count {
|
||||
flex-basis: 328px;
|
||||
padding-left: 16px;
|
||||
height: 100%;
|
||||
line-height: 40px;
|
||||
background: #fff;
|
||||
font-size: 12px;
|
||||
color: #111;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
background: #F3F9FF;
|
||||
}
|
||||
|
||||
.weapp-salary-payroll-pc-preview {
|
||||
|
|
@ -151,3 +13,166 @@
|
|||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.salary-preview-container {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
.edition-center {
|
||||
max-width: 1000px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-bottom: 32px;
|
||||
|
||||
.header {
|
||||
height: 48px;
|
||||
padding: 0 16px;
|
||||
font-size: 12px;
|
||||
color: #111;
|
||||
|
||||
.header-title {
|
||||
height: 22px;
|
||||
font-size: 25px;
|
||||
color: #111;
|
||||
line-height: 22px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.header-salary-date-time {
|
||||
margin-top: 16px;
|
||||
text-align: center;
|
||||
height: 14px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 14px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
//margin-top: 32px;
|
||||
|
||||
.comp-img {
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.corporate-culture-text {
|
||||
text-align: left;
|
||||
color: #111;
|
||||
margin: 16px 30px 20px 30px;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
padding: 10px 14px;
|
||||
background: #FAFAFA;
|
||||
border: 1px solid rgba(238, 238, 238, 1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.data-detail {
|
||||
.salary-group {
|
||||
background: #FFF;
|
||||
|
||||
.group-title {
|
||||
font-size: 14px;
|
||||
padding: 16px 0 0 30px;
|
||||
font-weight: bolder;
|
||||
color: #333333;
|
||||
|
||||
img {
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
span {
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.group-list {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0 30px;
|
||||
|
||||
.even {
|
||||
border-left: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.zero, .first {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
min-height: 40px;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
|
||||
.item-name {
|
||||
//flex-basis: 170px;
|
||||
//width: 170px;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
padding: 0 16px;
|
||||
height: 100%;
|
||||
background: #fbfbfb;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
font-size: 12px;
|
||||
color: #5F5F5F;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.text {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.item-count {
|
||||
//flex-basis: 328px;
|
||||
flex: 1;
|
||||
padding-left: 16px;
|
||||
height: 100%;
|
||||
line-height: 40px;
|
||||
background: #fff;
|
||||
font-size: 12px;
|
||||
color: #5F5F5F;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.space {
|
||||
margin: 20px 0 40px 0 !important;
|
||||
|
||||
button:last-child {
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import HistoricalPayroll from "./pages/historicalPayroll";
|
||||
import SalaryAdjustmentRecords from "./pages/salaryAdjustmentRecords";
|
||||
import MySalaryMobile from "./pages/mySalaryMobile";
|
||||
import MySalary from "./pages/mySalaryBenefits";
|
||||
import Programme from "./pages/socialSecurityBenefits/programme";
|
||||
import Archives from "./pages/socialSecurityBenefits/archives";
|
||||
import StandingBook from "./pages/socialSecurityBenefits/standingBook";
|
||||
import Programme from "./pages/socialSecurityBenefits/welfarePlan";
|
||||
import Programme_old from "./pages/socialSecurityBenefits/programme";
|
||||
// import Archivess from "./pages/socialSecurityBenefits/archives";
|
||||
import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面
|
||||
import StandingBookDemo from "./pages/socialSecurityBenefits/standingBook";
|
||||
import StandingBook from "./pages/socialSecurityBenefits/standingBook/standingBook";//社保福利台账重构页面
|
||||
import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail";
|
||||
import StandingBookOfflineComparison from "./pages/socialSecurityBenefits/standingBookOfflineComparison";
|
||||
import SalaryItem from "./pages/salaryItem";
|
||||
import PayrollFiles from "./pages/payrollFiles";
|
||||
import SalaryFiles from "./pages/payrollFiles/salaryFiles";
|
||||
import CumDeduct from "./pages/dataAcquisition/cumDeduct";
|
||||
import OtherDeduct from "./pages/dataAcquisition/otherDeduct";
|
||||
import CumSituation from "./pages/dataAcquisition/cumSituation";
|
||||
|
|
@ -24,6 +30,7 @@ import PayrollGrant from "./pages/payroll/payrollGrant";
|
|||
import PayrollDetail from "./pages/payroll/payrollDetail";
|
||||
// import Declare from "./pages/declare";
|
||||
import DeclareDetail from "./pages/declareDetail";
|
||||
import DeclareOnlineComparison from "./pages/declareOnlineComparison";
|
||||
import Employeedeclare from "./pages/employeedeclare";
|
||||
import EnterprisePayCertificationDetail from "./pages/enterprisePayCertificationDetail";
|
||||
import BankVoucherDetail from "./pages/bankVoucherDetail";
|
||||
|
|
@ -38,6 +45,7 @@ import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail";
|
|||
import CompareDetail from "./pages/calculateDetail/compareDetail";
|
||||
import DoCalcDetail from "./pages/calculate/doCalc";
|
||||
import OfflineCompare from "./pages/calculate/calcOc";
|
||||
import CalcView from "./pages/calculate/calcView";
|
||||
import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail";
|
||||
import TemplatePreview from "./pages/payroll/templatePreview";
|
||||
import PayrollTemplatePreview from "./pages/payroll/templatePreview/tmpPreview"; //重构的工资单模板预览页面
|
||||
|
|
@ -72,6 +80,10 @@ const Home = (props) => props.children;
|
|||
const SocialSecurityBenefits = (props) => props.children;
|
||||
const DataAcquisition = (props) => props.children;
|
||||
|
||||
// historicalPayroll 历史工资单查看
|
||||
// salaryAdjustmentRecords 调薪记录查看
|
||||
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalaryMobile 我的薪资福利-移动端
|
||||
// mySalary 我的薪资福利
|
||||
// mySalaryView 我的薪资福利-查看工资单
|
||||
|
|
@ -92,6 +104,7 @@ const DataAcquisition = (props) => props.children;
|
|||
// calculate 薪资核算
|
||||
// calculateDetail 核算详情
|
||||
// DoCalcDetail 核算详情页面-新
|
||||
// CalcView 核算查看页面-新
|
||||
// OfflineCompare 薪资核算线下对比-新
|
||||
// placeOnFileDetail 核算归档详情
|
||||
// compareDetail 线下线上对比
|
||||
|
|
@ -119,6 +132,8 @@ const Routes = (
|
|||
path="hrmSalary"
|
||||
onEnter={getLocaleLabel}
|
||||
component={Home}>
|
||||
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
|
||||
<Route key="salaryAdjustmentRecords" path="salaryAdjustmentRecords" component={SalaryAdjustmentRecords}/>
|
||||
<Route key="mySalaryMobile" path="mySalaryMobile" component={MySalaryMobile}/>
|
||||
<Route key="mySalary" path="mySalary" component={MySalary}/>
|
||||
<Route key="mySalaryView" path="mySalary/:salaryInfoId" component={MySalaryView}/>
|
||||
|
|
@ -127,7 +142,10 @@ const Routes = (
|
|||
path="socialSecurityBenefits"
|
||||
component={SocialSecurityBenefits}>
|
||||
<Route key="programme" path="programme" component={Programme}/>
|
||||
<Route key="programme_old" path="programme_old" component={Programme_old}/>
|
||||
<Route key="archives" path="archives" component={Archives}/>
|
||||
{/*<Route key="archives_demo" path="archives_demo" component={Archivess}/>*/}
|
||||
<Route key="standingBook_demo" path="standingBook_demo" component={StandingBookDemo}/>
|
||||
<Route key="standingBook" path="standingBook" component={StandingBook}/>
|
||||
<Route
|
||||
key="standingBookDetail"
|
||||
|
|
@ -141,7 +159,8 @@ const Routes = (
|
|||
/>
|
||||
</Route>
|
||||
<Route key="salaryItem" path="salaryItem" component={SalaryItem}/>
|
||||
<Route key="salaryFile" path="salaryFile" component={PayrollFiles}/>
|
||||
<Route key="salaryFile" path="salaryFile" component={SalaryFiles}/>
|
||||
<Route key="salaryFile-reconfig" path="salaryFile-reconfig" component={PayrollFiles}/>
|
||||
<Route key="adjustSalaryManage" path="adjustSalaryManage" component={AdjustSalaryManage}/>
|
||||
<Route
|
||||
key="dataAcquisition"
|
||||
|
|
@ -158,7 +177,8 @@ const Routes = (
|
|||
<Route key="calculateDetail" path="calculateDetail" component={CalculateDetail}/>
|
||||
<Route key="doCalc" path="calculate/:salaryAcctRecordId" component={DoCalcDetail}/>
|
||||
<Route key="calcOc" path="calcOc/:salaryAcctRecordId" component={OfflineCompare}/>
|
||||
<Route key="placeOnFileDetail" path="placeOnFileDetail/:salaryAcctRecordId" component={PlaceOnFileDetail}/>
|
||||
<Route key="calcView" path="calcView/:salaryAcctRecordId" component={CalcView}/>
|
||||
<Route key="placeOnFileDetail" path="placeOnFileDetail" component={PlaceOnFileDetail}/>
|
||||
<Route key="compareDetail" path="compareDetail" component={CompareDetail}/>
|
||||
<Route key="payroll" path="payroll" component={Payroll}/>
|
||||
<Route key="watermarkPreview" path="payroll/watermark/preview" component={WatermarkPreview}/>
|
||||
|
|
@ -168,6 +188,7 @@ const Routes = (
|
|||
<Route key="payrollinfo" path="payrollinfo" component={PayrollTemplatePreview}/>
|
||||
<Route key="declare" path="declare" component={Declare}/>
|
||||
<Route key="declareDetail" path="declareDetail" component={DeclareDetail}/>
|
||||
<Route key="declareOnlineComparison" path="declareDetail/:taxDeclarationId" component={DeclareOnlineComparison}/>
|
||||
<Route key="employeedeclare" path="employeedeclare" component={Employeedeclare}/>
|
||||
<Route key="enterprisePayCertificationDetail" path="enterprisePayCertificationDetail"
|
||||
component={EnterprisePayCertificationDetail}/>
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
.reportName {
|
||||
font-size: 14px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算查看
|
||||
* Description:
|
||||
* Date: 2023/12/7
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Dropdown, Menu, message } from "antd";
|
||||
import Layout from "../doCalc/layout";
|
||||
import SalaryEditCalc from "../doCalc/components/salaryEditCalc";
|
||||
import AdvanceInputBtn from "../doCalc/components/advanceInputBtn";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getExportField } from "../../../apis/calculate";
|
||||
import CustomCalcExportDialog from "../doCalc/components/customCalcExportDialog";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showChildren: false,
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }
|
||||
};
|
||||
this.calc = null;
|
||||
}
|
||||
|
||||
init = () => this.setState({ showChildren: true });
|
||||
|
||||
handleMenuClick = ({ key }) => {
|
||||
const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { consolidatedTaxation, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation };
|
||||
switch (key) {
|
||||
case "exportAll":
|
||||
const url = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}`;
|
||||
window.open(`${window.ecologyContentPath || ""}${url}`, "_blank");
|
||||
break;
|
||||
case "export_selected":
|
||||
const { calcTableRef: { wrappedInstance: { state: { selectedRowKeys } } } } = this.calc;
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543306, "未选择条目"));
|
||||
return;
|
||||
}
|
||||
const url1 = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=${selectedRowKeys.join(",")}&${convertToUrlString(payload)}`;
|
||||
window.open(`${window.ecologyContentPath || ""}${url1}`, "_blank");
|
||||
break;
|
||||
case "export_custom":
|
||||
getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { checkItems, itemsByGroup } = data;
|
||||
this.setState({
|
||||
customExpDialog: {
|
||||
...this.state.customExpDialog, visible: true, salaryAcctRecordId,
|
||||
checkItems, itemsByGroup
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showChildren, customExpDialog } = this.state;
|
||||
const btns = [
|
||||
<Dropdown.Button type="primary" style={{ marginRight: "10px" }}
|
||||
onClick={() => this.handleMenuClick({ key: "exportAll" })}
|
||||
overlay={<Menu onClick={(e) => this.handleMenuClick(e)}>
|
||||
<Menu.Item key="export_selected">{getLabel(543715, "导出所选")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
</Menu>}>{getLabel(81272, "导出全部")}</Dropdown.Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calc.onAdSearch(false)}
|
||||
/>
|
||||
];
|
||||
return (
|
||||
<Layout {...this.props} init={this.init}>
|
||||
<WeaTop title={getLabel(111, "薪资核算详情")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon={false} buttons={btns}
|
||||
>
|
||||
<div className="salary-calculate-view">
|
||||
{showChildren && <SalaryEditCalc {...this.props} calcDetail ref={dom => this.calc = dom}/>}
|
||||
{/* 薪资核算-自定义导出*/}
|
||||
<CustomCalcExportDialog
|
||||
{...customExpDialog}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
customExpDialog: { ...customExpDialog, visible: false }
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
.salary-calculate-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f1f1f1;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ class Calculate extends Component {
|
|||
queryParams: {
|
||||
name: "",
|
||||
dateRange: [
|
||||
moment(new Date()).startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
}, isRefresh: false,
|
||||
|
|
@ -123,7 +123,7 @@ class Calculate extends Component {
|
|||
break;
|
||||
case "3":
|
||||
//查看详情
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail/${id}?id=${id}`);
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcView/${id}`);
|
||||
break;
|
||||
case "4":
|
||||
//重新核算
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 批量更新-薪资项目的值
|
||||
* Description:
|
||||
* Date: 2023/12/6
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { Button, message } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { getSearchs, toDecimal_n } from "../../../../../util";
|
||||
import { salaryacctBatchUpdate } from "../../../../../apis/calculate";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
class BatchUpdateSalaryItemValDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visibe && !nextProps.visible) nextProps.calculateStore.initBatchUpdateForm();
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const {
|
||||
calculateStore: { batchUpdateForm }, salaryAcctRecordId, salaryItemId,
|
||||
idList, pattern, dataType
|
||||
} = this.props;
|
||||
batchUpdateForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { value } = batchUpdateForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
const payload = {
|
||||
salaryAcctRecordId, salaryItemId, idList,
|
||||
value: dataType === "number" ? toDecimal_n(value, pattern) : value
|
||||
};
|
||||
this.setState({ loading: false });
|
||||
salaryacctBatchUpdate(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { conditions, calculateStore: { batchUpdateForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} title={getLabel(111, "批量更新")} initLoadCss
|
||||
style={{ width: 480, height: 127 }}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="calc-update-dialog-layout">{getSearchs(batchUpdateForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default BatchUpdateSalaryItemValDialog;
|
||||
|
|
@ -143,3 +143,34 @@ export const editCalcSearchConditions = [
|
|||
title: "常用条件"
|
||||
}
|
||||
];
|
||||
export const batchUpdateConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["salaryItemName"],
|
||||
fieldcol: 14,
|
||||
label: "批量编辑项目",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["value"],
|
||||
fieldcol: 14,
|
||||
label: "批量编辑为",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,14 +5,17 @@
|
|||
* Date: 2023/9/14
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { acctResultList, updateLockStatus } from "../../../../../apis/calculate";
|
||||
import ProgressModal from "../../../../../components/progressModal";
|
||||
import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog";
|
||||
import EditSalaryCalcSlide from "./editSalaryCalcSlide";
|
||||
import { batchUpdateConditions } from "./condition";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
|
|
@ -22,7 +25,11 @@ class EditCalcTable extends Component {
|
|||
this.state = {
|
||||
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], progressVisible: false, progress: 0,
|
||||
salaryCalcSlide: { visible: false, id: "" }
|
||||
salaryCalcSlide: { visible: false, id: "" }, originPayloadData: {},
|
||||
batchUpdateDialog: {
|
||||
visible: false, salaryAcctRecordId: "", idList: [], salaryItemId: "",
|
||||
conditions: [], pattern: 0, dataType: ""
|
||||
}
|
||||
};
|
||||
this.timerLock = null;
|
||||
}
|
||||
|
|
@ -51,6 +58,10 @@ class EditCalcTable extends Component {
|
|||
break;
|
||||
case "LOCKING":
|
||||
const { salaryItemId, lockType: lockStatus } = params;
|
||||
if (lockStatus === "BATCHUPDATE") {
|
||||
this.batchUpdateSalaryItemVal(params);
|
||||
return;
|
||||
}
|
||||
this.updateLockStatus({ lockStatus, salaryItemId });
|
||||
break;
|
||||
case "EDIT":
|
||||
|
|
@ -120,6 +131,39 @@ class EditCalcTable extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
batchUpdateSalaryItemVal = (payload) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: <div>
|
||||
<div style={{ textAlign: "center" }}>{getLabel(111, "确认编辑所有人员(所选人员)薪资核算记录?")}</div>
|
||||
</div>,
|
||||
onOk: () => {
|
||||
const { salaryItemId, salaryItemName, dataType, pattern } = payload;
|
||||
const { routeParams: { salaryAcctRecordId }, calculateStore: { batchUpdateForm } } = this.props;
|
||||
const { selectedRowKeys: idList } = this.state;
|
||||
this.setState({
|
||||
batchUpdateDialog: {
|
||||
...this.state.batchUpdateDialog, visible: true, salaryAcctRecordId, salaryItemId,
|
||||
idList, pattern, dataType, conditions: _.map(batchUpdateConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "value") {
|
||||
const otherParams = dataType === "number" ? { precision: pattern } : {};
|
||||
return {
|
||||
...o, ...otherParams, label: getLabel(o.lanId, o.label),
|
||||
conditionType: dataType === "number" ? "INPUTNUMBER" : "INPUT"
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
})
|
||||
}))
|
||||
}
|
||||
}, () => {
|
||||
batchUpdateForm.initFormFields(this.state.batchUpdateDialog.conditions);
|
||||
batchUpdateForm.updateFields({ salaryItemName });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
|
|
@ -135,14 +179,19 @@ class EditCalcTable extends Component {
|
|||
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
|
||||
"批量锁定": getLabel(111, "批量锁定"), "查看拓扑图": getLabel(111, "查看拓扑图")
|
||||
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
|
||||
"查看拓扑图": getLabel(111, "查看拓扑图")
|
||||
};
|
||||
this.setState({ originPayloadData: { ...payload, i18n } });
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
queryCalcResultList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const {
|
||||
calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId },
|
||||
calcDetail = false
|
||||
} = this.props;
|
||||
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
|
||||
const payload = {
|
||||
salaryAcctRecordId, ...pageInfo, ...extra, otherConditions,
|
||||
|
|
@ -162,18 +211,22 @@ class EditCalcTable extends Component {
|
|||
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
|
||||
columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({
|
||||
calcDetail,
|
||||
columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({
|
||||
...it,
|
||||
fixed: idx < 2 ? "left" : false
|
||||
})) : traverse(columns)
|
||||
})) : traverse(columns, calcDetail)
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleBatchEditing = () => {
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { loading, progressVisible, progress, salaryCalcSlide } = this.state;
|
||||
const { loading, progressVisible, progress, salaryCalcSlide, batchUpdateDialog } = this.state;
|
||||
return (
|
||||
<div className="editCalcTable-layout">
|
||||
<Spin spinning={loading}>
|
||||
|
|
@ -183,6 +236,11 @@ class EditCalcTable extends Component {
|
|||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
<BatchUpdateSalaryItemValDialog {...batchUpdateDialog}
|
||||
onCancel={(isRefresh) => this.setState({
|
||||
batchUpdateDialog: { ...batchUpdateDialog, visible: false }
|
||||
}, () => isRefresh && this.queryCalcResultList())}
|
||||
/>
|
||||
<EditSalaryCalcSlide {...salaryCalcSlide}
|
||||
onClose={(isFresh) => this.setState({
|
||||
salaryCalcSlide: {
|
||||
|
|
@ -209,18 +267,19 @@ class EditCalcTable extends Component {
|
|||
|
||||
export default EditCalcTable;
|
||||
|
||||
const traverse = (arr) => {
|
||||
const traverse = (arr, calcDetail) => {
|
||||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", ellipsis: true,
|
||||
dataIndex: item.column, children: traverse(item.children),
|
||||
fixed: item.fixed || false
|
||||
dataIndex: item.column, children: traverse(item.children, calcDetail),
|
||||
fixed: item.fixed || false, dataType: item.dataType, align: "center"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", fixed: item.fixed || false,
|
||||
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus
|
||||
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, calcDetail,
|
||||
pattern: item.pattern, dataType: item.dataType, align: "center"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate";
|
||||
import { sysConfCodeRule } from "../../../../../apis/ruleconfig";
|
||||
import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel";
|
||||
|
|
@ -48,6 +49,9 @@ class Index extends Component {
|
|||
}
|
||||
};
|
||||
handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex });
|
||||
handleBatchEditing = (editable) => {
|
||||
this.calcTableRef.wrappedInstance.handleBatchEditing(editable);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state;
|
||||
|
|
@ -72,7 +76,10 @@ class Index extends Component {
|
|||
<span>{getLabel(18125, "公式")}=</span>
|
||||
<span>{formulaObj.formulaContent}</span>
|
||||
</div>
|
||||
<div></div>
|
||||
<div style={{ paddingRight: 8 }}>
|
||||
{/*<Button type="primary"*/}
|
||||
{/* onClick={() => this.handleBatchEditing(true)}>{getLabel(111, "批量保存")}</Button>*/}
|
||||
</div>
|
||||
</div>
|
||||
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<EditCalcAdvanceSearchPannel
|
||||
|
|
|
|||
|
|
@ -185,3 +185,25 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.calc-update-dialog-layout {
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-search-group {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.wea-content {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-cell-wrapper {
|
||||
background: #FFF;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-bottom: none;
|
||||
|
||||
.wea-form-cell {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,14 @@ class Layout extends Component {
|
|||
if (isOpenDevolution) {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } });
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => {
|
||||
this.state.store.hasRight && this.props.init && this.props.init();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } });
|
||||
this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => {
|
||||
this.props.init && this.props.init();
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ store: { ...this.state.store, loading: false } }));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ export default class PlaceOnFileDetail extends React.Component {
|
|||
};
|
||||
|
||||
return (
|
||||
<Layout {...this.props}>
|
||||
// <Layout {...this.props}>
|
||||
<div className="placeOnFileDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
|
|
@ -229,7 +229,7 @@ export default class PlaceOnFileDetail extends React.Component {
|
|||
closeMaskOnClick={() => this.setState({ slideVisiable: false })}/>
|
||||
}
|
||||
</div>
|
||||
</Layout>
|
||||
// </Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Calculate extends Component {
|
|||
queryParams: {
|
||||
taxAgentName: "",
|
||||
dateRange: [
|
||||
moment(new Date()).startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
}, isRefresh: false,
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class IncomeTaxDeclarationPersonnelSlide extends Component {
|
|||
});
|
||||
};
|
||||
getTaxdeclarationDetailInfo = (id) => {
|
||||
API.getTaxdeclarationDetailInfo({ id }).then(({ status, data }) => {
|
||||
API.getTaxdeclarationDetailInfo({ id }).then(({ status, data, errormsg }) => {
|
||||
if (status) {
|
||||
const { conditions } = this.state;
|
||||
const { declareStore: { taxDecForm } } = this.props;
|
||||
|
|
@ -118,6 +118,9 @@ class IncomeTaxDeclarationPersonnelSlide extends Component {
|
|||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
this.props.onClose();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -55,12 +55,20 @@ class TaxDeclarationInfo extends Component {
|
|||
];
|
||||
let dropMenuDatas = [];
|
||||
if (["DECLARE_SUCCESS_NO_PAY", "DECLARE_SUCCESS_UNPAID", "DECLARE_SUCCESS_PAID", "DECLARE_SUCCESS_PAYING"].includes(declareInfo.declareStatus)) {
|
||||
dropMenuDatas = dropMenuDatas.concat([{
|
||||
key: "exportGetDeclareTaxResultFeedback",
|
||||
icon: <i className="icon-coms-download2"/>,
|
||||
content: getLabel(111, "下载申报内置算税结果"),
|
||||
onClick: onOperate
|
||||
}]);
|
||||
dropMenuDatas = dropMenuDatas.concat([
|
||||
{
|
||||
key: "exportGetDeclareTaxResultFeedback",
|
||||
icon: <i className="icon-coms-download2"/>,
|
||||
content: getLabel(111, "下载申报内置算税结果"),
|
||||
onClick: onOperate
|
||||
},
|
||||
{
|
||||
key: "onlineComparison",
|
||||
icon: <i className="icon-coms-Journal-o"/>,
|
||||
content: getLabel(111, "在线对比"),
|
||||
onClick: onOperate
|
||||
}
|
||||
]);
|
||||
}
|
||||
return (
|
||||
<div className="taxDeclarationInfo_layout">
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalar
|
|||
import PaymentBtn from "./components/paymentBtn";
|
||||
import PaymentFeedbackBtn from "./components/paymentFeedbackBtn";
|
||||
import {
|
||||
deleteInfo,
|
||||
deleteTaxDeclaration,
|
||||
exportGetDeclareTaxResultFeedback,
|
||||
getDeclareInfo,
|
||||
|
|
@ -124,7 +125,20 @@ class Index extends Component {
|
|||
title: getLabel(501169, "编辑")
|
||||
});
|
||||
} else if (id === "DELETE") {
|
||||
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(543548, "确认删除吗?"),
|
||||
onOk: () => {
|
||||
deleteInfo({ id: params.id }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(502230, "删除成功!"));
|
||||
this.getDetailList();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(20462, "删除失败!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -291,6 +305,10 @@ class Index extends Component {
|
|||
message.error(getLabel(111, "下载失败!"));
|
||||
});
|
||||
};
|
||||
onlineComparison = () => {
|
||||
const [__, taxDeclarationId] = this.state.selectedKey.split("%%");
|
||||
window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_target");
|
||||
};
|
||||
handleTabEdit = (tabKey, type) => {
|
||||
if (type === "remove") {
|
||||
const [__, taxDeclarationId] = tabKey.split("%%");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 在线申报-在线对比
|
||||
* Description:
|
||||
* Date: 2024/1/22
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { getTaxdeclarationContrastList } from "../../apis/declare";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
queryParams: { onlyShowDiffEmp: true, onlyShowDiffItem: true }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getTaxdeclarationContrastList();
|
||||
}
|
||||
|
||||
getTaxdeclarationContrastList = () => {
|
||||
const { pageInfo, queryParams } = this.state;
|
||||
const { params: { taxDeclarationId } } = this.props;
|
||||
this.setState({ loading: true });
|
||||
getTaxdeclarationContrastList({ taxDeclarationId, ...pageInfo, ...queryParams })
|
||||
.then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, pageInfo: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: _.map(columns, o => ({
|
||||
dataIndex: o, title: o, width: 150,
|
||||
render: (__, record) => {
|
||||
return <div className="comparison-column-item-container">
|
||||
<div className="comparison-single-row">
|
||||
<span>{getLabel(543280, "系统值")}:</span>
|
||||
<span>{record[o].local}</span>
|
||||
</div>
|
||||
<div className="comparison-single-row">
|
||||
<span>{getLabel(111, "线上值")}:</span>
|
||||
<span>{record[o].online}</span>
|
||||
</div>
|
||||
{
|
||||
!_.isNil(record[o].diff) &&
|
||||
<div className="comparison-single-row danger">
|
||||
<span>{getLabel(543282, "差值")}:</span>
|
||||
<span>{record[o].diff}</span>
|
||||
</div>
|
||||
}
|
||||
</div>;
|
||||
}
|
||||
}))
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleDiffChange = (key, value) => {
|
||||
const { queryParams } = this.state;
|
||||
this.setState({
|
||||
queryParams: { ...queryParams, [key]: value === "1" }
|
||||
}, () => this.getTaxdeclarationContrastList());
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, columns, dataSource, pageInfo, queryParams } = this.state;
|
||||
const { onlyShowDiffEmp, onlyShowDiffItem } = queryParams;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getTaxdeclarationContrastList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.getTaxdeclarationContrastList());
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaTop title={getLabel(111, "在线对比")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttonSpace={10} showDropIcon={false}
|
||||
buttons={[
|
||||
<WeaCheckbox content={getLabel(543283, "只显示有差异的人员")} value={onlyShowDiffEmp ? 1 : 0}
|
||||
onChange={v => this.handleDiffChange("onlyShowDiffEmp", v)}
|
||||
/>,
|
||||
<WeaCheckbox content={getLabel(543284, "只显示有差异的薪资项目")} value={onlyShowDiffItem ? 1 : 0}
|
||||
onChange={v => this.handleDiffChange("onlyShowDiffItem", v)}
|
||||
/>
|
||||
]}
|
||||
>
|
||||
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination} bordered
|
||||
loading={loading} columns={columns} scroll={{ x: 1200, y: `calc(100vh - 170px)` }}
|
||||
className="online-comparison-table"
|
||||
/>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
.online-comparison-table {
|
||||
.comparison-column-item-container {
|
||||
.comparison-single-row {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.danger {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,7 @@ class FieldSlide extends Component {
|
|||
roundingMode: "1",
|
||||
pattern: "2",
|
||||
sortedIndex: "",
|
||||
width: "",
|
||||
description: ""
|
||||
};
|
||||
}
|
||||
|
|
@ -72,6 +73,7 @@ class FieldSlide extends Component {
|
|||
dataType,
|
||||
description,
|
||||
sortedIndex,
|
||||
width,
|
||||
sharedType,
|
||||
roundingMode,
|
||||
taxAgentIds,
|
||||
|
|
@ -86,6 +88,7 @@ class FieldSlide extends Component {
|
|||
dataType,
|
||||
description,
|
||||
sortedIndex,
|
||||
width,
|
||||
sharedType: sharedType ? sharedType.toString() : "0",
|
||||
roundingMode: roundingMode ? roundingMode.toString() : "0",
|
||||
taxAgentIds,
|
||||
|
|
@ -140,6 +143,7 @@ class FieldSlide extends Component {
|
|||
dataType,
|
||||
description,
|
||||
sortedIndex,
|
||||
width,
|
||||
sharedType,
|
||||
roundingMode,
|
||||
taxAgentIds,
|
||||
|
|
@ -153,6 +157,7 @@ class FieldSlide extends Component {
|
|||
dataType,
|
||||
description,
|
||||
sortedIndex,
|
||||
width,
|
||||
sharedType,
|
||||
roundingMode: Number(roundingMode),
|
||||
taxAgentIds,
|
||||
|
|
@ -192,6 +197,7 @@ class FieldSlide extends Component {
|
|||
roundingMode: "1",
|
||||
pattern: "2",
|
||||
sortedIndex: "",
|
||||
width: "",
|
||||
description: ""
|
||||
});
|
||||
};
|
||||
|
|
@ -217,6 +223,7 @@ class FieldSlide extends Component {
|
|||
roundingMode,
|
||||
pattern,
|
||||
sortedIndex,
|
||||
width,
|
||||
description
|
||||
} = this.state;
|
||||
return (
|
||||
|
|
@ -329,6 +336,11 @@ class FieldSlide extends Component {
|
|||
<WeaInputNumber value={sortedIndex} precision={0}
|
||||
onChange={value => this.handleChangeFields("sortedIndex", value)}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="显示宽度" labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
|
||||
<WeaInputNumber value={width} precision={0} min={0}
|
||||
onChange={value => this.handleChangeFields("width", value)}/>
|
||||
<span style={{ paddingLeft: 10, position: "absolute", marginTop: 4 }}>px</span>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="备注" labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
|
||||
<WeaTextarea
|
||||
value={description}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:历史工资单
|
||||
* Description:
|
||||
* Date: 2024/1/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide";
|
||||
import Payroll from "../mySalaryBenefits/components/payrollTable";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dateRange: [
|
||||
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { dateRange } = this.state;
|
||||
const employeeId = WeaTools.getUrlParams().hrmResourceID;
|
||||
return (
|
||||
<div className="history-payroll-box">
|
||||
<div className="topQuery">
|
||||
<span className="title">{getLabel(542604, "薪资所属月")}</span>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.setState({ dateRange: v })}/>
|
||||
</div>
|
||||
<Payroll salaryYearMonth={dateRange} type="mySalaryBillList4Card" employeeId={employeeId}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
.history-payroll-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 16px;
|
||||
|
||||
.topQuery {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 16px;
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import { WeaDialog, WeaError, WeaInput, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import Authority from "../mySalary/authority";
|
||||
import ComputerTemplate from "../payroll/templatePreview/computerTemplate";
|
||||
import PhoneTemplate from "../payroll/templatePreview/phoneTemplate";
|
||||
import "../payroll/templatePreview/index.less";
|
||||
import * as API from "../../apis/mySalaryBenefits";
|
||||
import { salaryBillGetToken } from "../../apis/mySalaryBenefits";
|
||||
|
|
@ -13,7 +12,9 @@ import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../a
|
|||
import CaptchaModal from "../../components/captchaModal";
|
||||
import PassSetDialog from "./passSetDialog";
|
||||
import { ConfirmBtns } from "../mySalary/mySalaryView";
|
||||
import "./index.less";
|
||||
import Content from "../../components/pcTemplate/content";
|
||||
import MobileTemplate from "../../components/mobileTemplate";
|
||||
import "../mySalary/index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -158,9 +159,9 @@ export default class MobilePayroll extends React.Component {
|
|||
if (status) {
|
||||
const { mySalaryBillData } = this.state;
|
||||
const { salaryTemplate } = mySalaryBillData;
|
||||
const { feedbackUrl } = salaryTemplate;
|
||||
const { feedbackUrl, mobileFeedbackUrl } = salaryTemplate;
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
window.location.href = `${window.ecologyContentPath || ""}${feedbackUrl}`;
|
||||
window.location.href = `${window.ecologyContentPath || ""}${getQueryString("type") === "phone" ? mobileFeedbackUrl : feedbackUrl}`;
|
||||
// window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`);
|
||||
} else {
|
||||
message.error(errorMsg);
|
||||
|
|
@ -174,76 +175,64 @@ export default class MobilePayroll extends React.Component {
|
|||
const { mySalaryStore: { clearLoading, pwdForm } } = this.props;
|
||||
const { mySalaryBillData, visible, captchaVisible, notSetting, pwdSetVisible } = this.state;
|
||||
const type = getQueryString("type");
|
||||
const employeeInformation = mySalaryBillData.employeeInformation ? mySalaryBillData.employeeInformation : {};
|
||||
const salaryGroups = mySalaryBillData.salaryGroups ? mySalaryBillData.salaryGroups : [];
|
||||
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <div>
|
||||
<WeaDialog
|
||||
onCancel={() => this.setState({ visible: false }, () => clearLoading())}
|
||||
title="请输入二次验证密码" visible={visible} initLoadCss
|
||||
className="verifyWrapper"
|
||||
hasScroll buttons={[
|
||||
<Button type="primary" size="small" onClick={this.doSecondAuth}>确定</Button>
|
||||
]}
|
||||
>
|
||||
<WeaError tipPosition="bottom" ref="weaError" error="此项必填">
|
||||
<WeaInput value={this.state.authCode} type="password" viewAttr={3}
|
||||
onChange={authCode => this.setState({ authCode })}/>
|
||||
</WeaError>
|
||||
{
|
||||
notSetting &&
|
||||
<div style={{ clear: "both", paddingTop: 10 }}>
|
||||
{getLabel("514970", "您还未设置二次验证密码,点击")}
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}</a>
|
||||
</div>
|
||||
}
|
||||
</WeaDialog>
|
||||
<PassSetDialog form={pwdForm} visible={pwdSetVisible} onCancel={() => this.setState({ pwdSetVisible: false })}/>
|
||||
</div>;
|
||||
const {
|
||||
salaryTemplate, salaryGroups, employeeInformation,
|
||||
sendTime, confirmStatus, showAck, showFeedback
|
||||
} = toJS(this.props.mySalaryStore.mySalaryBill);
|
||||
const salaryProps = {
|
||||
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
|
||||
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
|
||||
itemTypeList: [employeeInformation, ...salaryGroups]
|
||||
};
|
||||
return (
|
||||
<div className="computerTemplate" style={{
|
||||
height: "100%",
|
||||
overflowY: "hidden",
|
||||
paddingBottom: "20px"
|
||||
}}>
|
||||
<WeaDialog
|
||||
onCancel={() => this.setState({ visible: false }, () => clearLoading())}
|
||||
title="请输入二次验证密码" visible={visible} initLoadCss
|
||||
className="verifyWrapper"
|
||||
hasScroll buttons={[
|
||||
<Button type="primary" size="small" onClick={this.doSecondAuth}>确定</Button>
|
||||
]}
|
||||
>
|
||||
<WeaError tipPosition="bottom" ref="weaError" error="此项必填">
|
||||
<WeaInput value={this.state.authCode} type="password" viewAttr={3}
|
||||
onChange={authCode => this.setState({ authCode })}/>
|
||||
</WeaError>
|
||||
{
|
||||
notSetting &&
|
||||
<div style={{ clear: "both", paddingTop: 10 }}>
|
||||
{getLabel("514970", "您还未设置二次验证密码,点击")}
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}</a>
|
||||
</div>
|
||||
}
|
||||
</WeaDialog>
|
||||
<PassSetDialog form={pwdForm} visible={pwdSetVisible} onCancel={() => this.setState({ pwdSetVisible: false })}/>
|
||||
<React.Fragment>
|
||||
{
|
||||
type === "phone" ?
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={this.props.mySalaryStore}>
|
||||
<div className="templatePreview">
|
||||
<div className="contentWrapper">
|
||||
<PhoneTemplate
|
||||
isPreview
|
||||
salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)}
|
||||
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []}
|
||||
>
|
||||
{
|
||||
(!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) &&
|
||||
<ConfirmBtns
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
}
|
||||
</PhoneTemplate>
|
||||
</div>
|
||||
</div>
|
||||
<MobileTemplate {...salaryProps} title={getLabel(111, "工资单查看")}>
|
||||
<ConfirmBtns
|
||||
showAck={showAck} showFeedback={showFeedback}
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
</MobileTemplate>
|
||||
</Authority>
|
||||
:
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={this.props.mySalaryStore}>
|
||||
<div className="templatePreview">
|
||||
<div className="contentWrapper">
|
||||
<ComputerTemplate
|
||||
salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)}
|
||||
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : JSON.stringify([])}
|
||||
>
|
||||
{
|
||||
(!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) &&
|
||||
<ConfirmBtns
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
}
|
||||
</ComputerTemplate>
|
||||
</div>
|
||||
<div className="weapp-salary-my-salary-view-payroll">
|
||||
<Content {...salaryProps}>
|
||||
<ConfirmBtns
|
||||
showAck={showAck} showFeedback={showFeedback}
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
</Content>
|
||||
</div>
|
||||
</Authority>
|
||||
}
|
||||
|
|
@ -252,7 +241,7 @@ export default class MobilePayroll extends React.Component {
|
|||
onCancel={() => this.setState({ captchaVisible: false })}
|
||||
onConfirm={() => this.props.mySalaryStore.setInitEmVerify()}
|
||||
/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class PassSetDialog extends Component {
|
|||
return;
|
||||
}
|
||||
if (secondaryPwd1 !== secondaryPwd2) {
|
||||
message.error(getLabel("504376", "密码确认不正确!"));
|
||||
message.error(getLabel(504376, "密码确认不正确!"));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -20,3 +20,35 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.weapp-salary-my-salary-view-payroll {
|
||||
padding: 32px 0;
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
background: #f6f6f6;
|
||||
|
||||
.salary-preview-container {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
border: 1px solid rgba(229,229,229,1);
|
||||
padding-top: 32px;
|
||||
background: #F3F9FF;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.space {
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.ant-btn {
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ import { inject, observer } from "mobx-react";
|
|||
import { Button, message, Modal } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import Authority from "./authority";
|
||||
import ComputerTemplate from "../payroll/templatePreview/computerTemplate";
|
||||
import Content from "../../components/pcTemplate/content";
|
||||
import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll";
|
||||
import CaptchaModal from "../../components/captchaModal";
|
||||
import "../payroll/templatePreview/index.less";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ class MySalaryView extends Component {
|
|||
handleGoFeedback = () => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"),
|
||||
content: getLabel(544271, "请确认薪资信息是有误,进行反馈并发起反馈流程。"),
|
||||
onOk: () => {
|
||||
const { params: { salaryInfoId }, mySalaryStore: { getMySalaryBill } } = this.props;
|
||||
feedBackSalaryBill({ salaryInfoId }).then(({ status, errorMsg }) => {
|
||||
|
|
@ -84,29 +84,24 @@ class MySalaryView extends Component {
|
|||
if (_.isEmpty(mySalaryStore)) {
|
||||
return <div></div>;
|
||||
}
|
||||
const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation;
|
||||
const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups;
|
||||
const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate;
|
||||
const { salaryTemplate, salaryGroups, employeeInformation, sendTime } = mySalaryStore;
|
||||
const salaryProps = {
|
||||
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
|
||||
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
|
||||
itemTypeList: [employeeInformation, ...salaryGroups]
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={this.props.mySalaryStore}>
|
||||
<div style={{ height: "100%", overflow: "auto" }}>
|
||||
<div className="templatePreview">
|
||||
<ComputerTemplate
|
||||
isMsgPreview
|
||||
salaryTemplateShowSet={salaryTemplateShowSet ? JSON.stringify(salaryTemplateShowSet) : []}
|
||||
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []}
|
||||
>
|
||||
{
|
||||
(!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) &&
|
||||
<ConfirmBtns
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
}
|
||||
</ComputerTemplate>
|
||||
</div>
|
||||
<div className="weapp-salary-my-salary-view-payroll">
|
||||
<Content {...salaryProps}>
|
||||
<ConfirmBtns
|
||||
showAck={mySalaryStore.showAck} showFeedback={mySalaryStore.showFeedback}
|
||||
confirmSalaryBill={this.confirmSalaryBill}
|
||||
goFeedback={this.handleGoFeedback}
|
||||
/>
|
||||
</Content>
|
||||
</div>
|
||||
</Authority>
|
||||
<CaptchaModal
|
||||
|
|
@ -123,7 +118,13 @@ export default MySalaryView;
|
|||
|
||||
export const ConfirmBtns = (props) => {
|
||||
return <div className="space">
|
||||
<Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button>
|
||||
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
|
||||
{
|
||||
props.showAck === "1" &&
|
||||
<Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button>
|
||||
}
|
||||
{
|
||||
props.showFeedback === "1" &&
|
||||
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
|
||||
}
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,9 +8,12 @@ import React, { Component } from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import Authority from "../../../mySalary/authority";
|
||||
import { recordList } from "../../../../apis/mySalaryBenefits";
|
||||
import { mySalaryRecordList4Card, recordList } from "../../../../apis/mySalaryBenefits";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const API = {
|
||||
recordList, mySalaryRecordList4Card
|
||||
};
|
||||
|
||||
@inject("mySalaryStore")
|
||||
@observer
|
||||
|
|
@ -24,14 +27,18 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { mySalaryStore: { initRecordData } } = this.props;
|
||||
initRecordData(this.getRecordList);
|
||||
const { mySalaryStore: { initRecordData, getRecordData }, type } = this.props;
|
||||
!type ? initRecordData(this.getRecordList) : getRecordData({
|
||||
status: "1", token: "",
|
||||
callback: () => this.getRecordList()
|
||||
});
|
||||
}
|
||||
|
||||
getRecordList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const { employeeId, type = "recordList" } = this.props;
|
||||
this.setState({ loading: true });
|
||||
recordList({ ...pageInfo }).then(({ status, data }) => {
|
||||
API[type]({ ...pageInfo, employeeId }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
|
|
|
|||
|
|
@ -6,17 +6,20 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { mySalaryBillList } from "../../../../apis/mySalaryBenefits";
|
||||
import { mySalaryBillList, mySalaryBillList4Card } from "../../../../apis/mySalaryBenefits";
|
||||
import moment from "moment";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const API = {
|
||||
mySalaryBillList, mySalaryBillList4Card
|
||||
};
|
||||
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
juniorMapList: [], dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false, employeeId: ""
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -30,9 +33,9 @@ class Index extends Component {
|
|||
|
||||
getMySalaryBillList = (props) => {
|
||||
this.setState({ loading: true });
|
||||
const { pageInfo, employeeId } = this.state;
|
||||
const { salaryYearMonth } = props;
|
||||
mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props;
|
||||
API[type]({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data;
|
||||
|
|
@ -55,7 +58,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { juniorMapList, dataSource, loading, columns, pageInfo } = this.state;
|
||||
const { dataSource, loading, columns, pageInfo } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "1",
|
||||
salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().endOf("year").format("YYYY-MM")]
|
||||
salaryYearMonth: [
|
||||
moment().subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment().endOf("year").format("YYYY-MM")
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@ class Index extends Component {
|
|||
<span>{getLabel(111, "发放时间")}</span>
|
||||
<span>{moment(it.sendTime).format("YYYY-MM")}</span>
|
||||
</div>
|
||||
<a href="javascript:void(0);">{`${getLabel(33564, "查看")}>`}</a>
|
||||
<a href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&type=phone`}
|
||||
target="_blank">
|
||||
{`${getLabel(33564, "查看")}>`}
|
||||
</a>
|
||||
</li>;
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")],
|
||||
salaryYearMonth: [
|
||||
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment().endOf("year").format("YYYY-MM")],
|
||||
isMore: true //是否还有更多数据
|
||||
};
|
||||
}
|
||||
|
|
@ -39,7 +41,7 @@ class Index extends Component {
|
|||
mySalaryMobile.removeEventListener("scroll", this.handleScroll, true);
|
||||
}
|
||||
|
||||
getMySalaryBillList = () => {
|
||||
getMySalaryBillList = (type) => {
|
||||
const { salaryYearMonth, pageInfo } = this.state;
|
||||
this.setState({ loading: true });
|
||||
mySalaryBillList({ salaryYearMonth, ...pageInfo }).then(({ status, data }) => {
|
||||
|
|
@ -48,14 +50,13 @@ class Index extends Component {
|
|||
const { datas: dataSource, pageInfo: pageResult } = data;
|
||||
const { pageNum: current, pageSize, total } = pageResult;
|
||||
this.setState({
|
||||
dataSource: [...this.state.dataSource, ...dataSource],
|
||||
dataSource: type ? dataSource : [...this.state.dataSource, ...dataSource],
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
}, () => this.setState({ isMore: this.state.dataSource.length < total }));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleLoadMore = () => {
|
||||
// 为测试效果临时使用 message
|
||||
const { pageInfo, isMore } = this.state;
|
||||
if (!isMore) return;
|
||||
const { current } = pageInfo;
|
||||
|
|
@ -71,8 +72,9 @@ class Index extends Component {
|
|||
const { salaryYearMonth } = this.state;
|
||||
const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth;
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 },
|
||||
salaryYearMonth: type === "salaryStartYearMonth" ? [val, salaryEndYearMonth] : [salaryStartYearMonth, val]
|
||||
}, () => this.getMySalaryBillList());
|
||||
}, () => this.getMySalaryBillList(true));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ export default class BaseInformForm extends React.Component {
|
|||
ackFeedbackStatus, autoAckDays, feedbackUrl, autoSendStatus, autoSendDayOfMonth, autoSendTimeOfDay,
|
||||
autoSendCycleType
|
||||
} = request;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<WeaSearchGroup title="基础信息" items={[]} needTigger showGroup col={1} className="payrollBaseInfoWrapper">
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ class SalaryItemSettings extends Component {
|
|||
salarySobId: this.props.salarySobId,
|
||||
existSalaryItemIds: _.map(record.items, it => it.id),
|
||||
groupId: record.groupId,
|
||||
groupName: record.groupName,
|
||||
isReplenish: this.props.isReplenish
|
||||
};
|
||||
getAvailableSalaryItemSet(payload).then(({ status, data }) => {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ class TemplateBaseSettings extends Component {
|
|||
},
|
||||
ackFeedbackSetting: {
|
||||
ackStatus: "0",
|
||||
feedbackStatus: "0",
|
||||
autoAckDays: 7,
|
||||
feedBackUrl: ""
|
||||
feedBackUrl: "",
|
||||
mobileFeedbackUrl: ""
|
||||
},
|
||||
salaryBillViewingLimitSetting: {
|
||||
limitMonth: 0
|
||||
|
|
@ -68,8 +70,8 @@ class TemplateBaseSettings extends Component {
|
|||
};
|
||||
salaryBillBaseSetSave = () => {
|
||||
const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
|
||||
const { feedBackUrl } = ackFeedbackSetting;
|
||||
if (!feedBackUrl) {
|
||||
const { feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
|
||||
if (!feedBackUrl || !mobileFeedbackUrl) {
|
||||
Modal.warning({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "必要信息不完整,红色*为必填项!")
|
||||
|
|
@ -96,7 +98,7 @@ class TemplateBaseSettings extends Component {
|
|||
|
||||
render() {
|
||||
const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state;
|
||||
const { ackStatus, autoAckDays, feedBackUrl } = ackFeedbackSetting;
|
||||
const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting;
|
||||
const { limitMonth = 0 } = salaryBillViewingLimitSetting;
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
|
@ -155,10 +157,23 @@ class TemplateBaseSettings extends Component {
|
|||
})}/>
|
||||
<WeaHelpfulTip
|
||||
title={getLabel(111, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")}
|
||||
style={{ marginLeft: 10 }}
|
||||
style={{ marginLeft: 5 }}
|
||||
placement="top" width={200}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
</React.Fragment>
|
||||
}
|
||||
<WeaFormItem label={getLabel(111, "启用工资单反馈")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
<WeaCheckbox value={feedbackStatus} display="switch"
|
||||
onChange={feedbackStatus => this.setState({
|
||||
ackFeedbackSetting: {
|
||||
...ackFeedbackSetting, feedbackStatus
|
||||
}
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
{
|
||||
feedbackStatus === "1" &&
|
||||
<React.Fragment>
|
||||
<WeaFormItem label={getLabel(111, "PC端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
<WeaInput
|
||||
value={feedBackUrl} viewAttr={3}
|
||||
onChange={feedBackUrl => this.setState({
|
||||
|
|
@ -167,6 +182,15 @@ class TemplateBaseSettings extends Component {
|
|||
}
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "移动端反馈流程地址")} labelCol={{ span: 2 }} wrapperCol={{ span: 4 }}>
|
||||
<WeaInput
|
||||
value={mobileFeedbackUrl} viewAttr={3}
|
||||
onChange={mobileFeedbackUrl => this.setState({
|
||||
ackFeedbackSetting: {
|
||||
...ackFeedbackSetting, mobileFeedbackUrl
|
||||
}
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
</React.Fragment>
|
||||
}
|
||||
</WeaSearchGroup>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:薪资档案页面重构-高级搜索
|
||||
* Description:
|
||||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
return (
|
||||
<div className="achrive-advance-search">
|
||||
<WeaInputSearch value={salaryFileQueryForm.getFormParams().username}
|
||||
onChange={v => salaryFileQueryForm.updateFields({ username: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(545754, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.achrive-advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: -1.5px;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 2px;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
top: 1px;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-高级查询
|
||||
* Description:
|
||||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import * as API from "../../../../apis/payrollFiles";
|
||||
import { salaryFileSearchConditions } from "../../config";
|
||||
import { getTaxAgentSelectList } from "../../../../apis/taxAgent";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class salaryFileAdvanceSearchPannel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
searchConditions: []
|
||||
};
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([
|
||||
API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }),
|
||||
getTaxAgentSelectList()
|
||||
]);
|
||||
this.setState({
|
||||
searchConditions: _.map(salaryFileSearchConditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, child => {
|
||||
if (getKey(child) === "statuses") {
|
||||
return {
|
||||
...child,
|
||||
options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel }))
|
||||
};
|
||||
} else if (getKey(child) === "taxAgentId") {
|
||||
return {
|
||||
...child,
|
||||
options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content }))
|
||||
};
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
salaryFileQueryForm.initFormFields(this.state.searchConditions);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { searchConditions } = this.state;
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(salaryFileQueryForm, searchConditions, 2, false)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={() => salaryFileQueryForm.resetForm()}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default salaryFileAdvanceSearchPannel;
|
||||
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-导入弹窗
|
||||
* Description:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
|
||||
import ImportDialog from "../../../.././components/importDialog";
|
||||
import { convertToUrlString, getURLParameters } from "../../../../util/url";
|
||||
import { importSalaryArchive } from "../../../../apis/payrollFiles";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/salaryArchive/preview",
|
||||
extraPreview: {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { payrollFilesStore: { salaryFileQueryForm }, importType, isExtEmp } = nextProps;
|
||||
let payload = {}, extraPreview = {};
|
||||
if (importType !== "init" && importType !== "salaryItemAdjust") {
|
||||
extraPreview = {
|
||||
importType: "", listType: importType
|
||||
};
|
||||
payload = {
|
||||
importType: "", listType: importType, hasData: false,
|
||||
...salaryFileQueryForm.getFormParams()
|
||||
};
|
||||
} else {
|
||||
extraPreview = {
|
||||
importType: importType, listType: "FIXED"
|
||||
};
|
||||
payload = {
|
||||
importType: importType, listType: "FIXED", hasData: false,
|
||||
...salaryFileQueryForm.getFormParams()
|
||||
};
|
||||
}
|
||||
if (isExtEmp) payload = { ...payload, extSalaryArchiveList: true };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...this.state.importDialog, extraPreview,
|
||||
link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/salaryArchive/preview",
|
||||
extraPreview: {}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleImport = (payload) => {
|
||||
const { importDialog } = this.state, { isExtEmp } = this.props;
|
||||
const { extraPreview } = importDialog;
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: true } });
|
||||
importSalaryArchive({ ...payload, ...extraPreview, isExtEmp }).then(({ data, status }) => {
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: false } });
|
||||
if (status) {
|
||||
this.setState({
|
||||
importDialog: { ...importDialog, ...payload, importResult: data }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { importDialog } = this.state;
|
||||
const { link } = importDialog;
|
||||
return (
|
||||
<ImportDialog
|
||||
{...this.props} {...importDialog}
|
||||
onResetImportResult={() => this.setState({
|
||||
importDialog: {
|
||||
...importDialog, importResult: {}, imageId: "", link: ""
|
||||
}
|
||||
})}
|
||||
exportDataDom={
|
||||
<WeaCheckbox
|
||||
value={getURLParameters(link)["hasData"] === "true" ? "1" : "0"}
|
||||
content={getLabel(543208, "导出现有数据")}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => {
|
||||
let payload = { ...getURLParameters(link), hasData: val === "1" };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog,
|
||||
link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-列表
|
||||
* Description:
|
||||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import SalaryFilesEditSlide from "../salaryFilesEditSlide";
|
||||
import { toJS } from "mobx";
|
||||
import { message, Spin } from "antd";
|
||||
import * as API from "../../../../apis/payrollFiles";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const URLLIST = {
|
||||
pending: "/api/bs/hrmsalary/salaryArchive/pendingList",
|
||||
fixed: "/api/bs/hrmsalary/salaryArchive/fixedList",
|
||||
suspend: "/api/bs/hrmsalary/salaryArchive/suspendList",
|
||||
stop: "/api/bs/hrmsalary/salaryArchive/stopList",
|
||||
ext: "/api/bs/hrmsalary/salaryArchive/extList"
|
||||
};
|
||||
const APILIST = {
|
||||
addToSalarypayment: API.gotoFixed, //设为发薪员工
|
||||
delPenditngToDo: API.deletePendingTodo, //待定薪删除待办
|
||||
delSalaryFiles: API.deleteSalaryArchive, //删除薪资档案
|
||||
salarySuspension: API.gotoStop, //停薪
|
||||
delSuspendToDo: API.deleteSuspendTodo, //待停薪删除待办
|
||||
cancelSalarySuspension: API.cancelStop //取消停薪
|
||||
};
|
||||
|
||||
@inject("payrollFilesStore", "taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
salaryFilesEditSlide: { visible: false, salaryArchiveId: "" }
|
||||
};
|
||||
this.SFSlideRef = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSalaryFileList(this.props);
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
handleResize = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) {
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
|
||||
}, () => this.getSalaryFileList(nextProps));
|
||||
}
|
||||
if ((nextProps.selectedKey !== this.props.selectedKey)) {
|
||||
this.setState({
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
salaryFilesEditSlide: { ...this.state.salaryFilesEditSlide, visible: false }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
window.removeEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getColumns();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, ...params }
|
||||
}, () => this.getSalaryFileList(this.props));
|
||||
break;
|
||||
case "ROWSELECTION":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "ADD-TO-SALARYPAYMENT":
|
||||
case "DEL-PENDITNG-TO-DO":
|
||||
case "DEL-SALARY-FILES":
|
||||
case "SALARY-SUSPENSION":
|
||||
case "DEL-SUSPEND-TO-DO":
|
||||
case "CANCEL-SALARY-SUSPENSION":
|
||||
const { interfaceParams } = params;
|
||||
this.handleSalaryOpts(_.camelCase(id), interfaceParams);
|
||||
break;
|
||||
case "CHANGE-SALARY":
|
||||
case "VIEW":
|
||||
case "EDIT":
|
||||
const { taxAgentStore: { showOperateBtn }, selectedKey: runStatuses } = this.props;
|
||||
const { record: { id: salaryArchiveId } } = params;
|
||||
this.setState({
|
||||
salaryFilesEditSlide: {
|
||||
...this.state.salaryFilesEditSlide, visible: true, salaryArchiveId,
|
||||
runStatuses, showOperateBtn
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
handleSalaryOpts = (type, payload) => {
|
||||
WeaLoadingGlobal.start();
|
||||
APILIST[type](payload).then(({ status, data = {}, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg, type } = data;
|
||||
if (type === "fail" || type === "info") {
|
||||
message.error(msg);
|
||||
} else if (type === "success") {
|
||||
message.success(msg);
|
||||
this.getSalaryFileList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
} else {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.getSalaryFileList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "调薪": getLabel(542686, "调薪"),
|
||||
"增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"),
|
||||
"删除待办": getLabel(543181, "删除待办"), "查看": getLabel(33564, "查看"),
|
||||
"取消停薪": getLabel(543309, "取消停薪"), "共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条"), "设为发薪人员": getLabel(543308, "设为发薪人员"),
|
||||
"停薪": getLabel(542692, "停薪"), "编辑": getLabel(501169, "编辑")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryFileList = (props) => {
|
||||
const { pageInfo } = this.state;
|
||||
const {
|
||||
payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount
|
||||
} = props;
|
||||
this.setState({ loading: true });
|
||||
queryList(pageInfo, salaryFileQueryForm.getFormParams(), URLLIST[selectedKey]).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: result } = data;
|
||||
const { list: dataSource, total, pageNum: current, pageSize } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
|
||||
}, () => {
|
||||
onChangeTopTabCount(selectedKey, total);
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
getColumns = () => {
|
||||
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({
|
||||
dataIndex: it.dataIndex, title: it.title, align: "left",
|
||||
width: (it.dataIndex === "taxAgentName" || it.dataIndex === "operate") ? 185 : 150,
|
||||
fixed: it.dataIndex === "username" ? "left" : it.dataIndex === "operate" ? "right" : it.fixed ? it.fixed : false,
|
||||
ellipsis: true
|
||||
}));
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
columns, showOperateBtn, selectedKey: this.props.selectedKey,
|
||||
showDelSalaryFileBtn: this.props.showDelSalaryFileBtn,
|
||||
dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys,
|
||||
showSum: false, pageInfo: this.state.pageInfo
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource, salaryFilesEditSlide } = this.state;
|
||||
const { payrollFilesStore: { tableStore } } = this.props;
|
||||
const dom = document.querySelector(".wea-new-top-req-content");
|
||||
let height = 280;
|
||||
if (dom && dataSource.length > 0) {
|
||||
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 16;
|
||||
}
|
||||
return (
|
||||
<div className="table-layout" style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/salaryFileTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryFileTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
{/* 编辑查看员工薪资档案*/}
|
||||
<SalaryFilesEditSlide {...salaryFilesEditSlide} ref={dom => this.SFSlideRef = dom}
|
||||
onClose={(isFresh) => this.setState({
|
||||
salaryFilesEditSlide: { ...salaryFilesEditSlide, visible: isFresh }
|
||||
}, () => isFresh && this.getSalaryFileList(this.props))}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import React from "react";
|
||||
import { WeaFormItem, WeaHelpfulTip, WeaSearchGroup } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
|
||||
export const renderSalaryFilesForm = (form, condition, setHasBeenModify) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && condition && condition.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={() => setHasBeenModify(true)}/>
|
||||
</WeaFormItem>),
|
||||
colSpan: 1,
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
!_.isEmpty(items) && group.push(
|
||||
<WeaSearchGroup col={c.col} needTigger={true} showGroup={c.defaultshow} items={items} center={false}
|
||||
className={c.col === 3 ? "basic-salary-file-wrapper" : (c.col === 2 || c.col === 1) ? "twoColumns-salary-file-wrapper" : ""}
|
||||
title={
|
||||
<span>
|
||||
<span>{c.title}</span>
|
||||
{
|
||||
c.titleHelpful &&
|
||||
<WeaHelpfulTip width={200} title={c.titleHelpful} placement="topLeft"
|
||||
style={{ marginLeft: 8 }}/>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面重构-薪资档案编辑与查看
|
||||
* Description:
|
||||
* Date: 2024/1/11
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { renderSalaryFilesForm } from "./form";
|
||||
import { salaryFilesConditions } from "../../config";
|
||||
import { getConditionDomkeys, toDecimal_n } from "../../../../util";
|
||||
import * as API from "../../../../apis/archive";
|
||||
import { savePaySet } from "../../../../apis/payrollFiles";
|
||||
import SalaryItemChangeList from "../../../salaryFile/salaryItemChangeList";
|
||||
import SalaryArchiveEditAdjLogRecord from "../../../salaryFile/salaryArchiveEditAdjLogRecord";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollFilesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: [], formData: {}, salaryAdjustmentInfo: {},
|
||||
salaryArchiveItems: [], //薪资档案项目
|
||||
adjLogRecordDialog: { //薪资档案-调薪
|
||||
visible: false, title: "", salaryArchiveId: ""
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".salary-files-wrapper").classList.add("zIndex0-welfare-archive");
|
||||
this.getArchiveForm(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
document.querySelector(".salary-files-wrapper").classList.remove("zIndex0-welfare-archive");
|
||||
nextProps.payrollFilesStore.initSalaryFileForm();
|
||||
}
|
||||
}
|
||||
|
||||
getArchiveForm = async (props) => {
|
||||
const { payrollFilesStore: { salaryFileForm }, salaryArchiveId, runStatuses, showOperateBtn } = props;
|
||||
const { data: salaryAdjustmentInfo } = (runStatuses === "fixed") ? await API.salaryAdjustmentInfo() : { data: {} };
|
||||
const payload = { salaryArchiveId };
|
||||
API.getArchiveForm(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { baseInfo: { employee }, paySet: { data: paySetData }, adjustSalaryItems = [] } = data;
|
||||
const adjustSalaryItemsFormData = _.reduce(adjustSalaryItems, (pre, cur) => ({
|
||||
...pre, [cur["id"]]: cur["value"]
|
||||
}), {});
|
||||
const formData = { ...paySetData, ...employee, ...adjustSalaryItemsFormData };
|
||||
this.setState({
|
||||
salaryAdjustmentInfo,
|
||||
salaryArchiveItems: _.map(adjustSalaryItems, o => ({
|
||||
adjustValue: o.value, salaryItemId: o.id, pattern: o.pattern, dataType: o.dataType
|
||||
})),
|
||||
conditions: _.map(salaryFilesConditions, o => {
|
||||
if (o.salaryFile) {
|
||||
return {
|
||||
...o, items: _.map(adjustSalaryItems, g => {
|
||||
const otherParams = g.dataType === "number" ? { precision: g.pattern } : {};
|
||||
return {
|
||||
colSpan: 3, fieldcol: 14, label: g.name, labelcol: 10, ...otherParams,
|
||||
conditionType: g.dataType === "number" ? "INPUTNUMBER" : "INPUT",
|
||||
domkey: [g.id + ""], viewAttr: (runStatuses === "pending" && showOperateBtn) ? 2 : 1
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
return {
|
||||
...o, items: _.map(o.items, g => {
|
||||
if (getKey(g) === "payStartDate") {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: ((runStatuses === "pending" || runStatuses === "ext") && showOperateBtn) ? g.viewAttr : 1
|
||||
};
|
||||
} else if (getKey(g) === "payEndDate") {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (runStatuses === "stop" || !showOperateBtn) ? 1 : (runStatuses === "suspend" && showOperateBtn) ? 3 : g.viewAttr,
|
||||
rules: (runStatuses === "suspend" && showOperateBtn) ? "required|string" : ""
|
||||
};
|
||||
}
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label)
|
||||
};
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
salaryFileForm.initFormFields(this.state.conditions);
|
||||
_.map(getConditionDomkeys(this.state.conditions), k => {
|
||||
salaryFileForm.updateFields({ [k]: formData[k] || "" });
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = async () => {
|
||||
const { salaryArchiveItems } = this.state;
|
||||
const {
|
||||
payrollFilesStore: { salaryFileForm, setHasBeenModify },
|
||||
salaryArchiveId, runStatuses
|
||||
} = this.props;
|
||||
const [salaryForm] = await Promise.all([salaryFileForm.validateForm()]);
|
||||
if (salaryForm.isValid) {
|
||||
const { payStartDate, payEndDate, ...extraParams } = salaryForm.getFormParams();
|
||||
const payload = {
|
||||
//status-非系统人员保存与定薪人员一样
|
||||
salaryArchiveId, status: _.toUpper(runStatuses === "ext" ? "fixed" : runStatuses),
|
||||
payStartDate, payEndDate,
|
||||
salaryArchiveItems: _.map(salaryArchiveItems, o => ({
|
||||
salaryItemId: o.salaryItemId,
|
||||
adjustValue: (o.dataType === "number" && (extraParams[o.salaryItemId] || extraParams[o.salaryItemId] === 0)) ? toDecimal_n(extraParams[o.salaryItemId], o.pattern || 2) : extraParams[o.salaryItemId]
|
||||
}))
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
savePaySet(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
setHasBeenModify(false);
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onClose(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
salaryForm.showErrors();
|
||||
this.forceUpdate();
|
||||
}
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { loading, salaryAdjustmentInfo } = this.state, { runStatuses, showOperateBtn, salaryArchiveId } = this.props;
|
||||
const { isShow, url } = salaryAdjustmentInfo;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(543312, "员工薪资档案")}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{
|
||||
runStatuses === "fixed" && showOperateBtn && isShow === "true" &&
|
||||
<Button type="ghost" onClick={() => {
|
||||
const linkUrl = url.indexOf("http") !== -1 ? url : `${window.location.origin}${url}`;
|
||||
window.open(`${linkUrl}&salaryArchiveId=${salaryArchiveId}`, "_blank");
|
||||
}}>{getLabel(543310, "发起调薪")}</Button>
|
||||
}
|
||||
{
|
||||
(runStatuses === "fixed" || runStatuses === "ext") && showOperateBtn &&
|
||||
<Button type="ghost" onClick={() => {
|
||||
this.setState({
|
||||
adjLogRecordDialog: {
|
||||
...this.state.adjLogRecordDialog,
|
||||
visible: true, title: getLabel(542686, "调薪"), salaryArchiveId
|
||||
}
|
||||
});
|
||||
}}>{getLabel(542686, "调薪")}</Button>
|
||||
}
|
||||
{
|
||||
runStatuses !== "stop" && showOperateBtn &&
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
handleClose = (visible = false) => {
|
||||
const { payrollFilesStore: { hasBeenModify, setHasBeenModify }, onClose } = this.props;
|
||||
if (hasBeenModify) {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(545770, "确定放弃填写吗?放弃后数据将不会被保存!"),
|
||||
onOk: () => {
|
||||
onClose(visible);
|
||||
setHasBeenModify(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
onClose(visible);
|
||||
setHasBeenModify(false);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
payrollFilesStore: { salaryFileForm, setHasBeenModify }, runStatuses, salaryArchiveId,
|
||||
showOperateBtn, visible
|
||||
} = this.props;
|
||||
const { conditions, adjLogRecordDialog } = this.state;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="salary-files-edit-layout" {...this.props}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
direction={"right"} title={this.renderTitle()} onClose={() => this.handleClose(false)}
|
||||
content={<div className="salary-files-edit-area">
|
||||
{
|
||||
renderSalaryFilesForm(salaryFileForm, conditions, setHasBeenModify)
|
||||
}
|
||||
{
|
||||
runStatuses !== "pending" && visible &&
|
||||
<WeaSearchGroup title={getLabel(543328, "薪资调整记录")} items={[]} needTigger showGroup>
|
||||
<SalaryItemChangeList id={salaryArchiveId} selectedKey={runStatuses} showOperateBtn={showOperateBtn}/>
|
||||
</WeaSearchGroup>
|
||||
}
|
||||
<SalaryArchiveEditAdjLogRecord
|
||||
{...adjLogRecordDialog}
|
||||
onCancel={() => this.setState({
|
||||
adjLogRecordDialog: {
|
||||
...adjLogRecordDialog, visible: false, title: "", salaryArchiveId: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
</div>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -1,3 +1,10 @@
|
|||
import React from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, Dropdown, Menu } from "antd";
|
||||
import AdvanceInputBtn from "../components/advanceInputBtn";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const tabCondition = [
|
||||
{
|
||||
color: "#000000",
|
||||
|
|
@ -35,3 +42,428 @@ export const tabCondition = [
|
|||
viewcondition: "ext"
|
||||
}
|
||||
];
|
||||
export const tabList = [
|
||||
{ viewcondition: "pending", title: getLabel(542689, "待定薪"), showcount: true, groupid: "PENDING" },
|
||||
{ viewcondition: "fixed", title: getLabel(544638, "发薪员工"), showcount: true, groupid: "FIXED" },
|
||||
{ viewcondition: "suspend", title: getLabel(542691, "待停薪"), showcount: true, groupid: "SUSPEND" },
|
||||
{ viewcondition: "stop", title: getLabel(544637, "停薪员工"), showcount: true, groupid: "STOP" },
|
||||
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "EXT" }
|
||||
];
|
||||
export const renderReqBtns = (selectedKey, salaryImportTypes, onSalaryOpts, showOperateBtn) => {
|
||||
let reqBtns = [
|
||||
<Button type="primary" onClick={() => onSalaryOpts("IMPORT")}>{getLabel(32935, "导入")}</Button>,
|
||||
<AdvanceInputBtn
|
||||
onOpenAdvanceSearch={() => onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}
|
||||
/>
|
||||
];
|
||||
switch (selectedKey) {
|
||||
case "pending":
|
||||
!showOperateBtn && reqBtns.shift();
|
||||
showOperateBtn && reqBtns.splice(1, 0, <Button type="ghost" onClick={() => onSalaryOpts("ALL-GO-TO-FIXED")}>
|
||||
{getLabel(543304, "全部设为发薪人员")}
|
||||
</Button>);
|
||||
break;
|
||||
case "suspend":
|
||||
!showOperateBtn && reqBtns.shift();
|
||||
break;
|
||||
case "fixed":
|
||||
case "ext":
|
||||
reqBtns.shift();
|
||||
showOperateBtn && reqBtns.unshift(
|
||||
<Dropdown overlay={
|
||||
<Menu className="dropdownMenuWrapper" onClick={({ key }) => onSalaryOpts("IMPORT", key)}>
|
||||
{salaryImportTypes.map((item) => (
|
||||
<Menu.Item key={item.id}>{item.content}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
}>
|
||||
<Button type="primary">{getLabel(32935, "导入")}</Button>
|
||||
</Dropdown>
|
||||
);
|
||||
showOperateBtn && reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={<HelpfulDiv/>}
|
||||
/>);
|
||||
break;
|
||||
case "stop":
|
||||
reqBtns.shift();
|
||||
showOperateBtn && reqBtns.unshift(<Button type="primary"
|
||||
onClick={() => onSalaryOpts("CANCEL-SALARY-SUSPENSION")}>{getLabel(543307, "批量取消停薪")}</Button>);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return reqBtns;
|
||||
};
|
||||
export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
|
||||
let menus = [{
|
||||
key: "custom_cols",
|
||||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: getLabel(32535, "显示列定制")
|
||||
}];
|
||||
switch (selectedKey) {
|
||||
case "pending":
|
||||
menus = [
|
||||
{
|
||||
key: "ADD-TO-SALARYPAYMENT",
|
||||
icon: <i className="icon-coms-BatchEditing-Hot"/>,
|
||||
content: getLabel(543305, "批量设为发薪员工")
|
||||
},
|
||||
{
|
||||
key: "DEL-PENDITNG-TO-DO",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "fixed":
|
||||
menus = [
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "suspend":
|
||||
menus = [
|
||||
{
|
||||
key: "FULL-SALARY-SUSPENSION",
|
||||
icon: <i className="icon-coms02-all"/>,
|
||||
content: getLabel(543326, "全部停薪")
|
||||
},
|
||||
{
|
||||
key: "SALARY-SUSPENSION",
|
||||
icon: <i className="icon-coms-BatchEditing-Hot"/>,
|
||||
content: getLabel(543724, "批量停薪")
|
||||
},
|
||||
{
|
||||
key: "DEL-SUSPEND-TO-DO",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "stop":
|
||||
menus = [
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return showOperateBtn ? menus : _.filter(menus, o => o.key === "custom_cols");
|
||||
};
|
||||
|
||||
export const salaryFileSearchConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["username"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(25034, "姓名"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: false,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
icon: "icon-coms-hrm",
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "164",
|
||||
viewAttr: 2
|
||||
},
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["subcompanyIds"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(33553, "分部"),
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: false,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
icon: "icon-coms-hrm",
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "57",
|
||||
viewAttr: 2
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["departmentIds"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(27511, "部门"),
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: false,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
icon: "icon-coms-hrm",
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "24",
|
||||
viewAttr: 2
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["positionIds"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(6086, "岗位"),
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["statuses"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(382300, "人员状态"),
|
||||
labelcol: 8,
|
||||
options: [],
|
||||
multiple: true,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentId"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(537996, "个税扣缴义务人"),
|
||||
labelcol: 8,
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["workcode"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(1933, "工号"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["payStartDateStartDateStr", "payStartDateEndDateStr"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(542346, "起始发薪日期"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["payEndDateStartDateStr", "payEndDateEndDateStr"],
|
||||
fieldcol: 16,
|
||||
label: getLabel(542347, "最后发薪日期"),
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: getLabel(1361, "基本信息"),
|
||||
col: 2
|
||||
}
|
||||
];
|
||||
export const salaryFilesConditions = [
|
||||
{
|
||||
defaultshow: true, title: getLabel(1361, "基本信息"),
|
||||
col: 3,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["username"],
|
||||
fieldcol: 14,
|
||||
label: "姓名",
|
||||
lanId: 25034,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["department"],
|
||||
fieldcol: 14,
|
||||
label: "部门",
|
||||
lanId: 27511,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["position"],
|
||||
fieldcol: 14,
|
||||
label: "岗位",
|
||||
lanId: 6086,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["hiredate"],
|
||||
fieldcol: 14,
|
||||
label: "入职时间",
|
||||
lanId: 1908,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["mobile"],
|
||||
fieldcol: 14,
|
||||
label: "手机号",
|
||||
lanId: 125238,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["taxAgent"],
|
||||
fieldcol: 14,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 537996,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true, title: getLabel(543329, "发薪设置"),
|
||||
col: 1,
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["payStartDate"],
|
||||
fieldcol: 16,
|
||||
label: "起始发薪日期",
|
||||
lanId: 542346,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "DATEPICKER",
|
||||
domkey: ["payEndDate"],
|
||||
fieldcol: 16,
|
||||
label: "最后发薪日期",
|
||||
lanId: 542347,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true, title: getLabel(538004, "薪资档案"),
|
||||
titleHelpful: getLabel(543330, "提示:显示已生效的最新数据"),
|
||||
col: 2, salaryFile: true,
|
||||
items: []
|
||||
}
|
||||
];
|
||||
const HelpfulDiv = () => {
|
||||
return <div className="helpWrapper">
|
||||
<span>{getLabel(544742, "导入按钮使用场景说明:")}</span>
|
||||
<span>{getLabel(544743, "1.档案初始化:")}</span>
|
||||
<span className="pl10">
|
||||
<span>{getLabel(544744, "a.初次使用薪酬模块,全量导入员工的薪资档案数据;")}</span>
|
||||
<span>{getLabel(544745, "b.员工入职,导入新入职的员工的薪资档案数据(若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入);")}</span>
|
||||
<span>{getLabel(544746, "c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴;")}</span>
|
||||
</span>
|
||||
<span>{getLabel(545755, "2.调薪:档案中已存在的人员批量调整薪资项目值(包括返聘人员的情况);")}</span>
|
||||
<span>{getLabel(545756, "3.调整个税扣缴义务人:档案中已存在的人员批量调整个税扣缴义务人(包括返聘人员的情况);")}</span>
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -111,3 +111,201 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//薪资档案页面重构
|
||||
.salary-files-wrapper {
|
||||
min-width: 1000px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-top-req-title > div:first-child > div > div {
|
||||
padding-left: 0 !important;
|
||||
|
||||
.wea-tab {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.salary-files-content {
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.table-layout {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 246px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//薪资档案页面重构-编辑查看抽屉页面
|
||||
.salary-files-edit-layout {
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
|
||||
button:last-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-slide-modal-title {
|
||||
border-bottom: 1px solid #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
|
||||
.salary-files-edit-area {
|
||||
background: #f6f6f6;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 16px;
|
||||
|
||||
.basic-salary-file-wrapper {
|
||||
.wea-form-cell-wrapper {
|
||||
.wea-field-readonly {
|
||||
vertical-align: bottom;
|
||||
|
||||
span.child-item {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 125px;
|
||||
}
|
||||
}
|
||||
|
||||
& > div {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(3) {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(4), & > div:nth-child(5) {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.twoColumns-salary-file-wrapper {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(2n) {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group, .wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 5px 16px;
|
||||
|
||||
.wea-form-item-label {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-form-cell-wrapper {
|
||||
background: #FFF;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,278 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资档案页面-重构
|
||||
* Description:
|
||||
* Date: 2024/1/8
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaTab } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { renderDropMenuDatas, renderReqBtns, tabList } from "./config";
|
||||
import SalaryFileAdvanceSearchPannel from "./components/salaryFileAdvanceSearchPannel";
|
||||
import SalaryFileImportDialog from "./components/salaryFileImportDialog";
|
||||
import SalaryFileList from "./components/salaryFileList";
|
||||
import * as API from "../../apis/payrollFiles";
|
||||
import { sysinfo } from "../../apis/ruleconfig";
|
||||
import { convertToUrlString } from "../../util/url";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollFilesStore", "taxAgentStore")
|
||||
@observer
|
||||
class SalaryFiles extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "pending", showSearchAd: false, isQuery: false, showDelSalaryFileBtn: false,
|
||||
topTabCount: { PENDING: 0, FIXED: 0, SUSPEND: 0, STOP: 0, EXT: 0 }, showExtEmpsWitch: false,
|
||||
salaryFileImpDialog: { visible: false, title: getLabel(24023, "数据导入"), importType: "", isExtEmp: false },
|
||||
salaryImportTypes: []
|
||||
};
|
||||
this.salaryFileListRef = null;
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
// salaryArchiveDelete, //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是,
|
||||
// extEmpsWitch //非系统人员开关, 1: 开启, 0:关闭
|
||||
const [{ data: salaryFileDelFlag }, { data: { extEmpsWitch } }, { data: salaryImportTypes }] =
|
||||
await Promise.all([API.salaryArchiveDelete(), sysinfo(), API.getImportTypes()]);
|
||||
this.setState({
|
||||
showDelSalaryFileBtn: salaryFileDelFlag === "1", showExtEmpsWitch: extEmpsWitch === "1",
|
||||
salaryImportTypes: _.filter(salaryImportTypes, it => it.id !== "taxAgentAdjust")
|
||||
});
|
||||
}
|
||||
|
||||
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
|
||||
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
|
||||
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
|
||||
onDropMenuClick = (key) => {
|
||||
const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {};
|
||||
switch (key) {
|
||||
case "custom_cols":
|
||||
const { payrollFilesStore: { tableStore } } = this.props;
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
break;
|
||||
case "FULL-SALARY-SUSPENSION":
|
||||
this.allGotoStop();
|
||||
break;
|
||||
case "ADD-TO-SALARYPAYMENT":
|
||||
case "DEL-PENDITNG-TO-DO":
|
||||
case "SALARY-SUSPENSION":
|
||||
case "DEL-SUSPEND-TO-DO":
|
||||
const { selectedRowKeys = [] } = state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
handleSalaryOpts && handleSalaryOpts(_.camelCase(key), selectedRowKeys);
|
||||
break;
|
||||
case "exportAll":
|
||||
case "exportSelected":
|
||||
this.handleExport(key);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
queryInsuranceTabTotal = (active, total) => {
|
||||
API.queryTabTotal().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const key = _.find(tabList, o => o.viewcondition === active).groupid;
|
||||
this.setState({
|
||||
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleReqBtnsCLick = (type, importType) => {
|
||||
const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {};
|
||||
switch (type) {
|
||||
case "OPEN":
|
||||
this.handleOpenAdvanceSearch();
|
||||
break;
|
||||
case "SEARCH":
|
||||
this.handleAdvanceSearch();
|
||||
break;
|
||||
case "IMPORT":
|
||||
this.setState({
|
||||
salaryFileImpDialog: {
|
||||
...this.state.salaryFileImpDialog, visible: true,
|
||||
importType: importType || _.upperCase(this.state.selectedKey),
|
||||
isExtEmp: this.state.selectedKey === "ext"
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "ALL-GO-TO-FIXED":
|
||||
this.allGotoFixed();
|
||||
break;
|
||||
case "CANCEL-SALARY-SUSPENSION":
|
||||
const { selectedRowKeys = [] } = state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据!"));
|
||||
return;
|
||||
}
|
||||
handleSalaryOpts && handleSalaryOpts(_.camelCase(type), selectedRowKeys);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 全部设为发薪员工
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
allGotoFixed = () => {
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { pageInfo } = state;
|
||||
if (pageInfo && pageInfo.total === 0) {
|
||||
message.warning(getLabel(543300, "您没有需要处理的待定薪人员!"));
|
||||
return;
|
||||
}
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: `${getLabel(543301, "确定要将所有待定薪人员")}(${getLabel(18609, "共")}${pageInfo.total}${getLabel(30690, "条数据")})${getLabel(543302, "设为发薪人员吗")}?`,
|
||||
onOk: () => {
|
||||
WeaLoadingGlobal.start();
|
||||
API.allGotoFixed({}).then(({ status, data, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg } = data;
|
||||
message.info(msg || getLabel(30700, "操作成功!"));
|
||||
this.handleAdvanceSearch();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(30651, "操作失败!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 全部停薪
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
allGotoStop = () => {
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { pageInfo } = state;
|
||||
if (pageInfo && pageInfo.total === 0) {
|
||||
message.warning(getLabel(543325, "您没有需要处理的待停薪人员!"));
|
||||
return;
|
||||
}
|
||||
Modal.warning({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: `${getLabel(543723, "确定要将所有待停薪人员")}(${getLabel(18609, "共")}${pageInfo.total}${getLabel(30690, "条数据")})${getLabel(543327, "设为停薪人员吗")}?`,
|
||||
onOk: () => {
|
||||
WeaLoadingGlobal.start();
|
||||
API.allGotoStop({}).then(({ status, data, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg } = data;
|
||||
message.info(msg || getLabel(30700, "操作成功!"));
|
||||
this.handleAdvanceSearch();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(30651, "操作失败!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 导出薪资档案文件
|
||||
* Params:
|
||||
* Date: 2024/1/9
|
||||
*/
|
||||
handleExport = (type) => {
|
||||
const { payrollFilesStore: { salaryFileQueryForm } } = this.props;
|
||||
const { selectedKey } = this.state;
|
||||
let url = `${window.location.origin}/api/bs/hrmsalary/salaryArchive/exportList`;
|
||||
let payload = {}, runStatusList = _.upperCase(selectedKey);
|
||||
const { state } = this.salaryFileListRef.wrappedInstance || {};
|
||||
const { selectedRowKeys = [] } = state;
|
||||
switch (selectedKey) {
|
||||
case "pending":
|
||||
case "suspend":
|
||||
runStatusList = _.upperCase(selectedKey);
|
||||
break;
|
||||
case "fixed":
|
||||
runStatusList = "FIXED,SUSPEND";
|
||||
break;
|
||||
case "stop":
|
||||
runStatusList = "STOP_FROM_PENDING,STOP_FROM_SUSPEND";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (type === "exportAll") {
|
||||
payload = { ids: "", runStatusList, ...salaryFileQueryForm.getFormParams() };
|
||||
} else {
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning(getLabel(543345, "请选择需要导出的数据!"));
|
||||
return;
|
||||
}
|
||||
payload = { ids: selectedRowKeys.join(",") };
|
||||
}
|
||||
window.open(`${url}?${convertToUrlString(payload)}`, "_blank");
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
selectedKey, topTabCount, showSearchAd, isQuery, showDelSalaryFileBtn, showExtEmpsWitch,
|
||||
salaryFileImpDialog, salaryImportTypes
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return (
|
||||
<div className="salary-files-wrapper">
|
||||
<WeaReqTop
|
||||
title={getLabel(538004, "薪资档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
|
||||
onDropMenuClick={this.onDropMenuClick}
|
||||
buttons={renderReqBtns(selectedKey, salaryImportTypes, this.handleReqBtnsCLick, showOperateBtn)}
|
||||
replaceTab={
|
||||
<WeaTab
|
||||
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
|
||||
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
|
||||
onChange={key => this.setState({ selectedKey: key })}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<div className="salary-files-content">
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<SalaryFileAdvanceSearchPannel
|
||||
onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={this.onAdSearch}
|
||||
/>
|
||||
</div>
|
||||
{/*列表*/}
|
||||
<SalaryFileList isQuery={isQuery} ref={dom => this.salaryFileListRef = dom}
|
||||
selectedKey={selectedKey} showOperateBtn={showOperateBtn}
|
||||
showDelSalaryFileBtn={showDelSalaryFileBtn}
|
||||
onChangeTopTabCount={this.queryInsuranceTabTotal}
|
||||
/>
|
||||
{/* 导入*/}
|
||||
<SalaryFileImportDialog {...salaryFileImpDialog}
|
||||
onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
isQuery: isFresh ? !isQuery : isQuery,
|
||||
salaryFileImpDialog: {
|
||||
...salaryFileImpDialog, visible: false,
|
||||
importType: "", isExtEmp: false
|
||||
}
|
||||
});
|
||||
}}/>
|
||||
</div>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryFiles;
|
||||
|
|
@ -7,11 +7,24 @@ export const copyConditions = [
|
|||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "工资单名称",
|
||||
lanId: 536726,
|
||||
lanId: 543600,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["salarySobId"],
|
||||
fieldcol: 14,
|
||||
label: "薪资账套",
|
||||
lanId: 538010,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
|
|
@ -189,13 +202,37 @@ export const tempBaseSetFbConditions = [
|
|||
hide: false,
|
||||
rules: "required"
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["feedbackStatus"],
|
||||
fieldcol: 2,
|
||||
label: "启用工资单反馈",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "1",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["feedbackUrl"],
|
||||
fieldcol: 14,
|
||||
label: "反馈流程地址",
|
||||
lanId: 544096,
|
||||
label: "PC端反馈流程地址",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "/",
|
||||
viewAttr: 3,
|
||||
hide: false,
|
||||
rules: "required|string"
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["mobileFeedbackUrl"],
|
||||
fieldcol: 14,
|
||||
label: "移动端反馈流程地址",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "/",
|
||||
viewAttr: 3,
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { copyConditions } from "../conditions";
|
||||
import { duplicatePayroll } from "../../../../apis/payroll";
|
||||
import { duplicatePayroll, getPayrollTemplateLedgerList } from "../../../../apis/payroll";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
|
|
@ -20,15 +21,41 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) nextProps.payrollStore.payrollCopyForm.initFormFields(copyConditions);
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getPayrollTemplateLedgerList(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.payrollStore.initPayrollCopyForm();
|
||||
}
|
||||
|
||||
getPayrollTemplateLedgerList = (props) => {
|
||||
getPayrollTemplateLedgerList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(copyConditions, item => {
|
||||
return {
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "salarySobId") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(data, d => ({ key: d.id, showname: d.content }))
|
||||
};
|
||||
} else {
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
}
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions);
|
||||
props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { payrollStore: { payrollCopyForm }, copyId: id } = this.props;
|
||||
payrollCopyForm.validateForm().then(f => {
|
||||
|
|
@ -51,16 +78,16 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { loading, conditions } = this.state;
|
||||
const { payrollStore: { payrollCopyForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480 }} initLoadCss
|
||||
{...this.props} style={{ width: 480, height: 127 }} initLoadCss
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="payroll-dialog-layout">{getSearchs(payrollCopyForm, copyConditions, 1, false)}</div>
|
||||
<div className="payroll-dialog-layout">{getSearchs(payrollCopyForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,10 +129,10 @@ class Index extends Component {
|
|||
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"],
|
||||
helpfulTitle: getLabel(544273, "开启后,还需在计划任务中配置定时任务,执行自动确认任务;邮箱端查看工资单暂不支持确认及反馈;")
|
||||
};
|
||||
} else if (getKey(o) === "feedbackUrl") {
|
||||
} else if (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl") {
|
||||
return {
|
||||
...o,
|
||||
hide: _.isNil(fieldsEchoData["ackFeedbackStatus"]) ? o.hide : !fieldsEchoData["ackFeedbackStatus"]
|
||||
hide: _.isNil(fieldsEchoData["feedbackStatus"]) ? o.hide : !fieldsEchoData["feedbackStatus"]
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
|
|
@ -171,10 +171,10 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
_.map(tempBaseSetFbDomkeys, it => {
|
||||
if (it === "ackFeedbackStatus") {
|
||||
if (it === "ackFeedbackStatus" || it === "feedbackStatus") {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
|
||||
} else {
|
||||
payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "" });
|
||||
payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" });
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
|
|
@ -292,18 +292,23 @@ class Index extends Component {
|
|||
handleFbChange = (params) => {
|
||||
const { payrollStore: { payrollTempFeedbackForm, setHasBeenModify } } = this.props;
|
||||
const key = _.keys(params)[0];
|
||||
if (key === "ackFeedbackStatus") {
|
||||
if (key === "ackFeedbackStatus" || key === "feedbackStatus") {
|
||||
this.setState({
|
||||
fbConditions: _.map(this.state.fbConditions, it => {
|
||||
if (it.title === getLabel(544092, "工资单确认反馈设置")) {
|
||||
return {
|
||||
...it, items: _.map(it.items, o => {
|
||||
if (getKey(o) === "autoAckDays" || getKey(o) === "feedbackUrl") {
|
||||
if (getKey(o) === "autoAckDays" && key === "ackFeedbackStatus") {
|
||||
return {
|
||||
...o, hide: params[key].value === "0"
|
||||
...o, hide: params["ackFeedbackStatus"].value === "0"
|
||||
};
|
||||
} else if (key === "feedbackStatus" && (getKey(o) === "feedbackUrl" || getKey(o) === "mobileFeedbackUrl")) {
|
||||
return {
|
||||
...o, hide: params["feedbackStatus"].value === "0"
|
||||
};
|
||||
} else {
|
||||
return { ...o };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
@ -312,7 +317,14 @@ class Index extends Component {
|
|||
}, () => {
|
||||
payrollTempFeedbackForm.initFormFields(this.state.fbConditions);
|
||||
const ackFeedbackStatus = payrollTempFeedbackForm.getFormParams().ackFeedbackStatus;
|
||||
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({ autoAckDays: "7", feedbackUrl: "/" });
|
||||
const feedbackStatus = payrollTempFeedbackForm.getFormParams().feedbackStatus;
|
||||
if (ackFeedbackStatus === "0") payrollTempFeedbackForm.updateFields({
|
||||
autoAckDays: "7"
|
||||
});
|
||||
if (feedbackStatus === "0") payrollTempFeedbackForm.updateFields({
|
||||
feedbackUrl: "/",
|
||||
mobileFeedbackUrl: "/"
|
||||
});
|
||||
});
|
||||
}
|
||||
setHasBeenModify(true);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Index extends Component {
|
|||
this.state = {
|
||||
loading: false, columns: [], dataSource: [], selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }, delLoading: false,
|
||||
copyDialog: { visible: false, title: "", copyId: "" },
|
||||
copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
|
||||
tmplSlide: {
|
||||
visible: false, tmplId: "", top: 0, width: 792, height: 100,
|
||||
measureT: "%", measureX: "px", measureY: "%"
|
||||
|
|
@ -80,7 +80,7 @@ class Index extends Component {
|
|||
};
|
||||
handleOpts = ({ key }, record) => {
|
||||
const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
|
||||
const { id } = record;
|
||||
const { id, salarySobId } = record;
|
||||
switch (key) {
|
||||
case "edit":
|
||||
this.setState({
|
||||
|
|
@ -89,7 +89,10 @@ class Index extends Component {
|
|||
break;
|
||||
case "copy":
|
||||
this.setState({
|
||||
copyDialog: { ...copyDialog, visible: true, copyId: id, title: getLabel(543599, "复制工资单") }
|
||||
copyDialog: {
|
||||
...copyDialog, visible: true, copyId: id,
|
||||
salarySobId: salarySobId + "", title: getLabel(543599, "复制工资单")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "del":
|
||||
|
|
@ -175,7 +178,7 @@ class Index extends Component {
|
|||
{/*复制工资单模板*/}
|
||||
<PayrollCopyDialog {...copyDialog}
|
||||
onCancel={v => this.setState({
|
||||
copyDialog: { ...copyDialog, visible: false, copyId: "" }
|
||||
copyDialog: { ...copyDialog, visible: false, copyId: "", salarySobId: "" }
|
||||
}, () => v === "refresh" && this.getPayrollTemplateList(this.props))}
|
||||
/>
|
||||
{/* 新建编辑工资单模板*/}
|
||||
|
|
|
|||
|
|
@ -46,11 +46,12 @@ class Index extends Component {
|
|||
const {
|
||||
replenishRule, autoSendStatus, emailStatus, msgStatus, smsStatus, ...extraBs
|
||||
} = payrollTempForm.getFormParams(),
|
||||
{ ackFeedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
|
||||
{ ackFeedbackStatus, feedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
|
||||
{ formData, smsSettingDialog } = this.tmpBaseSetRef.state;
|
||||
const payload = {
|
||||
...toJS(tmplDataSource), ...extraFb, ...formData, ...extraBs,
|
||||
ackFeedbackStatus: ackFeedbackStatus === "1",
|
||||
feedbackStatus: feedbackStatus === "1",
|
||||
autoSendStatus: autoSendStatus === "1",
|
||||
emailStatus: emailStatus === "1",
|
||||
msgStatus: msgStatus === "1",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Index extends Component {
|
|||
queryParams: {
|
||||
salarySobId: "", name: "",
|
||||
dateRange: [
|
||||
moment(new Date()).startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ export default class Index extends Component {
|
|||
confValue: "0",
|
||||
withDrawTaxDeclaration: "0",
|
||||
extEmpsWitch: "0",
|
||||
salaryAcctFixedColumns: 0
|
||||
salaryAcctFixedColumns: 0,
|
||||
welBaseDiffByPerAndCom: "0",
|
||||
welBaseAutoAdjust: "0"
|
||||
},
|
||||
showEncryptOperationButton: "",
|
||||
progressVisible: false,
|
||||
|
|
@ -66,7 +68,8 @@ export default class Index extends Component {
|
|||
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
|
||||
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
|
||||
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
|
||||
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0"
|
||||
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0",
|
||||
welBaseDiffByPerAndCom = "0", welBaseAutoAdjust = "0"
|
||||
}
|
||||
} = sysInfo;
|
||||
// const { data: { ascOrDesc, orderRule } } = orderRules;
|
||||
|
|
@ -87,7 +90,8 @@ export default class Index extends Component {
|
|||
saveParams: {
|
||||
...saveParams,
|
||||
ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
|
||||
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0"
|
||||
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0",
|
||||
welBaseDiffByPerAndCom, welBaseAutoAdjust
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -307,6 +311,16 @@ export default class Index extends Component {
|
|||
confValue: !_.isNil(val) ? val.toString() : "0"
|
||||
});
|
||||
break;
|
||||
case "welBaseDiffByPerAndCom":
|
||||
case "welBaseAutoAdjust":
|
||||
this.saveSysOperate({
|
||||
title: key === "welBaseDiffByPerAndCom" ?
|
||||
getLabel(111, "福利档案基数区分个人和公司") :
|
||||
getLabel(111, "福利档案导入基数不符合要求时自动调整为上限/下限"),
|
||||
module: "basic", confKey: key,
|
||||
confValue: val
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -342,7 +356,9 @@ export default class Index extends Component {
|
|||
confValue,
|
||||
withDrawTaxDeclaration,
|
||||
extEmpsWitch,
|
||||
salaryAcctFixedColumns
|
||||
salaryAcctFixedColumns,
|
||||
welBaseDiffByPerAndCom,
|
||||
welBaseAutoAdjust
|
||||
} = saveParams;
|
||||
return (
|
||||
<div className="ruleWrapper">
|
||||
|
|
@ -398,6 +414,17 @@ export default class Index extends Component {
|
|||
onChange={val => this.handleChange("confValue", val)}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
<WeaSearchGroup title={getLabel(111, "福利档案基数")} showGroup center>
|
||||
<WeaFormItem label={getLabel(111, "区分个人和公司")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaCheckbox display="switch" value={welBaseDiffByPerAndCom}
|
||||
onChange={val => this.handleChange("welBaseDiffByPerAndCom", val)}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "导入基数自动调整上/下限")} labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<WeaCheckbox display="switch" value={welBaseAutoAdjust}
|
||||
onChange={val => this.handleChange("welBaseAutoAdjust", val)}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
<WeaSearchGroup title={getLabel(111, "薪资核算人员匹配规则")} showGroup center>
|
||||
<WeaFormItem label={getLabel(111, "匹配规则")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect options={matchRuleOptions} value={matchRule}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:调薪记录
|
||||
* Description:
|
||||
* Date: 2024/1/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import SalaryAdjustmentRecords from "../mySalaryBenefits/components/SalaryAdjustmentRecords";
|
||||
import "../historicalPayroll/index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const employeeId = WeaTools.getUrlParams().hrmResourceID;
|
||||
return (
|
||||
<div className="history-payroll-box">
|
||||
<SalaryAdjustmentRecords type="mySalaryRecordList4Card" employeeId={employeeId}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -83,7 +83,7 @@ export default class SalaryItemChangeList extends React.Component {
|
|||
}
|
||||
return { ...o, width, render: text => (<span title={text}>{text}</span>) };
|
||||
});
|
||||
if (showOperateBtn && selectedKey === "fixed") {
|
||||
if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) {
|
||||
columns = [...columns, {
|
||||
dataIndex: "operate", fixed: "right", width: 120, title: "操作",
|
||||
render: (text, record) => {
|
||||
|
|
|
|||
|
|
@ -142,6 +142,14 @@ export const salaryItemFields = [
|
|||
viewAttr: 2,
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: "width",
|
||||
label: "显示宽度",
|
||||
lanId: 111,
|
||||
type: "INPUTNUMBER",
|
||||
viewAttr: 2,
|
||||
tip: ""
|
||||
},
|
||||
{
|
||||
key: "description",
|
||||
label: "备注",
|
||||
|
|
|
|||
|
|
@ -46,8 +46,13 @@ class SalaryItemForm extends Component {
|
|||
case "pattern":
|
||||
case "roundingMode":
|
||||
return { ...item, display: dataType === "number" };
|
||||
case "width":
|
||||
case "sortedIndex":
|
||||
return { ...item };
|
||||
return {
|
||||
...item,
|
||||
label: getLabel(item.lanId, item.label),
|
||||
display: ((!isLedger && key === "width") || key === "sortedIndex")
|
||||
};
|
||||
case "useInEmployeeSalary":
|
||||
return {
|
||||
...item,
|
||||
|
|
@ -164,8 +169,13 @@ class SalaryItemForm extends Component {
|
|||
</WeaFormItem> :
|
||||
(type === "INPUTNUMBER" && display) ?
|
||||
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
|
||||
<WeaInputNumber value={value} viewAttr={viewAttr} precision={0}
|
||||
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/>
|
||||
<React.Fragment>
|
||||
<WeaInputNumber value={value} viewAttr={viewAttr} precision={0}
|
||||
min={key === "width" ? 0 : -99999}
|
||||
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/>
|
||||
{key === "width" && display &&
|
||||
<span style={{ paddingLeft: 10, position: "absolute", marginTop: 4 }}>px</span>}
|
||||
</React.Fragment>
|
||||
</WeaFormItem> : null
|
||||
}
|
||||
</React.Fragment>;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
import { WeaSwitch } from "comsMobx";
|
||||
import { Button } from "antd";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const tabCondition = [
|
||||
{
|
||||
color: "#000000",
|
||||
|
|
@ -42,97 +35,3 @@ export const tabCondition = [
|
|||
viewcondition: "ext"
|
||||
}
|
||||
];
|
||||
export const logConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: true,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "1"
|
||||
},
|
||||
domkey: ["employeeId"],
|
||||
fieldcol: 17,
|
||||
label: "对象",
|
||||
lanId: 106,
|
||||
labelcol: 7,
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: true,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "1"
|
||||
},
|
||||
domkey: ["operator"],
|
||||
fieldcol: 17,
|
||||
label: "操作人",
|
||||
lanId: 111,
|
||||
labelcol: 7,
|
||||
value: ""
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && condition && condition.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
||||
{
|
||||
getKey(fields) === "operator" &&
|
||||
<Button type="primary" onClick={onSearch} style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
|
||||
/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import UnifiedTable from "../../../components/UnifiedTable";
|
|||
import { convertToUrlString, getURLParameters } from "../../../util/url";
|
||||
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
|
||||
import ImportDialog from "../../../components/importDialog";
|
||||
import OperateLogDialog from "./operateLogDialog";
|
||||
import OperateLogDialog from "../welfareArchive/components/logDialog";
|
||||
import "./index.less";
|
||||
import { sysinfo } from "../../../apis/ruleconfig";
|
||||
|
||||
|
|
|
|||
|
|
@ -85,36 +85,3 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重构-社保福利档案
|
||||
.logDialog {
|
||||
.wea-dialog-body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.logDialogContent {
|
||||
background: #F6F6F6;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.wea-search-group {
|
||||
padding: 0;
|
||||
margin-bottom: 10px;
|
||||
background: #FFF;
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logTable {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class CustomBenefitsTable extends Component {
|
|||
content: getLabel(543231, "确认删除本条数据吗?"),
|
||||
onOk: () => {
|
||||
message.destroy();
|
||||
message.loading("正在删除中...", 0);
|
||||
message.loading(getLabel(529063, "正在删除中..."), 0);
|
||||
const payload = { id };
|
||||
deleteCustomCategory(payload).then(({ status, errormsg }) => {
|
||||
message.destroy();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import { WeaHelpfulTip, WeaInputNumber, WeaSelect, WeaTab, WeaTable } from "ecCom";
|
||||
import { WeaHelpfulTip, WeaInputNumber, WeaSelect, WeaTab } from "ecCom";
|
||||
import { Switch, Table } from "antd";
|
||||
import { insertUpdateColumns } from "./columns";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
|
@ -114,7 +114,13 @@ export default class DefaultSlideForm extends React.Component {
|
|||
const { programmeStore, requestParams, onChange } = this.props;
|
||||
const { defaultPersonDataSource, defaultCompanyDataSource } = programmeStore;
|
||||
insertUpdateColumns.map(item => {
|
||||
if (item.dataIndex == "isPayment") {
|
||||
if (item.dataIndex == "insuranceName") {
|
||||
item.render = (text) => {
|
||||
return (
|
||||
<div style={{ maxWidth: 100 }} className="ellipsis" title={text}>{text}</div>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "isPayment") {
|
||||
item.render = (text, record) => {
|
||||
return (
|
||||
<Switch
|
||||
|
|
@ -320,7 +326,7 @@ export default class DefaultSlideForm extends React.Component {
|
|||
item.render = (text, record) => {
|
||||
if (record.paymentCycle === "0") {
|
||||
return (
|
||||
<div>基数*比例+固定费用</div>
|
||||
<div style={{ maxWidth: 180 }} className="ellipsis">基数*比例+固定费用</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@
|
|||
.tableWrapper {
|
||||
margin-top: 10px;
|
||||
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ant-table-fixed-left {
|
||||
tr {
|
||||
height: 63px !important;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ class PaymentPeriodModal extends Component {
|
|||
const { monthList, allSelect } = this.state;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={onCancel}>保存</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ monthList: [], allSelect: false })}>重置</Button>
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
monthList: [], allSelect: false
|
||||
}, () => this.props.onSetPaymentPeriod(this.state.monthList))}>重置</Button>
|
||||
];
|
||||
const options = [
|
||||
{ label: "一月", value: "1" },
|
||||
|
|
|
|||
|
|
@ -41,3 +41,23 @@ export const socialAccountConditions = [
|
|||
title: ""
|
||||
}
|
||||
];
|
||||
export const welfareRQConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgents"],
|
||||
fieldcol: 8,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 537996,
|
||||
labelcol: 6,
|
||||
options: [],
|
||||
viewAttr: 2,
|
||||
multiple: true
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: ""
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利台账重构-列表
|
||||
* Description:
|
||||
* Date: 2024/1/23
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { getIframeParentHeight } from "../../../../util";
|
||||
import * as API from "../../../../apis/standingBook";
|
||||
import { convertToUrlString } from "../../../../util/url";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class WelfareRecordList extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], columns: [],
|
||||
pageInfo: { current: 0, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getWelfareRecordList();
|
||||
} else if (type === "turn") {
|
||||
const module = {
|
||||
billMonth: params.billMonth,
|
||||
paymentOrganization: params.paymentOrganizationId
|
||||
};
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList());
|
||||
break;
|
||||
case "CALC":
|
||||
case "VIEW":
|
||||
const payload = {
|
||||
billMonth: params.billMonth,
|
||||
paymentOrganization: params.paymentOrganizationId,
|
||||
creator: params.creator,
|
||||
type: id === "VIEW" ? "detail" : ""
|
||||
};
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(payload)}`);
|
||||
break;
|
||||
case "DELRC":
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"),
|
||||
onOk: () => {
|
||||
API.siaccountDelete(module).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(502230, "删除成功"));
|
||||
this.getWelfareRecordList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "RECALC":
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "确认信息"),
|
||||
content: getLabel(111, "重新核算后,此条台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"),
|
||||
onOk: () => {
|
||||
API.socialSecurityBenefitsRecalculate({ id: params.id })
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.getWelfareRecordList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "FILE":
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "确认信息"),
|
||||
content: getLabel(111, "归档后,此条台账数据无法删除且不可以再进行此月份的核算,是否确认归档?"),
|
||||
onOk: () => {
|
||||
API.siaccountFile(module).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.getWelfareRecordList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计"), "已归档": getLabel(18800, "已归档"),
|
||||
"未归档": getLabel(17999, "已归档"), "操作": getLabel(30585, "操作"),
|
||||
"核算": getLabel(538780, "核算"), "归档": getLabel(251, "归档"),
|
||||
"查看": getLabel(33564, "查看"), "重新核算": getLabel(542637, "重新核算"),
|
||||
"删除": getLabel(535052, "删除")
|
||||
};
|
||||
const childFrameObj = document.getElementById("unitTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getWelfareRecordList = () => {
|
||||
const { queryForm, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
|
||||
this.setState({ loading: true });
|
||||
API.getCommonList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: result } = data;
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource, columns
|
||||
}, () => this.postMessageToChild({
|
||||
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource } = this.state;
|
||||
return (
|
||||
<div className="salary-welfare-record-list"
|
||||
style={{ height: getIframeParentHeight(".wea-new-top-content", dataSource.length, 46) + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/unitTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
|
||||
id="unitTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WelfareRecordList;
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利台账重构-查询组件
|
||||
* Description:
|
||||
* Date: 2024/1/23
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import * as API from "../../../../apis/standingBook";
|
||||
import { welfareRQConditions } from "../columns";
|
||||
import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide";
|
||||
import moment from "moment";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("standingBookStore")
|
||||
@observer
|
||||
class WelfareRecordQuery extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [],
|
||||
dateRange: [
|
||||
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
API.getAdminTaxAgentList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
conditions: _.map(welfareRQConditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgents") {
|
||||
return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
|
||||
}
|
||||
return o;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
|
||||
welfareRQForm.initFormFields(this.state.conditions);
|
||||
onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
renderForm = (form, conditions) => {
|
||||
const { dateRange } = this.state;
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && conditions && conditions.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={this.getWelfareRecordList}/>
|
||||
</WeaFormItem>)
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={3} needTigger showGroup={c.defaultshow}
|
||||
items={[
|
||||
{
|
||||
com: (<WeaFormItem label={getLabel(542443, "账单月份")} labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/>
|
||||
</WeaFormItem>)
|
||||
},
|
||||
...items
|
||||
]}
|
||||
/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
getWelfareRecordList = () => {
|
||||
const { standingBookStore: { welfareRQForm } } = this.props;
|
||||
const { dateRange } = this.state;
|
||||
const [startTime, endTime] = dateRange;
|
||||
const payload = {
|
||||
...welfareRQForm.getFormParams(), startTime, endTime
|
||||
};
|
||||
this.props.onSearch(payload);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { standingBookStore: { welfareRQForm } } = this.props;
|
||||
const { conditions } = this.state;
|
||||
return (
|
||||
<div className="salary-welfare-record-query">{this.renderForm(welfareRQForm, conditions)}</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WelfareRecordQuery;
|
||||
|
|
@ -24,8 +24,8 @@ export default class StandingBook extends React.Component {
|
|||
value: "",
|
||||
selectedKey: "0",
|
||||
tableParams: {
|
||||
startTime: moment(new Date()).startOf("year").format("YYYY-MM"),
|
||||
endTime: moment(new Date()).startOf("month").format("YYYY-MM"),
|
||||
startTime: moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
|
||||
paymentOrganization: ""
|
||||
},
|
||||
current: 1,
|
||||
|
|
|
|||
|
|
@ -54,3 +54,85 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//社保福利台账页面重构
|
||||
.salary-welfare-record {
|
||||
min-width: 1000px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.salary-welfare-record-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.salary-welfare-record-query {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.wea-search-group {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
|
||||
.wea-content, .wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.rangePickerBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-select, .ant-select, .ant-select-selection {
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.wea-select .wea-select-input .arrow {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 8px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.wea-select .wdb {
|
||||
word-break: break-all !important;
|
||||
word-wrap: break-word !important;
|
||||
}
|
||||
|
||||
.wea-select .wea-select-input {
|
||||
height: 30px;
|
||||
white-space: nowrap;
|
||||
min-width: 100px;
|
||||
max-width: 345px;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
padding: 4px 17px 4px 4px;
|
||||
position: relative;
|
||||
min-height: 30px;
|
||||
border: 1px solid #d9d9d9;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salary-welfare-record-list {
|
||||
.ant-spin-nested-loading,
|
||||
.ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利台账重构
|
||||
* version: 1.0
|
||||
* Description:
|
||||
* Date: 2024/1/23
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import * as API from "../../../apis/standingBook";
|
||||
import { getCalculateProgress } from "../../../apis/calculate";
|
||||
import WelfareRecordQuery from "./components/welfareRecordQuery";
|
||||
import WelfareRecordList from "./components/welfareRecordList";
|
||||
import Accountdialog from "./components/accountDialog";
|
||||
import ProgressModal from "../../../components/progressModal";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("standingBookStore", "taxAgentStore")
|
||||
@observer
|
||||
class StandingBook extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
queryForm: {
|
||||
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
|
||||
taxAgents: ""
|
||||
}, progressVisible: false, progress: 0,
|
||||
accountDialog: { visible: false, title: "", loading: false, options: [] }
|
||||
};
|
||||
this.wfListRef = null;
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 社保福利台账重构-核算
|
||||
* Params:
|
||||
* Date: 2024/1/23
|
||||
*/
|
||||
handleAccount = async (formVal) => {
|
||||
const { billMonth, ...extra } = formVal;
|
||||
const payload = {
|
||||
billMonth: moment(billMonth).format("YYYY-MM"),
|
||||
...extra
|
||||
};
|
||||
this.setState({ accountDialog: { ...this.state.accountDialog, loading: true } });
|
||||
const { data: creator, status, errormsg } = await API.save(payload);
|
||||
if (status) {
|
||||
this.setState({
|
||||
accountDialog: { ...this.state.accountDialog, loading: false },
|
||||
progressVisible: true
|
||||
}, () => {
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
|
||||
if (status) {
|
||||
if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
this.setState({ progressVisible: false, progress: 0 });
|
||||
message.error(data.message);
|
||||
return;
|
||||
}
|
||||
if (this.state.progress !== 100) {
|
||||
this.setState({
|
||||
progress: (Number(data.progress).toFixed(2)) * 100
|
||||
});
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
this.setState({ progressVisible: false, progress: 0 }, () => {
|
||||
message.success(getLabel(543232, "核算成功"));
|
||||
this.setState({
|
||||
accountDialog: { ...this.state.accountDialog, visible: false }
|
||||
}, () => {
|
||||
this.wfListRef.wrappedInstance.getWelfareRecordList();
|
||||
const calcPayload = { ...payload, creator };
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
clearInterval(this.timer);
|
||||
this.setState({ progressVisible: false, progress: 0 });
|
||||
}
|
||||
}).catch(() => {
|
||||
clearInterval(this.timer);
|
||||
this.setState({ progressVisible: false, progress: 0 });
|
||||
});
|
||||
}, 600);
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
clearInterval(this.timer);
|
||||
this.setState({
|
||||
accountDialog: { ...this.state.accountDialog, loading: false },
|
||||
progressVisible: false, progress: 0
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { accountDialog, queryForm } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const rightBtns = [<Button type="primary" onClick={() => this.setState({
|
||||
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
|
||||
})}>{getLabel(538780, "核算")}</Button>];
|
||||
return (
|
||||
<div className="salary-welfare-record">
|
||||
<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []}>
|
||||
<div className="salary-welfare-record-content">
|
||||
<WelfareRecordQuery
|
||||
onSearch={(payload) => {
|
||||
this.setState({
|
||||
queryForm: { ...queryForm, ...payload }
|
||||
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
|
||||
}}
|
||||
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
|
||||
/>
|
||||
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}/>
|
||||
</div>
|
||||
<Accountdialog {...accountDialog}
|
||||
onCancel={() => this.setState({
|
||||
accountDialog: { ...accountDialog, visible: false, title: "", loading: false }
|
||||
})} onOk={this.handleAccount}
|
||||
/>
|
||||
{/*核算进度条*/}
|
||||
{
|
||||
this.state.progressVisible &&
|
||||
<ProgressModal visible={this.state.progressVisible} progress={this.state.progress}
|
||||
onCancel={() => {
|
||||
this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</WeaTop>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default StandingBook;
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利档案页面重构-高级搜索
|
||||
* Description:
|
||||
* Date: 2023/10/31
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("archivesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { archivesStore: { welfareForm } } = this.props;
|
||||
return (
|
||||
<div className="achrive-advance-search">
|
||||
<WeaInputSearch value={welfareForm.getFormParams().username}
|
||||
onChange={v => welfareForm.updateFields({ username: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(111, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.achrive-advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: -1.5px;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 2px;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
top: 1px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,16 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利档案-操作日志
|
||||
* name:社保福利档案-操作日志
|
||||
* Description:
|
||||
* Date: 2023/10/23
|
||||
* Date: 2023/11/6
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { getAdjustHistoryList } from "../../../../apis/archive";
|
||||
import { getLogSearchsForm, logConditions } from "../config";
|
||||
import { getAdjustHistoryList } from "../../../../../apis/welfareArchive";
|
||||
import { getLogSearchsForm, logConditions } from "../../config";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//重构-社保福利档案
|
||||
.logDialog {
|
||||
.wea-dialog-body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.logDialogContent {
|
||||
background: #F6F6F6;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.wea-search-group {
|
||||
padding: 0;
|
||||
margin-bottom: 10px;
|
||||
background: #FFF;
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logTable {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利档案页面重构-高级搜索面板
|
||||
* Description:
|
||||
* Date: 2023/10/31
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { getSaCondition } from "../../../../../apis/archive";
|
||||
import { getSearchs } from "../../../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("archivesStore")
|
||||
@observer
|
||||
class WelfareAdvanceSearchPannel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
searchConditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
getSaCondition().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
searchConditions: _.map(data.condition, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "departmentIdsStr" || getKey(o) === "positionsStr" || getKey(o) === "subcompanyIdsStr") {
|
||||
return {
|
||||
...o, browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: false,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
icon: "icon-coms-hrm",
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: getKey(o) === "departmentIdsStr" ? "57" : getKey(o) === "positionsStr" ? "278" : "194",
|
||||
viewAttr: 2
|
||||
}
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
const { archivesStore: { welfareForm } } = this.props;
|
||||
welfareForm.initFormFields(this.state.searchConditions);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { searchConditions } = this.state;
|
||||
const { archivesStore: { welfareForm } } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(welfareForm, searchConditions, 2, false)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={() => welfareForm.resetForm()}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WelfareAdvanceSearchPannel;
|
||||
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利档案页面重构-导入
|
||||
* Description:
|
||||
* Date: 2023/11/6
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
|
||||
import ImportDialog from "../../../../../components/importDialog";
|
||||
import { convertToUrlString, getURLParameters } from "../../../../../util/url";
|
||||
import { importBatch } from "../../../../../apis/welfareArchive";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("archivesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/scheme/preview"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { runStatuses, archivesStore: { welfareForm } } = nextProps;
|
||||
const payload = {
|
||||
[runStatuses !== "ext" ? "exportData" : "extWelArchiveList"]: "false",
|
||||
runStatuses, ...welfareForm.getFormParams()
|
||||
};
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...this.state.importDialog,
|
||||
link: `/api/bs/hrmsalary/scheme/template/export?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
importDialog: {
|
||||
nextloading: false, link: "", importResult: {}, imageId: "",
|
||||
previewUrl: "/api/bs/hrmsalary/scheme/preview"
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleImport = (payload) => {
|
||||
const { importDialog } = this.state, { runStatuses: runStatus } = this.props;
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: true } });
|
||||
importBatch({ ...payload, runStatus: runStatus.split(",")[0] }).then(({ data, status }) => {
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: false } });
|
||||
if (status) {
|
||||
this.setState({
|
||||
importDialog: { ...importDialog, ...payload, importResult: data }
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { runStatuses, archivesStore: { welfareForm } } = this.props;
|
||||
const { importDialog } = this.state;
|
||||
const { link } = importDialog;
|
||||
return (
|
||||
<ImportDialog
|
||||
{...this.props} {...importDialog}
|
||||
onResetImportResult={() => this.setState({
|
||||
importDialog: {
|
||||
...importDialog, importResult: {}, imageId: "", link: ""
|
||||
}
|
||||
})}
|
||||
exportDataDom={
|
||||
<WeaCheckbox
|
||||
value={getURLParameters(link)["exportData"] === "true" ? "1" : "0"}
|
||||
content={getLabel(543208, "导出现有数据")}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => {
|
||||
let payload = {
|
||||
exportData: val === "1", runStatuses, ...welfareForm.getFormParams()
|
||||
};
|
||||
runStatuses === "ext" && (payload = { ...payload, extWelArchiveList: true, runStatuses: "" });
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog,
|
||||
link: `/api/bs/hrmsalary/scheme/template/export?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
|
||||
nextUplaodCallback={imageId => this.handleImport({ imageId })}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,322 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利档案页面重构-查看编辑弹框
|
||||
* Description:
|
||||
* Date: 2023/11/6
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import * as API from "../../../../../apis/welfareArchive";
|
||||
import { getTaxAgentSelectList } from "../../../../../apis/taxAgent";
|
||||
import { sysinfo } from "../../../../../apis/ruleconfig";
|
||||
import { getWelfareSearchsForm, welfareConditions } from "../../config";
|
||||
import { getConditionDomkeys, toDecimal_n } from "../../../../../util";
|
||||
import { Button, message, Modal } from "antd";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("archivesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: [], formData: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".salary-welfare-archive").classList.add("zIndex0-welfare-archive");
|
||||
const promise = this.getBaseForm(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
const { archivesStore: { initWelfareProfileForm } } = nextProps;
|
||||
document.querySelector(".salary-welfare-archive").classList.remove("zIndex0-welfare-archive");
|
||||
initWelfareProfileForm();
|
||||
}
|
||||
}
|
||||
|
||||
getBaseForm = async (props) => {
|
||||
const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]);
|
||||
const {
|
||||
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
|
||||
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData,
|
||||
showOperateBtn
|
||||
} = props;
|
||||
let socialComData = {}, fundComData = {}, otherComData = {};
|
||||
if (!_.isNil(socialBase.comItems)) {
|
||||
_.forEach(getConditionDomkeys(socialBase.comItems), o => {
|
||||
socialComData = {
|
||||
...socialComData,
|
||||
[`${o}_com`]: !_.isNil(socialBase.comData) ? socialBase.comData[o] : _.find(socialBase.comItems[0].items, k => getKey(k) === o).min
|
||||
};
|
||||
});
|
||||
}
|
||||
if (!_.isNil(fundBase.comItems)) {
|
||||
_.forEach(getConditionDomkeys(fundBase.comItems), o => {
|
||||
fundComData = {
|
||||
...fundComData,
|
||||
[`${o}_com`]: !_.isNil(fundBase.comData) ? fundBase.comData[o] : _.find(fundBase.comItems[0].items, k => getKey(k) === o).min
|
||||
};
|
||||
});
|
||||
}
|
||||
if (!_.isNil(otherBase.comItems)) {
|
||||
_.forEach(getConditionDomkeys(otherBase.comItems), o => {
|
||||
otherComData = {
|
||||
...otherComData,
|
||||
[`${o}_com`]: !_.isNil(otherBase.comData) ? otherBase.comData[o] : _.find(otherBase.comItems[0].items, k => getKey(k) === o).min
|
||||
};
|
||||
});
|
||||
}
|
||||
const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" };
|
||||
API.getBaseForm(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { data: result } = data;
|
||||
const formData = {
|
||||
...result, ...socialBaseData, ...fundBaseData, ...othersBaseData,
|
||||
...socialBase.data, ...fundBase.data, ...otherBase.data,
|
||||
...socialComData, ...fundComData, ...otherComData,
|
||||
welBaseAutoAdjust: sysInfoData.data.welBaseAutoAdjust === "1"
|
||||
};
|
||||
this.setState({
|
||||
formData,
|
||||
conditions: _.map(welfareConditions, o => {
|
||||
if (o.title === "basic") {
|
||||
return {
|
||||
...o, title: getLabel(542699, "员工基本信息"),
|
||||
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : o.viewAttr,
|
||||
items: _.map(o.items, g => {
|
||||
return { ...g, label: getLabel(g.lanId, g.label) };
|
||||
})
|
||||
};
|
||||
} else if (o.title === "taxAgent") {
|
||||
return {
|
||||
...o, title: getLabel(537996, "个税扣缴义务人"),
|
||||
items: _.map(o.items, g => {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content }))
|
||||
};
|
||||
})
|
||||
};
|
||||
} else if (o.title === "social" || o.title === "fund" || o.title === "others") {
|
||||
const title = o.title === "social" ? getLabel(543194, "社保基础信息") : o.title === "fund" ? getLabel(543197, "公积金基础信息") : getLabel(543198, "其他福利基础信息");
|
||||
return {
|
||||
...o, title,
|
||||
items: _.map(o.items, g => {
|
||||
if (getKey(g) === "socialSchemeId" || getKey(g) === "fundSchemeId" || getKey(g) === "otherSchemeId" || _.lowerCase(getKey(g)).indexOf("take") !== -1) {
|
||||
const key = _.lowerCase(getKey(g)).indexOf("take") !== -1 ? "underTake" : getKey(g);
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr,
|
||||
options: _.find(props[`${o.title}Items`], j => j.domkey[0] === key).options
|
||||
};
|
||||
} else if (getKey(g).indexOf("StartTime") !== -1) {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (formData[o["typename"]][`${o.title}Name`] && showOperateBtn) ? 3 : g.viewAttr
|
||||
};
|
||||
}
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
return {
|
||||
...o, items: _.map(o.items, g => {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
|
||||
};
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
welfareProfileForm.initFormFields(this.state.conditions);
|
||||
_.map(getConditionDomkeys(this.state.conditions), k => {
|
||||
if (k === "paymentOrganization") {
|
||||
welfareProfileForm.updateFields({ [k]: paymentOrganization.toString() });
|
||||
} else if (_.lowerCase(k).indexOf("social") !== -1 || k === "schemeAccount") {
|
||||
welfareProfileForm.updateFields({ [k]: formData["SOCIAL_SECURITY"][k] ? formData["SOCIAL_SECURITY"][k].toString() : "" });
|
||||
} else if (_.lowerCase(k).indexOf("fund") !== -1) {
|
||||
welfareProfileForm.updateFields({ [k]: formData["ACCUMULATION_FUND"][k] ? formData["ACCUMULATION_FUND"][k].toString() : "" });
|
||||
} else if (_.lowerCase(k).indexOf("other") !== -1) {
|
||||
welfareProfileForm.updateFields({ [k]: formData["OTHER"][k] ? formData["OTHER"][k].toString() : "" });
|
||||
} else {
|
||||
welfareProfileForm.updateFields({ [k]: formData[k] || "" });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
covertPayload = (welfareType, underTakeType, paymentForm, paymentComForm) => {
|
||||
const { archivesStore: { welfareProfileForm } } = this.props;
|
||||
const welfareData = welfareProfileForm.getFormParams();
|
||||
const { formData } = this.state;
|
||||
return {
|
||||
baseForm: JSON.stringify({
|
||||
...formData[welfareType], ..._.reduce(_.keys(formData[welfareType]), (pre, cur) => {
|
||||
if (welfareData[cur] || !_.isNil(welfareData[cur])) return { ...pre, [cur]: welfareData[cur] };
|
||||
return { ...pre };
|
||||
}, {}),
|
||||
underTake: welfareData[`${underTakeType}UnderTake`]
|
||||
}),
|
||||
paymentForm: !_.isEmpty(paymentForm) ? JSON.stringify(_.reduce(paymentForm, (pre, cur) => {
|
||||
if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: toDecimal_n(formData[cur], 2).toString() };
|
||||
return { ...pre, [cur]: "0" };
|
||||
}, {})) : "",
|
||||
paymentComForm: !_.isEmpty(paymentComForm) ? JSON.stringify(_.reduce(paymentComForm, (pre, cur) => {
|
||||
if (formData[`${cur}_com`] || formData[`${cur}_com`] === 0) return {
|
||||
...pre,
|
||||
[cur]: toDecimal_n(formData[`${cur}_com`], 2).toString()
|
||||
};
|
||||
return { ...pre, [cur]: "0" };
|
||||
}, {})) : "",
|
||||
welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true
|
||||
};
|
||||
};
|
||||
save = async () => {
|
||||
const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items), getConditionDomkeys(this.props.socialBase.comItems || [])),
|
||||
fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items), getConditionDomkeys(this.props.fundBase.comItems || [])),
|
||||
otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items), getConditionDomkeys(this.props.otherBase.comItems || []));
|
||||
if (!(socailPayload.validate && fundPayload.validate && otherPayload.validate)) {
|
||||
message.warning(getLabel(111, "请维护起始缴纳月!"));
|
||||
return;
|
||||
}
|
||||
this.setState({ loading: true });
|
||||
const [{
|
||||
status: socialStatus,
|
||||
errormsg: socialErrorMsg = "!"
|
||||
}, {
|
||||
status: fundStatus,
|
||||
errormsg: fundErrorMsg = "!"
|
||||
}, {
|
||||
status: otherStatus,
|
||||
errormsg: otherErrorMsg = "!"
|
||||
}] = await Promise.all([API.save(socailPayload), API.save(fundPayload), API.save(otherPayload)]);
|
||||
this.setState({ loading: false });
|
||||
if (socialStatus && fundStatus && otherStatus) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onClose(true);
|
||||
} else {
|
||||
message.error(socialErrorMsg + fundErrorMsg + otherErrorMsg);
|
||||
}
|
||||
};
|
||||
updateFormData = (baseData) => this.setState({ formData: { ...this.state.formData, ...baseData } });
|
||||
handleFormChange = (val) => {
|
||||
const changeKey = _.keys(val)[0], changeVal = val[changeKey].value;
|
||||
const {
|
||||
archivesStore: { setHasBeenModify },
|
||||
onChangeProgramme, employeeId,
|
||||
paymentOrganization, showOperateBtn
|
||||
} = this.props;
|
||||
setHasBeenModify(true);
|
||||
if (changeKey === "socialSchemeId" || changeKey === "fundSchemeId" || changeKey === "otherSchemeId") {
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, o => {
|
||||
if (
|
||||
(o.typename === "SOCIAL_SECURITY" && changeKey === "socialSchemeId") ||
|
||||
(o.typename === "ACCUMULATION_FUND" && changeKey === "fundSchemeId") ||
|
||||
(o.typename === "OTHER" && changeKey === "otherSchemeId")
|
||||
) {
|
||||
return {
|
||||
...o, items: _.map(o.items, g => {
|
||||
if (getKey(g).indexOf("StartTime") !== -1) {
|
||||
return {
|
||||
...g, viewAttr: (changeVal && showOperateBtn) ? 3 : g.viewAttr
|
||||
};
|
||||
}
|
||||
return { ...g };
|
||||
})
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
onChangeProgramme(changeKey.slice(0, changeKey.indexOf("SchemeId")), changeVal, {
|
||||
employeeId,
|
||||
paymentOrganization
|
||||
});
|
||||
}
|
||||
};
|
||||
handleExtraChange = (key, value) => this.setState({ formData: { ...this.state.formData, [key]: value } });
|
||||
handleSameChange = (baseItems, value) => {
|
||||
let newFormDatas = {}, hasCompromise = false;
|
||||
baseItems.forEach((formLabel) => {
|
||||
const { min, max } = formLabel;
|
||||
newFormDatas[getKey(formLabel)] = toDecimal_n(value, 2) || "";
|
||||
if (min !== "0.000" && value !== "" && Number(value) < Number(min)) {
|
||||
hasCompromise = true;
|
||||
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(min), 2);
|
||||
}
|
||||
if (max !== "0.000" && value !== "" && Number(value) > Number(max)) {
|
||||
hasCompromise = true;
|
||||
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(max), 2);
|
||||
}
|
||||
});
|
||||
if (hasCompromise) {
|
||||
message.warning(getLabel("111", "超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。"));
|
||||
}
|
||||
this.setState({ formData: { ...this.state.formData, ...newFormDatas } });
|
||||
};
|
||||
handleNoPaymentChange = (type, value) => this.setState({
|
||||
formData: { ...this.state.formData, [type]: { ...this.state.formData[type], nonPayment: value } }
|
||||
});
|
||||
renderTitle = () => {
|
||||
const { loading } = this.state;
|
||||
const { runStatuses, showOperateBtn } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(543191, "员工福利档案")}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{
|
||||
runStatuses !== "4,5" && showOperateBtn &&
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
handleClose = () => {
|
||||
const { archivesStore: { hasBeenModify }, onClose } = this.props;
|
||||
if (hasBeenModify) {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确定放弃填写吗?放弃后数据将不会被保存!"),
|
||||
onOk: () => {
|
||||
onClose();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
onClose();
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { archivesStore: { welfareProfileForm }, showOperateBtn } = this.props;
|
||||
const { conditions, formData } = this.state;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="salary-welfare-archive-edit-layout" {...this.props}
|
||||
top={0} width={800} height={100} measureT={"%"} measureX={"px"} measureY={"%"}
|
||||
direction={"right"} title={this.renderTitle()} onClose={this.handleClose}
|
||||
content={<div className="salary-welfare-archive-edit-area">
|
||||
{
|
||||
getWelfareSearchsForm(
|
||||
welfareProfileForm, conditions, this.handleFormChange, this.handleNoPaymentChange, this.handleExtraChange,
|
||||
this.handleSameChange, formData, this.props, showOperateBtn
|
||||
)
|
||||
}
|
||||
</div>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,304 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利档案页面重构-列表
|
||||
* Description:
|
||||
* Date: 2023/10/31
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import WelfareEditArchiveSlide from "../welfareEditArchiveSlide";
|
||||
import * as API from "../../../../../apis/welfareArchive";
|
||||
import { welfareTypeEnum } from "../../config";
|
||||
import { getConditionDomkeys, getConditionFields } from "../../../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const APILIST = {
|
||||
runStatuses: API.queryList,
|
||||
ext: API.getExtTable,
|
||||
delToDo: API.updateRunStatus, //删除待办
|
||||
delArchive: API.deleteArchive, //删除档案
|
||||
addToPay: API.stayAddToPay, //增员
|
||||
stayDelToStop: API.stayDelToStop, //减员
|
||||
delToDoStay: API.cancelStayDel, //待减员-删除待办
|
||||
cancelStop: API.cancelStopPayment //停缴员工-取消停缴
|
||||
};
|
||||
|
||||
@inject("archivesStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
welfareEditSlide: { visible: false, employeeId: "", welfareTypeEnum: "", paymentOrganization: "" }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
window.addEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
handleResize = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
window.removeEventListener("resize", this.handleResize, false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if ((nextProps.runStatuses !== this.props.runStatuses) || (nextProps.isQuery !== this.props.isQuery)) {
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
|
||||
}, () => this.getWelfareList(nextProps));
|
||||
}
|
||||
if ((nextProps.runStatuses !== this.props.runStatuses)) {
|
||||
this.setState({
|
||||
dataSource: [], columns: [], loading: false, selectedRowKeys: [],
|
||||
welfareEditSlide: { ...this.state.welfareEditSlide, visible: false }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getWelfareList(this.props);
|
||||
} else if (type === "turn") {
|
||||
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
|
||||
const { runStatuses, showOperateBtn } = this.props;
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, ...params }
|
||||
}, () => this.getWelfareList(this.props));
|
||||
break;
|
||||
case "CHECKBOX":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "EDIT":
|
||||
case "VIEW":
|
||||
const payload = { employeeId, paymentOrganization };
|
||||
const [socialItems, fundItems, othersItems] = await Promise.all([
|
||||
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"] }),
|
||||
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"] }),
|
||||
this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"] })
|
||||
]);
|
||||
this.setState({
|
||||
welfareEditSlide: {
|
||||
...this.state.welfareEditSlide, employeeId, paymentOrganization, runStatuses,
|
||||
socialItems: socialItems.data.items[0].items,
|
||||
socialBaseData: {
|
||||
SOCIAL_SECURITY: { ...socialItems.data.data, socialUnderTake: socialItems.data.data.underTake }
|
||||
},
|
||||
fundItems: fundItems.data.items[0].items,
|
||||
fundBaseData: {
|
||||
ACCUMULATION_FUND: { ...fundItems.data.data, fundUnderTake: fundItems.data.data.underTake }
|
||||
},
|
||||
othersItems: othersItems.data.items[0].items,
|
||||
othersBaseData: { OTHER: { ...othersItems.data.data, otherUnderTake: othersItems.data.data.underTake } }
|
||||
}
|
||||
}, async () => {
|
||||
const { socialBaseData, fundBaseData, othersBaseData } = this.state.welfareEditSlide;
|
||||
const { SOCIAL_SECURITY: { socialSchemeId } } = socialBaseData,
|
||||
{ ACCUMULATION_FUND: { fundSchemeId } } = fundBaseData,
|
||||
{ OTHER: { otherSchemeId } } = othersBaseData;
|
||||
const [socialBase, fundBase, otherBase] = await Promise.all([
|
||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"], schemeId: socialSchemeId }),
|
||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }),
|
||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId })
|
||||
]);
|
||||
this.setState({
|
||||
welfareEditSlide: {
|
||||
...this.state.welfareEditSlide, visible: true, showOperateBtn,
|
||||
socialBase: socialBase.data, fundBase: fundBase.data, otherBase: otherBase.data
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
case "ADD-TO-PAY":
|
||||
case "STAY-DEL-TO-STOP":
|
||||
case "CANCEL-STOP":
|
||||
case "DEL-TO-DO":
|
||||
case "DEL-TO-DO-STAY":
|
||||
const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ?
|
||||
[baseInfo] : { ids: [baseInfo], ...interfaceParams };
|
||||
this.handleWelfareOpts(_.camelCase(id), module);
|
||||
break;
|
||||
case "DEL-ARCHIVE":
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(388758, "确认要删除吗?"),
|
||||
onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo])
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getProfileTypeForm = async (props) => {
|
||||
const { employeeId, paymentOrganization, welfareTypeEnum } = props;
|
||||
const payload = { employeeId, paymentOrganization, welfareTypeEnum };
|
||||
return API.getBaseForm(payload);
|
||||
};
|
||||
getPaymentForm = async (props) => {
|
||||
return API.getPaymentForm({ ...props });
|
||||
};
|
||||
getWelfareList = (props) => {
|
||||
const { pageInfo } = this.state;
|
||||
const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;
|
||||
const params = { ...pageInfo, ...welfareForm.getFormParams() };
|
||||
const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : {
|
||||
...params,
|
||||
runStatuses: runStatuses.split(",")
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
APILIST[runStatuses === "ext" ? "ext" : "runStatuses"](payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
columns: _.map(columns, o => {
|
||||
const { column: dataIndex, text: title, width, fixed } = o;
|
||||
if (dataIndex === "employeeName") {
|
||||
return {
|
||||
dataIndex, title, width, fixed: "left", ellipsis: true
|
||||
};
|
||||
}
|
||||
return {
|
||||
dataIndex, title, width, ellipsis: true, fixed: fixed || false
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
const { pageInfo, selectedRowKeys, columns, dataSource } = this.state;
|
||||
onChangeTopTabCount(runStatuses, total);
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, runStatuses,
|
||||
columns, showOperateBtn
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:批量操作
|
||||
* Params:
|
||||
* Date: 2023/11/3
|
||||
*/
|
||||
handleBatchOpt = (type, payload) => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据"));
|
||||
return;
|
||||
}
|
||||
const params = _.isNil(payload) ? selectedRowKeys : { ids: selectedRowKeys, ...payload };
|
||||
this.handleWelfareOpts(type, params);
|
||||
};
|
||||
handleWelfareOpts = (type, payload) => {
|
||||
WeaLoadingGlobal.start();
|
||||
APILIST[type](payload).then(({ status, data = {}, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { msg, type } = data;
|
||||
if (type === "fail") {
|
||||
message.error(msg);
|
||||
} else if (type === "success") {
|
||||
message.success(msg);
|
||||
this.getWelfareList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
} else {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.getWelfareList(this.props);
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "编辑": getLabel(501169, "编辑"),
|
||||
"增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"),
|
||||
"删除待办": getLabel(543181, "删除待办"), "减员": getLabel(543182, "减员"),
|
||||
"查看": getLabel(33564, "查看"), "取消停缴": getLabel(543183, "取消停缴"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
handleChangeProgramme = (type, schemeId, payload) => {
|
||||
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId })
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { data: defVal, items, comData, comItems } = data;
|
||||
this.setState({
|
||||
welfareEditSlide: { ...this.state.welfareEditSlide, [`${type}Base`]: data }
|
||||
}, () => {
|
||||
const perData = _.reduce(getConditionDomkeys(items), (pre, cur) => {
|
||||
const minNum = !_.isNil(getConditionFields(items)[cur].min) ? Number(getConditionFields(items)[cur].min) : undefined,
|
||||
maxNum = !_.isNil(getConditionFields(items)[cur].max) ? Number(getConditionFields(items)[cur].max) : undefined;
|
||||
const val = !_.isNil(defVal) ? Number(defVal[cur]) : 0;
|
||||
return {
|
||||
...pre,
|
||||
[cur]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
|
||||
};
|
||||
}, {});
|
||||
if (!_.isNil(comItems)) {
|
||||
const comDataTmpv = _.reduce(getConditionDomkeys(comItems), (pre, cur) => {
|
||||
const minNum = !_.isNil(getConditionFields(comItems)[cur].min) ? Number(getConditionFields(comItems)[cur].min) : undefined,
|
||||
maxNum = !_.isNil(getConditionFields(comItems)[cur].max) ? Number(getConditionFields(comItems)[cur].max) : undefined;
|
||||
const val = !_.isNil(comData) ? Number(comData[cur]) : 0;
|
||||
return {
|
||||
...pre,
|
||||
[`${cur}_com`]: (val < minNum && !!minNum) ? minNum : (val > maxNum && !!maxNum) ? maxNum : val
|
||||
};
|
||||
}, {});
|
||||
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData, ...comDataTmpv });
|
||||
return;
|
||||
}
|
||||
this.archiveSlideRef.wrappedInstance.updateFormData({ ...perData });
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource, welfareEditSlide } = this.state;
|
||||
const dom = document.querySelector(".wea-new-top-req-content");
|
||||
let height = 280;
|
||||
if (dom && dataSource.length > 0) {
|
||||
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 170;
|
||||
}
|
||||
return (
|
||||
<div className="table-layout" style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/welfareArchiveTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/welfareArchiveTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
{/* 编辑查看员工福利档案*/}
|
||||
<WelfareEditArchiveSlide {...welfareEditSlide} ref={dom => this.archiveSlideRef = dom}
|
||||
onClose={(isFresh) => this.setState({
|
||||
welfareEditSlide: { ...welfareEditSlide, visible: false }
|
||||
}, () => isFresh && this.getWelfareList(this.props))}
|
||||
onChangeProgramme={this.handleChangeProgramme}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利档案页面重构-小提示
|
||||
* Description:
|
||||
* Date: 2023/10/31
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { dataSource } = this.props;
|
||||
return (
|
||||
<div className="tip-info-area">
|
||||
<div className="title">{getLabel(543177, "小提示")}</div>
|
||||
<div className="tip-detail">
|
||||
{
|
||||
_.map(dataSource, item => (<div className="tip-item">{getLabel(item.lanId, item.title)}</div>))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
||||
export const HelpfulDiv = () => {
|
||||
return <div className="helpWrapper">
|
||||
<span>{getLabel(544362, "1、缴纳月份区间包含起始缴纳月,不包含最后缴纳月;")}</span>
|
||||
<span>{getLabel(544365, "2、维护的所有的最后缴纳月都大于当前月,则该待办数据自动清除,不显示在待减员列表;")}</span>
|
||||
<span>{getLabel(544366, "3、减员失败情况:①有起始缴纳月却未维护最后缴纳月;②员工存在未归档的核算数据;")}</span>
|
||||
</div>;
|
||||
};
|
||||
|
||||
export const CancelHelpfulDiv = () => {
|
||||
return <div className="helpWrapper">
|
||||
<span>{getLabel(544362, "1、缴纳月份区间包含起始缴纳月,不包含最后缴纳月;")}</span>
|
||||
<span>{getLabel(544363, "2、若员工当前不在停缴档案的个税扣缴义务人下,则不可取消停缴;")}</span>
|
||||
<span>{getLabel(544364, "3、若员工当前在其他个税扣缴义务人下正在缴纳,也不可取消停缴;")}</span>
|
||||
</div>;
|
||||
};
|
||||
|
|
@ -0,0 +1,811 @@
|
|||
import React from "react";
|
||||
import {
|
||||
WeaCheckbox,
|
||||
WeaFormItem,
|
||||
WeaHelpfulTip,
|
||||
WeaInputNumber,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaTools
|
||||
} from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { Button } from "antd";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import { CancelHelpfulDiv, HelpfulDiv } from "./components/welfareTip";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
//批量操作列表
|
||||
export const welfareTypeEnum = {
|
||||
social: "SOCIAL_SECURITY",
|
||||
fund: "ACCUMULATION_FUND",
|
||||
other: "OTHER"
|
||||
};
|
||||
export const optTypeEnum = [
|
||||
//批量增员
|
||||
{
|
||||
key: "batchStaffIncrease",
|
||||
type: "addToPay",
|
||||
payload: null
|
||||
},
|
||||
// 待增员-批量删除待办
|
||||
{
|
||||
key: "batchDeleteTodolist",
|
||||
type: "delToDo",
|
||||
payload: { runStatus: "4" }
|
||||
},
|
||||
// 待减员-批量删除待办
|
||||
{
|
||||
key: "batchDeleteTodolistStayDel",
|
||||
type: "delToDoStay",
|
||||
payload: { runStatus: "3" }
|
||||
},
|
||||
//批量减员
|
||||
{
|
||||
key: "batchReduction",
|
||||
type: "stayDelToStop",
|
||||
payload: null
|
||||
},
|
||||
//批量取消停缴
|
||||
{
|
||||
key: "batchCancellationOfSuspended",
|
||||
type: "cancelStop",
|
||||
payload: null
|
||||
}
|
||||
];
|
||||
export const tabList = [
|
||||
{ viewcondition: "1", title: getLabel(542711, "待增员"), showcount: true, groupid: "stayAdd" },
|
||||
{ viewcondition: "2,3", title: getLabel(542504, "在缴员工"), showcount: true, groupid: "paying" },
|
||||
{ viewcondition: "3", title: getLabel(542713, "待减员"), showcount: true, groupid: "stayDel" },
|
||||
{ viewcondition: "4,5", title: getLabel(542505, "停缴员工"), showcount: true, groupid: "stopPay" },
|
||||
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "ext" }
|
||||
];
|
||||
export const welfareTipList = [
|
||||
{
|
||||
viewcondition: "1",
|
||||
list: [
|
||||
{
|
||||
lanId: 544349,
|
||||
title: "1、个税扣缴义务人变更进入【待增员】的,保留所有最新版本数据;若修改了数据再增员则修改的数据作为新版本保存;"
|
||||
},
|
||||
{
|
||||
lanId: 544350,
|
||||
title: "2、维护好员工的社保福利档案数据后,点击【增员】,数据会进入【在缴员工】;"
|
||||
},
|
||||
{
|
||||
lanId: 544351,
|
||||
title: "3、若不需给该员工缴纳,可点击【删除待办】进入【停缴员工】;进入【停缴员工】后,可以点击【取消停缴】再次进入【待增员】;"
|
||||
},
|
||||
{
|
||||
lanId: 544352,
|
||||
title: "4、不管起始缴纳月维护到哪个月,都可以进行增员,不影响核算判断;若维护了最后缴纳月,且小于等于当前月,则增员失败;"
|
||||
},
|
||||
{
|
||||
lanId: 544353,
|
||||
title: "5、增员失败情况:①终止缴纳月小于等于当前月;②方案或起始缴纳月未维护;"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
viewcondition: "2,3",
|
||||
list: [
|
||||
{
|
||||
lanId: 544358,
|
||||
title: "1、需缴纳社保福利的员工维护在【在缴员工】;"
|
||||
},
|
||||
{
|
||||
lanId: 544359,
|
||||
title: "2、可使用更新导入,调整档案数据;"
|
||||
},
|
||||
{
|
||||
lanId: 544360,
|
||||
title: "3、若维护了最后缴纳月且小于等于当前月,则自动进入【待减员】;"
|
||||
},
|
||||
{
|
||||
lanId: 544361,
|
||||
title: "4、核算人员范围为,【在缴员工】中的起始缴纳月和最后缴纳月区间包含当前月的人员;"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
viewcondition: "3",
|
||||
list: [
|
||||
{
|
||||
lanId: 544355,
|
||||
title: "1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;"
|
||||
},
|
||||
{
|
||||
lanId: 544356,
|
||||
title: "2、【待减员】为是否不再缴纳的待办状态,数据是从【在缴员工】中复制的,若不处理列表中的待办数据,也不影响社保福利核算;【待减员】维护的数据和【在缴员工】数据是同步的;"
|
||||
},
|
||||
{
|
||||
lanId: 544357,
|
||||
title: "3、点击【减员】前先维护最后缴纳月,所有有起始缴纳月的福利项的最后缴纳月都小于等于当前月且无未归档的核算数据的档案才能减员成功,减员成功后数据进入【停缴员工】;"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
viewcondition: "4,5",
|
||||
list: [
|
||||
{
|
||||
lanId: 544354,
|
||||
title: "1、不需要缴纳社保福利的员工,保存在【停缴员工】;"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
viewcondition: "ext",
|
||||
list: []
|
||||
}
|
||||
];
|
||||
export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
|
||||
let menus = [{
|
||||
key: "log",
|
||||
icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(111, "操作日志")
|
||||
}];
|
||||
if (showOperateBtn) {
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
menus = [
|
||||
{
|
||||
key: "fullStaffIncrease",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543185, "全量增员")
|
||||
},
|
||||
{
|
||||
key: "batchStaffIncrease",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543187, "批量增员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolist",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "2,3":
|
||||
menus = [
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "3":
|
||||
menus = [
|
||||
{
|
||||
key: "fullReduction",
|
||||
icon: <i className="iconfont icon-quanbu"/>,
|
||||
content: getLabel(543189, "全量减员")
|
||||
},
|
||||
{
|
||||
key: "batchReduction",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543188, "批量减员")
|
||||
},
|
||||
{
|
||||
key: "batchDeleteTodolistStayDel",
|
||||
icon: <i className="iconfont icon-piliangshanchu"/>,
|
||||
content: getLabel(543186, "批量删除待办")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
case "4,5":
|
||||
menus = [
|
||||
{
|
||||
key: "batchCancellationOfSuspended",
|
||||
icon: <i className="iconfont icon-piliangcaozuo"/>,
|
||||
content: getLabel(543190, "批量取消停缴")
|
||||
},
|
||||
{
|
||||
key: "exportAll",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(81272, "导出全部")
|
||||
},
|
||||
{
|
||||
key: "exportSelected",
|
||||
icon: <i className="iconfont icon-piliangdaochu"/>,
|
||||
content: getLabel(512938, "导出选中")
|
||||
},
|
||||
...menus
|
||||
];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return menus;
|
||||
};
|
||||
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport, showOperateBtn) => {
|
||||
let reqBtns = showOperateBtn ? [
|
||||
<Button type="primary" onClick={onImport}>{getLabel(32935, "导入")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>
|
||||
] : [<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>];
|
||||
if (showOperateBtn) {
|
||||
switch (selectedKey) {
|
||||
case "1":
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={
|
||||
<span>
|
||||
{getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")}
|
||||
</span>
|
||||
}
|
||||
/>);
|
||||
break;
|
||||
case "3":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={HelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
case "4,5":
|
||||
reqBtns.shift();
|
||||
reqBtns.unshift(<WeaHelpfulTip
|
||||
width={300} placement="topLeft"
|
||||
title={CancelHelpfulDiv}
|
||||
/>);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return reqBtns;
|
||||
};
|
||||
export const logConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: true,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "1"
|
||||
},
|
||||
domkey: ["employeeId"],
|
||||
fieldcol: 17,
|
||||
label: "对象",
|
||||
lanId: 106,
|
||||
labelcol: 7,
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: true,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "",
|
||||
type: "1"
|
||||
},
|
||||
domkey: ["operator"],
|
||||
fieldcol: 17,
|
||||
label: "操作人",
|
||||
lanId: 111,
|
||||
labelcol: 7,
|
||||
value: ""
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && condition && condition.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
||||
{
|
||||
getKey(fields) === "operator" &&
|
||||
<Button type="primary" onClick={onSearch}
|
||||
style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
|
||||
/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
export const welfareConditions = [
|
||||
{
|
||||
defaultshow: true,
|
||||
title: "basic",
|
||||
col: 3,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["username"],
|
||||
fieldcol: 14,
|
||||
label: "姓名",
|
||||
lanId: 25034,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["department"],
|
||||
fieldcol: 14,
|
||||
label: "部门",
|
||||
lanId: 27511,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["position"],
|
||||
fieldcol: 14,
|
||||
label: "岗位",
|
||||
lanId: 6086,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["telephone"],
|
||||
fieldcol: 14,
|
||||
label: "手机号",
|
||||
lanId: 125238,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["hiredate"],
|
||||
fieldcol: 14,
|
||||
label: "入职日期",
|
||||
lanId: 1516,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true,
|
||||
title: "taxAgent",
|
||||
col: 1,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["paymentOrganization"],
|
||||
fieldcol: 16,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 537996,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true,
|
||||
title: "social", typename: "SOCIAL_SECURITY",
|
||||
col: 2, showPaid: true,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["socialSchemeId"],
|
||||
fieldcol: 14,
|
||||
label: "社保方案名称",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["socialUnderTake"],
|
||||
fieldcol: 14,
|
||||
label: "社保个人实际承担方",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["socialStartTime"],
|
||||
fieldcol: 14,
|
||||
label: "社保起始缴纳月",
|
||||
lanId: 542507,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["schemeAccount"],
|
||||
fieldcol: 14,
|
||||
label: "社保账号",
|
||||
lanId: 81594,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["socialEndTime"],
|
||||
fieldcol: 14,
|
||||
label: "社保最后缴纳月",
|
||||
lanId: 542508,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true,
|
||||
title: "fund", typename: "ACCUMULATION_FUND",
|
||||
col: 2, showPaid: true,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["fundSchemeId"],
|
||||
fieldcol: 14,
|
||||
label: "公积金方案名称",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["fundUnderTake"],
|
||||
fieldcol: 14,
|
||||
label: "公积金个人实际承担方",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["fundStartTime"],
|
||||
fieldcol: 14,
|
||||
label: "公积金起始缴纳月",
|
||||
lanId: 542509,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["fundAccount"],
|
||||
fieldcol: 14,
|
||||
label: "公积金账号",
|
||||
lanId: 542268,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["fundEndTime"],
|
||||
fieldcol: 14,
|
||||
label: "公积金最后缴纳月",
|
||||
lanId: 542510,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["supplementFundAccount"],
|
||||
fieldcol: 14,
|
||||
label: "补充公积金账号",
|
||||
lanId: 542270,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
defaultshow: true,
|
||||
title: "others", typename: "OTHER",
|
||||
col: 2, showPaid: true,
|
||||
items: [
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["otherSchemeId"],
|
||||
fieldcol: 14,
|
||||
label: "其它福利名称",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "SELECT",
|
||||
domkey: ["otherUnderTake"],
|
||||
fieldcol: 14,
|
||||
label: "其它福利个人实际承担方",
|
||||
lanId: 111,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["otherStartTime"],
|
||||
fieldcol: 14,
|
||||
label: "其他福利起始缴纳月",
|
||||
lanId: 542511,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
colSpan: 3,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["otherEndTime"],
|
||||
fieldcol: 14,
|
||||
label: "其他福利最后缴纳月",
|
||||
lanId: 542512,
|
||||
labelcol: 10,
|
||||
value: "",
|
||||
options: [],
|
||||
viewAttr: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
export const getWelfareSearchsForm = (
|
||||
form, condition, onChange = () => void (0),
|
||||
onNoPaymentChange = () => void (0), onExtraChange = () => void (0), onSameChange = () => void (0),
|
||||
payload, extraFormField, showOperateBtn) => {
|
||||
const CustomComponent = ({ type }) => {
|
||||
const value = payload[type].nonPayment ? payload[type].nonPayment.toString() : "";
|
||||
return <WeaCheckbox
|
||||
value={value} content={getLabel(543196, "暂不缴纳")}
|
||||
onChange={v => onNoPaymentChange(type, v)}
|
||||
disabled={runStatuses === "4,5" || !showOperateBtn}
|
||||
/>;
|
||||
};
|
||||
const { socialBase, fundBase, otherBase, runStatuses } = extraFormField;
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && condition && condition.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={onChange}/>
|
||||
</WeaFormItem>),
|
||||
colSpan: 1,
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
!_.isEmpty(items) && group.push(
|
||||
<WeaSearchGroup col={c.col} needTigger={true} showGroup={c.defaultshow} items={items} center={false}
|
||||
title={c.title}
|
||||
customComponent={c.showPaid ? <CustomComponent type={c.typename}/> : <span></span>}
|
||||
className={c.col === 3 ? "basic-welfare-info-wrapper" : (c.col === 2 || c.items.length > 1) ? "twoColumns-welfare-info-wrapper" : ""}
|
||||
/>);
|
||||
});
|
||||
return _.reduce(group, (pre, cur) => {
|
||||
if (cur.props.title === getLabel(543194, "社保基础信息") && _.every(socialBase.items, o => o.items.length > 0)) {
|
||||
if (!_.isNil(socialBase.comItems) && _.every(socialBase.comItems, o => o.items.length > 0)) {
|
||||
return [
|
||||
...pre, cur,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(socialBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(socialBase.comItems, o => ({
|
||||
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||
}))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>
|
||||
];
|
||||
} else {
|
||||
return [...pre, cur,
|
||||
<BenefitBaseComponent dataSource={socialBase.items} value={payload}
|
||||
onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>];
|
||||
}
|
||||
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
|
||||
if (!_.isNil(fundBase.comItems) && _.every(fundBase.comItems, o => o.items.length > 0)) {
|
||||
return [
|
||||
...pre, cur,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(fundBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(fundBase.comItems, o => ({
|
||||
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||
}))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>
|
||||
];
|
||||
} else {
|
||||
return [...pre, cur,
|
||||
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
|
||||
onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>];
|
||||
}
|
||||
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
|
||||
if (!_.isNil(otherBase.comItems) && _.every(otherBase.comItems, o => o.items.length > 0)) {
|
||||
return [
|
||||
...pre, cur,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(otherBase.items, o => ({ ...o, title: `${o.title}(${getLabel(500201, "个人")})` }))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>,
|
||||
<BenefitBaseComponent
|
||||
dataSource={_.map(otherBase.comItems, o => ({
|
||||
...o, title: `${o.title}(${getLabel(1851, "公司")})`,
|
||||
items: _.map(o.items, g => ({ ...g, domkey: [`${getKey(g)}_com`] }))
|
||||
}))}
|
||||
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>
|
||||
];
|
||||
} else {
|
||||
return [...pre, cur,
|
||||
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
|
||||
onSameChange={onSameChange} runStatuses={runStatuses}
|
||||
showOperateBtn={showOperateBtn}
|
||||
/>];
|
||||
}
|
||||
}
|
||||
return [...pre, cur];
|
||||
}, []);
|
||||
};
|
||||
|
||||
const BenefitBaseComponent = (props) => {
|
||||
const { dataSource, value, onChange, onSameChange, runStatuses, showOperateBtn } = props;
|
||||
return <React.Fragment>
|
||||
{
|
||||
_.map(dataSource, item => {
|
||||
const { title, items } = item;
|
||||
return <WeaSearchGroup
|
||||
items={_.map(items, child => ({
|
||||
com: <WeaFormItem label={child.label} labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
|
||||
<WeaInputNumber
|
||||
value={value[getKey(child)] || (child.min !== "0.000" ? child.min : 0)} precision={2}
|
||||
min={(child.min !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.min) : -999999999999999}
|
||||
max={(child.max !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.max) : 999999999999999}
|
||||
onChange={v => onChange(getKey(child), v)}
|
||||
viewAttr={(runStatuses === "4,5" || !showOperateBtn) ? 1 : 2}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
}))}
|
||||
customComponent={<div className="welfare-same-box">
|
||||
<span>{getLabel(543195, "各项福利基数一致")}</span>
|
||||
<WeaInputNumber style={{ width: 100 }} onBlur={v => onSameChange(items, v)}
|
||||
disabled={runStatuses === "4,5" || !showOperateBtn}/>
|
||||
</div>}
|
||||
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
|
||||
/>;
|
||||
})
|
||||
}
|
||||
</React.Fragment>;
|
||||
};
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利档案页面重构
|
||||
* Description:
|
||||
* Date: 2023/10/31
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaTab } from "ecCom";
|
||||
import { message } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import WelfareAdvanceSearchPannel from "./components/welfareAdvanceSearchPannel";
|
||||
import WelfareTableList from "./components/welfareTableList";
|
||||
import WelfareArchivesImportDialog from "./components/welfareArchivesImportDialog";
|
||||
import WelfareTip from "./components/welfareTip";
|
||||
import LogDialog from "./components/logDialog";
|
||||
import * as API from "../../../apis/welfareArchive";
|
||||
import { sysinfo } from "../../../apis/ruleconfig";
|
||||
import { optTypeEnum, renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const APILIST = {
|
||||
fullStaffIncrease: API.allStayAddToPay,
|
||||
fullReduction: API.allStayDelToStop
|
||||
};
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "1", showSearchAd: false, isQuery: false, logDialogVisible: false,
|
||||
topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 },
|
||||
welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" },
|
||||
showExtEmpsWitch: false
|
||||
};
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
// extEmpsWitch //非系统人员开关, 1: 开启, 0:关闭
|
||||
const [{ data: { extEmpsWitch } }] = await Promise.all([sysinfo()]);
|
||||
this.setState({ showExtEmpsWitch: extEmpsWitch === "1" });
|
||||
}
|
||||
|
||||
queryInsuranceTabTotal = (active, total) => {
|
||||
API.queryInsuranceTabTotal().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const key = _.find(tabList, o => o.viewcondition === active).groupid;
|
||||
this.setState({
|
||||
topTabCount: { ...this.state.topTabCount, ...data, [key]: total }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
|
||||
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
|
||||
handleImport = () => {
|
||||
this.setState({
|
||||
welfareImpDialog: {
|
||||
...this.state.welfareImpDialog, visible: true,
|
||||
runStatuses: this.state.selectedKey
|
||||
}
|
||||
});
|
||||
};
|
||||
onDropMenuClick = (key) => {
|
||||
switch (key) {
|
||||
case "fullStaffIncrease":
|
||||
case "fullReduction":
|
||||
this.handleFullOptions(key);
|
||||
break;
|
||||
case "batchStaffIncrease":
|
||||
case "batchDeleteTodolist":
|
||||
case "batchReduction":
|
||||
case "batchCancellationOfSuspended":
|
||||
case "batchDeleteTodolistStayDel":
|
||||
const type = _.find(optTypeEnum, o => o.key === key).type;
|
||||
const payload = _.find(optTypeEnum, o => o.key === key).payload;
|
||||
this.welfareListRef.wrappedInstance.handleBatchOpt(type, payload);
|
||||
break;
|
||||
case "exportAll":
|
||||
case "exportSelected":
|
||||
this.handleExport(key);
|
||||
break;
|
||||
case "log":
|
||||
this.setState({ logDialogVisible: true });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
|
||||
handleFullOptions = (key) => {
|
||||
WeaLoadingGlobal.start();
|
||||
APILIST[key]().then(({ status, data, errormsg }) => {
|
||||
WeaLoadingGlobal.destroy();
|
||||
if (status) {
|
||||
const { type, msg } = data;
|
||||
if (type === "fail") {
|
||||
message.error(msg);
|
||||
} else {
|
||||
message.success(msg);
|
||||
this.onAdSearch();
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => WeaLoadingGlobal.destroy());
|
||||
};
|
||||
handleExport = (key) => {
|
||||
const {
|
||||
state: { selectedRowKeys },
|
||||
props: { archivesStore: { welfareForm } }
|
||||
} = this.welfareListRef.wrappedInstance,
|
||||
{ selectedKey: runStatuses } = this.state;
|
||||
let payload = { runStatuses };
|
||||
if (key.indexOf("Selected") !== -1 && _.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(543303, "请选择表格数据"));
|
||||
return;
|
||||
}
|
||||
payload = { ...payload, ids: selectedRowKeys.join(",") };
|
||||
key.indexOf("Selected") === -1 && (payload = { ...payload, ids: "", ...welfareForm.getFormParams() });
|
||||
window.open(`/api/bs/hrmsalary/scheme/export?${convertToUrlString(payload)}`, "_blank");
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
selectedKey, topTabCount, showSearchAd, isQuery,
|
||||
logDialogVisible, welfareImpDialog, showExtEmpsWitch
|
||||
} = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
|
||||
return (
|
||||
<div className="salary-welfare-archive">
|
||||
<WeaReqTop
|
||||
title={getLabel(538001, "社保福利档案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel, showOperateBtn)}
|
||||
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport, showOperateBtn)}
|
||||
replaceTab={
|
||||
<WeaTab
|
||||
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
|
||||
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
|
||||
onChange={key => this.setState({ selectedKey: key })}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<div className="salary-welfare-archive-content">
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<WelfareAdvanceSearchPannel
|
||||
onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={this.onAdSearch}
|
||||
/>
|
||||
</div>
|
||||
{/*列表*/}
|
||||
<WelfareTableList isQuery={isQuery} ref={dom => this.welfareListRef = dom}
|
||||
runStatuses={selectedKey} showOperateBtn={showOperateBtn}
|
||||
onChangeTopTabCount={this.queryInsuranceTabTotal}
|
||||
/>
|
||||
{/*提示*/}
|
||||
{!_.isEmpty(tipList) && <WelfareTip dataSource={tipList}/>}
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
{/* 导入*/}
|
||||
<WelfareArchivesImportDialog {...welfareImpDialog}
|
||||
onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
isQuery: isFresh ? !isQuery : isQuery,
|
||||
welfareImpDialog: {
|
||||
...this.state.welfareImpDialog, visible: false,
|
||||
runStatuses: ""
|
||||
}
|
||||
});
|
||||
}}/>
|
||||
</div>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
.zIndex0-welfare-archive {
|
||||
.wea-new-top-req {
|
||||
z-index: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.salary-welfare-archive {
|
||||
min-width: 1000px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-top-req-title > div:first-child > div > div {
|
||||
padding-left: 0 !important;
|
||||
|
||||
.wea-tab {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.salary-welfare-archive-content {
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.table-layout {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 320px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tip-info-area {
|
||||
margin-top: 16px;
|
||||
width: 100%;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.tip-detail {
|
||||
padding: 16px;
|
||||
background: #fff;
|
||||
|
||||
.tip-item {
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salary-welfare-archive-edit-layout {
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-slide-modal-title {
|
||||
border-bottom: 1px solid #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
|
||||
.salary-welfare-archive-edit-area {
|
||||
background: #f6f6f6;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 16px;
|
||||
|
||||
.basic-welfare-info-wrapper {
|
||||
.wea-form-cell-wrapper {
|
||||
.wea-field-readonly {
|
||||
vertical-align: bottom;
|
||||
|
||||
span.child-item {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 125px;
|
||||
}
|
||||
}
|
||||
|
||||
& > div:nth-child(1), & > div:nth-child(2) {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(3) {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(4), & > div:nth-child(5) {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.twoColumns-welfare-info-wrapper {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:nth-child(1), & > div:nth-child(3) {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(2), & > div:nth-child(4) {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
& > div:nth-child(5) {
|
||||
border-right: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group, .wea-form-cell {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 5px 16px;
|
||||
|
||||
.wea-form-item-label {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-form-cell-wrapper {
|
||||
background: #FFF;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.welfare-same-box {
|
||||
& > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利方案页面重构-高级搜索
|
||||
* Description:
|
||||
* Date: 2024/2/2
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { programmeStore: { planSearchForm } } = this.props;
|
||||
return (
|
||||
<div className="achrive-advance-search">
|
||||
<WeaInputSearch value={planSearchForm.getFormParams().schemeName}
|
||||
onChange={v => planSearchForm.updateFields({ schemeName: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(545754, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.achrive-advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: -1.5px;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 2px;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
top: 1px;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保福利方案页面重构-高级搜索面板
|
||||
* Description:
|
||||
* Date: 2024/2/2
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { getSearchs } from "../../../../../util";
|
||||
import { searchConditons } from "../../config";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
class WelfarePlanAdvanceSearchPannel extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
const { programmeStore: { planSearchForm } } = this.props;
|
||||
planSearchForm.initFormFields(searchConditons);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { programmeStore: { planSearchForm } } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(planSearchForm, searchConditons, 2, false)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={() => planSearchForm.resetForm()}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WelfarePlanAdvanceSearchPannel;
|
||||
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利方案重构-复制
|
||||
* Description:
|
||||
* Date: 2024/2/4
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import * as API from "../../../../../apis/welfareScheme";
|
||||
import { getSearchs } from "../../../../../util";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCopyForm();
|
||||
}
|
||||
|
||||
|
||||
save = () => {
|
||||
const { programmeStore: { planCopyForm }, copyId: id, selectedKey } = this.props;
|
||||
planCopyForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.setState({ loading: true });
|
||||
API.copyScheme({ id, schemeName: planCopyForm.getFormDatas()[`${selectedKey}_schemeName`].value })
|
||||
.then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { programmeStore: { planCopyForm }, conditions } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 46 }} initLoadCss
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(planCopyForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 社保福利方案-自定义福利新建编辑
|
||||
* Description:
|
||||
* Date: 2024/2/4
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import * as API from "../../../../../apis/welfareScheme";
|
||||
import { getConditionDomkeys, getSearchs } from "../../../../../util";
|
||||
import { customPlanConditons } from "../../config";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getCustomCategoryForm(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCustomForm();
|
||||
}
|
||||
|
||||
getCustomCategoryForm = (props) => {
|
||||
API.getCustomCategoryForm({ id: props.customId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { form } = data;
|
||||
this.setState({
|
||||
conditions: _.map(customPlanConditons, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "welfareType" && props.customId) {
|
||||
return { ...o, viewAttr: 1 };
|
||||
} else {
|
||||
return { ...o, viewAttr: props.showOperateBtn ? o.viewAttr : 1 };
|
||||
}
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
const { programmeStore: { planCustomForm } } = props;
|
||||
planCustomForm.initFormFields(this.state.conditions);
|
||||
_.forEach(getConditionDomkeys(this.state.conditions), k => {
|
||||
if (k === "paymentScope" && props.customId && form[k]) {
|
||||
planCustomForm.updateFields({ [k]: { value: form[k].join(",") } });
|
||||
} else {
|
||||
planCustomForm.updateFields({ [k]: { value: form[k] || "" } });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { programmeStore: { planCustomForm }, customId: id, selectedKey } = this.props;
|
||||
planCustomForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.setState({ loading: true });
|
||||
const payload = {
|
||||
id, ...planCustomForm.getFormParams(),
|
||||
paymentScope: planCustomForm.getFormParams().paymentScope.split(",")
|
||||
};
|
||||
API[!id ? "createSICategory" : "updateCustomCategory"](payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.props.onCancel(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, conditions } = this.state;
|
||||
const { programmeStore: { planCustomForm }, showOperateBtn } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
|
||||
buttons={showOperateBtn ? [
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
] : []}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(planCustomForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:社保方案页面重构-社保方案编辑与查看
|
||||
* Description:
|
||||
* Date: 2024/2/5
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } from "ecCom";
|
||||
import PlanSetTable from "./planSetTable";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import * as API from "../../../../../apis/welfareScheme";
|
||||
import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent";
|
||||
import { getConditionDomkeys, getSearchs } from "../../../../../util";
|
||||
import { planConditons } from "../../config";
|
||||
import cs from "classnames";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("programmeStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, conditions: [], selectedKey: "2", planDatas: []
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".salary-welfare-plan-wrapper").classList.add("zIndex0-welfare-plan");
|
||||
const promise = this.getForm(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
document.querySelector(".salary-welfare-plan-wrapper").classList.remove("zIndex0-welfare-plan");
|
||||
nextProps.programmeStore.initPlanForm();
|
||||
this.setState({ loading: false, conditions: [], selectedKey: "2", planDatas: [] });
|
||||
}
|
||||
}
|
||||
|
||||
getForm = async (props) => {
|
||||
const { data: result } = await getTaxAgentSelectListAsAdmin();
|
||||
const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props;
|
||||
API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { form: { schemeBatch, schemeDetailList } } = data;
|
||||
this.setState({
|
||||
planDatas: schemeDetailList,
|
||||
conditions: _.map(planConditons, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return {
|
||||
...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]),
|
||||
viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1,
|
||||
options: _.map(result, k => ({ key: k.id, showname: k.content }))
|
||||
};
|
||||
}
|
||||
return { ...o, viewAttr: showOperateBtn ? o.viewAttr : 1 };
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
planForm.initFormFields(this.state.conditions);
|
||||
_.map(getConditionDomkeys(this.state.conditions), k => {
|
||||
if (k === "sharedType") {
|
||||
planForm.updateFields({ [k]: schemeBatch[k] || "0" });
|
||||
} else {
|
||||
planForm.updateFields({ [k]: schemeBatch[k] || "" });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
save = async () => {
|
||||
const { programmeStore: { planForm, setHasBeenModify }, welfareTypeEnum, id } = this.props;
|
||||
planForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
if (planForm.getFormParams().sharedType === "1" && _.isEmpty(planForm.getFormParams().taxAgentIds)) {
|
||||
planForm.showError("taxAgentIds", getLabel(111, "\"可见范围\"未填写"));
|
||||
} else {
|
||||
const { planDatas } = this.state;
|
||||
const payload = {
|
||||
insuranceScheme: {
|
||||
...planForm.getFormParams(), welfareType: welfareTypeEnum, id,
|
||||
paymentArea: planForm.getFormParams().paymentType
|
||||
},
|
||||
insuranceSchemeDetailList: planDatas
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API[id ? "updateScheme" : "createScheme"](payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
setHasBeenModify(false);
|
||||
this.props.onClose(true);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
}
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { loading } = this.state, { title, showOperateBtn } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
handleClose = (visible = false) => {
|
||||
const { programmeStore: { hasBeenModify, setHasBeenModify }, onClose } = this.props;
|
||||
if (hasBeenModify) {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(545770, "确定放弃填写吗?放弃后数据将不会被保存!"),
|
||||
onOk: () => {
|
||||
onClose(visible);
|
||||
setHasBeenModify(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
onClose(visible);
|
||||
setHasBeenModify(false);
|
||||
}
|
||||
};
|
||||
onChange = (params) => {
|
||||
const { programmeStore: { planForm, setHasBeenModify } } = this.props;
|
||||
const key = _.keys(params)[0];
|
||||
if (key === "sharedType") {
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, it => ({
|
||||
...it, items: _.map(it.items, o => {
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return {
|
||||
...o, hide: params[key].value === "0",
|
||||
rules: params[key].value === "1" ? "required|string" : "",
|
||||
viewAttr: params[key].value === "1" ? 3 : 2
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
planForm.updateFields({ taxAgentIds: "" });
|
||||
});
|
||||
}
|
||||
setHasBeenModify(true);
|
||||
};
|
||||
renderTab = () => {
|
||||
const { selectedKey } = this.state;
|
||||
return <WeaTab
|
||||
keyParam="viewcondition" selectedKey={selectedKey}
|
||||
datas={[
|
||||
{ title: getLabel(500201, "个人"), viewcondition: "2" },
|
||||
{ title: getLabel(1851, "公司"), viewcondition: "1" }
|
||||
]} onChange={v => this.setState({ selectedKey: v })}
|
||||
/>;
|
||||
};
|
||||
handleSetPlanDatas = (datas) => {
|
||||
const { programmeStore: { setHasBeenModify } } = this.props;
|
||||
const { planDatas } = this.state;
|
||||
//先统一上下限值
|
||||
let dataSource = _.reduce(planDatas, (pre, cur) => {
|
||||
const curData = _.find(datas, o => o.insuranceId === cur.insuranceId);
|
||||
if (_.isEmpty(curData)) return [...pre, cur];
|
||||
return [...pre, { ...cur, lowerLimit: curData.lowerLimit, upperLimit: curData.upperLimit }];
|
||||
}, []);
|
||||
//再赋值修改值
|
||||
dataSource = _.reduce(dataSource, (pre, cur) => {
|
||||
const curData = _.find(datas, o => o.id === cur.id);
|
||||
return [...pre, { ...cur, ...curData }];
|
||||
}, []);
|
||||
this.setState({ planDatas: dataSource }, () => setHasBeenModify(true));
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { conditions, planDatas, selectedKey } = this.state;
|
||||
const { programmeStore: { planForm }, showOperateBtn } = this.props;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className={cs("welfare-plan-edit-layout", { "nopermission-welfare-plan-edit-layout": !showOperateBtn })}
|
||||
top={0} width={1000} height={100} measureT="%" measureX="px" measureY="%"{...this.props}
|
||||
direction={"right"} title={this.renderTitle()} onClose={() => this.handleClose(false)}
|
||||
content={<div className="welfare-plan-edit-area">
|
||||
{getSearchs(planForm, conditions, 1, false, this.onChange)}
|
||||
<WeaSearchGroup showGroup needTigger title={this.renderTab()}>
|
||||
<PlanSetTable dataSource={planDatas} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
|
||||
onPlanSet={this.handleSetPlanDatas}/>
|
||||
</WeaSearchGroup>
|
||||
</div>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue