Merge branch 'release/2.14.4.2406.02' into release/2.14.4.2406.02-个税

# Conflicts:
#	pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
This commit is contained in:
黎永顺 2024-06-21 10:49:13 +08:00
commit 7826086cb1
18 changed files with 251 additions and 89 deletions

View File

@ -244,3 +244,7 @@ export const getSmsSalaryItemSet = (params) => {
export const genPdfBeforeExport = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/genPdfBeforeExport", "GET", params);
};
//工资单预览
export const salaryBillPreview = (params) => {
return postFetch("/api/bs/hrmsalary/salaryBill/preview", params);
};

View File

@ -0,0 +1,17 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
return (
<WeaReqTop
title={getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props}
/>
);
}
}
export default Index;

View File

@ -0,0 +1,15 @@
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
render() {
return (
<WeaTop title={getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" {...this.props}/>
);
}
}
export default Index;

View File

@ -5,9 +5,11 @@
* Date: 2023/9/5
*/
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { postFetch } from "../../../util/request";
const { getLabel } = WeaLocaleProvider;
class ImpStep2 extends Component {
constructor(props) {
super(props);
@ -41,9 +43,15 @@ class ImpStep2 extends Component {
render() {
const { dataSource, columns, loading } = this.state;
const { scrollHeight } = this.props;
const pagination = {
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
total: dataSource.length,
showSizeChanger: true
};
return (
<WeaTable
dataSource={dataSource} columns={columns} loading={loading} scroll={{ x: 800, y: `${scrollHeight}px` }}
pagination={pagination}
/>
);
}

View File

@ -37,7 +37,7 @@ class SalaryDetails extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isQuery !== this.props.isQuery) this.setState({
pageInfo: { ...this.state.pageInfo, current: 1 }
pageInfo: { ...this.state.pageInfo, current: 1 }, updateSum: true
}, () => this.getSalaryList(nextProps));
}
@ -56,7 +56,7 @@ class SalaryDetails extends Component {
const { pageNum: current, size: pageSize } = params;
this.setState({
pageInfo: { ...pageInfo, current, pageSize },
updateSum: true
updateSum: false
}, () => this.getSalaryList(this.props));
} else if (id === "CHECKBOX") {
const { selectedRowKeys: checkBox } = params;

View File

@ -9,7 +9,19 @@
}
}
.ledgerSlideContent {
.ledgerSlideLayout {
.wea-new-top {
.ant-col-10 {
padding-right: 45px !important;
}
}
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
right: 45px !important;
}
.ledgerSlideContent {
}
}
.copyWrapper {

View File

@ -10,6 +10,7 @@ import LedgerSalaryItemEditSlide from "./ledgerSalaryItemEditSlide";
import { getSalaryItemForm } from "../../../apis/ledger";
import { commonEnumList } from "../../../apis/ruleconfig";
import FormalFormModal from "../../salaryItem/formalFormModal";
import { toDecimal_n } from "../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@ -88,7 +89,7 @@ class LedgerSalaryItemTable extends Component {
handleEditSalaryItem = async (record) => {
const { salarySobId, dataSource } = this.props, { salaryItemId, id } = record;
const {
itemHide: hideDefault,
itemHide: hideDefault, defaultValue,
valueType, name, description,
roundingMode, formulaId, dataType, useInEmployeeSalary,
pattern, canEdit, formulaContent, originFormulaContent, originSqlContent
@ -123,7 +124,7 @@ class LedgerSalaryItemTable extends Component {
...this.state.salaryItemPayload,
visible: true,
request: {
canEdit, dataType, description,
canEdit, dataType, description, defaultValue,
formulaContent, formulaId, name,
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault,
valueType, roundingMode, pattern,
@ -151,11 +152,12 @@ class LedgerSalaryItemTable extends Component {
});
const { salaryItemId } = record;
const {
hideDefault, roundingMode, pattern, valueType,
originFormulaContent, originSqlContent, formulaId
hideDefault, roundingMode, pattern, valueType, defaultValue,
originFormulaContent, originSqlContent, formulaId, dataType
} = request;
this.handleChangeSalaryItem({
itemHide: hideDefault.toString(),
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue,
roundingMode, pattern, valueType,
formulaContent: valueType.toString() === "2" ? originFormulaContent : originSqlContent,
formulaId: ((valueType.toString() === "3" && (!originSqlContent || originSqlContent === " ")) || (valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || valueType.toString() === "1") ? "" : formulaId,

View File

@ -1,13 +1,3 @@
.ledgerOuter {
.wea-new-top {
.ant-col-10 {
& > span:nth-child(2) {
margin-top: -6px;
}
}
}
}
.ledgerWrapper {
height: 100%;

View File

@ -0,0 +1,6 @@
.payPreBox {
.pay-preview-layout {
width: 100%;
height: 100%;
}
}

View File

@ -0,0 +1,62 @@
/*
*
* 工资单预览
* @Author: 黎永顺
* @Date: 2024/6/17
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { salaryBillPreview } from "../../../../apis/payroll";
import Content from "../../../../components/pcTemplate/content";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class PayrollPreviewDialog extends Component {
constructor(props) {
super(props);
this.state = {
salaryBillData: { salaryTemplate: {}, salaryGroups: [], employeeInformation: {} }
};
this.preRef = null;
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { salaryInfoId, recipient } = nextProps;
salaryBillPreview({ salaryInfoId, recipient }).then(({ status, data }) => {
if (status) {
this.setState({ salaryBillData: data });
}
});
}
}
render() {
const {
salaryTemplate, salaryGroups, employeeInformation, sendTime
} = this.state.salaryBillData;
const salaryProps = {
theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime,
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
itemTypeList: [employeeInformation, ...salaryGroups]
};
return (
<WeaDialog
{...this.props} ref={dom => this.preRef = dom} scalable hasScroll className="payPreBox" initLoadCss
style={{
width: 998, height: window.innerHeight - 40, minHeight: 200, minWidth: 380, maxHeight: "90%",
maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}}
>
<div className="pay-preview-layout">{!_.isEmpty(salaryGroups) && <Content {...salaryProps}/>}</div>
</WeaDialog>
);
}
}
export default PayrollPreviewDialog;

View File

@ -10,6 +10,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable";
import PayrollPartTable from "./payrollPartTable";
import { genPdfBeforeExport, getPayrollIssuanceProgressBar } from "../../../apis/payroll";
import ProgressModal from "../../../components/progressModal";
import PayrollPreviewDialog from "./components/payrollPreviewDialog";
const getLabel = WeaLocaleProvider.getLabel;
const { ButtonSelect } = WeaDropdown;
@ -31,6 +32,10 @@ export default class PayrollGrant extends React.Component {
title: "工资单发放",
grantType: "",
salarySendId: ""
},
payrollPreviewDialog: {
visible: false, title: getLabel(111, "工资单预览"),
salaryInfoId: "", recipient: ""
}
};
this.pageInfo = { current: 1, pageSize: 10 };
@ -303,7 +308,7 @@ export default class PayrollGrant extends React.Component {
};
getColumns = () => {
const { selectedKey, showFeedbackColumn } = this.state;
const { selectedKey, showFeedbackColumn, payrollPreviewDialog } = this.state;
const { payrollStore } = this.props;
const { salaryGrantTableStore: columns, salarySendDetailBaseInfo } = payrollStore;
return _.map([
@ -323,6 +328,15 @@ export default class PayrollGrant extends React.Component {
onClick={() => this.handleWithdraw({ ids: [record.id] })}>
撤回
</a>
<a href="javascript:void(0);" style={{ marginRight: 10 }}
onClick={() => this.setState({
payrollPreviewDialog: {
...payrollPreviewDialog,
visible: true, salaryInfoId: record.id, recipient: record.employeeId
}
})}>
{getLabel(111, "查看")}
</a>
{
salarySendDetailBaseInfo.showPdfBtn &&
<a
@ -367,11 +381,21 @@ export default class PayrollGrant extends React.Component {
}
} else if (salarySendDetailBaseInfo.canSend) {
return (
<a
href="javascript:void(0);"
onClick={() => this.handleGrant({ ids: [record.id] })}>
发放
</a>
<React.Fragment>
<a
href="javascript:void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleGrant({ ids: [record.id] })}>
发放
</a>
<a href="javascript:void(0);" onClick={() => this.setState({
payrollPreviewDialog: {
...payrollPreviewDialog,
visible: true, salaryInfoId: record.id, recipient: record.employeeId
}
})}>
{getLabel(111, "查看")}
</a>
</React.Fragment>
);
}
}
@ -538,9 +562,10 @@ export default class PayrollGrant extends React.Component {
grantListCondition,
setGrantListShowSearchAd,
salaryGrantPageInfo,
getInfoList
getInfoList,
loading
} = payrollStore;
const { selectedRowKeys, selectedKey, currentId, payrollPartModalParams } = this.state;
const { selectedRowKeys, selectedKey, currentId, payrollPartModalParams, payrollPreviewDialog } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange
@ -569,35 +594,19 @@ export default class PayrollGrant extends React.Component {
];
return (
<div className="payrollGrant_new">
<WeaTop
title="工资单发放" // 文字
icon={<i className="icon-coms-meeting"/>} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
buttons={this.getSearchsAdQuick()}
/>
<WeaTop title="工资单发放" icon={<i className="icon-coms-meeting"/>} iconBgcolor="#F14A2D"
showDropIcon={true} buttons={this.getSearchsAdQuick()}/>
<WeaTab
datas={topTab}
keyParam="viewcondition"
selectedKey={selectedKey}
onChange={v =>
this.setState({ selectedKey: v }, () => {
getInfoList({
salarySendId: currentId,
isGranted: v !== "0"
});
})
}
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
searchsBasePlaceHolder="请输入姓名"
showSearchAd={grantListShowSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setGrantListShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(grantListConditionForm, toJS(grantListCondition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
onSearchChange={v => grantListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={grantListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
datas={topTab} keyParam="viewcondition" selectedKey={selectedKey} searchType={["base", "advanced"]}
onChange={v => this.setState({ selectedKey: v }, () => {
getInfoList({ salarySendId: currentId, isGranted: v !== "0" });
})}
searchsBasePlaceHolder="请输入姓名" showSearchAd={grantListShowSearchAd} buttonsAd={adBtn}
setShowSearchAd={bool => setGrantListShowSearchAd(bool)}
searchsAd={getSearchs(grantListConditionForm, toJS(grantListCondition), 2)}
onSearch={() => this.handleSearch()}
onSearchChange={v => grantListConditionForm.updateFields({ username: v })}
searchsBaseValue={grantListConditionForm.getFormParams().username}
/>
<div className="titleBar">
<div className="titleBarLeft">
@ -626,7 +635,7 @@ export default class PayrollGrant extends React.Component {
</div>
<div className="tableWrapper">
{
!_.isEmpty(this.getColumns()) ?
!loading ?
<CustomPaginationTable
rowKey="id"
rowSelection={rowSelection}
@ -666,6 +675,14 @@ export default class PayrollGrant extends React.Component {
progress={this.state.progress}
/>
}
{/*工资单预览*/}
<PayrollPreviewDialog {...payrollPreviewDialog}
onCancel={() => this.setState({
payrollPreviewDialog: {
...payrollPreviewDialog,
visible: false
}
})}/>
</div>
);
}

View File

@ -403,8 +403,8 @@ export const mapBarOptions = (params) => ({
},
grid: {
top: "10%",
right: "0%",
left: "5%",
right: "2%",
left: "2%",
bottom: "10%",
containLabel: true
},
@ -457,8 +457,9 @@ export const mapBarOptions = (params) => ({
series: _.map(params.data, (item, index) => {
return {
name: item.name,
barWidth: "32",
barGap: "0%",
barMaxWidth: 30,
barMinWidth: 10,
barGap: 0,
data: _.map(item.data, (it) => it.replace(/,/g, "")),
type: "bar",
itemStyle: {
@ -484,6 +485,10 @@ export const mapBarOptions = (params) => ({
];
}
},
textStyle: {
textShadowColor: "transparent",
color: "#fff"
},
rich: {
a: {
fontWeight: "bold",
@ -501,8 +506,9 @@ export const mapBarOptions = (params) => ({
}),
dataZoom: [
{
type: "inside"
type: "inside",
start: params.xAxis.length <= 7 ? 0 : 25,
end: params.xAxis.length <= 7 ? 100 : 75,
},
{
type: "slider",

View File

@ -128,13 +128,14 @@ export const salaryItemFields = [
viewAttr: 2,
tip: ""
},
// {
// key: "defaultValue",
// label: "默认值",
// type: "INPUT",
// viewAttr: 2,
// tip: ""
// },
{
key: "defaultValue",
label: "默认值",
type: "INPUT",
viewAttr: 2,
precision: 2,
tip: ""
},
{
key: "formulaContent",
label: "公式",

View File

@ -2,7 +2,7 @@ import React from "react";
import { inject, observer } from "mobx-react";
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
import { renderLoading } from "../../util";
import { renderLoading, toDecimal_n } from "../../util";
import CustomTab from "../../components/customTab";
import SystemSalaryItemModal from "./systemSalaryItemModal";
import { columns } from "./columns";
@ -314,16 +314,21 @@ export default class SalaryItem extends React.Component {
});
return;
}
saveItem(payload, continueFlag).then(() => {
getTableDatas({ ...this.state.searchParams }).then(res => {
this.setState({
searchParams: {
...this.state.searchParams,
total: res.total
}
const { pattern, defaultValue, dataType, ...extra } = payload;
saveItem({
...extra, pattern, dataType,
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
}, continueFlag)
.then(() => {
getTableDatas({ ...this.state.searchParams }).then(res => {
this.setState({
searchParams: {
...this.state.searchParams,
total: res.total
}
});
});
});
});
};
const renderCustomOperate = () => {

View File

@ -71,6 +71,16 @@ export const patternOptions = [
key: "8",
showname: "8",
selected: false
},
{
key: "9",
showname: "9",
selected: false
},
{
key: "10",
showname: "10",
selected: false
}
];

View File

@ -51,7 +51,7 @@ class SalaryItemForm extends Component {
return {
...item,
label: getLabel(item.lanId, item.label),
display: ((!isLedger && key === "width") || key === "sortedIndex")
display: !isLedger
};
case "useInEmployeeSalary":
return {
@ -122,6 +122,8 @@ class SalaryItemForm extends Component {
return { ...item, type: v === "number" ? "INPUTNUMBER" : "INPUT" };
} else if (key === "valueType" && item.key === "defaultValue") {
return { ...item, display: v === "1" };
} else if (key === "pattern" && item.key === "defaultValue") {
return { ...item, precision: parseInt(v) };
} else if (key === "valueType" && (item.key === "originSqlContent" || item.key === "originFormulaContent")) {
return {
...item,
@ -133,11 +135,11 @@ class SalaryItemForm extends Component {
return { ...item };
})
}, () => {
// if (key === "valueType" && !this.props.isLedger) {
// onChangeFieldsItem({ formulaContent: "", formulaId: 0, valueType: v });
// } else {
onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary" || key === "hideDefault") ? Number(v) : v });
// }
if (key === "dataType") {
onChangeFieldsItem({ [key]: v, defaultValue: "" });
} else {
onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary" || key === "hideDefault") ? Number(v) : v });
}
});
};
@ -148,7 +150,7 @@ class SalaryItemForm extends Component {
<WeaSearchGroup showGroup needTigger={false}>
{
_.map(salaryItemFieldsList, item => {
const { key, label, type, viewAttr, tip, options, display = true, multiple = false } = item;
const { key, label, type, viewAttr, tip, options, display = true, multiple = false, precision = 0 } = item;
const value = !_.isNil(request[key]) ? request[key].toString() : "";
return <React.Fragment>
{
@ -181,9 +183,10 @@ class SalaryItemForm extends Component {
(type === "INPUTNUMBER" && display) ?
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
<React.Fragment>
<WeaInputNumber value={value} viewAttr={viewAttr} precision={0}
min={key === "width" ? 0 : -99999}
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/>
<WeaInputNumber
value={key === "width" && value ? parseInt(value) : value}
precision={precision} viewAttr={viewAttr}
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/>
{key === "width" && display &&
<span style={{ paddingLeft: 10, position: "absolute", marginTop: 4 }}>px</span>}
</React.Fragment>

View File

@ -246,7 +246,9 @@ class PlanSetTable extends Component {
{ key: "5", showname: "5" },
{ key: "6", showname: "6" },
{ key: "7", showname: "7" },
{ key: "8", showname: "8" }
{ key: "8", showname: "8" },
{ key: "9", showname: "9" },
{ key: "10", showname: "10" }
]} viewAttr={showOperateBtn ? 2 : 1}
onChange={validNum => onEdit({
record: { ...record, validNum },

View File

@ -458,7 +458,9 @@ export class payrollStore {
departmentIds: form.departmentIds ? form.departmentIds.split(",") : [],
subCompanyIds: form.subCompanyIds ? form.subCompanyIds.split(",") : []
};
this.loading = true;
API.getInfoList(params).then(res => {
this.loading = false;
if (res.status) {
this.salaryGrantTableStore = res.data.columns;
this.salaryGrantDataSource = res.data.list;
@ -470,7 +472,7 @@ export class payrollStore {
} else {
message.error(res.errormsg || "获取失败");
}
});
}).catch(() => this.loading = false);
};
// 工资单-工资单发放详情列表