Merge branch 'release/2.10.1.2402.01' into custom/陕西万众-薪资账套薪资核算配置

This commit is contained in:
黎永顺 2024-03-04 14:02:51 +08:00
commit d0d22ee088
79 changed files with 4747 additions and 364 deletions

View File

@ -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) => {

View File

@ -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 => {

View File

@ -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

View File

@ -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` }}
/>
);
}
}

View File

@ -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)` }}
/>
}

View File

@ -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}/>;
}
@ -127,9 +127,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={{

View File

@ -7,7 +7,6 @@
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { dealTemplate } from "../pcTemplate";
import moment from "moment";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@ -18,21 +17,21 @@ class Index extends Component {
const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile");
return (
<React.Fragment>
<div className="pbmc-head">{title || 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>
{/*<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) => {
@ -62,10 +62,11 @@ class Index extends Component {
})
}
{
(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,8 +74,8 @@ 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>

View File

@ -8,7 +8,7 @@
}
.pbmc-body {
height: calc(100% - 150px);
height: calc(100% - 50px);
background: #f6f6f6;
overflow: auto;
@ -40,6 +40,7 @@
font-size: 19px;
font-weight: 700;
margin-bottom: 12px;
text-align: center;
}
.time {
@ -67,7 +68,6 @@
}
.corporate-culture-text {
font-size: 14px;
text-align: left;
color: #111;
padding: 8px 16px;
@ -84,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 {
@ -104,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 {

View File

@ -1,6 +1,5 @@
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import moment from "moment";
import { dealTemplate } from "./index";
const getLabel = WeaLocaleProvider.getLabel;
@ -11,69 +10,74 @@ class Content extends Component {
const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc");
return (
<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(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}>{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.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 } = 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.toString() === "2" && tip) && (<div className="send-tip bottom">
<div className="label">{getLabel(111, "发放说明")}</div>
<div className="detail">{tip}</div>
</div>)
}
</div>
</div>);
})
}
<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>
{
!onlyOneGrup && tipPosi.toString() === "2" && tip &&
<div className="corporate-culture-text" title={tip}>{tip}</div>
}
</div>
</div>
{this.props.children}
</div>
);
}

View File

@ -28,11 +28,11 @@ export const dealTemplate = (itemTypeList, type) => {
});
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) {

View File

@ -4,7 +4,7 @@
overflow-y: auto;
.weapp-salary-sp {
background: #f6f6f6;
background: #F3F9FF;
}
.weapp-salary-payroll-pc-preview {
@ -37,11 +37,12 @@
.header-title {
height: 22px;
font-size: 17px;
font-size: 25px;
color: #111;
line-height: 22px;
font-weight: 400;
text-align: center;
font-weight: bolder;
}
.header-salary-date-time {
@ -57,7 +58,8 @@
.body {
width: 100%;
margin-top: 32px;
background: #FFF;
//margin-top: 32px;
.comp-img {
text-align: center;
@ -68,30 +70,43 @@
}
.corporate-culture-text {
width: 100%;
margin-top: 16px;
text-align: center;
min-height: 12px;
font-size: 12px;
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 {
margin-top: 16px;
.salary-group {
margin-bottom: 16px;
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;
@ -111,17 +126,18 @@
border-right: 1px solid #e5e5e5;
.item-name {
flex-basis: 170px;
//flex-basis: 170px;
//width: 170px;
flex: 1;
box-sizing: border-box;
width: 170px;
padding: 0 16px;
height: 100%;
background: #fbfbfb;
border-right: 1px solid #e5e5e5;
font-size: 12px;
color: #666;
color: #5F5F5F;
display: flex;
justify-content: center;
justify-content: flex-start;
align-items: center;
flex-shrink: 0;
@ -135,13 +151,14 @@
}
.item-count {
flex-basis: 328px;
//flex-basis: 328px;
flex: 1;
padding-left: 16px;
height: 100%;
line-height: 40px;
background: #fff;
font-size: 12px;
color: #111;
color: #5F5F5F;
word-break: break-all;
}
}
@ -150,4 +167,12 @@
}
}
}
.space {
margin: 20px 0 40px 0 !important;
button:last-child {
margin-right: 30px;
}
}
}

View File

@ -1,16 +1,18 @@
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 Archivess from "./pages/socialSecurityBenefits/archives";
import Programme from "./pages/socialSecurityBenefits/welfarePlan";
// import Archivess from "./pages/socialSecurityBenefits/archives";
import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面
import StandingBook 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";
@ -66,6 +68,10 @@ const Home = (props) => props.children;
const SocialSecurityBenefits = (props) => props.children;
const DataAcquisition = (props) => props.children;
// historicalPayroll 历史工资单查看
// salaryAdjustmentRecords 调薪记录查看
// mySalaryMobile 我的薪资福利-移动端
// mySalaryMobile 我的薪资福利-移动端
// mySalary 我的薪资福利
// mySalaryView 我的薪资福利-查看工资单
@ -111,6 +117,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}/>
@ -120,7 +128,6 @@ const Routes = (
component={SocialSecurityBenefits}>
<Route key="programme" path="programme" component={Programme}/>
<Route key="archives" path="archives" component={Archives}/>
<Route key="archives_demo" path="archives_demo" component={Archivess}/>
<Route key="standingBook" path="standingBook" component={StandingBook}/>
<Route
key="standingBookDetail"
@ -134,7 +141,7 @@ 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="adjustSalaryManage" path="adjustSalaryManage" component={AdjustSalaryManage}/>
<Route
key="dataAcquisition"

View File

@ -97,6 +97,7 @@
flex-direction: column;
justify-content: space-between;
margin-left: 10px;
overflow: hidden;
.reportName {
font-size: 14px;

View File

@ -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,

View File

@ -78,7 +78,7 @@ class Index extends Component {
const { declareStore: { declareForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 500 }} initLoadCss
{...this.props} style={{ width: 500, height: 174 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(543618, "生成申报表")}</Button>
]}

View File

@ -25,8 +25,8 @@ class Calculate extends Component {
queryParams: {
taxAgentName: "",
dateRange: [
moment(new Date()).startOf("year").format("YYYY-MM"),
moment(new Date()).startOf("month").format("YYYY-MM")
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM")
]
}, isRefresh: false,
declareDaialog: { visible: false, title: "" }

View File

@ -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;

View File

@ -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;
}
}

View File

@ -255,8 +255,9 @@ class LedgerSalaryItemTable extends Component {
render: (text, record) => {
const { salarySobId, salaryItemId } = record;
return <a
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`}
target="_blank">{text}</a>;
// href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`}
// target="_blank"
href="javascript:void(0);">{text}</a>;
}
},
{

View File

@ -159,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);
@ -201,7 +201,7 @@ export default class MobilePayroll extends React.Component {
</div>;
const {
salaryTemplate, salaryGroups, employeeInformation,
sendTime, confirmStatus
sendTime, confirmStatus, showAck, showFeedback
} = toJS(this.props.mySalaryStore.mySalaryBill);
const salaryProps = {
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
@ -215,13 +215,11 @@ export default class MobilePayroll extends React.Component {
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={this.props.mySalaryStore}>
<MobileTemplate {...salaryProps} title={getLabel(111, "工资单查看")}>
{
(_.isNil(confirmStatus) || confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={showAck} showFeedback={showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</MobileTemplate>
</Authority>
:
@ -229,13 +227,11 @@ export default class MobilePayroll extends React.Component {
store={this.props.mySalaryStore}>
<div className="weapp-salary-my-salary-view-payroll">
<Content {...salaryProps}>
{
(_.isNil(confirmStatus) || confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={showAck} showFeedback={showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</Content>
</div>
</Authority>

View File

@ -27,12 +27,22 @@
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;

View File

@ -96,13 +96,11 @@ class MySalaryView extends Component {
store={this.props.mySalaryStore}>
<div className="weapp-salary-my-salary-view-payroll">
<Content {...salaryProps}>
{
(_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") &&
<ConfirmBtns
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
}
<ConfirmBtns
showAck={mySalaryStore.showAck} showFeedback={mySalaryStore.showFeedback}
confirmSalaryBill={this.confirmSalaryBill}
goFeedback={this.handleGoFeedback}
/>
</Content>
</div>
</Authority>
@ -120,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>;
};

View File

@ -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;

View File

@ -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, "条")}`,

View File

@ -18,7 +18,11 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "1", salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().endOf("year").format("YYYY-MM")]
selectedKey: "1",
salaryYearMonth: [
moment().subtract(1, 'year').startOf("year").format("YYYY-MM"),
moment().endOf("year").format("YYYY-MM")
]
};
}

View File

@ -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 //是否还有更多数据
};
}

View File

@ -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 }) => {

View File

@ -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>

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
};

View File

@ -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;

View File

@ -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,443 @@ 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, <Dropdown.Button type="ghost" style={{ marginRight: "10px" }}
onClick={() => onSalaryOpts("ALL-GO-TO-FIXED")}
overlay={<Menu
onClick={({ key }) => onSalaryOpts(key)}>
<Menu.Item
key="ADD-TO-SALARYPAYMENT">{getLabel(543305, "批量设为发薪员工")}</Menu.Item>
<Menu.Item
key="DEL-PENDITNG-TO-DO">{getLabel(543186, "批量删除待办")}</Menu.Item>
</Menu>}>{getLabel(543304, "")}</Dropdown.Button>);
break;
case "suspend":
!showOperateBtn && reqBtns.shift();
showOperateBtn && reqBtns.splice(1, 0, <Dropdown.Button type="ghost" style={{ marginRight: "10px" }}
onClick={() => onSalaryOpts("FULL-SALARY-SUSPENSION")}
overlay={<Menu
onClick={({ key }) => onSalaryOpts(key)}>
<Menu.Item
key="SALARY-SUSPENSION">{getLabel(543724, "批量停薪")}</Menu.Item>
<Menu.Item
key="DEL-SUSPEND-TO-DO">{getLabel(543186, "批量删除待办")}</Menu.Item>
</Menu>}>{getLabel(543326, "")}</Dropdown.Button>);
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>;
};

View File

@ -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;
}
}
}
}

View File

@ -0,0 +1,285 @@
/*
* 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;
case "ADD-TO-SALARYPAYMENT":
case "DEL-PENDITNG-TO-DO":
case "FULL-SALARY-SUSPENSION":
case "SALARY-SUSPENSION":
case "DEL-SUSPEND-TO-DO":
this.onDropMenuClick(type);
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;

View File

@ -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,

View File

@ -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>
);
}

View File

@ -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,7 +171,7 @@ 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() : "/" });
@ -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);

View File

@ -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))}
/>
{/* 新建编辑工资单模板*/}

View File

@ -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",

View File

@ -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")
]
}

View File

@ -40,6 +40,7 @@ export default class Index extends Component {
extEmpsWitch: "0",
salaryAcctFixedColumns: 0,
welBaseDiffByPerAndCom: "0",
welBaseAutoAdjust: "0"
},
showEncryptOperationButton: "",
progressVisible: false,
@ -68,7 +69,7 @@ export default class Index extends Component {
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0",
welBaseDiffByPerAndCom = "0",
welBaseDiffByPerAndCom = "0", welBaseAutoAdjust = "0"
}
} = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules;
@ -90,7 +91,7 @@ export default class Index extends Component {
...saveParams,
ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0",
welBaseDiffByPerAndCom
welBaseDiffByPerAndCom, welBaseAutoAdjust
}
});
}
@ -311,8 +312,11 @@ export default class Index extends Component {
});
break;
case "welBaseDiffByPerAndCom":
case "welBaseAutoAdjust":
this.saveSysOperate({
title: getLabel(111, "福利档案基数区分个人和公司"),
title: key === "welBaseDiffByPerAndCom" ?
getLabel(111, "福利档案基数区分个人和公司") :
getLabel(111, "福利档案导入基数不符合要求时自动调整为上限/下限"),
module: "basic", confKey: key,
confValue: val
});
@ -353,7 +357,8 @@ export default class Index extends Component {
withDrawTaxDeclaration,
extEmpsWitch,
salaryAcctFixedColumns,
welBaseDiffByPerAndCom
welBaseDiffByPerAndCom,
welBaseAutoAdjust
} = saveParams;
return (
<div className="ruleWrapper">
@ -414,6 +419,11 @@ export default class Index extends Component {
<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 }}>

