From 1ad44f50065b1bd0a9cba9832e76553e429d7a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 7 Jan 2026 17:44:23 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=92=B1=E6=99=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculate/calculate.js | 12 +- .../components/calculateTablelist/index.js | 4 +- pc4mobx/hrmSalary/pages/calculate/config.js | 14 +- .../components/ledgerBaseSetting.js | 160 ++++++++---------- pc4mobx/hrmSalary/pages/ledgerPage/config.js | 9 +- 5 files changed, 105 insertions(+), 94 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index a91cf275..bcf88908 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; +import { WeaBrowser, WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; import { WeaForm } from "comsMobx"; import { Button, message, Modal } from "antd"; import moment from "moment"; @@ -271,6 +271,14 @@ class Calculate extends Component { queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance, selectedRowKeys, loading } = this.state; + const itemRender = { + cityIds: (field, textAreaProps, form, formParams) => { + return ( { + form.updateFields({ cityIds: { value: v } }); + this.forceUpdate(); + }}/>); + } + }; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon @@ -283,7 +291,7 @@ class Calculate extends Component { ]}>
- +
diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index f0928ada..a0ce1b94 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -30,12 +30,12 @@ class Index extends Component { getSalaryAcctList = (props) => { const { pageInfo } = this.state, { queryParams, form } = props; - const { taxAgentIds } = form.getFormParams(); + const { taxAgentIds, ...extraFormparams } = form.getFormParams(); const { dateRange, ...extra } = queryParams; const [startMonthStr, endMonthStr] = dateRange || []; const params = { startMonthStr, endMonthStr, ...extra }; const payload = { - ...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] + ...pageInfo, ...params, ...extraFormparams, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] }; this.setState({ loading: true }); getSalaryAcctList(payload).then(({ status, data }) => { diff --git a/pc4mobx/hrmSalary/pages/calculate/config.js b/pc4mobx/hrmSalary/pages/calculate/config.js index 287b57c0..ded319a6 100644 --- a/pc4mobx/hrmSalary/pages/calculate/config.js +++ b/pc4mobx/hrmSalary/pages/calculate/config.js @@ -6,7 +6,7 @@ export const queryConditions = [ domkey: ["taxAgentIds"], fieldcol: 14, label: "个税扣缴义务人", - lanI: 111, + lanId: 111, otherParams: { showSearch: true, optionFilterProp: "children" }, @@ -15,8 +15,18 @@ export const queryConditions = [ labelcol: 6, value: "", viewAttr: 2 + }, + { + conditionType: "BROWSER", + domkey: ["cityIds"], + fieldcol: 14, + label: "所属城市", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 } ], defaultshow: true } -]; +]; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index 1efcad82..6305536c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -5,7 +5,16 @@ * Date: 2022/12/9 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom"; +import { + WeaBrowser, + WeaCheckbox, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaLocaleProvider, + WeaSelect, + WeaTextarea +} from "ecCom"; import { Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { baseSettingFormItem } from "../config"; @@ -18,7 +27,6 @@ import { getSubtractMonthYearMonth, prefixAddZero } from "../../../util/date"; -import { commonEnumList } from "../../../apis/ruleconfig"; import { postFetch } from "../../../util/request"; import moment from "moment"; import cs from "classnames"; @@ -26,14 +34,12 @@ import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; -@inject("taxAgentStore") -@observer +@inject("taxAgentStore") @observer class LedgerBaseSetting extends Component { constructor(props) { super(props); this.state = { - baseForm: [], - settingBaseInfo: { + baseForm: [], settingBaseInfo: { name: "", taxAgentId: "", taxableItems: "1", @@ -44,6 +50,8 @@ class LedgerBaseSetting extends Component { attendCycleFromDay: "1", socialSecurityCycleType: "3", description: "", + city: "", + cityData: [], canEdit: false } }; @@ -83,6 +91,8 @@ class LedgerBaseSetting extends Component { attendCycleFromDay: "1", socialSecurityCycleType: "3", description: "", + city: "", + cityData: [], canEdit: "true" } }, () => this.props.onTaxableItemsChange(this.state.settingBaseInfo.taxableItems)); @@ -102,8 +112,7 @@ class LedgerBaseSetting extends Component { }); this.setState({ settingBaseInfo: { - ...settingBaseInfo, - ...tmpV + ...settingBaseInfo, ...tmpV, cityData: basicForm["cityData"] || [] } }, () => { this.props.onSaveParams(this.state.settingBaseInfo); @@ -137,10 +146,8 @@ class LedgerBaseSetting extends Component { baseForm: _.map(baseForm, it => { if (it.key === "taxableItems") { return { - ...it, - options: _.map(data, it => ({ - key: it.value.toString(), - showname:
+ ...it, options: _.map(data, it => ({ + key: it.value.toString(), showname:
{it.defaultLabel} @@ -161,8 +168,7 @@ class LedgerBaseSetting extends Component { const { settingBaseInfo } = this.state; this.setState({ settingBaseInfo: { - ...settingBaseInfo, - [key]: value + ...settingBaseInfo, [key]: value } }, () => { onSaveParams(this.state.settingBaseInfo); @@ -176,49 +182,43 @@ class LedgerBaseSetting extends Component { const { canEdit, taxAgentId } = settingBaseInfo; let taxAgentIdDisabled = false, taxableItemsDisabled = false; const admin = editId ? record.opts.includes("admin") : true; - return ( -
- - - { - _.map(baseForm, item => { - const { key, label, type, options = [], children = [], multiple = false } = item; - taxAgentIdDisabled = key === "taxAgentId" && editId && !PageAndOptAuth.isChief; - taxableItemsDisabled = key === "taxableItems" && editId; - return - { - type === "INPUT" ? - this.handleChangeField(key, v)}/> : - type === "TEXTAREA" ? - this.handleChangeField(key, v)}/> : - type === "CHECKBOX" ? - - - - : - type === "SELECT" ? - this.handleChangeField(key, v)}/> : - type === "CUSTOM" ? - this.handleChangeField(key, v)}/> : null - } - ; - }) - } - - - -
- ); + return (
+ + + {_.map(baseForm, item => { + const { + key, label, type, options = [], children = [], multiple = false, browserType + } = item; + taxAgentIdDisabled = key === "taxAgentId" && editId && !PageAndOptAuth.isChief; + taxableItemsDisabled = key === "taxableItems" && editId; + return + {type === "INPUT" ? this.handleChangeField(key, v)}/> : type === "TEXTAREA" ? + this.handleChangeField(key, v)}/> : type === "CHECKBOX" ? + + + + : type === "SELECT" ? + this.handleChangeField(key, v)}/> : type === "CUSTOM" ? + this.handleChangeField(key, v)}/> : type === "BROWSER" ? + this.handleChangeField(key, v)}/> : null} + ; + })} + + + +
); } } @@ -228,15 +228,13 @@ const CustomSelect = (props) => { const { list, baseInfo, onChange, inputStr, admin } = props; const selectInfo = buildEditBasicInfo(baseInfo); return - { - _.map(list, item => { - const { key, options = [] } = item; - return - onChange(key, v)}/> - ; - }) - } + {_.map(list, item => { + const { key, options = [] } = item; + return + onChange(key, v)}/> + ; + })} {inputStr === "salaryCycleStrObj" ? selectInfo.salaryCycleInfo.salaryPeriodTip : selectInfo.attendCycleInfo.attendancePeriodTip} ; @@ -323,15 +321,11 @@ const buildSalaryInfo = (editBasicInfo, monthCal, nowYear, nowMonth) => { if (salaryCycleFromDayNum === 1) { customInfo.salaryPeriodTip = "至" + nowMonthStr + "最后一天"; - customInfo.salaryPeriodStart = customInfo.salaryYear + "-" - + prefixAddZero(customInfo.salaryMonth, 2) + "-01"; - customInfo.salaryPeriodEnd = customInfo.salaryYear + "-" - + prefixAddZero(customInfo.salaryMonth, 2) + "-" - + prefixAddZero(getMonthDays(customInfo.salaryYear, customInfo.salaryMonth), 2); + customInfo.salaryPeriodStart = customInfo.salaryYear + "-" + prefixAddZero(customInfo.salaryMonth, 2) + "-01"; + customInfo.salaryPeriodEnd = customInfo.salaryYear + "-" + prefixAddZero(customInfo.salaryMonth, 2) + "-" + prefixAddZero(getMonthDays(customInfo.salaryYear, customInfo.salaryMonth), 2); } else { customInfo.salaryPeriodTip = "至" + nextMonthStr + (salaryCycleFromDayNum - 1) + "号"; - customInfo.salaryPeriodStart = customInfo.salaryYear + "-" - + prefixAddZero(customInfo.salaryMonth, 2) + "-" + prefixAddZero(salaryCycleFromDayNum, 2); + customInfo.salaryPeriodStart = customInfo.salaryYear + "-" + prefixAddZero(customInfo.salaryMonth, 2) + "-" + prefixAddZero(salaryCycleFromDayNum, 2); let year = customInfo.salaryYear; let month = customInfo.salaryMonth; if (month === "12") { @@ -340,9 +334,7 @@ const buildSalaryInfo = (editBasicInfo, monthCal, nowYear, nowMonth) => { } else { month = Number(month) + 1; } - customInfo.salaryPeriodEnd = year + "-" - + prefixAddZero(month, 2) + "-" - + prefixAddZero(salaryCycleFromDayNum - 1, 2); + customInfo.salaryPeriodEnd = year + "-" + prefixAddZero(month, 2) + "-" + prefixAddZero(salaryCycleFromDayNum - 1, 2); } return customInfo; }; @@ -358,24 +350,18 @@ const buildAttendanceInfo = (editBasicInfo, monthCal, nowYear, nowMonth) => { if (attendCycleFromDayNum === 1) { customInfo.attendancePeriodTip = "至" + nowMonthStr + "最后一天"; - customInfo.attendancePeriodStart = year + "-" - + prefixAddZero(month, 2) + "-01"; - customInfo.attendancePeriodEnd = year + "-" - + prefixAddZero(month, 2) + "-" - + prefixAddZero(getMonthDays(year, month), 2); + customInfo.attendancePeriodStart = year + "-" + prefixAddZero(month, 2) + "-01"; + customInfo.attendancePeriodEnd = year + "-" + prefixAddZero(month, 2) + "-" + prefixAddZero(getMonthDays(year, month), 2); } else { customInfo.attendancePeriodTip = "至" + nextMonthStr + (attendCycleFromDayNum - 1) + "号"; - customInfo.attendancePeriodStart = year + "-" - + prefixAddZero(month, 2) + "-" + prefixAddZero(attendCycleFromDayNum, 2); + customInfo.attendancePeriodStart = year + "-" + prefixAddZero(month, 2) + "-" + prefixAddZero(attendCycleFromDayNum, 2); if (month === "12") { year = (Number(year) + 1).toString(); month = "1"; } else { month = (Number(month) + 1).toString(); } - customInfo.attendancePeriodEnd = year + "-" - + prefixAddZero(month, 2) + "-" - + prefixAddZero(attendCycleFromDayNum - 1, 2); + customInfo.attendancePeriodEnd = year + "-" + prefixAddZero(month, 2) + "-" + prefixAddZero(attendCycleFromDayNum - 1, 2); } return customInfo; }; @@ -390,4 +376,4 @@ const getMonth = (salaryCycleType) => { case "4": // 下月 return getAddMonthYearMonth(1); } -}; +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js index 46ca9d57..234c69c9 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js @@ -554,6 +554,13 @@ export const baseSettingFormItem = [ label: "核算人员范围", type: "CHECKBOX" }, + { + key: "city", + label: "所属城市", + type: "BROWSER", + browserType: 58, + multiple: false + }, { key: "description", label: "备注", @@ -931,4 +938,4 @@ export const ruleConditions = [//调薪计薪规则项表单 ], defaultshow: true } -]; +]; \ No newline at end of file