From 70f2d606fd44e6af554c15ecf72579c188fb8bbc Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 15 Apr 2025 16:12:16 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/components/FormInfo/index.js | 2 +- .../pages/custom-pages/lingyue/baseLayout.js | 42 ++++++++++++------- .../lingyue/components/baseReportList.js | 3 +- .../lingyue/components/conditions.js | 14 ++++++- .../lingyue/salaryPaymentReport/index.js | 2 +- .../lingyue/salaryStatisticsReport/index.js | 4 +- .../lingyue/salaryTaxReturnForm/index.js | 2 +- 7 files changed, 46 insertions(+), 23 deletions(-) diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js index d6940489..d0d87963 100644 --- a/pc4mobx/hrmSalary/components/FormInfo/index.js +++ b/pc4mobx/hrmSalary/components/FormInfo/index.js @@ -67,7 +67,7 @@ export default class FormInfo extends Component { } } coms != null && formItems.push({ - com: ({coms}), + com: ({coms}), hide: field.hide, col }); diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js index bf66d6e1..30414232 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js @@ -13,6 +13,7 @@ import FormInfo from "../../../components/FormInfo"; import { getffgsAllList } from "../../../apis/custom-apis/lingyue"; import { baseConditions } from "./components/conditions"; import CustomSelect from "../../../components/CustomSelect"; +import { postFetch } from "../../../util/request"; import { WeaSwitch } from "comsMobx"; import moment from "moment"; import { Button } from "antd"; @@ -28,22 +29,29 @@ class Layout extends Component { } componentDidMount() { - this.init(); + const promise = this.init(); } - init = () => { - getffgsAllList().then(({ status, data }) => { - if (status) this.setState({ - conditions: _.map(baseConditions, item => ({ - ...item, items: _.map(item.items, o => { - if (getKey(o) === "fycdgsqc") { - return { ...o, options: _.map(data, o => ({ ...o, name: o.content })) }; - } - return { ...o, label: getLabel(o.lanId, o.label), value: moment().format("YYYY-MM") }; - }) - })) - }, () => this.props.form.initFormFields(this.state.conditions)); - }); + init = async () => { + const [{ data: fycdgsOptions }, { data: taxAgentList }] = await Promise.all([ + getffgsAllList(), + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) + ]); + this.setState({ + conditions: _.map(baseConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "fycdgsqc") { + return { ...o, options: _.map(fycdgsOptions, o => ({ ...o, name: o.content })) }; + } else if (getKey(o) === "taxAgentIds") { + return { + ...o, hide: this.props.type === "salaryStatistic", + options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) + }; + } + return { ...o, label: getLabel(o.lanId, o.label), value: moment().format("YYYY-MM") }; + }) + })) + }, () => this.props.form.initFormFields(this.state.conditions)); }; render() { @@ -62,13 +70,17 @@ class Layout extends Component { salaryMonth: (field, textAreaProps, form, formParams) => { return (); + }, + taxAgentIds: (field, textAreaProps, form, formParams) => { + return (); } }; return ( } buttons={buttons} showDropIcon={false} iconBgcolor="#F14A2D" className="custom_salary_lingyue">
- {this.props.children}
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js index 21f6352a..556e5e9f 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js @@ -82,7 +82,8 @@ export default class BaseReportList extends Component { const { form, type } = this.props, { pageInfo, selectedRowKeys, sumDataSource } = this.state; const payload = { ...pageInfo, ...form.getFormParams(), - fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : [] + fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : [], + taxAgentIds: form.getFormParams().taxAgentIds ? form.getFormParams().taxAgentIds.split(",") : [] }; this.setState({ loading: true }); interfaceType[type]["list"](payload).then(({ status, data, errormsg }) => { diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js index cbb76a72..dce25587 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js @@ -44,7 +44,6 @@ export const baseConditions = [ { items: [ { - colSpan: 1, conditionType: "MONTHPICKER", domkey: ["salaryMonth"], fieldcol: 16, @@ -55,7 +54,18 @@ export const baseConditions = [ viewAttr: 2 }, { - colSpan: 1, + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 16, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + options: [], + multiple: true, + value: "", + viewAttr: 2 + }, + { conditionType: "SELECT", domkey: ["fycdgsqc"], fieldcol: 16, diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryPaymentReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryPaymentReport/index.js index 94103205..b3ac9aab 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryPaymentReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryPaymentReport/index.js @@ -35,7 +35,7 @@ class Index extends Component { render() { const { isQuery } = this.state; return ( this.setState({ isQuery: !isQuery })}> + onChange={() => this.setState({ isQuery: !isQuery })} type="paymentReport"> ); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryStatisticsReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryStatisticsReport/index.js index 30188882..61f4e72a 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryStatisticsReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryStatisticsReport/index.js @@ -34,8 +34,8 @@ class Index extends Component { render() { const { isQuery } = this.state; - return ( this.setState({ isQuery: !isQuery })}> + return ( this.setState({ isQuery: !isQuery })} type="salaryStatistic"> ); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryTaxReturnForm/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryTaxReturnForm/index.js index 750464d7..92874aba 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryTaxReturnForm/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryTaxReturnForm/index.js @@ -35,7 +35,7 @@ class Index extends Component { render() { const { isQuery } = this.state; return ( this.setState({ isQuery: !isQuery })}> + onChange={() => this.setState({ isQuery: !isQuery })} type="taxReturn"> ); }