View File

@ -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;

View File

@ -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) => {

View File

@ -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 (

View File

@ -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;

View File

@ -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" },

View File

@ -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: ""
}
];

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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%;
}
}
}
}

View File

@ -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;

View File

@ -5,13 +5,14 @@
* Date: 2023/10/31
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
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
@ -27,7 +28,36 @@ class WelfareAdvanceSearchPannel extends Component {
getSaCondition().then(({ status, data }) => {
if (status) {
this.setState({
searchConditions: data.condition
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);

View File

@ -9,6 +9,7 @@ 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";
@ -38,33 +39,34 @@ class Index extends Component {
}
getBaseForm = async (props) => {
const { data: taxAgentList } = await getTaxAgentSelectList();
const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]);
const {
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData,
showOperateBtn
} = props;
let socialComData = {}, fundComData = {}, otherComData = {};
if (!_.isNil(socialBase.comItems) && !_.isNil(socialBase.comData)) {
if (!_.isNil(socialBase.comItems)) {
_.forEach(getConditionDomkeys(socialBase.comItems), o => {
socialComData = {
...socialComData,
[`${o}_com`]: socialBase.comData[o]
[`${o}_com`]: !_.isNil(socialBase.comData) ? socialBase.comData[o] : _.find(socialBase.comItems[0].items, k => getKey(k) === o).min
};
});
}
if (!_.isNil(fundBase.comItems) && !_.isNil(fundBase.comData)) {
if (!_.isNil(fundBase.comItems)) {
_.forEach(getConditionDomkeys(fundBase.comItems), o => {
fundComData = {
...fundComData,
[`${o}_com`]: fundBase.comData[o]
[`${o}_com`]: !_.isNil(fundBase.comData) ? fundBase.comData[o] : _.find(fundBase.comItems[0].items, k => getKey(k) === o).min
};
});
}
if (!_.isNil(otherBase.comItems) && !_.isNil(otherBase.comData)) {
if (!_.isNil(otherBase.comItems)) {
_.forEach(getConditionDomkeys(otherBase.comItems), o => {
otherComData = {
...otherComData,
[`${o}_com`]: otherBase.comData[o]
[`${o}_com`]: !_.isNil(otherBase.comData) ? otherBase.comData[o] : _.find(otherBase.comItems[0].items, k => getKey(k) === o).min
};
});
}
@ -75,7 +77,8 @@ class Index extends Component {
const formData = {
...result, ...socialBaseData, ...fundBaseData, ...othersBaseData,
...socialBase.data, ...fundBase.data, ...otherBase.data,
...socialComData, ...fundComData, ...otherComData
...socialComData, ...fundComData, ...otherComData,
welBaseAutoAdjust: sysInfoData.data.welBaseAutoAdjust === "1"
};
this.setState({
formData,
@ -83,7 +86,7 @@ class Index extends Component {
if (o.title === "basic") {
return {
...o, title: getLabel(542699, "员工基本信息"),
viewAttr: runStatuses === "4,5" ? 1 : o.viewAttr,
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : o.viewAttr,
items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
})
@ -94,7 +97,7 @@ class Index extends Component {
items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
options: _.map(taxAgentList, j => ({ key: j.id, showname: j.content }))
options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content }))
};
})
};
@ -107,13 +110,18 @@ class Index extends Component {
const key = _.lowerCase(getKey(g)).indexOf("take") !== -1 ? "underTake" : getKey(g);
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
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" ? 1 : g.viewAttr
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
};
})
};
@ -122,7 +130,7 @@ class Index extends Component {
...o, items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : g.viewAttr
};
})
};
@ -153,7 +161,7 @@ class Index extends Component {
return {
baseForm: JSON.stringify({
...formData[welfareType], ..._.reduce(_.keys(formData[welfareType]), (pre, cur) => {
if (welfareData[cur]) return { ...pre, [cur]: welfareData[cur] };
if (welfareData[cur] || !_.isNil(welfareData[cur])) return { ...pre, [cur]: welfareData[cur] };
return { ...pre };
}, {}),
underTake: welfareData[`${underTakeType}UnderTake`]
@ -202,7 +210,11 @@ class Index extends Component {
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 } = this.props;
const {
archivesStore: { setHasBeenModify },
onChangeProgramme, employeeId,
paymentOrganization, showOperateBtn
} = this.props;
setHasBeenModify(true);
if (changeKey === "socialSchemeId" || changeKey === "fundSchemeId" || changeKey === "otherSchemeId") {
this.setState({
@ -216,7 +228,7 @@ class Index extends Component {
...o, items: _.map(o.items, g => {
if (getKey(g).indexOf("StartTime") !== -1) {
return {
...g, viewAttr: changeVal ? 3 : g.viewAttr
...g, viewAttr: (changeVal && showOperateBtn) ? 3 : g.viewAttr
};
}
return { ...g };
@ -257,7 +269,7 @@ class Index extends Component {
});
renderTitle = () => {
const { loading } = this.state;
const { runStatuses } = this.props;
const { runStatuses, showOperateBtn } = this.props;
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
@ -265,7 +277,7 @@ class Index extends Component {
</div>
<div className="titleCol titleRightBox">
{
runStatuses !== "4,5" &&
runStatuses !== "4,5" && showOperateBtn &&
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
}
</div>
@ -287,7 +299,7 @@ class Index extends Component {
};
render() {
const { archivesStore: { welfareProfileForm } } = this.props;
const { archivesStore: { welfareProfileForm }, showOperateBtn } = this.props;
const { conditions, formData } = this.state;
return (
<WeaSlideModal
@ -298,7 +310,7 @@ class Index extends Component {
{
getWelfareSearchsForm(
welfareProfileForm, conditions, this.handleFormChange, this.handleNoPaymentChange, this.handleExtraChange,
this.handleSameChange, formData, this.props
this.handleSameChange, formData, this.props, showOperateBtn
)
}
</div>}

View File

@ -71,7 +71,7 @@ class Index extends Component {
this.getWelfareList(this.props);
} else if (type === "turn") {
const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
const { runStatuses } = this.props;
const { runStatuses, showOperateBtn } = this.props;
switch (id) {
case "PAGEINFO":
this.setState({
@ -116,7 +116,7 @@ class Index extends Component {
]);
this.setState({
welfareEditSlide: {
...this.state.welfareEditSlide, visible: true,
...this.state.welfareEditSlide, visible: true, showOperateBtn,
socialBase: socialBase.data, fundBase: fundBase.data, otherBase: otherBase.data
}
});
@ -167,14 +167,14 @@ class Index extends Component {
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
columns: _.map(columns, o => {
const { column: dataIndex, text: title, width } = 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
dataIndex, title, width, ellipsis: true, fixed: fixed || false
};
})
}, () => {
@ -289,7 +289,7 @@ class Index extends Component {
id="atdTable"
/>
</Spin>
{/* 编辑看员工福利档案*/}
{/* 编辑看员工福利档案*/}
<WelfareEditArchiveSlide {...welfareEditSlide} ref={dom => this.archiveSlideRef = dom}
onClose={(isFresh) => this.setState({
welfareEditSlide: { ...welfareEditSlide, visible: false }

View File

@ -9,7 +9,7 @@ import {
WeaTools
} from "ecCom";
import { WeaSwitch } from "comsMobx";
import { Button } from "antd";
import { Button, Dropdown, Menu } from "antd";
import AdvanceInputBtn from "./components/advanceInputBtn";
import { CancelHelpfulDiv, HelpfulDiv } from "./components/welfareTip";
@ -148,21 +148,21 @@ export const renderDropMenuDatas = (selectedKey, getLabel, 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: "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"/>,
@ -193,21 +193,21 @@ export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
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: "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"/>,
@ -223,11 +223,11 @@ export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
break;
case "4,5":
menus = [
{
key: "batchCancellationOfSuspended",
icon: <i className="iconfont icon-piliangcaozuo"/>,
content: getLabel(543190, "批量取消停缴")
},
// {
// key: "batchCancellationOfSuspended",
// icon: <i className="iconfont icon-piliangcaozuo"/>,
// content: getLabel(543190, "批量取消停缴")
// },
{
key: "exportAll",
icon: <i className="iconfont icon-daochu"/>,
@ -247,14 +247,23 @@ export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
}
return menus;
};
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport, showOperateBtn) => {
export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onDropMenuClick, showOperateBtn) => {
let reqBtns = showOperateBtn ? [
<Button type="primary" onClick={onImport}>{getLabel(32935, "导入")}</Button>,
<Button type="primary" onClick={() => onDropMenuClick("import")}>{getLabel(32935, "导入")}</Button>,
<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>
] : [<AdvanceInputBtn onOpenAdvanceSearch={onOpenAdvanceSearch} onAdvanceSearch={onAdvanceSearch}/>];
if (showOperateBtn) {
switch (selectedKey) {
case "1":
showOperateBtn && reqBtns.splice(1, 0, <Dropdown.Button type="ghost" style={{ marginRight: "10px" }}
onClick={() => onDropMenuClick("fullStaffIncrease")}
overlay={<Menu
onClick={({ key }) => onDropMenuClick(key)}>
<Menu.Item
key="batchStaffIncrease">{getLabel(543187, "批量增员")}</Menu.Item>
<Menu.Item
key="batchDeleteTodolist">{getLabel(543186, "批量删除待办")}</Menu.Item>
</Menu>}>{getLabel(543185, "")}</Dropdown.Button>);
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={
@ -266,6 +275,15 @@ export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdva
break;
case "3":
reqBtns.shift();
showOperateBtn && reqBtns.splice(0, 0, <Dropdown.Button type="primary" style={{ marginRight: "10px" }}
onClick={() => onDropMenuClick("fullReduction")}
overlay={<Menu
onClick={({ key }) => onDropMenuClick(key)}>
<Menu.Item
key="batchReduction">{getLabel(543188, "批量减员")}</Menu.Item>
<Menu.Item
key="batchDeleteTodolistStayDel">{getLabel(543186, "批量删除待办")}</Menu.Item>
</Menu>}>{getLabel(543189, "")}</Dropdown.Button>);
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={HelpfulDiv}
@ -273,6 +291,8 @@ export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdva
break;
case "4,5":
reqBtns.shift();
showOperateBtn && reqBtns.splice(0, 0, <Button type="primary" style={{ marginRight: "10px" }}
onClick={() => onDropMenuClick("batchCancellationOfSuspended")}>{getLabel(543190, "批量取消停缴")}</Button>);
reqBtns.unshift(<WeaHelpfulTip
width={300} placement="topLeft"
title={CancelHelpfulDiv}
@ -660,13 +680,16 @@ export const welfareConditions = [
]
}
];
export const getWelfareSearchsForm = (form, condition, onChange = () => void (0), onNoPaymentChange = () => void (0), onExtraChange = () => void (0), onSameChange = () => void (0), payload, extraFormField) => {
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"}
disabled={runStatuses === "4,5" || !showOperateBtn}
/>;
};
const { socialBase, fundBase, otherBase, runStatuses } = extraFormField;
@ -703,18 +726,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(socialBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
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}/>
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}/>];
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)) {
@ -722,18 +751,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(fundBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
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}/>
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}/>];
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)) {
@ -741,18 +776,24 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
...pre, cur,
<BenefitBaseComponent
dataSource={_.map(otherBase.items, o => ({ ...o, title: `${o.title}${getLabel(500201, "个人")}` }))}
value={payload} onChange={onExtraChange} onSameChange={onSameChange} runStatuses={runStatuses}/>,
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}/>
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}/>];
onSameChange={onSameChange} runStatuses={runStatuses}
showOperateBtn={showOperateBtn}
/>];
}
}
return [...pre, cur];
@ -760,7 +801,7 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
};
const BenefitBaseComponent = (props) => {
const { dataSource, value, onChange, onSameChange, runStatuses } = props;
const { dataSource, value, onChange, onSameChange, runStatuses, showOperateBtn } = props;
return <React.Fragment>
{
_.map(dataSource, item => {
@ -770,17 +811,17 @@ const BenefitBaseComponent = (props) => {
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" ? child.min : -999999999999999}
max={child.max !== "0.000" ? child.max : 999999999999999}
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" ? 1 : 2}
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"}/>
disabled={runStatuses === "4,5" || !showOperateBtn}/>
</div>}
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
/>;

View File

@ -57,16 +57,16 @@ class Index extends Component {
};
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 "import":
this.setState({
welfareImpDialog: {
...this.state.welfareImpDialog, visible: true,
runStatuses: this.state.selectedKey
}
});
break;
case "fullStaffIncrease":
case "fullReduction":
this.handleFullOptions(key);
@ -138,7 +138,7 @@ class Index extends Component {
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)}
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.onDropMenuClick, showOperateBtn)}
replaceTab={
<WeaTab
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth

View File

@ -157,6 +157,17 @@
.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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,337 @@
/*
* Author: 黎永顺
* name: 社保方案重构-方案设置列表
* Description:
* Date: 2024/2/5
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaHelpfulTip, WeaInputNumber, WeaLocaleProvider, WeaSelect, WeaTableEdit } from "ecCom";
import PaymentPeriodModal from "../../../programme/paymentPeriodModal";
const getLabel = WeaLocaleProvider.getLabel;
class PlanSetTable extends Component {
constructor(props) {
super(props);
this.state = {
datas: [], paymentPeriodModal: {
visible: false, record: {}, cycleSetting: "000000000000"
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.selectedKey !== this.props.selectedKey || nextProps.dataSource !== this.props.dataSource) {
this.setState({ datas: _.filter(nextProps.dataSource, o => String(o.paymentScopeValue) === nextProps.selectedKey) });
}
}
/*
* Author: 黎永顺
* Description: 缴纳周期-自定义设置
* Params:
* Date: 2024/2/6
*/
handleSetPaymentPeriod = (cycleSetting) => {
const { datas, paymentPeriodModal } = this.state;
const { record: { id } } = paymentPeriodModal;
let cycleObj = {
1: "0",
2: "0",
3: "0",
4: "0",
5: "0",
6: "0",
7: "0",
8: "0",
9: "0",
10: "0",
11: "0",
12: "0"
};
if (!_.isEmpty(cycleSetting)) {
_.forEach(cycleSetting, item => {
_.assign(cycleObj, { [item]: "1" });
});
} else {
_.forEach(Object.keys(cycleObj), item => {
_.assign(cycleObj, { [item]: "0" });
});
}
const tmpVStr = _.reduce(Object.values(cycleObj), (pre, cur) => {
return pre + cur;
}, "");
this.setState({
datas: _.map(datas, o => {
if (id === o.id) {
return { ...o, cycleSetting: tmpVStr };
} else {
return o;
}
})
}, () => this.props.onPlanSet(this.state.datas));
};
render() {
const { datas, paymentPeriodModal } = this.state;
const { showOperateBtn } = this.props;
const columns = [
{
title: getLabel(15795, "类型名称"),
dataIndex: "insuranceName",
key: "insuranceName",
width: 120, fixed: "left",
com: [{
type: "custom",
key: "custom",
render: text => (<span>{text}</span>)
}]
},
{
title: getLabel(543168, "是否缴费"),
dataIndex: "isPayment",
key: "isPayment",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaCheckbox value={(!_.isNil(text) && text) ? "1" : "0"} display="switch" viewAttr={showOperateBtn ? 2 : 1}
onChange={isPayment => onEdit({
record: { ...record, isPayment: isPayment === "1" },
index, key: "custom"
})}/>
)
}]
},
{
title: getLabel(543169, "缴纳对象"),
dataIndex: "paymentScope",
key: "paymentScope",
width: 120,
com: [{
type: "custom",
key: "custom",
render: text => (<span>{text}</span>)
}]
},
{
title: <PaymentCycleTitle/>,
dataIndex: "paymentCycle",
key: "paymentCycle",
width: 200,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (<div className="flex-center">
<WeaSelect value={text} options={[
{ key: "0", showname: getLabel(543159, "月缴") },
{ key: "1", showname: getLabel(111, "自定义") }
]} viewAttr={showOperateBtn ? 2 : 1}
onChange={paymentCycle => onEdit({
record: { ...record, paymentCycle, accountType: paymentCycle },
index, key: "custom"
})}/>
{
showOperateBtn && text === "1" &&
<a href="javascript:void(0);" onClick={() => this.setState({
paymentPeriodModal: {
record: record, visible: true,
cycleSetting: record.cycleSetting || "000000000000"
}
})}>{getLabel(30747, "设置")}</a>
}
</div>)
}]
},
{
title: getLabel(543170, "核算方式"),
dataIndex: "accountType",
key: "accountType",
width: 200,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect viewAttr={(record.paymentCycle === "1" && showOperateBtn) ? 2 : 1} value={text} options={[
{ key: "0", showname: getLabel(543160, "基数*比例+固定费用"), disabled: record.paymentCycle === "1" },
{ key: "1", showname: getLabel(543161, "∑基数*比例+∑固定费用") },
{ key: "2", showname: getLabel(543162, "∑(基数*比例+固定费用)") }
]} onChange={accountType => onEdit({
record: { ...record, accountType },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543171, "基数下限"),
dataIndex: "lowerLimit",
key: "lowerLimit",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} max={record.upperLimit || 99999999999} precision={2}
viewAttr={showOperateBtn ? 2 : 1}
onChange={lowerLimit => onEdit({
record: { ...record, lowerLimit },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543172, "基数上限"),
dataIndex: "upperLimit",
key: "upperLimit",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={record.lowerLimit || 0} precision={2} viewAttr={showOperateBtn ? 2 : 1}
onChange={upperLimit => onEdit({
record: { ...record, upperLimit },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543173, "缴纳比例%"),
dataIndex: "paymentProportion",
key: "paymentProportion",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} precision={4} viewAttr={showOperateBtn ? 2 : 1}
onChange={paymentProportion => onEdit({
record: { ...record, paymentProportion },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543174, "固定费用"),
dataIndex: "fixedCost",
key: "fixedCost",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaInputNumber value={text} min={0} precision={2} viewAttr={showOperateBtn ? 2 : 1}
onChange={fixedCost => onEdit({
record: { ...record, fixedCost },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543175, "有效小数位"),
dataIndex: "validNum",
key: "validNum",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect value={_.isNil(text) ? "2" : String(text)} options={[
{ key: "0", showname: "0" },
{ key: "1", showname: "1" },
{ key: "2", showname: "2" },
{ key: "3", showname: "3" },
{ key: "4", showname: "4" },
{ key: "5", showname: "5" },
{ key: "6", showname: "6" },
{ key: "7", showname: "7" },
{ key: "8", showname: "8" }
]} viewAttr={showOperateBtn ? 2 : 1}
onChange={validNum => onEdit({
record: { ...record, validNum },
index, key: "custom"
})}/>)
}]
},
{
title: getLabel(543176, "进位规则"),
dataIndex: "rententionRule",
key: "rententionRule",
width: 120,
com: [{
type: "custom",
key: "custom",
render: (text, record, index, onEdit) => (
<WeaSelect value={_.isNil(text) ? "2" : text} viewAttr={showOperateBtn ? 2 : 1}
options={[
{ key: "1", showname: getLabel(19766, "原始数据") },
{ key: "2", showname: getLabel(389654, "四舍五入") },
{ key: "3", showname: getLabel(542722, "向上舍入") },
{ key: "4", showname: getLabel(542723, "向下舍入") },
{ key: "5", showname: getLabel(542724, "见分进角") },
{ key: "6", showname: getLabel(543157, "向上取偶") }
]} onChange={rententionRule => onEdit({
record: { ...record, rententionRule },
index, key: "custom"
})}/>)
}]
}
];
return (
<React.Fragment>
<WeaTableEdit
columns={columns} datas={datas}
showDelete={false} showAdd={false} showCopy={false} showTitle={false}
tableProps={{ scroll: { x: 800 }, bordered: true }}
onChange={datas => this.setState({ datas }, () => this.props.onPlanSet(this.state.datas))}
/>
<PaymentPeriodModal
{...paymentPeriodModal}
onCancel={() => this.setState({
paymentPeriodModal: {
visible: false, record: {}, cycleSetting: "000000000000"
}
})}
onSetPaymentPeriod={this.handleSetPaymentPeriod}
/>
</React.Fragment>
);
}
}
export default PlanSetTable;
const PaymentCycleTitle = () => (<div>
<span>{getLabel(543158, "缴纳周期")}</span>
<WeaHelpfulTip
style={{ paddingLeft: 8 }}
width={480}
title={
<div>
<div>{getLabel(544738, "例养老保险缴纳周期选择3/6/9/12")}</div>
<br/>
<div>
{
getLabel(544739, "若:核算方式选择基数求和*比例;则数据核算逻辑为:\n" +
" 账单月1月2月时养老保险不会被核算\n" +
" 账单月3月时养老保险核算金额为养老保险月缴纳基数*3*缴纳比例+固定费用*3\n" +
" 3代表1月2月3月 3个月*3代表3个月基数相加和固定费用相加")
}
</div>
<br/>
<div>
{
getLabel(544740, "若:核算方式选择基数*比例再求和;则数据核算逻辑为:\n" +
" 账单月1月2月时养老保险不会被核算\n" +
" 账单月3月时养老保险核算金额为\n" +
" 将1~3月算出来的【养老保险月缴纳基数*缴纳比例+固定费用】求和")
}
</div>
<br/>
<div>{getLabel(544741, "若:缴纳周期选择选择月缴,则核算方式默认为【基数*比例+固定费用】,不可修改")}</div>
</div>
}
placement="topLeft"
/>
</div>);

View File

@ -0,0 +1,324 @@
/*
* Author: 黎永顺
* name: 社保福利方案重构-列表
* Description:
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaLoadingGlobal, WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, message, Modal } from "antd";
import TipLabel from "../../../../../components/TipLabel";
import WelfarePlanCopyDialog from "../welfarePlanCopyDialog";
import WelfarePlanCustomDialog from "../welfarePlanCustomDialog";
import WelfarePlanEditSlide from "../welfarePlanEditSlide";
import { tabWelfarePlanList, welfarePlanCopyConditions, welfarePlanCustomTipList } from "../../config";
import * as API from "../../../../../apis/welfareScheme";
const getLabel = WeaLocaleProvider.getLabel;
const APIFOX = {
SOCIAL_SECURITY: API.getTable,
ACCUMULATION_FUND: API.getTable,
OTHER: API.getTable,
CUSTOM: API.getCustomCategoryList
};
@inject("programmeStore", "taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], loading: false,
pageInfo: { current: 1, pageSize: 10, total: 0 },
copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] },
customDialog: { visible: false, title: "", customId: "" },
welfarePlanEditSlide: { visible: false, id: "", welfareTypeEnum: "", title: "" }
};
}
componentDidMount() {
this.getList(this.props);
}
componentWillReceiveProps(nextProps, nextContext) {
if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) {
this.setState({
welfarePlanEditSlide: { visible: false, id: "", welfareTypeEnum: "", title: "" },
pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 }
}, () => this.getList(nextProps));
}
if ((nextProps.selectedKey !== this.props.selectedKey)) {
this.setState({
dataSource: [], columns: [], loading: false,
pageInfo: { current: 1, pageSize: 10, total: 0 },
copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] }
});
}
}
getList = (props) => {
const {
programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, customQuery,
taxAgentStore: { showOperateBtn }
} = props;
const { pageInfo } = this.state;
const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: customQuery },
welfarePayload = { ...planSearchForm.getFormParams() };
const payload = welfareTypeEnum === "CUSTOM" ? { ...originPayload, ...customPayload } : { ...originPayload, ...welfarePayload };
this.setState({ loading: true });
APIFOX[welfareTypeEnum](payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: _.map(_.filter(columns, o => (o.dataIndex !== "id" && o.dataIndex !== "paymentArea")), g => {
const { dataIndex } = g;
let col = { ...g, width: "20%" };
switch (dataIndex) {
case "schemeName":
col = {
...col, width: 250,
render: (text, record) => (<a href="javascript:void(0);"
onClick={() => this.handleOpts("edit", record)}>{text}</a>)
};
break;
case "paymentType":
col = { ...col, width: 100 };
break;
case "paymentScope":
col = welfareTypeEnum !== "CUSTOM" ? { ...col, width: 300 } : {
...col, width: "30%",
render: (__, record) => (<span>{record[`${dataIndex}Span`]}</span>)
};
break;
case "remarks":
col = { ...col, width: 200 };
break;
case "welfareType":
col = {
...col, width: "30%",
render: (__, record) => (<span>{record[`${dataIndex}Span`]}</span>)
};
break;
case "isUse":
col = {
...col, render: (__, record) => (<WeaCheckbox
value={record[dataIndex] + ""} display="switch" viewAttr={showOperateBtn ? 2 : 1}
onChange={value => this.handleCustomBenefitsSwitch(record, value)}
/>)
};
break;
default:
break;
}
return col;
})
});
}
}).catch(() => this.setState({ loading: false }));
};
handleOpts = (key, record = {}) => {
const { selectedKey, programmeStore: { planCopyForm } } = this.props;
const { id, schemeName } = record;
switch (key) {
case "edit":
this.setState({
welfarePlanEditSlide: {
visible: true, id, welfareTypeEnum: selectedKey,
title: `${id ? getLabel(501169, "编辑") : getLabel(365, "新建")}${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}${getLabel(111, "方案")}`
}
});
break;
case "delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "确定删除吗?删除后数据不可找回"),
onOk: () => {
API.deleteScheme({ welfareTypeEnum: selectedKey, ids: [id] })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.getList(this.props);
} else {
message.error(errormsg);
}
});
}
});
break;
case "custom-delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "确定删除吗?删除后数据不可找回"),
onOk: () => {
WeaLoadingGlobal.start();
API.deleteCustomCategory({ id }).then(({ status, errormsg }) => {
WeaLoadingGlobal.destroy();
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.getList(this.props);
} else {
message.error(errormsg);
}
}).catch(() => WeaLoadingGlobal.destroy());
}
});
break;
case "custom-edit":
this.setState({
customDialog: {
visible: true, customId: id,
title: `${id ? getLabel(501169, "编辑") : getLabel(365, "新建")}${getLabel(543151, "自定义福利")}`
}
});
break;
case "copy":
this.setState({
copyDialog: {
visible: true, copyId: id, copyName: `${schemeName}-${getLabel(77, "复制")}`,
title: `${getLabel(77, "复制")}-${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}`,
conditions: welfarePlanCopyConditions[selectedKey]
}
}, () => {
const { copyDialog: { conditions, copyName } } = this.state;
planCopyForm.initFormFields(conditions);
planCopyForm.updateFields({ [`${selectedKey}_schemeName`]: { value: copyName } });
});
break;
default:
break;
}
};
handleCustomBenefitsSwitch = ({ id }, isUse) => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: isUse === "1" ? getLabel(111, "确定要启用吗?") : getLabel(111, "确定要停用吗?"),
onOk: () => {
const payload = { id, isUse };
API.updateCustomCategoryStatus(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
this.getList(this.props);
} else {
message.error(errormsg || "操作失败");
this.setState({
dataSource: _.map(this.state.dataSource, item => {
if (item.id === id) {
return {
...item, isUse: item.isUse
};
}
return { ...item };
})
});
}
});
},
onCancel: () => {
this.setState({
dataSource: _.map(this.state.dataSource, item => {
if (item.id === id) {
return {
...item, isUse: item.isUse
};
}
return { ...item };
})
});
}
});
};
render() {
const { dataSource, columns, pageInfo, loading, copyDialog, customDialog, welfarePlanEditSlide } = this.state;
const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props;
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.getList(this.props));
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.getList(this.props));
}
};
const optCols = selectedKey !== "CUSTOM" ? {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 185,
render: (__, record) => (<div className="planOptBtns">
<a href="javascript:void(0);"
onClick={() => this.handleOpts("edit", record)}>{getLabel(501169, "编辑")}</a>
<a href="javascript:void(0);" onClick={() => this.handleOpts("copy", record)}>{getLabel(77, "复制")}</a>
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a href="javascript:void(0)"
onClick={() => this.handleOpts("delete", record)}>{getLabel(535052, "删除")}</a>
</Menu.Item>
</Menu>
}>
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
</Dropdown>
</div>)
} : {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 165,
render: (__, record) => (<div className="planOptBtns">
<a href="javascript:void(0);"
onClick={() => this.handleOpts("custom-edit", record)}>{getLabel(501169, "编辑")}</a>
<a href="javascript:void(0);"
onClick={() => this.handleOpts("custom-delete", record)}>{getLabel(535052, "删除")}</a>
</div>)
};
return (
<div className="welfare-plan-adapt">
<div className="adapt-left">
<WeaTable
rowKey="id" dataSource={dataSource} pagination={pagination} loading={loading}
scroll={{ y: "calc(100vh - 182px)" }}
columns={showOperateBtn ? [...columns, optCols] : [...columns, {
title: getLabel(18610, "操作"),
dataIndex: "operation", width: 120,
render: (__, record) => (<a href="javascript:void(0);"
onClick={() => this.handleOpts(selectedKey === "CUSTOM" ? "custom-edit" : "edit", record)}>{getLabel(33564, "查看")}</a>)
}]}
/>
</div>
{
selectedKey === "CUSTOM" &&
<div className="adapt-right"><TipLabel tipList={welfarePlanCustomTipList}/></div>
}
{/*复制方案*/}
<WelfarePlanCopyDialog {...copyDialog} selectedKey={selectedKey}
onCancel={(isRefrese) => this.setState({
copyDialog: { ...copyDialog, visible: false, conditions: [] }
}, () => isRefrese && this.getList(this.props))}
/>
{/*新建编辑自定义方案*/}
<WelfarePlanCustomDialog {...customDialog} selectedKey={selectedKey} showOperateBtn={showOperateBtn}
onCancel={(isRefrese) => this.setState({
customDialog: { ...customDialog, visible: false, customId: "" }
}, () => isRefrese && this.getList(this.props))}
/>
{/*新建编辑方案*/}
<WelfarePlanEditSlide {...welfarePlanEditSlide} showOperateBtn={showOperateBtn}
onClose={(isFresh) => this.setState({
welfarePlanEditSlide: { ...welfarePlanEditSlide, visible: false }
}, () => isFresh && this.getList(this.props))}
/>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,265 @@
import React from "react";
import { WeaLocaleProvider, WeaSelect, WeaTools } from "ecCom";
import { Button } from "antd";
import AdvanceInputBtn from "./components/advanceInputBtn";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabWelfarePlanList = [
{ key: "SOCIAL_SECURITY", title: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", title: getLabel(538969, "公积金") },
{ key: "OTHER", title: getLabel(542717, "企业年金及其他福利") },
{ key: "CUSTOM", title: getLabel(543151, "自定义福利") }
];
export const welfarePlanCustomTipList = [
getLabel(544345, "1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项残疾保险等"),
getLabel(544346, "2、新增自定义福利默认启用社保福利方案中的自定义福利项均未开启缴纳当前页面的自定义福利项才可以停用停用后再新增方案时没有该福利项"),
getLabel(544347, "3、自定义福利若要缴纳需要在方案里填写缴纳相关数据")
];
/*
* Author: 黎永顺
* Description: 社保福利方案-头部操作
* Params:
* Date: 2024/2/2
*/
export const renderDropMenuDatas = (selectedKey, showOperateBtn) => {
return [{
key: "log",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}];
};
export const renderReqBtns = (selectedKey, onSalaryOpts, showOperateBtn, customQuery) => {
let reqBtns = [
<Button type="primary" onClick={() => onSalaryOpts("ADD")}>{getLabel(365, "新建")}</Button>,
<AdvanceInputBtn onOpenAdvanceSearch={() => onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}/>
];
switch (selectedKey) {
case "CUSTOM":
reqBtns[reqBtns.length - 1] = <WeaSelect style={{ width: 220 }} onChange={v => onSalaryOpts("SEARCH", v)}
value={customQuery}
options={[
{ key: "", showname: getLabel(111, "全部"), selected: true },
{ key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") },
{ key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") }
]}
/>;
break;
default:
break;
}
!showOperateBtn && reqBtns.shift();
return reqBtns;
};
export const searchConditons = [
{
items: [
{
colSpan: 2,
conditionType: "INPUT",
domkey: ["schemeName"],
fieldcol: 16,
isQuickSearch: true,
label: getLabel(33162, "方案名称"),
labelcol: 8,
value: "",
viewAttr: 2
},
{
colSpan: 2,
conditionType: "SELECT",
domkey: ["paymentTypeEnum"],
fieldcol: 16,
isQuickSearch: true,
label: getLabel(543163, "缴纳类型"),
labelcol: 8,
value: "",
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
],
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
defaultshow: true
}
];
export const welfarePlanCopyConditions = {
SOCIAL_SECURITY: [
{
items: [
{
conditionType: "INPUT",
domkey: ["SOCIAL_SECURITY_schemeName"],
fieldcol: 16,
label: getLabel(111, "社保名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
],
ACCUMULATION_FUND: [
{
items: [
{
conditionType: "INPUT",
domkey: ["ACCUMULATION_FUND_schemeName"],
fieldcol: 16,
label: getLabel(111, "公积金名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
],
OTHER: [
{
items: [
{
conditionType: "INPUT",
domkey: ["OTHER_schemeName"],
fieldcol: 16,
label: getLabel(111, "企业年金及其他福利名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true,
title: "",
col: 1
}
]
};
export const planConditons = [
{
items: [
{
conditionType: "SELECT",
domkey: ["paymentType"],
fieldcol: 14,
label: getLabel(543163, "缴纳类型"),
labelcol: 6,
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
],
value: "SCHEME_TOWN",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "INPUT",
domkey: ["schemeName"],
fieldcol: 14,
label: getLabel(33162, "方案名称"),
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["sharedType"],
fieldcol: 14,
label: getLabel(543164, "可见性"),
labelcol: 6,
options: [
{ key: "0", showname: getLabel(111, "公共") },
{ key: "1", showname: getLabel(111, "私有") }
],
value: "0",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["taxAgentIds"],
fieldcol: 14,
label: getLabel(543165, "可见性范围"),
labelcol: 6,
multiple: true,
options: [],
value: "",
hide: true,
viewAttr: 2
},
{
conditionType: "TEXTAREA",
domkey: ["remarks"],
fieldcol: 14,
label: getLabel(536726, "备注"),
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
defaultshow: true
}
];
export const customPlanConditons = [
{
items: [
{
conditionType: "INPUT",
domkey: ["insuranceName"],
fieldcol: 14,
label: getLabel(111, "福利名称"),
labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["welfareType"],
fieldcol: 14,
label: getLabel(500401, "类型"),
labelcol: 8,
options: [
{ key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") },
{ key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") }
],
value: "SOCIAL_SECURITY",
detailtype: 3,
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["paymentScope"],
fieldcol: 16,
label: getLabel(543169, "缴纳对象"),
labelcol: 8,
options: [
{ key: "SCOPE_COMPANY", showname: getLabel(1851, "公司") },
{ key: "SCOPE_PERSON", showname: getLabel(500201, "个人") }
],
detailtype: 2,
rules: "required|string",
viewAttr: 3
}
],
title: "",
defaultshow: true
}
];

View File

@ -0,0 +1,94 @@
/*
* Author: 黎永顺
* name: 福利方案页面重构
* Description:
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
import { renderDropMenuDatas, renderReqBtns, tabWelfarePlanList } from "./config";
import WelfarePlanAdvanceSearchPannel from "./components/welfarePlanAdvanceSearchPannel";
import WelfarePlanList from "./components/welfarePlanList";
import LogDialog from "../../../components/logViewModal";
import cs from "classnames";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "SOCIAL_SECURITY", showSearchAd: false, isQuery: false, logDialogVisible: false,
customQuery: ""
};
this.welfarePlanListRef = null;
}
handleReqBtnsCLick = (type, value) => {
const { selectedKey } = this.state;
switch (type) {
case "ADD":
const { handleOpts } = this.welfarePlanListRef.wrappedInstance || {};
handleOpts(selectedKey === "CUSTOM" ? "custom-edit" : "edit");
break;
case "OPEN":
this.handleOpenAdvanceSearch();
break;
case "SEARCH":
this.handleAdvanceSearch(value);
break;
default:
break;
}
};
handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true });
handleAdvanceSearch = (customQuery = "") => this.setState({ isQuery: !this.state.isQuery, customQuery });
onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery });
onDropMenuClick = (key) => {
switch (key) {
case "log":
this.setState({ logDialogVisible: true });
break;
default:
break;
}
};
render() {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { logDialogVisible, selectedKey, showSearchAd, isQuery, customQuery } = this.state;
return (
<div className="salary-welfare-plan-wrapper">
<WeaReqTop
title={getLabel(538000, "社保福利方案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
onDropMenuClick={this.onDropMenuClick} tabDatas={tabWelfarePlanList} selectedKey={selectedKey}
onChange={selectedKey => this.setState({ selectedKey, showSearchAd: false, customQuery: "" })}
buttons={renderReqBtns(selectedKey, this.handleReqBtnsCLick, showOperateBtn, customQuery)}
>
<div className="salary-welfare-plan-content">
<div
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<WelfarePlanAdvanceSearchPannel
onCancel={() => this.setState({ showSearchAd: false })}
onAdSearch={this.onAdSearch}
/>
</div>
{/*列表*/}
<WelfarePlanList ref={dom => this.welfarePlanListRef = dom} customQuery={customQuery}
selectedKey={selectedKey} isQuery={isQuery}/>
</div>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction={selectedKey === "CUSTOM" ? "siCategory" : "siScheme"}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</WeaReqTop>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,270 @@
//社保福利方案页面重构
.salary-welfare-plan-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-welfare-plan-content {
padding: 8px 16px;
display: flex;
flex-direction: column;
width: 100%;
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: 125px;
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
}
}
}
}
.welfare-plan-adapt {
width: 100%;
flex: 1;
.adapt-left {
width: 100%;
.wea-new-table {
background: #FFF;
}
.planOptBtns {
display: flex;
align-items: center;
a {
margin-right: 10px;
}
a:last-child {
margin-right: 0;
}
}
}
.adapt-right {
width: 100%;
margin-top: 16px;
.tipContentWrapper {
background: #FFF !important;
}
}
}
}
}
.welfare-plan-edit-layout {
.flex-center {
display: flex;
align-items: center;
.wea-select {
flex: 1;
margin-right: 4px;
}
}
.ant-table-fixed-left {
.ant-table-tbody > tr {
height: 41px !important;
}
}
.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%;
.welfare-plan-edit-area {
background: #f6f6f6;
height: 100%;
overflow-y: auto;
padding: 16px;
.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;
.wea-form-cell:not(:last-child) {
border-bottom: 1px solid #e5e5e5;
}
}
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
.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: 426.16px;
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;
}
}
}
}
.nopermission-welfare-plan-edit-layout {
.ant-table-fixed-left {
.ant-table-tbody > tr {
height: 37.38px !important
}
}
}
.zIndex0-welfare-plan {
.wea-new-top-req {
z-index: 0 !important;
}
}
@media screen and (min-width: 1440px) {
.salary-welfare-plan-content {
.welfare-plan-adapt {
display: flex;
.adapt-left {
width: calc(100% - 390px);
}
.adapt-right {
width: 380px !important;
max-width: 380px !important;
margin-top: 0 !important;
margin-left: 16px;
}
}
}
}

View File

@ -11,6 +11,7 @@ export class StandingBookStore {
@action initAccountForm = () => this.accountForm = new WeaForm();
@observable addCPForm = new WeaForm(); // 社保台账详情页面添加补差人员form
@action initAddCPForm = () => this.addCPForm = new WeaForm();
@observable welfareRQForm = new WeaForm(); // 社保台账页面重构查询form
@observable tableStore = new TableStore(); // new table

View File

@ -12,6 +12,14 @@ export class PayrollFilesStore {
@observable pivotTableStore = new TableStore();
@observable adjustForm = new WeaForm(); //调薪记录-核算form
@action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form
/*薪资档案页面重构*/
@observable salaryFileQueryForm = new WeaForm(); // 薪资档案查询form
@observable salaryFileForm = new WeaForm(); // 薪资档案form
@action initSalaryFileForm = () => this.salaryFileForm = new WeaForm(); // 薪资档案form初始化
@observable hasBeenModify = false; //薪资档案-员工薪资档案-是否修改过
@action setHasBeenModify = (v) => this.hasBeenModify = v;//薪资档案-员工薪资档案数据
/*薪资档案页面重构*/
@action("薪资档案-列表查询")
queryList = (payload = {}, searchItemsValue = {}, url = "") => {

View File

@ -10,6 +10,14 @@ const { TableStore } = WeaTableNew;
export class ProgrammeStore {
//lys-表单初始化(方案查询表单)
@observable planSearchForm = new WeaForm();
@observable planForm = new WeaForm(); //方案-新增编辑Form
@action initPlanForm = () => this.planForm = new WeaForm();//方案-初始化新增编辑Form
@observable planCopyForm = new WeaForm(); //方案-复制Form
@action initPlanCopyForm = () => this.planCopyForm = new WeaForm();//方案-初始化复制Form
@observable planCustomForm = new WeaForm(); //方案-新建编辑自定义方案Form
@action initPlanCustomForm = () => this.planCustomForm = new WeaForm();//方案-初始化新建编辑自定义方案Form
@observable hasBeenModify = false; //社保福利方案-员工薪资档数据-是否修改过
@action setHasBeenModify = (v) => this.hasBeenModify = v;//设置社保福利方案-员工薪资档数据
@observable tableStore = new TableStore(); // new table

View File

@ -6,7 +6,7 @@
height: 100%;
text-align: center;
>div {
> div {
position: absolute;
top: 50%;
margin-top: -10px;
@ -31,6 +31,43 @@
}
.ant-checkbox-wrapper+.ant-checkbox-wrapper {
.ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin-left: 0 !important;
}
}
//公共彈框表单样式
.form-dialog-layout {
background: #f6f6f6;
.wea-search-group {
padding: 16px;
}
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}
.wea-select {
display: inline-block;
position: relative;
}
.ant-select-selection {
height: 30px;
border-radius: 0;
}
.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;
}
}
}
}

View File

@ -127,9 +127,18 @@ export const padding0 = (num, length) => {
return "0." + num;
};
export const toDecimal_n = (num, decimalPlaces) => {
if (num === null || !isFinite(num)) return null
if (num === null || !isFinite(num)) return null;
if (decimalPlaces < 0) return null;
const multiplier = Math.pow(10, decimalPlaces);
const roundedNum = Math.round(num * multiplier) / multiplier;
return roundedNum.toFixed(decimalPlaces);
};
//设置ifrme高度
export const getIframeParentHeight = (selector, total, extraHeight) => {
const dom = document.querySelector(selector);
let height = 280;
if (dom && total > 0) {
height = (parseFloat(dom.style.height) > 620 && total === 10) ? total * 48 + 108: total < 10 ? total * 48 + 108 : parseFloat(dom.style.height) - extraHeight;
}
return height;
};