From fea2c5921e2d48e81a2b63afdfff1720061733a5 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 28 Oct 2025 15:07:15 +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 --- .../components/CustomSelect/index.js | 127 ++++++++++++++++++ .../components/CustomSelect/index.less | 43 ++++++ .../hrmSalary/components/FormInfo/index.js | 6 +- .../components/calculateDialog/index.js | 25 +++- pc4mobx/hrmSalary/pages/calculate/index.less | 7 +- .../components/attendanceRefrenceDataModal.js | 29 +++- .../dataAcquisition/cumDeduct/columns.js | 10 +- .../salaryCumDeductChooseTaxPeriodDialog.js | 37 +++-- .../pages/dataAcquisition/cumDeduct/index.js | 11 +- .../dataAcquisition/cumSituation/columns.js | 3 +- .../dataAcquisition/otherDeduct/columns.js | 3 +- .../components/condition.js | 3 +- .../declare/components/declareDialog/index.js | 24 +++- pc4mobx/hrmSalary/pages/declare/index.less | 7 +- .../components/advanceInputBtn/index.less | 4 +- .../components/salaryFileList/index.js | 23 +++- .../pages/variableSalary/conditions.js | 4 +- pc4mobx/hrmSalary/style/index.less | 8 +- 18 files changed, 323 insertions(+), 51 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/CustomSelect/index.js create mode 100644 pc4mobx/hrmSalary/components/CustomSelect/index.less diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.js b/pc4mobx/hrmSalary/components/CustomSelect/index.js new file mode 100644 index 00000000..43068096 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.js @@ -0,0 +1,127 @@ +/* + * 自定义多选下拉框 + * 支持搜索 + * @Author: 黎永顺 + * @Date: 2024/9/13 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaCheckbox, WeaInput, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import classNames from "classnames"; +import { Dropdown } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + visible: false, value: props.value ? props.value.split(",") : [], + keywords: "" + }; + } + + isAllChecked = () => { + const { options } = this.props, { value, keywords } = this.state; + let v = "0"; + if (_.uniq(value).length === options.filter(k => k.showname.indexOf(keywords) >= 0).length) v = "1"; + return v; + }; + + isChecked = (v) => { + const { value } = this.state; + return value.indexOf(v) > -1 ? "1" : "0"; + }; + onAllChange = (v) => { + const { options, onChange } = this.props, { keywords } = this.state; + let values = [], shownames = []; + if (v == 1) { + options.filter(k => k.showname.indexOf(keywords) >= 0).forEach(o => { + values.push(o.key); + shownames.push(o.showname); + }); + } + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; + + onItemChange = (v, id) => { + const { onChange, options } = this.props, { value } = this.state; + let values = !_.isEmpty(value) ? value : [], shownames = []; + if (v == "1") { + values.push(id); + } else { + values = values.filter(val => val !== id); + } + values.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + this.setState({ value: values }); + onChange && onChange(values.join(","), shownames.join(",")); + }; + + getList = () => { + const { options } = this.props, { keywords } = this.state; + let style = {}; + if (options.length > 5) style = { height: 200 }; + return
+ +
+ this.setState({ keywords })}/> +
+
+ + +
+ {options && options.filter(k => k.showname.indexOf(keywords) >= 0).map(o => { + return
+ this.onItemChange(v, o.key)} + > + +
; + })} +
+
; + }; + + getShownames = () => { + const { options } = this.props; + let { value } = this.state; + let shownames = []; + value.forEach(val => { + let target = options.filter((data) => data.key == val)[0]; + if (target) shownames.push(target.showname); + }); + return shownames.join(","); + }; + + render() { + const { visible } = this.state, { layout } = this.props; + const clsname = classNames({ + "wea-associative-search-mult": true + }); + return (
+ this.setState({ visible })} visible={visible} + getPopupContainer={() => (layout || document.body)}> +
+ {this.getShownames()} + {!this.state.visible ? : } +
+
+
); + } +} + +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/components/CustomSelect/index.less b/pc4mobx/hrmSalary/components/CustomSelect/index.less new file mode 100644 index 00000000..2f2d7288 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomSelect/index.less @@ -0,0 +1,43 @@ +.customMuiSelect { + border: none; + padding: 0; + + .wea-select-input { + min-width: 100px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + user-select: none; + + &:hover, &:focus { + border-color: #57c5f7; + } + + .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #979797; + } + } + +} + +.wea-select-panel { + padding: 5px 0; + max-height: 200px; + border-radius: 3px; + background: #fff; + border: 1px solid #ddd; + + .wea-select-panel-item { + padding: 5px 10px; + + &:hover { + background-color: #e9f7ff; + } + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js index d0d87963..83c939d5 100644 --- a/pc4mobx/hrmSalary/components/FormInfo/index.js +++ b/pc4mobx/hrmSalary/components/FormInfo/index.js @@ -89,10 +89,10 @@ export default class FormInfo extends Component { }; render() { - const { formFields, className, form } = this.props; + const { formFields, className, form, style = {} } = this.props; if (formFields == null || !form.isFormInit) return (
); return ( -
{this.renderForm()}
+
{this.renderForm()}
); } -} +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js index fc677ecd..e4096f4f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js @@ -8,9 +8,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; -import { getSearchs } from "../../../../util"; import { salaryacctGetForm, saveBasic } from "../../../../apis/calculate"; import { calculateConditions } from "./condition"; +import FormInfo from "../../../../components/FormInfo"; +import CustomSelect from "../../../../components/CustomSelect"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -79,6 +80,22 @@ class Index extends Component { render() { const { conditions, loading } = this.state; const { calculateStore: { calculateForm } } = this.props; + const itemRender = { + salarySobIds: (field, textAreaProps, form, formParams) => { + return ( + { + form.updateFields({ salarySobIds: { value: v } }); + this.forceUpdate(); + }}/> + { + _.isEmpty(formParams.salarySobIds) && + + + + } + ); + } + }; return ( {getLabel(111, "确定")} ]} > -
{getSearchs(calculateForm, conditions, 1, false)}
+ + {/*
{getSearchs(calculateForm, conditions, 1, false)}
*/}
); } } -export default Index; +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 1a95766c..78c54fb9 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -149,6 +149,11 @@ .calculate-dialog-layout { background: #f6f6f6; + .wea-required-e9 { + top: 0; + right: -14px; + } + .wea-form-item-wrapper { display: inline-block !important; } @@ -216,4 +221,4 @@ } } } -} +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js index 87f06a11..0dfb7194 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js @@ -9,7 +9,6 @@ import { inject, observer } from "mobx-react"; import { WeaDialog } from "ecCom"; import { Button, message } from "antd"; import { reFrenceConditions } from "../columns"; -import { getSearchs } from "../../../../util"; import { checkOperation, getAttendanceFieldSettingList, @@ -22,6 +21,8 @@ import SelectItemModal from "../../../../components/selectItemsModal"; import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper"; import { postFetch } from "../../../../util/request"; import "./index.less"; +import FormInfo from "../../../../components/FormInfo"; +import CustomSelect from "../../../../components/CustomSelect"; @inject("attendanceStore") @observer @@ -216,11 +217,29 @@ class AttendanceRefrenceDataModal extends Component { , ]; + const itemRender = { + salarySobIds: (field, textAreaProps, form, formParams) => { + return ( + { + form.updateFields({ salarySobIds: { value: v } }); + this.forceUpdate(); + }}/> + { + _.isEmpty(formParams.salarySobIds) && + + + + } + ); + } + }; return ( -
- {getSearchs(refenceform, condition, 1, false, null, "", "multiple_select")} -
+ + {/*
*/} + {/* {getSearchs(refenceform, condition, 1, false, null, "", "multiple_select")}*/} + {/*
*/} {/* 表头设置 */} { if (getKey(o) === "taxAgentIds") { return { - ...o, lable: getLabel(o.lanId, o.label), + ...o, + lable: getLabel(o.lanId, o.label), options: _.map(data, g => ({ key: String(g.id), showname: g.name })) }; } @@ -81,19 +81,28 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { render() { const { loading, conditions } = this.state; const { cumDeductStore: { cumTaxPeriodForm } } = this.props; - return ( - { + return ( { + form.updateFields({ taxAgentIds: { value: v } }); + this.forceUpdate(); + }}/>); + } + }; + return ({getLabel(33703, "确认")}]} bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")} > -
- {getSearchs(cumTaxPeriodForm, conditions, 1, false)} -
-
- ); + + + {/*
*/} + {/* {getSearchs(cumTaxPeriodForm, conditions, 1, false)}*/} + {/*
*/} +
); } } -export default SalaryCumDeductChooseTaxPeriodDialog; +export default SalaryCumDeductChooseTaxPeriodDialog; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index a7e896eb..187e1aea 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -35,6 +35,7 @@ import { getDomkes } from "../../../util"; import Layout from "../layout"; import moment from "moment"; import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductChooseTaxPeriodDialog"; +import CustomSelect from "../../../components/CustomSelect"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -609,8 +610,12 @@ export const DataCollectionSelect = (props) => { wrapperCol = 14, viewAttr = 2, multiple = false } = props; return - onChange({ key, value: val })} options={options} - viewAttr={viewAttr} multiple={multiple} showSearch optionFilterProp="children"/> + { + multiple ? + onChange({ key, value: val })} options={options}/> : + onChange({ key, value: val })} options={options} + viewAttr={viewAttr} multiple={multiple} showSearch optionFilterProp="children"/> + } ; }; @@ -638,4 +643,4 @@ export const DataCollectionDateRangePick = (props) => { }} /> ; -}; +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index d978e48a..f4df7257 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -22,6 +22,7 @@ export const dataCollectCondition = [ value: "", options: [], rules: "required|string", + otherParams: { showSearch: true, optionFilterProp: "children" }, viewAttr: 3 }, // { @@ -338,4 +339,4 @@ export const taxOptions = [ key: "12", showname: "十二月" } -]; +]; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index ef7f4489..8c727a15 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -22,6 +22,7 @@ export const dataCollectCondition = [ value: "", options: [], rules: "required|string", + otherParams: { showSearch: true, optionFilterProp: "children" }, viewAttr: 3 }, { @@ -635,4 +636,4 @@ export const taxDetailSettingsConditions = { defaultshow: true, col: 1 }] -}; +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js index 1e009b70..a00bd99d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js @@ -11,6 +11,7 @@ export const condition = [ value: "", options: [], rules: "required|string", + otherParams: { showSearch: true, optionFilterProp: "children" }, viewAttr: 3 }, { @@ -193,4 +194,4 @@ export const searchCondition = [ title: "常用条件", defaultshow: true } -]; +]; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js index 04396e25..c4598447 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js @@ -13,6 +13,8 @@ import { saveDeclare, taxdeclarationGetRate } from "../../../../apis/declare"; import { declareConditions } from "./condition"; import { postFetch } from "../../../../util/request"; import * as API from "../../../../apis/ruleconfig"; +import FormInfo from "../../../../components/FormInfo"; +import CustomSelect from "../../../../components/CustomSelect"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -112,6 +114,22 @@ class Index extends Component { render() { const { conditions, loading } = this.state; const { declareStore: { declareForm } } = this.props; + const itemRender = { + taxAgentIds: (field, textAreaProps, form, formParams) => { + return ( + { + form.updateFields({ taxAgentIds: { value: v } }); + this.forceUpdate(); + }}/> + { + _.isEmpty(formParams.taxAgentIds) && + + + + } + ); + } + }; return ( {getLabel(543618, "生成申报表")} ]} > -
{getSearchs(declareForm, conditions, 1, false)}
+ + {/*
{getSearchs(declareForm, conditions, 1, false)}
*/}
); } } -export default Index; +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less index a54ad83c..c463f48e 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.less +++ b/pc4mobx/hrmSalary/pages/declare/index.less @@ -57,6 +57,11 @@ .declare-dialog-layout { background: #f6f6f6; + .wea-required-e9 { + top: 0; + right: -14px; + } + .wea-search-group { padding: 16px; @@ -153,4 +158,4 @@ color: red; } } -} +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less index f301e571..709c383e 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less @@ -5,7 +5,7 @@ top: -1.5px; .wea-advanced-search { - top: 1px; + top: 2px!important; left: -1px; height: 28px; line-height: 1; @@ -25,4 +25,4 @@ white-space: nowrap; text-overflow: ellipsis; } -} +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f7309e98..03cbe602 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -10,16 +10,17 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; -import { WeaTableNew } from "comsMobx"; +import { WeaSwitch, WeaTableNew } from "comsMobx"; import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; -import { getSearchs } from "../../../../util"; import { extraConditions } from "../../conditions"; import AdvanceInputBtn from "../advanceInputBtn"; import SearchPannel from "../searchPannel"; import { postFetch } from "../../../../util/request"; import { toJS } from "mobx"; import cs from "classnames"; +import FormInfo from "../../../../components/FormInfo"; +import CustomSelect from "../../../../components/CustomSelect"; const WeaTableComx = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; @@ -173,9 +174,23 @@ class Index extends Component { if (dom && dataSource.length > 0) { height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62; } + const itemRender = { + taxAgentIds: (field, textAreaProps, form, formParams) => { + return ( { + form.updateFields({ taxAgentIds: { value: v } }); + this.getVariableSalaryList(); + }}/>); + }, + salaryMonth: (field, textAreaProps, form, formParams) => { + return (); + } + }; return (
- {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())} + + {/*{getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())}*/} this.openAdvanceSearch()} onAdvanceSearch={this.getVariableSalaryList}/>
@@ -202,4 +217,4 @@ class Index extends Component { } } -export default Index; +export default Index; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js index 9a9301cb..daa0d435 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js @@ -44,6 +44,7 @@ export const conditions = [ value: "", options: [], multiple: true, + hide: true, viewAttr: 2 }, { @@ -180,6 +181,7 @@ export const salaryFileConditions = [ value: "", options: [], rules: "required", + otherParams: { showSearch: true, optionFilterProp: "children" }, viewAttr: 3 }, { @@ -218,4 +220,4 @@ export const salaryFileConditions = [ title: "", col: 2, defaultshow: true } -]; +]; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 3d772d9e..19751375 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -39,6 +39,11 @@ .form-dialog-layout { background: #f6f6f6; + .wea-required-e9 { + top: 0; + right: -14px; + } + .wea-form-item-wrapper { display: block !important; } @@ -173,5 +178,4 @@ a:not(:last-child) { margin-right: 8px; } -} - +} \ No newline at end of file