Merge branch 'release/3.0.1.2504.01-合并业务线' into custom/万君筑天科技-合并业务线

# Conflicts:
#	pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
This commit is contained in:
lys 2025-04-24 17:08:00 +08:00
commit e01ee211d8
7 changed files with 68 additions and 50 deletions

View File

@ -166,7 +166,7 @@ class SalaryDetails extends Component {
this.postMessageToChild({ this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow, dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
columns: _.map(columns, (it, idx) => ({ columns: _.map(columns, (it, idx) => ({
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true, dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true, showSee: false,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth), width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
ellipsis: true ellipsis: true

View File

@ -5,10 +5,10 @@
* Date: 2023/3/7 * Date: 2023/3/7
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTable, WeaTop } from "ecCom"; import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
import { viewAttendQuote } from "../../../../apis/attendance"; import { viewAttendQuote } from "../../../../apis/attendance";
import AttendanceDataEditSlide from "./attendanceDataEditSlide"; import AttendanceDataEditSlide from "./attendanceDataEditSlide";
import { Button } from "antd"; import { Button, Spin } from "antd";
import "./index.less"; import "./index.less";
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@ -17,11 +17,32 @@ class AttendanceDataViewSlide extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loading: { query: false }, keyword: "", dataSource: [], columns: [], loading: { query: false }, keyword: "", dataSource: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }, attendanceSlide: { visible: false, record: {} } pageInfo: { current: 1, pageSize: 10, total: 0 }, attendanceSlide: { visible: false, record: {} }
}; };
} }
componentDidMount() {
window.addEventListener("message", this.handleReceive, false);
}
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "turn") {
switch (id) {
case "PAGEINFO":
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.viewAttendQuote());
break;
default:
break;
}
}
};
componentWillReceiveProps(nextProps, nextContext) { componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) { if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".attendanceRefWrapper").classList.add("zIndex0-attendance"); document.querySelector(".attendanceRefWrapper").classList.add("zIndex0-attendance");
@ -34,27 +55,29 @@ class AttendanceDataViewSlide extends Component {
viewAttendQuote = (extraPayload = {}, props) => { viewAttendQuote = (extraPayload = {}, props) => {
const { loading, pageInfo, keyword } = this.state; const { loading, pageInfo, keyword } = this.state;
const { attendQuoteId } = props; const { attendQuoteId } = props || this.props;
this.setState({ loading: { ...loading, query: true } }); this.setState({ loading: { ...loading, query: true } });
viewAttendQuote({ ...pageInfo, attendQuoteId, keyword, ...extraPayload }).then(({ status, data }) => { viewAttendQuote({ ...pageInfo, attendQuoteId, keyword, ...extraPayload }).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } }); this.setState({ loading: { ...loading, query: false } });
if (status) { if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo; const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
this.setState({ this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
columns: [ }, () => this.postMessageToChild({
..._.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : null })), pageInfo: this.state.pageInfo, dataSource, showRowSelection: false, unitTableType: "attendanceView",
{ columns: _.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : false }))
title: getLabel(111, "操作"), dataIndex: "operate", width: 80, }));
render: (__, record) => (<a href="JavaScript:void(0);" onClick={() => this.setState({
attendanceSlide: { visible: true, record }
})}>{getLabel(111, "编辑")}</a>)
}
]
});
} }
}).catch(() => this.setState({ loading: { ...loading, query: false } })); }).catch(() => this.setState({ loading: { ...loading, query: false } }));
}; };
postMessageToChild = (payload = {}) => {
const i18n = {
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
"条": getLabel(18256, "条")
};
const childFrameObj = document.getElementById("attendanceViewTable");
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
handleExportAttendQuote = () => { handleExportAttendQuote = () => {
if (!this.handleDebounce) { if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => { this.handleDebounce = _.debounce(() => {
@ -69,24 +92,7 @@ class AttendanceDataViewSlide extends Component {
render() { render() {
const { showOperateBtn, salaryYearMonth, ...extra } = this.props; const { showOperateBtn, salaryYearMonth, ...extra } = this.props;
const { columns, dataSource, loading, pageInfo, keyword, attendanceSlide } = this.state; const { loading, keyword, attendanceSlide } = this.state;
const pagination = {
...pageInfo,
showTotal: (total) => `${total}`,
pageSizeOptions: ["10", "20", "50", "100"],
showSizeChanger: true,
showQuickJumper: true,
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.viewAttendQuote({}, this.props));
},
onChange: (current) => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.viewAttendQuote({}, this.props));
}
};
const btns = [ const btns = [
<Button type="primary" onClick={this.handleExportAttendQuote}>{getLabel(81272, "导出全部")}</Button>, <Button type="primary" onClick={this.handleExportAttendQuote}>{getLabel(81272, "导出全部")}</Button>,
<WeaInputSearch <WeaInputSearch
@ -108,9 +114,16 @@ class AttendanceDataViewSlide extends Component {
<div>{getLabel(543376, "考勤周期")}{salaryYearMonth}</div> <div>{getLabel(543376, "考勤周期")}{salaryYearMonth}</div>
<div></div> <div></div>
</div> </div>
<WeaTable <div style={{ height: `calc(100% - 40px)` }}>
columns={columns} dataSource={dataSource} bordered pagination={pagination} <Spin spinning={loading.query}>
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/> <iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/unitTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
id="attendanceViewTable"
/>
</Spin>
</div>
<AttendanceDataEditSlide {...attendanceSlide} <AttendanceDataEditSlide {...attendanceSlide}
onSuccess={() => this.viewAttendQuote({}, this.props)} onSuccess={() => this.viewAttendQuote({}, this.props)}
onClose={() => this.setState({ onClose={() => this.setState({

View File

@ -54,8 +54,8 @@
margin-bottom: 8px; margin-bottom: 8px;
} }
.wea-new-table { .ant-spin-nested-loading, .ant-spin-container {
background: #FFF; height: 100%;
} }
} }

View File

@ -73,9 +73,14 @@ class CustomTreeSelect extends Component {
const { itemName } = detail; const { itemName } = detail;
return ( return (
<TreeSelect dropdownStyle={{ maxHeight: 320, overflow: "auto" }} defaultValue={itemName} <TreeSelect dropdownStyle={{ maxHeight: 320, overflow: "auto" }} defaultValue={itemName}
dropdownMatchSelectWidth className="custom_item_treeselect" dropdownMatchSelectWidth className="custom_item_treeselect" showSearch
loadData={(node) => this.getSourceItem(node.props.value)} loadData={(node) => this.getSourceItem(node.props.value)}
onSelect={this.handleSelect}> onSelect={this.handleSelect}
treeNodeFilterProp="title"
filterTreeNode={(inputValue, treeNode) => {
const title = treeNode.props.title.props ? treeNode.props.title.props.children[0].props.children : treeNode.props.title;
return title.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
}}>
{ {
_.map(sourceList, o => ( _.map(sourceList, o => (
<TreeNode title={o.value} key={o.key} value={o.key} isLeaf={o.isLeaf} selectable={false}> <TreeNode title={o.value} key={o.key} value={o.key} isLeaf={o.isLeaf} selectable={false}>

View File

@ -17,7 +17,7 @@ class Index extends Component {
return ( return (
<div className="salary-btn-flex"> <div className="salary-btn-flex">
<div className="mounth-range"> <div className="mounth-range">
<span className="label">{getLabel(543549, "薪资所属月")}</span> <span className="label">{getLabel(111, "税款所属期")}</span>
<MonthRangePicker dateRange={dateRange} viewAttr={2} <MonthRangePicker dateRange={dateRange} viewAttr={2}
onChange={v => this.props.onChange({ dateRange: v })}/> onChange={v => this.props.onChange({ dateRange: v })}/>
</div> </div>

View File

@ -8,7 +8,7 @@ import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom"; import { WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, message, Modal } from "antd"; import { Dropdown, Menu, message, Modal } from "antd";
import { getDeclareList, withDrawTaxDeclaration } from "../../../../apis/declare"; import { getDeclareList, withDrawTaxDeclaration } from "../../../../apis/declare";
import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import { sysConfCodeRule, sysinfo } from "../../../../apis/ruleconfig";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -35,18 +35,19 @@ class Index extends Component {
if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" }); if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" });
}); });
}; };
getDeclareList = (props) => { getDeclareList = async (props) => {
const { pageInfo } = this.state; const { data: sysData } = await sysinfo();
const { queryParams } = props; const { pageInfo } = this.state, { queryParams } = props;
const { dateRange, ...extra } = queryParams; const { dateRange, ...extra } = queryParams;
const [fromSalaryMonthStr, endSalaryMonthStr] = dateRange || []; const [fromSalaryMonth, endSalaryMonth] = dateRange || [];
const params = { fromSalaryMonthStr, endSalaryMonthStr, ...extra }; const params = { fromSalaryMonth: fromSalaryMonth + "-01", endSalaryMonth: endSalaryMonth + "-01", ...extra };
const payload = { ...pageInfo, ...params }; const payload = { ...pageInfo, ...params };
this.setState({ loading: true }); this.setState({ loading: true });
getDeclareList(payload).then(({ status, data }) => { getDeclareList(payload).then(({ status, data }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
const { columns, list: dataSource, pageNum, pageSize, total } = data; let { columns, list: dataSource, pageNum, pageSize, total } = data;
sysData["TAX_DECLARATION_DATE_TYPE"] === "1" && (columns = _.filter(columns, o => o.dataIndex !== "salaryMonth"));
this.setState({ this.setState({
dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total }, dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total },
columns: _.map(columns, o => { columns: _.map(columns, o => {

View File

@ -59,7 +59,6 @@ class PersonalScopeModal extends Component {
...scopeSelectLinkageDatas[cur], ...scopeSelectLinkageDatas[cur],
browserConditionParam: { browserConditionParam: {
...scopeSelectLinkageDatas[cur].browserConditionParam, ...scopeSelectLinkageDatas[cur].browserConditionParam,
isSingle: true,
replaceDatas: !_.isEmpty(record) ? [{ replaceDatas: !_.isEmpty(record) ? [{
id: String(record.targetId), id: String(record.targetId),
name: record.targetName name: record.targetName