From 8ed92e793d73764cd690c25d2b63a2320ea12e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sun, 4 Feb 2024 17:04:05 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.10.1.2401.01-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=96=B9=E6=A1=88=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/advanceInputBtn/index.js | 33 +++ .../components/advanceInputBtn/index.less | 29 ++ .../welfarePlanAdvanceSearchPannel/index.js | 51 ++++ .../components/welfarePlanCopyDialog/index.js | 68 +++++ .../welfarePlanCustomDialog/index.js | 91 ++++++ .../components/welfarePlanList/index.js | 262 ++++++++++++++++++ .../welfarePlan/config.js | 180 +++++++++++- .../welfarePlan/index.js | 32 ++- .../welfarePlan/index.less | 65 ++++- pc4mobx/hrmSalary/stores/programme.js | 8 +- pc4mobx/hrmSalary/style/index.less | 43 ++- 11 files changed, 828 insertions(+), 34 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js new file mode 100644 index 00000000..e78bba6f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.js @@ -0,0 +1,33 @@ +/* + * Author: 黎永顺 + * name:社保福利方案页面重构-高级搜索 + * Description: + * Date: 2024/2/2 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("programmeStore") +@observer +class Index extends Component { + render() { + const { programmeStore: { planSearchForm } } = this.props; + return ( +
+ planSearchForm.updateFields({ schemeName: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less new file mode 100644 index 00000000..9081d39f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/advanceInputBtn/index.less @@ -0,0 +1,29 @@ +.achrive-advance-search { + display: flex; + align-items: center; + position: relative; + top: -1.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 1px; + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js new file mode 100644 index 00000000..0ea2dcc2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanAdvanceSearchPannel/index.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name:社保福利方案页面重构-高级搜索面板 + * Description: + * Date: 2024/2/2 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { getSearchs } from "../../../../../util"; +import { searchConditons } from "../../config"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("programmeStore") +@observer +class WelfarePlanAdvanceSearchPannel extends Component { + + componentDidMount() { + const { programmeStore: { planSearchForm } } = this.props; + planSearchForm.initFormFields(searchConditons); + } + + render() { + const { programmeStore: { planSearchForm } } = this.props; + return ( + +
+ {getSearchs(planSearchForm, searchConditons, 2, false)} +
+
+
+ + + + + + + + + +
+
+
+ ); + } +} + +export default WelfarePlanAdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js new file mode 100644 index 00000000..59af2d46 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCopyDialog/index.js @@ -0,0 +1,68 @@ +/* + * Author: 黎永顺 + * name: 社保福利方案重构-复制 + * Description: + * Date: 2024/2/4 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import * as API from "../../../../../apis/welfareScheme"; +import { getSearchs } from "../../../../../util"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("programmeStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCopyForm(); + } + + + save = () => { + const { programmeStore: { planCopyForm }, copyId: id, selectedKey } = this.props; + planCopyForm.validateForm().then(f => { + if (f.isValid) { + this.setState({ loading: true }); + API.copyScheme({ id, schemeName: planCopyForm.getFormDatas()[`${selectedKey}_schemeName`].value }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }); + } else { + f.showErrors(); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading } = this.state; + const { programmeStore: { planCopyForm }, conditions } = this.props; + return ( + {getLabel(537558, "保存")} + ]} + > +
{getSearchs(planCopyForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js new file mode 100644 index 00000000..8c9d2c7f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanCustomDialog/index.js @@ -0,0 +1,91 @@ +/* + * Author: 黎永顺 + * name: 社保福利方案-自定义福利新建编辑 + * Description: + * Date: 2024/2/4 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import * as API from "../../../../../apis/welfareScheme"; +import { getSearchs } from "../../../../../util"; +import { customPlanConditons } from "../../config"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("programmeStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, conditions: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getCustomCategoryForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.programmeStore.initPlanCustomForm(); + } + + getCustomCategoryForm = (props) => { + API.getCustomCategoryForm({ id: props.customId }).then(({ status, data }) => { + if (status) { + const { form } = data; + this.setState({ + conditions: customPlanConditons + }, () => { + const { programmeStore: { planCustomForm } } = props; + planCustomForm.initFormFields(this.state.conditions); + // planCustomForm.updateFields({ [`${selectedKey}_schemeName`]: { value: copyName } }); + }); + } + }); + }; + + save = () => { + const { programmeStore: { planCustomForm }, copyId: id, selectedKey } = this.props; + planCustomForm.validateForm().then(f => { + if (f.isValid) { + this.setState({ loading: true }); + const payload = { + ...planCustomForm.getFormParams(), + paymentScope: planCustomForm.getFormParams().paymentScope.split(",") + }; + console.log(payload); + return; + API.copyScheme({ id, schemeName: planCustomForm.getFormDatas()[`${selectedKey}_schemeName`].value }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }); + } else { + f.showErrors(); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, conditions } = this.state; + const { programmeStore: { planCustomForm } } = this.props; + return ( + {getLabel(537558, "保存")} + ]} + > +
{getSearchs(planCustomForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js new file mode 100644 index 00000000..9571e336 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js @@ -0,0 +1,262 @@ +/* + * Author: 黎永顺 + * name: 社保福利方案重构-列表 + * Description: + * Date: 2024/2/2 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaCheckbox, WeaLoadingGlobal, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Dropdown, Menu, message, Modal } from "antd"; +import TipLabel from "../../../../../components/TipLabel"; +import WelfarePlanCopyDialog from "../welfarePlanCopyDialog"; +import WelfarePlanCustomDialog from "../welfarePlanCustomDialog"; +import { tabWelfarePlanList, welfarePlanCopyConditions, welfarePlanCustomTipList } from "../../config"; +import * as API from "../../../../../apis/welfareScheme"; + +const getLabel = WeaLocaleProvider.getLabel; +const APIFOX = { + SOCIAL_SECURITY: API.getTable, + ACCUMULATION_FUND: API.getTable, + OTHER: API.getTable, + CUSTOM: API.getCustomCategoryList +}; + +@inject("programmeStore", "taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] }, + customDialog: { visible: false, title: "", customId: "" } + }; + } + + componentDidMount() { + this.getList(this.props); + } + + componentWillReceiveProps(nextProps, nextContext) { + if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) { + this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 } + }, () => this.getList(nextProps)); + } + if ((nextProps.selectedKey !== this.props.selectedKey)) { + this.setState({ + dataSource: [], columns: [], loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + copyDialog: { visible: false, title: "", copyId: "", copyName: "", conditions: [] } + }); + } + } + + getList = (props) => { + const { programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, custom } = props; + const { pageInfo } = this.state; + const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: custom }, + welfarePayload = { ...planSearchForm.getFormParams() }; + const payload = welfareTypeEnum === "CUSTOM" ? { ...originPayload, ...customPayload } : { ...originPayload, ...welfarePayload }; + this.setState({ loading: true }); + APIFOX[welfareTypeEnum](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(_.filter(columns, o => (o.dataIndex !== "id" && o.dataIndex !== "paymentArea")), g => { + const { dataIndex } = g; + let col = { ...g, width: "20%" }; + switch (dataIndex) { + case "schemeName": + col = { + ...col, width: 250, + render: (text, record) => ( this.handleOpts("view", record)}>{text}) + }; + break; + case "paymentType": + col = { ...col, width: 100 }; + break; + case "paymentScope": + col = { ...col, width: 300 }; + break; + case "remarks": + col = { ...col, width: 200 }; + break; + case "paymentScopt": + case "welfareType": + col = { + ...col, width: "30%", + render: (__, record) => ({record[`${dataIndex}Span`] || record["paymentScopeSpan"]}) + }; + break; + case "isUse": + col = { + ...col, render: (__, record) => () + }; + break; + default: + break; + } + return col; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleOpts = (key, record = {}) => { + const { selectedKey, programmeStore: { planCopyForm } } = this.props; + const { id, schemeName } = record; + switch (key) { + case "edit": + break; + case "delete": + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定删除吗?删除后数据不可找回"), + onOk: () => { + API.deleteScheme({ welfareTypeEnum: selectedKey, ids: [id] }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.getList(this.props); + } else { + message.error(errormsg); + } + }); + } + }); + break; + case "custom-delete": + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定删除吗?删除后数据不可找回"), + onOk: () => { + WeaLoadingGlobal.start(); + API.deleteCustomCategory({ id }).then(({ status, errormsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.getList(this.props); + } else { + message.error(errormsg); + } + }).catch(() => WeaLoadingGlobal.destroy()); + } + }); + break; + case "custom-edit": + this.setState({ + customDialog: { + visible: true, customId: id, + title: `${id ? getLabel(501169, "编辑") : getLabel(365, "新建")}${getLabel(543151, "自定义福利")}` + } + }); + break; + case "copy": + this.setState({ + copyDialog: { + visible: true, copyId: id, copyName: `${schemeName}-${getLabel(77, "复制")}`, + title: `${getLabel(77, "复制")}-${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}`, + conditions: welfarePlanCopyConditions[selectedKey] + } + }, () => { + const { copyDialog: { conditions, copyName } } = this.state; + planCopyForm.initFormFields(conditions); + planCopyForm.updateFields({ [`${selectedKey}_schemeName`]: { value: copyName } }); + }); + break; + default: + break; + } + }; + + render() { + const { dataSource, columns, pageInfo, loading, copyDialog, customDialog } = this.state; + const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getList(this.props)); + } + }; + const optCols = selectedKey !== "CUSTOM" ? { + title: getLabel(18610, "操作"), + dataIndex: "operation", width: 185, + render: (__, record) => (
+ this.handleOpts("edit", record)}>{getLabel(501169, "编辑")} + this.handleOpts("copy", record)}>{getLabel(77, "复制")} + + + this.handleOpts("delete", record)}>{getLabel(535052, "删除")} + + + }> + + +
) + } : { + title: getLabel(18610, "操作"), + dataIndex: "operation", width: 165, + render: (__, record) => (
+ this.handleOpts("custom-edit", record)}>{getLabel(501169, "编辑")} + this.handleOpts("custom-delete", record)}>{getLabel(535052, "删除")} +
) + }; + return ( +
+
+ ( this.handleOpts("view", record)}>{getLabel(33564, "查看")}) + }]} + /> +
+ { + selectedKey === "CUSTOM" && +
+ } + {/*复制方案*/} + this.setState({ + copyDialog: { ...copyDialog, visible: false, conditions: [] } + }, () => isRefrese && this.getList(this.props))} + /> + {/*新建编辑自定义方案*/} + this.setState({ + customDialog: { ...customDialog, visible: false, customId: "" } + }, () => isRefrese && this.getList(this.props))} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js index c2155dbf..d3b64200 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/config.js @@ -1,8 +1,7 @@ import React from "react"; -import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { WeaLocaleProvider, WeaSelect, WeaTools } from "ecCom"; import { Button } from "antd"; -import AdvanceInputBtn from "../welfareArchive/components/advanceInputBtn"; -import { CancelHelpfulDiv, HelpfulDiv } from "../welfareArchive/components/welfareTip"; +import AdvanceInputBtn from "./components/advanceInputBtn"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -13,6 +12,11 @@ export const tabWelfarePlanList = [ { key: "OTHER", title: getLabel(542717, "企业年金及其他福利") }, { key: "CUSTOM", title: getLabel(543151, "自定义福利") } ]; +export const welfarePlanCustomTipList = [ + getLabel(544345, "1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项,如:残疾保险等"), + getLabel(544346, "2、新增自定义福利默认启用,社保福利方案中的自定义福利项均未开启缴纳,当前页面的自定义福利项才可以停用;停用后再新增方案时没有该福利项"), + getLabel(544347, "3、自定义福利若要缴纳,需要在方案里填写缴纳相关数据") +]; /* * Author: 黎永顺 * Description: 社保福利方案-头部操作 @@ -27,18 +31,166 @@ export const renderDropMenuDatas = (selectedKey, showOperateBtn) => { }]; }; export const renderReqBtns = (selectedKey, onSalaryOpts, showOperateBtn) => { - let reqBtns = showOperateBtn ? [ - , - onSalaryOpts("OPEN")} onAdvanceSearch={()=>onSalaryOpts("SEARCH")}/> - ] : [onSalaryOpts("OPEN")} onAdvanceSearch={()=>onSalaryOpts("SEARCH")}/>]; - if (showOperateBtn) { - switch (selectedKey) { - case "CUSTOM": - break; - default: - break; - } + let reqBtns = [ + , + onSalaryOpts("OPEN")} onAdvanceSearch={() => onSalaryOpts("SEARCH")}/> + ]; + switch (selectedKey) { + case "CUSTOM": + reqBtns[reqBtns.length - 1] = onSalaryOpts("SEARCH")} + options={[ + { key: "", showname: getLabel(111, "全部"), selected: true }, + { key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") }, + { key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") }, + { key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") } + ]} + />; + break; + default: + break; } + !showOperateBtn && reqBtns.shift(); return reqBtns; }; +export const searchConditons = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["schemeName"], + fieldcol: 16, + isQuickSearch: true, + label: getLabel(33162, "方案名称"), + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["paymentTypeEnum"], + fieldcol: 16, + isQuickSearch: true, + label: getLabel(543163, "缴纳类型"), + labelcol: 8, + value: "", + options: [ + { key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") }, + { key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") } + ], + viewAttr: 2 + } + ], + title: getLabel(82743, "基础信息"), + defaultshow: true + } +]; +export const welfarePlanCopyConditions = { + SOCIAL_SECURITY: [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["SOCIAL_SECURITY_schemeName"], + fieldcol: 16, + label: getLabel(111, "社保名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "", + col: 1 + } + ], + ACCUMULATION_FUND: [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["ACCUMULATION_FUND_schemeName"], + fieldcol: 16, + label: getLabel(111, "公积金名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "", + col: 1 + } + ], + OTHER: [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["OTHER_schemeName"], + fieldcol: 16, + label: getLabel(111, "企业年金及其他福利名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "", + col: 1 + } + ] +}; +export const customPlanConditons = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["insuranceName"], + fieldcol: 14, + label: getLabel(111, "福利名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["welfareType"], + fieldcol: 14, + label: getLabel(500401, "类型"), + labelcol: 8, + options: [ + { key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") }, + { key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") }, + { key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") } + ], + detailtype: 3, + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["paymentScope"], + fieldcol: 16, + label: getLabel(543169, "缴纳对象"), + labelcol: 8, + options: [ + { key: "SCOPE_COMPANY", showname: getLabel(1851, "公司") }, + { key: "SCOPE_PERSON", showname: getLabel(500201, "个人") } + ], + detailtype: 2, + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; + diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js index 3fbf52c5..338de3ee 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js @@ -8,7 +8,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { renderDropMenuDatas, renderReqBtns, tabWelfarePlanList } from "./config"; +import WelfarePlanAdvanceSearchPannel from "./components/welfarePlanAdvanceSearchPannel"; +import WelfarePlanList from "./components/welfarePlanList"; import LogDialog from "../../../components/logViewModal"; +import cs from "classnames"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -19,17 +22,17 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "SOCIAL_SECURITY", showSearchAd: false, isQuery: false, logDialogVisible: false, - topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 }, - welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" }, - showExtEmpsWitch: false + selectedKey: "SOCIAL_SECURITY", showSearchAd: false, isQuery: false, logDialogVisible: false }; + this.welfarePlanListRef = null; } - handleReqBtnsCLick = (type, importType) => { - const { state, handleSalaryOpts } = this.salaryFileListRef.wrappedInstance || {}; + handleReqBtnsCLick = (type) => { + const { selectedKey } = this.state; switch (type) { case "ADD": + const { handleOpts } = this.welfarePlanListRef.wrappedInstance || {}; + selectedKey === "CUSTOM" ? handleOpts("custom-edit") : ""; break; case "OPEN": this.handleOpenAdvanceSearch(); @@ -43,6 +46,7 @@ class Index extends Component { }; handleOpenAdvanceSearch = () => this.setState({ showSearchAd: true }); handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); + onAdSearch = () => this.setState({ showSearchAd: false, isQuery: !this.state.isQuery }); onDropMenuClick = (key) => { switch (key) { case "log": @@ -54,16 +58,28 @@ class Index extends Component { }; render() { - const { taxAgentStore: { showOperateBtn }, logDialogVisible } = this.props; + const { taxAgentStore: { showOperateBtn } } = this.props; + const { logDialogVisible, selectedKey, showSearchAd, isQuery } = this.state; return (
} iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)} - onDropMenuClick={this.onDropMenuClick} tabDatas={tabWelfarePlanList} + onDropMenuClick={this.onDropMenuClick} tabDatas={tabWelfarePlanList} selectedKey={selectedKey} + onChange={selectedKey => this.setState({ selectedKey, showSearchAd: false })} buttons={renderReqBtns(selectedKey, this.handleReqBtnsCLick, showOperateBtn)} >
+
+ this.setState({ showSearchAd: false })} + onAdSearch={this.onAdSearch} + /> +
+ {/*列表*/} + this.welfarePlanListRef = dom} + selectedKey={selectedKey} isQuery={isQuery}/>
{/*操作日志*/}