release/2.19.1.2501.01

This commit is contained in:
lys 2025-04-18 16:21:49 +08:00
parent 82ffd93fd5
commit ae43a2aa7c
5 changed files with 97 additions and 14 deletions

View File

@ -6,7 +6,8 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom"; import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
import { WeaForm } from "comsMobx";
import { Button, message, Modal } from "antd"; import { Button, message, Modal } from "antd";
import moment from "moment"; import moment from "moment";
import CalculateQuery from "./components/calculateQuery"; import CalculateQuery from "./components/calculateQuery";
@ -15,9 +16,15 @@ import CalculateDialog from "./components/calculateDialog";
import ProgressModal from "../../components/progressModal"; import ProgressModal from "../../components/progressModal";
import LogDialog from "../../components/logViewModal"; import LogDialog from "../../components/logViewModal";
import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate";
import FormInfo from "../../components/FormInfo";
import { queryConditions } from "./config";
import { getTaxAgentSelectList } from "../../apis/taxAgent";
import cs from "classnames";
import "./index.less"; import "./index.less";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const form = new WeaForm();
@inject("calculateStore", "taxAgentStore") @inject("calculateStore", "taxAgentStore")
@observer @observer
@ -31,17 +38,32 @@ class Calculate extends Component {
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM") moment(new Date()).endOf("year").format("YYYY-MM")
] ]
}, isRefresh: false, logDialogVisible: false, }, isRefresh: false, logDialogVisible: false, conditions: [],
progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") },
calcDaialog: { visible: false, title: "" } calcDaialog: { visible: false, title: "" }, showAdvance: false
}; };
this.timer = null; this.timer = null;
this.handleDebounce = null; this.handleDebounce = null;
} }
async componentDidMount() {
const { data } = await getTaxAgentSelectList();
this.setState({
conditions: _.map(queryConditions, item => ({
...item, items: _.map(item.items, o => {
o = { ...o, label: getLabel(o.lanId, o.label) };
if (getKey(o) === "taxAgentIds") {
return { ...o, options: _.map(data, k => ({ key: k.id, showname: k.content })) };
}
return { ...o };
})
}))
}, () => form.initFormFields(this.state.conditions));
}
renderCalculateOpts = () => { renderCalculateOpts = () => {
const { taxAgentStore: { showOperateBtn } } = this.props; const { taxAgentStore: { showOperateBtn } } = this.props;
const { queryParams, isRefresh } = this.state; const { queryParams, isRefresh, showAdvance } = this.state;
let calculateOpts = [ let calculateOpts = [
<Button type="primary" onClick={() => this.setState({ <Button type="primary" onClick={() => this.setState({
calcDaialog: { calcDaialog: {
@ -49,10 +71,11 @@ class Calculate extends Component {
title: getLabel(538780, "核算") title: getLabel(538780, "核算")
} }
})}>{getLabel(538780, "核算")}</Button>, })}>{getLabel(538780, "核算")}</Button>,
<CalculateQuery queryParams={queryParams} onChange={v => this.setState({ <CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })}
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, onChange={v => this.setState({
queryParams: { ...queryParams, ...v } isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> queryParams: { ...queryParams, ...v }
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
]; ];
return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts;
}; };
@ -188,7 +211,9 @@ class Calculate extends Component {
}; };
render() { render() {
const { queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions } = this.state; const {
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance
} = this.state;
return ( return (
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" <WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon
@ -201,7 +226,18 @@ class Calculate extends Component {
]} ]}
> >
<div className="calculate-body"> <div className="calculate-body">
<CalculateTablelist queryParams={queryParams} isRefresh={isRefresh} onCalcOpts={this.handleCalcOpts}/> <div className={cs("advance-calc", { "show-advance-calc": showAdvance })}>
<FormInfo center={false} itemRender={{}} form={form} formFields={conditions} colCount={2}/>
<div className="advance-calc-btns">
<Button type="primary"
onClick={() => this.setState({ isRefresh: !isRefresh })}>{getLabel(111, "搜索")}</Button>
<Button type="ghost" onClick={() => form.resetForm()}>{getLabel(111, "重置")}</Button>
<Button type="ghost"
onClick={() => this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "取消")}</Button>
</div>
</div>
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
onCalcOpts={this.handleCalcOpts}/>
<CalculateDialog {...calcDaialog} <CalculateDialog {...calcDaialog}
onCancel={(bool, id) => this.setState({ onCancel={(bool, id) => this.setState({
calcDaialog: { ...calcDaialog, visible: false }, calcDaialog: { ...calcDaialog, visible: false },

View File

@ -27,7 +27,7 @@ class Index extends Component {
onChange={v => this.props.onChange({ name: v })} onChange={v => this.props.onChange({ name: v })}
onSearch={this.props.onSearch} onSearch={this.props.onSearch}
/> />
<a href="javascript:void(0);">{getLabel(111, "高级搜索")}</a> <a href="javascript:void(0);" onClick={this.props.onAdvance}>{getLabel(111, "高级搜索")}</a>
</div> </div>
</div> </div>
); );

View File

@ -29,12 +29,14 @@ class Index extends Component {
} }
getSalaryAcctList = (props) => { getSalaryAcctList = (props) => {
const { pageInfo } = this.state; const { pageInfo } = this.state, { queryParams, form } = props;
const { queryParams } = props; const { taxAgentIds } = form.getFormParams();
const { dateRange, ...extra } = queryParams; const { dateRange, ...extra } = queryParams;
const [startMonthStr, endMonthStr] = dateRange || []; const [startMonthStr, endMonthStr] = dateRange || [];
const params = { startMonthStr, endMonthStr, ...extra }; const params = { startMonthStr, endMonthStr, ...extra };
const payload = { ...pageInfo, ...params }; const payload = {
...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : []
};
this.setState({ loading: true }); this.setState({ loading: true });
getSalaryAcctList(payload).then(({ status, data }) => { getSalaryAcctList(payload).then(({ status, data }) => {
this.setState({ loading: false }); this.setState({ loading: false });

View File

@ -0,0 +1,19 @@
export const queryConditions = [
{
items: [
{
conditionType: "SELECT",
domkey: ["taxAgentIds"],
fieldcol: 14,
label: "个税扣缴义务人",
lanI: 111,
multiple: true,
options: [],
labelcol: 6,
value: "",
viewAttr: 2
}
],
defaultshow: true
}
];

View File

@ -90,6 +90,32 @@
overflow-y: hidden; overflow-y: hidden;
} }
.advance-calc {
display: none;
background: #FFF;
margin-bottom: 8px;
.advance-calc-btns {
display: flex;
justify-content: center;
align-items: center;
padding: 15px 0;
border-top: 1px solid #dadada;
button {
margin-right: 15px;
}
}
.wea-search-group, .wea-content {
padding: 0;
}
}
.show-advance-calc {
display: block;
}
.calculate-body { .calculate-body {
height: 100%; height: 100%;
width: 100%; width: 100%;