From a6cf191c29e5c6abd738b3a6b1359391e2f15152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Mar 2023 10:43:25 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86-=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 + .../externalPersonManageEditSlide.js | 40 ++++ .../pages/externalPersonManage/conditions.js | 185 ++++++++++++++++++ .../pages/externalPersonManage/index.js | 89 +++++++++ .../pages/externalPersonManage/index.less | 7 + .../hrmSalary/stores/externalPersonManage.js | 7 + pc4mobx/hrmSalary/stores/index.js | 4 +- 7 files changed, 334 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js create mode 100644 pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js create mode 100644 pc4mobx/hrmSalary/pages/externalPersonManage/index.js create mode 100644 pc4mobx/hrmSalary/pages/externalPersonManage/index.less create mode 100644 pc4mobx/hrmSalary/stores/externalPersonManage.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index b59a534a..1165659b 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -32,6 +32,7 @@ import SysConfig from "./pages/sysConfig"; import RuleConfig from "./pages/ruleConfig"; import Appconfig from "./pages/appConfig"; import FieldManagement from "./pages/fieldManagement"; +import ExternalPersonManage from "./pages/externalPersonManage"; import stores from "./stores"; import "./style/index"; @@ -78,6 +79,7 @@ const DataAcquisition = (props) => props.children; // sysconfig-1 规则配置 // appconfig 应用配置 // fieldManagement 字段管理 +// externalPersonManage 非系统人员管理 const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js new file mode 100644 index 00000000..634a7124 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js @@ -0,0 +1,40 @@ +/* + * Author: 黎永顺 + * name: 非系统人员管理表单项 + * Description: + * Date: 2023/3/13 + */ +import React, { Component } from "react"; +import { WeaSlideModal } from "ecCom"; +import SlideModalTitle from "../../../components/slideModalTitle"; + +class ExternalPersonManageEditSlide extends Component { + render() { + const { visible, title, onCancel, showOperateBtn } = this.props; + return ( + console.log(111)} + /> + } + content={null} + onClose={onCancel} + /> + ); + } +} + +export default ExternalPersonManageEditSlide; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js new file mode 100644 index 00000000..6cc054d7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -0,0 +1,185 @@ +export const searchCondition = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["username"], + fieldcol: 16, + label: "姓名", + labelcol: 8, + value: "", + viewAttr: 2, + } + ], + defaultshow: true, + }, +]; +export const condition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["username"], + rules: "required|string", + fieldcol: 18, + label: "姓名", + labelcol: 6, + value: "", + viewAttr: 3, + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "部门", + type: "57", + viewAttr: 2, + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["departmentId"], + fieldcol: 18, + label: "部门", + labelcol: 6, + viewAttr: 2, + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "分部", + type: "164", + viewAttr: 2, + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyId"], + fieldcol: 18, + label: "分部", + labelcol: 6, + viewAttr: 2, + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "岗位", + type: "24", + viewAttr: 2, + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["jobtitleId"], + fieldcol: 18, + label: "岗位", + labelcol: 6, + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "DATEPICKER", + domkey: ["companystartdate"], + fieldcol: 18, + label: "入职日期", + labelcol: 6, + value: "", + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["mobil"], + fieldcol: 18, + label: "手机", + labelcol: 6, + value: "", + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 18, + label: "工号", + labelcol: 6, + value: "", + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["idNo"], + fieldcol: 18, + label: "身份证号码", + labelcol: 6, + value: "", + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["bankCardNum"], + fieldcol: 18, + label: "本人开户的银行卡卡号", + labelcol: 6, + value: "", + viewAttr: 2, + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["bankName"], + fieldcol: 18, + label: "本人开户的银行卡开户支行全称", + labelcol: 6, + value: "", + viewAttr: 2, + }, + ], + defaultshow: true, + }, +]; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.js b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js new file mode 100644 index 00000000..d2c6eeba --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js @@ -0,0 +1,89 @@ +/* + * Author: 黎永顺 + * name: 非系统人员管理 + * Description: + * Date: 2023/3/13 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaTab, WeaTop } from "ecCom"; +import ExternalPersonManageEditSlide from "./components/externalPersonManageEditSlide"; +import { Button } from "antd"; +import { getSearchs } from "../../util"; +import { condition, searchCondition } from "./conditions"; +import "./index.less"; + +@inject("externalPersonManageStore", "taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + showSearchAd: false, + externalPersonManagePayload: { + visible: false, title: "新建" + } + }; + } + + componentDidMount() { + const { externalPersonManageStore: { form, addForm } } = this.props; + form.initFormFields(searchCondition); + addForm.initFormFields(condition); + } + + handleCancel = () => { + const { externalPersonManagePayload } = this.state; + const { externalPersonManageStore: { addForm } } = this.props; + addForm.resetForm(); + this.setState({ + externalPersonManagePayload: { + ...externalPersonManagePayload, + visible: false, title: "新建" + } + }); + }; + handleAdd = () => { + const { externalPersonManagePayload } = this.state; + this.setState({ + externalPersonManagePayload: { + ...externalPersonManagePayload, + visible: true + } + }); + }; + + + render() { + const { showSearchAd, externalPersonManagePayload } = this.state; + const { externalPersonManageStore: { form, addForm }, taxAgentStore: { showOperateBtn } } = this.props; + return ( +
+ } + iconBgcolor="#F14A2D" showDropIcon={false} + > +
+ 新建 + ]} + searchType={["base", "advanced"]} showSearchAd={showSearchAd} + setShowSearchAd={(showSearchAd) => this.setState({ showSearchAd })} + searchsAd={getSearchs(form, searchCondition, 2)} + searchsBasePlaceHolder="请输入姓名" + onSearchChange={username => form.updateFields({ username })} + searchsBaseValue={form.getFormParams().username} + /> + +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.less b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less new file mode 100644 index 00000000..32f8b668 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less @@ -0,0 +1,7 @@ +.externalPerWrapper{ + width: 100%; + height: 100%; + .externalPerCont{ + height: 100%; + } +} diff --git a/pc4mobx/hrmSalary/stores/externalPersonManage.js b/pc4mobx/hrmSalary/stores/externalPersonManage.js new file mode 100644 index 00000000..7640bd04 --- /dev/null +++ b/pc4mobx/hrmSalary/stores/externalPersonManage.js @@ -0,0 +1,7 @@ +import { observable } from "mobx"; +import { WeaForm } from "comsMobx"; + +export class ExternalPersonManageStore { + @observable form = new WeaForm(); + @observable addForm = new WeaForm(); +} diff --git a/pc4mobx/hrmSalary/stores/index.js b/pc4mobx/hrmSalary/stores/index.js index 6b7af8e1..c9590ab3 100644 --- a/pc4mobx/hrmSalary/stores/index.js +++ b/pc4mobx/hrmSalary/stores/index.js @@ -18,6 +18,7 @@ import { DeclareStore } from "./declare"; import { StandingBookStore } from "./StandingBook"; import { PayrollFilesStore } from "./payrollFiles"; import { SpecialAddStore } from "./specialAdd"; +import { ExternalPersonManageStore } from "./externalPersonManage"; module.exports = { baseFormStore: new BaseFormStore(), @@ -39,5 +40,6 @@ module.exports = { declareStore: new DeclareStore(), standingBookStore: new StandingBookStore(), payrollFilesStore: new PayrollFilesStore(), - specialAddStore: new SpecialAddStore() + specialAddStore: new SpecialAddStore(), + externalPersonManageStore: new ExternalPersonManageStore() }; From eb207921cdf70f85a5b9fdc35941c1836de082ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Mar 2023 14:40:19 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86-=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/apis/externalPersonManage.js | 27 +++ .../externalPersonManageEditSlide.js | 82 +++++++- .../pages/externalPersonManage/conditions.js | 183 +++++++++--------- .../pages/externalPersonManage/index.js | 116 +++++++++-- 4 files changed, 300 insertions(+), 108 deletions(-) create mode 100644 pc4mobx/hrmSalary/apis/externalPersonManage.js diff --git a/pc4mobx/hrmSalary/apis/externalPersonManage.js b/pc4mobx/hrmSalary/apis/externalPersonManage.js new file mode 100644 index 00000000..91854ebb --- /dev/null +++ b/pc4mobx/hrmSalary/apis/externalPersonManage.js @@ -0,0 +1,27 @@ +import { postFetch } from "../util/request"; +import { WeaTools } from "ecCom"; + +//非系统人员-保存 +export const save = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/save", params); +}; + +//非系统人员-修改 +export const update = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/update", params); +}; + +//非系统人员-列表 +export const listPage = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/listPage", params); +}; + +//非系统人员-删除 +export const deleteExtEmp = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/delete", params); +}; + +//非系统人员-详情 +export const detail = params => { + return WeaTools.callApi("/api/bs/hrmsalary/extEmp/detail", "get", params); +}; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js index 634a7124..6c8d46da 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js @@ -6,11 +6,86 @@ */ import React, { Component } from "react"; import { WeaSlideModal } from "ecCom"; +import { message } from "antd"; +import { getSearchs } from "../../../util"; import SlideModalTitle from "../../../components/slideModalTitle"; +import { detail, save, update } from "../../../apis/externalPersonManage"; class ExternalPersonManageEditSlide extends Component { + constructor(props) { + super(props); + this.state = { + date: "", + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.detail(nextProps); + } + + detail = (props) => { + const { form, id } = props; + detail({ id }).then(({ status, data }) => { + if (status) { + const { + departmentName, departmentId, subcompanyName, subcompanyId, + jobtitleName, jobtitleId, ...extraFormfields + } = data; + form.updateFields({ + "departmentId": { + value: departmentId, + valueSpan: departmentName, + valueObj: [{ id: departmentId, name: departmentName }] + } + }); + form.updateFields({ + "subcompanyId": { + value: subcompanyId, + valueSpan: departmentName, + valueObj: [{ id: subcompanyId, name: subcompanyName }] + } + }); + form.updateFields({ + "jobtitleId": { + value: jobtitleId, + valueSpan: jobtitleName, + valueObj: [{ id: jobtitleId, name: jobtitleName }] + } + }); + _.map(_.keys(extraFormfields), item => { + form.updateFields({ [item]: { value: extraFormfields[item] } }, false); + }); + } + }); + }; + + handleSubmit = () => { + const { form, id, onCancel } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const payload = _.omitBy(form.getFormParams(), _.isEmpty); + this.setState({ loading: true }); + const APIFOX = !id ? save : update; + APIFOX(id ? { ...payload, id } : payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("创建成功"); + onCancel(true); + } else { + message.error(errormsg || "创建失败"); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + this.setState({ date: new Date() }); + } + }); + }; + render() { - const { visible, title, onCancel, showOperateBtn } = this.props; + const { loading } = this.state; + const { visible, title, onCancel, showOperateBtn, form, condition } = this.props; return ( console.log(111)} + onSave={this.handleSubmit} /> } - content={null} + content={getSearchs(form, condition, 1)} onClose={onCancel} /> ); diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js index 6cc054d7..2afc57f0 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -29,96 +29,96 @@ export const condition = [ value: "", viewAttr: 3, }, - { - browserConditionParam: { - completeParams: {}, - conditionDataParams: {}, - dataParams: {}, - destDataParams: {}, - hasAddBtn: false, - hasAdvanceSerach: false, - idSeparator: ",", - isAutoComplete: 1, - isDetail: 0, - isMultCheckbox: false, - isSingle: true, - icon: "icon-coms-hrm", - linkUrl: "", - pageSize: 10, - quickSearchName: "", - replaceDatas: [], - title: "部门", - type: "57", - viewAttr: 2, - }, - colSpan: 1, - conditionType: "BROWSER", - domkey: ["departmentId"], - fieldcol: 18, - label: "部门", - labelcol: 6, - viewAttr: 2, - }, - { - browserConditionParam: { - completeParams: {}, - conditionDataParams: {}, - dataParams: {}, - destDataParams: {}, - hasAddBtn: false, - hasAdvanceSerach: false, - idSeparator: ",", - isAutoComplete: 1, - isDetail: 0, - isMultCheckbox: false, - isSingle: true, - icon: "icon-coms-hrm", - linkUrl: "", - pageSize: 10, - quickSearchName: "", - replaceDatas: [], - title: "分部", - type: "164", - viewAttr: 2, - }, - colSpan: 1, - conditionType: "BROWSER", - domkey: ["subcompanyId"], - fieldcol: 18, - label: "分部", - labelcol: 6, - viewAttr: 2, - }, - { - browserConditionParam: { - completeParams: {}, - conditionDataParams: {}, - dataParams: {}, - destDataParams: {}, - hasAddBtn: false, - hasAdvanceSerach: false, - idSeparator: ",", - isAutoComplete: 1, - isDetail: 0, - isMultCheckbox: false, - isSingle: true, - icon: "icon-coms-hrm", - linkUrl: "", - pageSize: 10, - quickSearchName: "", - replaceDatas: [], - title: "岗位", - type: "24", - viewAttr: 2, - }, - colSpan: 1, - conditionType: "BROWSER", - domkey: ["jobtitleId"], - fieldcol: 18, - label: "岗位", - labelcol: 6, - viewAttr: 2, - }, + // { + // browserConditionParam: { + // completeParams: {}, + // conditionDataParams: {}, + // dataParams: {}, + // destDataParams: {}, + // hasAddBtn: false, + // hasAdvanceSerach: false, + // idSeparator: ",", + // isAutoComplete: 1, + // isDetail: 0, + // isMultCheckbox: false, + // isSingle: true, + // icon: "icon-coms-hrm", + // linkUrl: "", + // pageSize: 10, + // quickSearchName: "", + // replaceDatas: [], + // title: "部门", + // type: "57", + // viewAttr: 2, + // }, + // colSpan: 1, + // conditionType: "BROWSER", + // domkey: ["departmentId"], + // fieldcol: 18, + // label: "部门", + // labelcol: 6, + // viewAttr: 2, + // }, + // { + // browserConditionParam: { + // completeParams: {}, + // conditionDataParams: {}, + // dataParams: {}, + // destDataParams: {}, + // hasAddBtn: false, + // hasAdvanceSerach: false, + // idSeparator: ",", + // isAutoComplete: 1, + // isDetail: 0, + // isMultCheckbox: false, + // isSingle: true, + // icon: "icon-coms-hrm", + // linkUrl: "", + // pageSize: 10, + // quickSearchName: "", + // replaceDatas: [], + // title: "分部", + // type: "164", + // viewAttr: 2, + // }, + // colSpan: 1, + // conditionType: "BROWSER", + // domkey: ["subcompanyId"], + // fieldcol: 18, + // label: "分部", + // labelcol: 6, + // viewAttr: 2, + // }, + // { + // browserConditionParam: { + // completeParams: {}, + // conditionDataParams: {}, + // dataParams: {}, + // destDataParams: {}, + // hasAddBtn: false, + // hasAdvanceSerach: false, + // idSeparator: ",", + // isAutoComplete: 1, + // isDetail: 0, + // isMultCheckbox: false, + // isSingle: true, + // icon: "icon-coms-hrm", + // linkUrl: "", + // pageSize: 10, + // quickSearchName: "", + // replaceDatas: [], + // title: "岗位", + // type: "24", + // viewAttr: 2, + // }, + // colSpan: 1, + // conditionType: "BROWSER", + // domkey: ["jobtitleId"], + // fieldcol: 18, + // label: "岗位", + // labelcol: 6, + // viewAttr: 2, + // }, { colSpan: 1, conditionType: "DATEPICKER", @@ -132,7 +132,7 @@ export const condition = [ { colSpan: 1, conditionType: "INPUT", - domkey: ["mobil"], + domkey: ["mobile"], fieldcol: 18, label: "手机", labelcol: 6, @@ -181,5 +181,6 @@ export const condition = [ }, ], defaultshow: true, + title: "基本信息" }, ]; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.js b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js index d2c6eeba..1ab229c2 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/index.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js @@ -8,9 +8,11 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaTab, WeaTop } from "ecCom"; import ExternalPersonManageEditSlide from "./components/externalPersonManageEditSlide"; -import { Button } from "antd"; +import { Button, message, Modal } from "antd"; import { getSearchs } from "../../util"; import { condition, searchCondition } from "./conditions"; +import UnifiedTable from "../../components/UnifiedTable"; +import { deleteExtEmp, listPage } from "../../apis/externalPersonManage"; import "./index.less"; @inject("externalPersonManageStore", "taxAgentStore") @@ -19,9 +21,12 @@ class Index extends Component { constructor(props) { super(props); this.state = { + loading: false, + selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, showSearchAd: false, externalPersonManagePayload: { - visible: false, title: "新建" + visible: false, title: "新建", id: "" } }; } @@ -30,33 +35,92 @@ class Index extends Component { const { externalPersonManageStore: { form, addForm } } = this.props; form.initFormFields(searchCondition); addForm.initFormFields(condition); + this.listPage(); } - handleCancel = () => { + listPage = () => { + const { pageInfo } = this.state; + const { externalPersonManageStore: { form } } = this.props; + const payload = { ...pageInfo, ...form.getFormParams() }; + listPage(payload).then(({ status, data }) => { + if (status) { + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, columns, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }); + }; + deleteExtEmp = (ids) => { + deleteExtEmp(ids).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.listPage(); + } else { + message.error(errormsg || "删除失败"); + } + }); + }; + handleDelete = (id) => { + Modal.confirm({ + title: "信息确认", + content: "确定删除吗", + onOk: () => this.deleteExtEmp([id]) + }); + }; + handleCancel = (isRefresh) => { const { externalPersonManagePayload } = this.state; const { externalPersonManageStore: { addForm } } = this.props; addForm.resetForm(); this.setState({ externalPersonManagePayload: { ...externalPersonManagePayload, - visible: false, title: "新建" + visible: false, title: "新建", id: "" } - }); + }, () => isRefresh && this.listPage()); }; - handleAdd = () => { + handleAdd = (id = "") => { const { externalPersonManagePayload } = this.state; this.setState({ externalPersonManagePayload: { ...externalPersonManagePayload, - visible: true + visible: true, id, title: id ? "编辑" : "新建" } }); }; - + getColumns = () => { + const { columns } = this.state; + return _.map(_.filter(columns, item => !!item.display), child => ({ + ...child, + render: (text) => { + return {text}; + } + })); + }; render() { - const { showSearchAd, externalPersonManagePayload } = this.state; + const { showSearchAd, externalPersonManagePayload, loading, pageInfo, selectedRowKeys, dataSource } = this.state; const { externalPersonManageStore: { form, addForm }, taxAgentStore: { showOperateBtn } } = this.props; + const pagination = { + current: pageInfo.current, + pageSize: pageInfo.pageSize, + total: pageInfo.total, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.listPage()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listPage()); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; return (
新建 - ]} + buttons={showOperateBtn ? [ + + ] : []} searchType={["base", "advanced"]} showSearchAd={showSearchAd} setShowSearchAd={(showSearchAd) => this.setState({ showSearchAd })} searchsAd={getSearchs(form, searchCondition, 2)} - searchsBasePlaceHolder="请输入姓名" + searchsBasePlaceHolder="请输入姓名" onSearch={this.listPage} onSearchChange={username => form.updateFields({ username })} searchsBaseValue={form.getFormParams().username} + onAdSearch={() => this.setState({ showSearchAd: false }, () => this.listPage())} + onAdReset={() => form.resetForm()} onAdCancel={() => this.setState({ showSearchAd: false })} + /> + ( + + this.handleAdd(id)} + style={{ paddingRight: 8 }}>编辑 + this.handleDelete(id)}>删除 + + ) + } + ] : []} + dataSource={dataSource} + pagination={pagination} + rowSelection={rowSelection} + xWidth={this.getColumns().length * 120} />
From efadb541f5c00329b28ebef1d9ef740e01c37605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 14 Mar 2023 18:14:23 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86-=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/ledger.js | 33 ++++ pc4mobx/hrmSalary/apis/taxAgent.js | 12 ++ .../components/externalPersonModal/index.js | 86 ++++++++++ .../externalPersonManageEditSlide.js | 8 +- .../components/ledgerAssociatedPersonnel.js | 115 ++++++++++--- pc4mobx/hrmSalary/pages/taxAgent/editModal.js | 2 + pc4mobx/hrmSalary/pages/taxAgent/index.less | 43 +++++ .../hrmSalary/pages/taxAgent/personalScope.js | 161 +++++++++++++----- .../pages/taxAgent/slideTaxagentUser.js | 73 ++++---- pc4mobx/hrmSalary/stores/taxAgent.js | 16 ++ 10 files changed, 444 insertions(+), 105 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/externalPersonModal/index.js diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index b04e881e..834a6c47 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -71,6 +71,17 @@ export const saveLedgerBasic = params => { }).then(res => res.json()); }; +//薪资帐套外部人员范围(包含)列表 +export const getLedgerPersonRangeExtList = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资帐套人员范围(包含)列表 export const getLedgerPersonRangeInclude = params => { return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", { @@ -104,6 +115,28 @@ export const getLedgerPersonRangeForm = params => { ); }; +//保存薪资帐套外部人员范围 +export const saveLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/ext/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//删除薪资帐套外部人员范围 +export const deleteLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //保存薪资帐套人员范围 export const saveLedgerPersonRange = params => { return fetch("/api/bs/hrmsalary/salarysob/range/save", { diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 5f2b86ee..25747f12 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -70,6 +70,18 @@ export const deleteTaxAgent = (params) => { export const taxAgentRangeSave = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params); }; +//非系统人员范围查询 +export const taxAgentRangelistExt = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params); +}; +//非系统人员范围删除 +export const taxAgentRangeExtDelete = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/delete", params); +}; +//非系统人员范围保存 +export const taxAgentRangeExtSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/save", params); +}; //人员范围删除 export const taxAgentRangeDelete = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params); diff --git a/pc4mobx/hrmSalary/components/externalPersonModal/index.js b/pc4mobx/hrmSalary/components/externalPersonModal/index.js new file mode 100644 index 00000000..1d9e17ec --- /dev/null +++ b/pc4mobx/hrmSalary/components/externalPersonModal/index.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 外部人员添加弹框 + * Description: + * Date: 2023/3/14 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup } from "ecCom"; +import { Button, Modal } from "antd"; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + targetIds: "", + targetNames: "" + }; + } + + handleExternalPersonSave = () => { + const { targetIds } = this.state; + const { onExternalPersonSave } = this.props; + if (!_.isEmpty(targetIds)) { + onExternalPersonSave({ targetIds: targetIds.split(",") }); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }; + + render() { + const { targetIds, targetNames } = this.state; + const { onCancel, visible, loading } = this.props; + const buttons = [ + , + + ]; + return ( + + + + this.setState({ targetIds, targetNames })} + /> + + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js index 6c8d46da..f8d165f9 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js @@ -21,7 +21,7 @@ class ExternalPersonManageEditSlide extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible && nextProps.visible) this.detail(nextProps); + if (nextProps.visible !== this.props.visible && nextProps.visible && nextProps.id) this.detail(nextProps); } detail = (props) => { @@ -61,7 +61,7 @@ class ExternalPersonManageEditSlide extends Component { }; handleSubmit = () => { - const { form, id, onCancel } = this.props; + const { form, id, onCancel, title } = this.props; form.validateForm().then(f => { if (f.isValid) { const payload = _.omitBy(form.getFormParams(), _.isEmpty); @@ -70,10 +70,10 @@ class ExternalPersonManageEditSlide extends Component { APIFOX(id ? { ...payload, id } : payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success("创建成功"); + message.success(`${title}成功`); onCancel(true); } else { - message.error(errormsg || "创建失败"); + message.error(errormsg || `${title}失败`); } }).catch(() => this.setState({ loading: false })); } else { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index d3660ebe..ae587725 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -11,19 +11,24 @@ import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; import PersonalScopeTable from "../../../components/PersonalScopeTable"; import PersonalScopeModal from "../../../components/PersonalScopeModal"; import { + deleteLedgerPersonExtRange, deleteLedgerPersonRange, getLedgerPersonRangeExclude, + getLedgerPersonRangeExtList, getLedgerPersonRangeInclude, salarysobRangeImportData, salarysobRangePreview, + saveLedgerPersonExtRange, saveLedgerPersonRange } from "../../../apis/ledger"; import ImportModal from "../../../components/importModal"; import { importEmployColumns } from "../../taxAgent/columns"; +import ExternalPersonModal from "../../../components/externalPersonModal"; const APIFox = { listInclude: getLedgerPersonRangeInclude, - listExclude: getLedgerPersonRangeExclude + listExclude: getLedgerPersonRangeExclude, + externalList: getLedgerPersonRangeExtList }; const APISaveFox = { save: saveLedgerPersonRange @@ -39,6 +44,8 @@ class LedgerAssociatedPersonnel extends Component { selectedKey: "listInclude", rowKeys: [], previewDataSource: [], + externalPersonModalVisible: false, + loading: false, importParams: { visible: false, step: 0, @@ -52,6 +59,25 @@ class LedgerAssociatedPersonnel extends Component { }; } + /* + * Author: 黎永顺 + * Description:外部人员保存 + * Params: + * Date: 2023/3/14 + */ + handleSaveExternalPerson = (val) => { + const { editId: salarySobId } = this.props; + saveLedgerPersonExtRange({ ...val, salarySobId }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.setState({ externalPersonModalVisible: false }); + this.personalScopeTableRef.getPersonalScopeList(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; /* * Author: 黎永顺 * Description: 删除人员范围 @@ -59,23 +85,55 @@ class LedgerAssociatedPersonnel extends Component { * Date: 2022/11/30 */ taxAgentRangeDelete = () => { + const { selectedKey } = this.state; Modal.confirm({ title: "信息确认", content: "确认要删除吗?", onOk: () => { - deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => { - if (status) { - message.success("删除成功"); - this.setState({ rowKeys: [] }, () => { - this.personalScopeTableRef.clearRowkeys(); - }); - } else { - message.error(errormsg || "删除失败"); - } - }); + return new Promise((resolve, reject) => { + return selectedKey === "externalList" ? this.deleteLedgerPersonExtRange(resolve, reject) : this.deleteLedgerPersonRange(resolve, reject); + }).catch(() => console.log("出错!")); } }); }; + deleteLedgerPersonExtRange = (resolve, reject) => { + message.destroy(); + message.loading("正在删除中...", 0); + deleteLedgerPersonExtRange(this.state.rowKeys).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + message.success("删除成功"); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || "删除失败"); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + deleteLedgerPersonRange = (resolve, reject) => { + message.destroy(); + message.loading("正在删除中...", 0); + deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + message.success("删除成功"); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || "删除失败"); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; /* * Author: 黎永顺 * Description:新增人员范围 @@ -84,13 +142,17 @@ class LedgerAssociatedPersonnel extends Component { */ handleAddPersonal = () => { const { personalAddModal, selectedKey } = this.state; - this.setState({ - personalAddModal: { - ...personalAddModal, - visible: true, - includeType: selectedKey === "listInclude" ? 1 : 0 - } - }); + if (selectedKey === "externalList") { + this.setState({ externalPersonModalVisible: true }); + } else { + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: true, + includeType: selectedKey === "listInclude" ? 1 : 0 + } + }); + } }; /* * Author: 黎永顺 @@ -138,7 +200,9 @@ class LedgerAssociatedPersonnel extends Component { rowKeys, personalAddModal, importParams, - previewDataSource + previewDataSource, + externalPersonModalVisible, + loading } = this.state; const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props; const topTab = [ @@ -149,6 +213,10 @@ class LedgerAssociatedPersonnel extends Component { { title: "从范围中排除", viewcondition: "listExclude" + }, + { + title: "非系统人员范围", + viewcondition: "externalList" } ]; const btns = showOperateBtn ? [ @@ -192,7 +260,7 @@ class LedgerAssociatedPersonnel extends Component { datas={topTab} keyParam="viewcondition" //主键 selectedKey={selectedKey} - buttons={showOperateBtn && selectedKey === "listExclude" ? btns.slice(1) : btns} + buttons={showOperateBtn && selectedKey === "listInclude" ? btns : btns.slice(1)} onChange={selectedKey => this.setState({ selectedKey })} /> )} + {/*非系统人员添加*/} + this.setState({ externalPersonModalVisible: false })} + onExternalPersonSave={this.handleSaveExternalPerson} + /> {/*新增人员范围*/} } initLoadCss + className="taxagentModalWrapper" visible={visible} style={{ width: 800, height: 450 }} hasScroll> diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.less b/pc4mobx/hrmSalary/pages/taxAgent/index.less index efc466ba..0f42ec4b 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.less @@ -108,3 +108,46 @@ } } } + +.taxagentModalWrapper { + .topMenuWrapper { + height: 47px; + line-height: 47px; + padding: 0 10px; + display: flex; + justify-content: space-between; + + .topMenuTabWrapper { + display: flex; + align-items: center; + + .menuTabItem { + height: 24px; + padding: 0 16px; + border-radius: 3px; + margin-right: 6px; + display: flex; + align-items: center; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + flex: 1 1 auto; + line-height: normal; + } + + .menuTabItem:hover { + color: #5d9cec; + background: #e9f7ff; + } + + .active { + color: #5d9cec; + background: #e9f7ff; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index 767822a1..2a2de5dd 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -18,6 +18,7 @@ export default class PersonalScope extends Component { constructor(props) { super(props); this.state = { + deleteLoading: false, queryLoading: false, submitLoading: false, targetTypeList: [], @@ -46,7 +47,6 @@ export default class PersonalScope extends Component { } }); }; - getTaxAgentRangeListInclude = (pageModule = {}) => { const { taxAgentId } = this.props; const { getTaxAgentRangeListInclude } = this.props.taxAgentStore; @@ -75,6 +75,35 @@ export default class PersonalScope extends Component { } ); }; + + taxAgentRangelistExt = (pageModule = {}) => { + const { taxAgentId } = this.props; + const { taxAgentRangelistExt } = this.props.taxAgentStore; + this.setState({ queryLoading: true }); + taxAgentRangelistExt({ ...pageModule, taxAgentId }).then( + ({ status, data }) => { + this.setState({ queryLoading: false }); + if (status && !_.isEmpty(data)) { + const { + columns, + list: dataSource, + pageNum: current, + pageSize, + total + } = data; + this.setState({ + columns, + dataSource, + pageObj: { + current, + pageSize, + total + } + }); + } + } + ); + }; getTaxAgentRangeListExclude = (pageModule = {}) => { const { taxAgentId } = this.props; const { getTaxAgentRangeListExclude } = this.props.taxAgentStore; @@ -105,17 +134,93 @@ export default class PersonalScope extends Component { }; taxAgentRangeDelete = ({ ids, tab }) => { - const { taxAgentRangeDelete } = this.props.taxAgentStore; - const { pageObj } = this.state; Modal.confirm({ title: "信息确认", content: `确认删除该条数据吗?`, onOk: () => { - taxAgentRangeDelete(ids).then(({ status, errorMsg }) => { + return new Promise((resolve, reject) => { + return tab == "2" ? this.taxAgentExtRangeDeleteComfirm(resolve, reject, ids) : this.taxAgentRangeDeleteComfirm(resolve, reject, ids, tab); + }).catch(() => console.log("出错!")); + } + }); + }; + taxAgentExtRangeDeleteComfirm = (resolve, reject, ids) => { + const { taxAgentRangeExtDelete } = this.props.taxAgentStore; + const { pageObj } = this.state; + message.destroy(); + message.loading("正在删除中...", 0); + taxAgentRangeExtDelete(ids).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + this.tagAgentRef.onSelectChange([]); + message.success("删除成功"); + this.taxAgentRangelistExt({ + current: pageObj.current, + pageSize: pageObj.pageSize + }); + } else { + message.error(errormsg || "删除失败"); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + taxAgentRangeDeleteComfirm = (resolve, reject, ids, tab) => { + const { taxAgentRangeDelete } = this.props.taxAgentStore; + const { pageObj } = this.state; + message.destroy(); + message.loading("正在删除中...", 0); + taxAgentRangeDelete(ids).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + this.tagAgentRef.onSelectChange([]); + message.success("删除成功"); + tab == "1" + ? this.getTaxAgentRangeListInclude({ + current: pageObj.current, + pageSize: pageObj.pageSize + }) + : this.getTaxAgentRangeListExclude({ + current: pageObj.current, + pageSize: pageObj.pageSize + }); + } else { + message.error(errormsg || "删除失败"); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + + taxAgentRangeSave = (module) => { + const { taxAgentId } = this.props; + const { pageObj } = this.state; + const { includeType } = module; + const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore; + this.setState({ submitLoading: true }); + if (includeType === 2) { + taxAgentRangeExtSave({ taxAgentId, ..._.pick(module, "targetIds") }).then(({ status, errormsg }) => { + this.setState({ submitLoading: false }); + if (status) { + this.tagAgentRef.closeModal(); + message.success("新增成功"); + this.taxAgentRangelistExt({ current: pageObj.current, pageSize: pageObj.pageSize }); + } else { + message.error(errormsg || "新增失败"); + } + }); + } else { + taxAgentRangeSave({ ...module, taxAgentId }).then( + ({ status, errormsg }) => { + this.setState({ submitLoading: false }); if (status) { - this.tagAgentRef.onSelectChange([]); - message.success("删除成功"); - tab == "1" + this.tagAgentRef.closeModal(); + message.success("新增成功"); + includeType == "1" ? this.getTaxAgentRangeListInclude({ current: pageObj.current, pageSize: pageObj.pageSize @@ -125,41 +230,11 @@ export default class PersonalScope extends Component { pageSize: pageObj.pageSize }); } else { - message.error(errorMsg || "删除失败"); + message.error(errormsg || "新增失败"); } - }); - }, - onCancel() { - } - }); - }; - - taxAgentRangeSave = (module) => { - const { taxAgentId } = this.props; - const { pageObj } = this.state; - const { includeType } = module; - const { taxAgentRangeSave } = this.props.taxAgentStore; - this.setState({ submitLoading: true }); - taxAgentRangeSave({ ...module, taxAgentId }).then( - ({ status, errormsg }) => { - this.setState({ submitLoading: false }); - if (status) { - this.tagAgentRef.closeModal(); - message.success("新增成功"); - includeType == "1" - ? this.getTaxAgentRangeListInclude({ - current: pageObj.current, - pageSize: pageObj.pageSize - }) - : this.getTaxAgentRangeListExclude({ - current: pageObj.current, - pageSize: pageObj.pageSize - }); - } else { - message.error(errormsg || "新增失败"); } - } - ); + ); + } }; render() { @@ -209,12 +284,14 @@ export default class PersonalScope extends Component { onTaxAngetSearch={({ targetName, tab }) => { tab == "1" ? this.getTaxAgentRangeListInclude({ targetName }) - : this.getTaxAgentRangeListExclude({ targetName }); + : tab == "0" ? this.getTaxAgentRangeListExclude({ targetName }) : + this.taxAgentRangelistExt({ targetName }); }} onChangeTab={(tab) => { + this.tagAgentRef.onSelectChange([]); tab == "1" ? this.getTaxAgentRangeListInclude() - : this.getTaxAgentRangeListExclude(); + : tab == "0" ? this.getTaxAgentRangeListExclude() : this.taxAgentRangelistExt(); }} />
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index ab52e298..24f73077 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -5,12 +5,14 @@ import AddTaxAgentModal from "./addTaxAgentModal"; import ImportModal from "../../components/importModal"; import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent"; import { importEmployColumns } from "./columns"; - +import ExternalPersonModal from "../../components/externalPersonModal"; +import cs from "classnames"; export default class SlideTaxagentUser extends React.Component { constructor(props) { super(props); this.state = { + externalPersonModalVisible: false, //外部人员关联弹框 addTaxagentModalVisible: false, includeType: 1, selectedRowKeys: [], @@ -42,8 +44,8 @@ export default class SlideTaxagentUser extends React.Component { handleTabDelete = () => { const { onDeleteTaxAgent } = this.props; - const { includeType } = this.state; - if (this.state.selectedRowKeys.length == 0) { + const { includeType, selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { message.warning("未选择条目"); return; } @@ -61,9 +63,10 @@ export default class SlideTaxagentUser extends React.Component { closeModal = () => { this.setState({ - addTaxagentModalVisible: false + addTaxagentModalVisible: false, + externalPersonModalVisible: false }, () => { - this.addTaxRef.handleReset(); + this.addTaxRef && this.addTaxRef.handleReset(); }); }; handleInitModal = () => { @@ -107,6 +110,7 @@ export default class SlideTaxagentUser extends React.Component { selectedRowKeys, searchValue, addTaxagentModalVisible, + externalPersonModalVisible, importParams, previewDataSource } = this.state; @@ -155,39 +159,23 @@ export default class SlideTaxagentUser extends React.Component { return (
-
-
+
+
{ - this.handleTabClick(1); - }}> + className={cs("menuTabItem", { "active": includeType == 1 })} + onClick={() => this.handleTabClick(1)}> 人员范围 - | { - this.handleTabClick(0); - }}> + + this.handleTabClick(0)}> 从范围中排除 + this.handleTabClick(2)}> + 非系统人员范围 +
@@ -226,6 +215,7 @@ export default class SlideTaxagentUser extends React.Component {
{ this.setState({ searchValue: value }); @@ -246,7 +236,12 @@ export default class SlideTaxagentUser extends React.Component { pagination={pagination} />
- + this.setState({ externalPersonModalVisible: false })} + onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })} + /> this.addTaxRef = ref} loading={submitLoading} diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 7d95a81a..02d3feb6 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/taxAgent"; // 引入API接口文件 import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions"; +import { taxAgentRangeExtDelete } from "../apis/taxAgent"; const { TableStore } = WeaTableNew; @@ -163,6 +164,21 @@ export class TaxAgentStore { getTaxAgentRangeForm = params => { return API.getTaxAgentRangeForm(params); }; + // 非系统人员范围保存 + @action + taxAgentRangeExtSave = params => { + return API.taxAgentRangeExtSave(params); + }; + // 非系统人员范围查询 + @action + taxAgentRangelistExt = params => { + return API.taxAgentRangelistExt(params); + }; + // 非系统人员范围删除 + @action + taxAgentRangeExtDelete = params => { + return API.taxAgentRangeExtDelete(params); + }; // 人员范围保存 @action taxAgentRangeSave = params => { From e14ebaacad55b9796426cf105842a77d8b0cde51 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, 15 Mar 2023 14:21:26 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payrollFiles/components/importMenu.js | 7 ++-- .../pages/payrollFiles/config/index.js | 7 ++++ pc4mobx/hrmSalary/pages/payrollFiles/index.js | 32 ++++++++++++++++--- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index 74dd4b0e..90de4d67 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -26,7 +26,7 @@ class ImportMenu extends Component { params.listType = "FIXED"; } else { params.listType = this.state.importParams.importType; - params.importType = ''; + params.importType = ""; } API.salaryArchivePreview(params).then(({ status, data }) => { if (status) { @@ -92,14 +92,15 @@ class ImportMenu extends Component { }; // 导入档案 handleImportFile = (params) => { + const { isExtEmp = false } = this.props; if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") { params.importType = this.state.importParams.importType; params.listType = "FIXED"; } else { - params.importType = ''; + params.importType = ""; params.listType = this.state.importParams.importType; } - API.importSalaryArchive(params).then(({ status, data }) => { + API.importSalaryArchive({ ...params, isExtEmp }).then(({ status, data }) => { if (status) { data.errorData = data.errorNotice; this.setState({ diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js index 5440dcd5..89fdab3f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js @@ -26,5 +26,12 @@ export const tabCondition = [ showcount: true, title: "停薪员工", viewcondition: "stop" + }, + { + color: "#000000", + groupid: "EXT", + showcount: false, + title: "非系统人员", + viewcondition: "ext" } ]; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index e52b9e38..1c642e24 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -441,6 +441,27 @@ class Index extends Component { }}/> ]; + } else if (selectedKey === "ext" && showOperateBtn) { + return [ + } + placement="topLeft" + />, + { + this.query(); + this.setState({ selectedRowKeys: [] }); + }}/> + }> + + + ]; } return []; }; @@ -486,7 +507,7 @@ class Index extends Component {
; - } else if (selectedKey === "fixed") { + } else if (selectedKey === "fixed" || selectedKey === "ext") { return this.handleEdit(record)}>调薪; } else if (selectedKey === "suspend") { return
@@ -579,7 +600,7 @@ class Index extends Component { window.open(`${linkUrl}&salaryArchiveId=${id}`); }}>发起调薪); } - if (showOperateBtn && selectedKey === "fixed") { + if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) { arrList.push(); @@ -624,7 +645,7 @@ class Index extends Component { salaryItemId: it.id, adjustValue: String(it.value || "") })), - status: _.upperCase(selectedKey) + status: selectedKey === "ext" ? "FIXED" : _.upperCase(selectedKey) }; API.savePaySet(payload).then(({ status, errormsg }) => { if (status) { @@ -657,8 +678,11 @@ class Index extends Component { case "suspend": this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); break; + case "stop": + this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); + break; default: - this.queryList("/api/bs/hrmsalary/salaryArchive/stopList"); + this.queryList("/api/bs/hrmsalary/salaryArchive/extList"); break; } }; From 49fb95755090a1803b7435c0b67e5992e93931c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 16 Mar 2023 09:05:34 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculateDetail/userSure.js | 25 +++ .../externalPersonManageEditSlide.js | 39 ++++- .../pages/externalPersonManage/conditions.js | 164 ++++++++++-------- .../components/ledgerAssociatedPersonnel.js | 4 +- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 2 +- pc4mobx/hrmSalary/util/index.js | 68 ++++---- 6 files changed, 185 insertions(+), 117 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index e74a8d8a..d0701591 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -497,6 +497,31 @@ export default class UserSure extends React.Component { title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下增加的人员" placement="topLeft" /> + | + { + this.setState({ selectedKey: "3" }, () => { + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PC", + listType: "MA", + url: "/api/bs/hrmsalary/salaryacct/addedemployee/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.state.userListSearchValue + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + }); + }}> + 非系统人员 +
{ if (status) { const { - departmentName, departmentId, subcompanyName, subcompanyId, - jobtitleName, jobtitleId, ...extraFormfields + departmentOrgName, departmentId, subcompanyOrgName, subcompanyId, + jobtitleOrgName, jobtitleId, ...extraFormfields } = data; form.updateFields({ "departmentId": { value: departmentId, - valueSpan: departmentName, - valueObj: [{ id: departmentId, name: departmentName }] + valueSpan: departmentOrgName, + valueObj: [{ id: departmentId, name: departmentOrgName }] } }); form.updateFields({ "subcompanyId": { value: subcompanyId, - valueSpan: departmentName, - valueObj: [{ id: subcompanyId, name: subcompanyName }] + valueSpan: subcompanyOrgName, + valueObj: [{ id: subcompanyId, name: subcompanyOrgName }] } }); form.updateFields({ "jobtitleId": { value: jobtitleId, - valueSpan: jobtitleName, - valueObj: [{ id: jobtitleId, name: jobtitleName }] + valueSpan: jobtitleOrgName, + valueObj: [{ id: jobtitleId, name: jobtitleOrgName }] } }); _.map(_.keys(extraFormfields), item => { @@ -64,6 +64,20 @@ class ExternalPersonManageEditSlide extends Component { const { form, id, onCancel, title } = this.props; form.validateForm().then(f => { if (f.isValid) { + const tmpV = _.reduce(_.keys(form.getFormDatas()), (pre, cur) => { + if (cur === "departmentId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + departmentName: form.getFormDatas()["departmentId"].valueSpan + }); + } else if (cur === "subcompanyId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + subcompanyName: form.getFormDatas()["subcompanyId"].valueSpan + }); + } + return _.assign(pre, { [cur]: form.getFormDatas()[cur].value }); + }, {}); const payload = _.omitBy(form.getFormParams(), _.isEmpty); this.setState({ loading: true }); const APIFOX = !id ? save : update; @@ -82,6 +96,13 @@ class ExternalPersonManageEditSlide extends Component { } }); }; + handleFormChange = (res) => { + const { form, id } = this.props; + if (!id && (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId")) { + const key = _.replace(_.keys(res)[0], "Id", "Name"); + form.updateFields({ [key]: res[_.keys(res)[0]].valueSpan || "" }); + } + }; render() { const { loading } = this.state; @@ -106,7 +127,7 @@ class ExternalPersonManageEditSlide extends Component { onSave={this.handleSubmit} /> } - content={getSearchs(form, condition, 1)} + content={getSearchs(form, condition, 1, false, this.handleFormChange)} onClose={onCancel} /> ); diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js index 2afc57f0..f150bfdc 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -9,11 +9,11 @@ export const searchCondition = [ label: "姓名", labelcol: 8, value: "", - viewAttr: 2, + viewAttr: 2 } ], - defaultshow: true, - }, + defaultshow: true + } ]; export const condition = [ { @@ -27,68 +27,88 @@ export const condition = [ label: "姓名", labelcol: 6, value: "", - viewAttr: 3, + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "部门", + type: "57", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["departmentId"], + fieldcol: 18, + label: "部门", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 18, + label: "部门名称", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "分部", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyId"], + fieldcol: 18, + label: "分部", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["subcompanyName"], + fieldcol: 18, + label: "分部名称", + labelcol: 6, + value: "", + viewAttr: 2 }, - // { - // browserConditionParam: { - // completeParams: {}, - // conditionDataParams: {}, - // dataParams: {}, - // destDataParams: {}, - // hasAddBtn: false, - // hasAdvanceSerach: false, - // idSeparator: ",", - // isAutoComplete: 1, - // isDetail: 0, - // isMultCheckbox: false, - // isSingle: true, - // icon: "icon-coms-hrm", - // linkUrl: "", - // pageSize: 10, - // quickSearchName: "", - // replaceDatas: [], - // title: "部门", - // type: "57", - // viewAttr: 2, - // }, - // colSpan: 1, - // conditionType: "BROWSER", - // domkey: ["departmentId"], - // fieldcol: 18, - // label: "部门", - // labelcol: 6, - // viewAttr: 2, - // }, - // { - // browserConditionParam: { - // completeParams: {}, - // conditionDataParams: {}, - // dataParams: {}, - // destDataParams: {}, - // hasAddBtn: false, - // hasAdvanceSerach: false, - // idSeparator: ",", - // isAutoComplete: 1, - // isDetail: 0, - // isMultCheckbox: false, - // isSingle: true, - // icon: "icon-coms-hrm", - // linkUrl: "", - // pageSize: 10, - // quickSearchName: "", - // replaceDatas: [], - // title: "分部", - // type: "164", - // viewAttr: 2, - // }, - // colSpan: 1, - // conditionType: "BROWSER", - // domkey: ["subcompanyId"], - // fieldcol: 18, - // label: "分部", - // labelcol: 6, - // viewAttr: 2, - // }, // { // browserConditionParam: { // completeParams: {}, @@ -127,7 +147,7 @@ export const condition = [ label: "入职日期", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -137,7 +157,7 @@ export const condition = [ label: "手机", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -147,7 +167,7 @@ export const condition = [ label: "工号", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -157,7 +177,7 @@ export const condition = [ label: "身份证号码", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -167,7 +187,7 @@ export const condition = [ label: "本人开户的银行卡卡号", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -177,10 +197,10 @@ export const condition = [ label: "本人开户的银行卡开户支行全称", labelcol: 6, value: "", - viewAttr: 2, - }, + viewAttr: 2 + } ], defaultshow: true, title: "基本信息" - }, + } ]; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index ae587725..723b56b3 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -66,8 +66,8 @@ class LedgerAssociatedPersonnel extends Component { * Date: 2023/3/14 */ handleSaveExternalPerson = (val) => { - const { editId: salarySobId } = this.props; - saveLedgerPersonExtRange({ ...val, salarySobId }).then(({ status, errormsg }) => { + const { editId: salarySobId, saveSalarySobId } = this.props; + saveLedgerPersonExtRange({ ...val, salarySobId: salarySobId || saveSalarySobId }).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success("保存成功"); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 1c642e24..aa20841e 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -679,7 +679,7 @@ class Index extends Component { this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); break; case "stop": - this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); + this.queryList("/api/bs/hrmsalary/salaryArchive/stopList"); break; default: this.queryList("/api/bs/hrmsalary/salaryArchive/extList"); diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index ffaa1956..f49caf6e 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -1,6 +1,7 @@ -import { Spin } from 'antd'; -import { WeaSwitch } from 'comsMobx'; -import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom'; +import { Spin } from "antd"; +import { WeaSwitch } from "comsMobx"; +import { WeaAlertPage, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; + const getLabel = WeaLocaleProvider.getLabel; // 渲染form表单: 一般对form的渲染都统一使用该方法 @@ -10,14 +11,14 @@ export const getCustomSearchs = (form, condition, col, isCenter) => { let items = []; let group = []; isFormInit && condition && - condition.map(c =>{ + condition.map(c => { c.items.map(fields => { items.push({ - com:( + com: ( @@ -27,39 +28,39 @@ export const getCustomSearchs = (form, condition, col, isCenter) => { formParams={formParams} /> ), - colSpan:1, - }) + colSpan: 1 + }); }); }); - if(items.length > 0) { + if (items.length > 0) { group.push( ) + />); return group; } -} +}; // 渲染form表单: 一般对form的渲染都统一使用该方法 -export const getSearchs = (form, condition, col, isCenter) => { +export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0)) => { const { isFormInit } = form; const formParams = form.getFormParams(); let group = []; - isFormInit && condition && condition.map(c =>{ + isFormInit && condition && condition.map(c => { let items = []; c.items.map(fields => { items.push({ - com:( + com: ( @@ -67,39 +68,40 @@ export const getSearchs = (form, condition, col, isCenter) => { fieldConfig={fields} form={form} formParams={formParams} + onChange={onChange} /> ), - colSpan:1, - }) + colSpan: 1 + }); }); group.push( ) + />); }); return group; -} +}; // 页面加载中效果处理 export const renderLoading = (loading) => (
- +
-) +); // 无权限处理 export const renderNoright = () => (
- {getLabel(2012,'对不起,您暂时没有权限!')} + {getLabel(2012, "对不起,您暂时没有权限!")}
-) +); // 暂无数据处理 export const renderNoData = () => ( @@ -108,13 +110,13 @@ export const renderNoData = () => ( 暂无数据
-) +); //分页计算 -export function calcPageNo (total, pageNo = 1, pageSize = 10, selectDelDataLen = 1) { - const totalPage = Math.ceil((total - selectDelDataLen) / pageSize) // 总页数 - pageNo = pageNo > totalPage ? totalPage : pageNo - pageNo = pageNo < 1 ? 1 : pageNo - return pageNo +export function calcPageNo(total, pageNo = 1, pageSize = 10, selectDelDataLen = 1) { + const totalPage = Math.ceil((total - selectDelDataLen) / pageSize); // 总页数 + pageNo = pageNo > totalPage ? totalPage : pageNo; + pageNo = pageNo < 1 ? 1 : pageNo; + return pageNo; } From fb3b4c7d59d1c9e59c33204eb2d83d5c3ad6047f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 16 Mar 2023 11:03:52 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/externalPersonModal/index.js | 4 +-- .../pages/calculateDetail/userSure.js | 25 ------------------- .../pages/externalPersonManage/index.js | 10 ++++---- .../pages/salaryFile/saralyFileViewSlide.js | 2 +- 4 files changed, 8 insertions(+), 33 deletions(-) diff --git a/pc4mobx/hrmSalary/components/externalPersonModal/index.js b/pc4mobx/hrmSalary/components/externalPersonModal/index.js index 1d9e17ec..64f21fbf 100644 --- a/pc4mobx/hrmSalary/components/externalPersonModal/index.js +++ b/pc4mobx/hrmSalary/components/externalPersonModal/index.js @@ -46,9 +46,9 @@ class Index extends Component { onCancel={onCancel} > - + - | - { - this.setState({ selectedKey: "3" }, () => { - const childFrameObj = document.getElementById("atdTable"); - const salaryAcctRecordId = getQueryString("id"); - const payload = { - type: "PC", - listType: "MA", - url: "/api/bs/hrmsalary/salaryacct/addedemployee/list", - queryParams: { - salaryAcctRecordId, - employeeName: this.state.userListSearchValue - } - }; - childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); - }); - }}> - 非系统人员 -
this.setState({ showSearchAd: false }, () => this.listPage())} onAdReset={() => form.resetForm()} onAdCancel={() => this.setState({ showSearchAd: false })} /> - ( this.handleAdd(id)} style={{ paddingRight: 8 }}>编辑 - this.handleDelete(id)}>删除 + {/* this.handleDelete(id)}>删除*/} ) } @@ -161,7 +161,7 @@ class Index extends Component { dataSource={dataSource} pagination={pagination} rowSelection={rowSelection} - xWidth={this.getColumns().length * 120} + xWidth={800} /> Date: Thu, 16 Mar 2023 11:44:12 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/taxAgent/personalScope.js | 3 ++- pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index 2a2de5dd..2efb06f2 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -273,7 +273,8 @@ export default class PersonalScope extends Component { () => { tab == "1" ? this.getTaxAgentRangeListInclude({ ...pageObj, ...params }) - : this.getTaxAgentRangeListExclude({ ...pageObj, ...params }); + : tab == "0" ? this.getTaxAgentRangeListExclude({ ...pageObj, ...params }) : + this.taxAgentRangelistExt({ ...pageObj, ...params }); } ); }} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index 24f73077..9823bc49 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -135,6 +135,7 @@ export default class SlideTaxagentUser extends React.Component { onChange: this.onSelectChange }; const pagination = { + ...pageObj, total: pageObj.total, showTotal: total => `共 ${total} 条`, showSizeChanger: true, From a1b8fc3f51f2bead3cdbd4bf71ac11d089bca839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 16 Mar 2023 18:32:24 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/config/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js index 89fdab3f..22a80218 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js @@ -30,7 +30,7 @@ export const tabCondition = [ { color: "#000000", groupid: "EXT", - showcount: false, + showcount: true, title: "非系统人员", viewcondition: "ext" } From 4b241b281628065556d18f9ad72a68e242867d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 17 Mar 2023 11:00:58 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../externalPersonManageEditSlide.js | 42 +++++++--------- .../pages/externalPersonManage/conditions.js | 6 ++- pc4mobx/hrmSalary/util/index.js | 49 ++++--------------- 3 files changed, 32 insertions(+), 65 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js index 1ff46da9..c564b29e 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { WeaSlideModal } from "ecCom"; import { message } from "antd"; -import { getSearchs } from "../../../util"; +import { getConditionDomkeys, getSearchs } from "../../../util"; import SlideModalTitle from "../../../components/slideModalTitle"; import { detail, save, update } from "../../../apis/externalPersonManage"; @@ -25,36 +25,32 @@ class ExternalPersonManageEditSlide extends Component { } detail = (props) => { - const { form, id } = props; + const { form, id, condition } = props; detail({ id }).then(({ status, data }) => { if (status) { - const { - departmentOrgName, departmentId, subcompanyOrgName, subcompanyId, - jobtitleOrgName, jobtitleId, ...extraFormfields - } = data; form.updateFields({ "departmentId": { - value: departmentId, - valueSpan: departmentOrgName, - valueObj: [{ id: departmentId, name: departmentOrgName }] + value: data["departmentId"], + valueSpan: data["departmentOrgName"], + valueObj: [{ id: data["departmentId"], name: data["departmentOrgName"] }] } }); form.updateFields({ "subcompanyId": { - value: subcompanyId, - valueSpan: subcompanyOrgName, - valueObj: [{ id: subcompanyId, name: subcompanyOrgName }] + value: data["subcompanyId"], + valueSpan: data["subcompanyOrgName"], + valueObj: [{ id: data["subcompanyId"], name: data["subcompanyOrgName"] }] } }); - form.updateFields({ - "jobtitleId": { - value: jobtitleId, - valueSpan: jobtitleOrgName, - valueObj: [{ id: jobtitleId, name: jobtitleOrgName }] - } - }); - _.map(_.keys(extraFormfields), item => { - form.updateFields({ [item]: { value: extraFormfields[item] } }, false); + // form.updateFields({ + // "jobtitleId": { + // value: jobtitleId, + // valueSpan: data["jobtitleOrgName"], + // valueObj: [{ id: jobtitleId, name: data["jobtitleOrgName"] }] + // } + // }); + _.map(_.without(getConditionDomkeys(condition), "departmentId", "subcompanyId"), item => { + form.updateFields({ [item]: { value: data[item] } }, false); }); } }); @@ -78,7 +74,7 @@ class ExternalPersonManageEditSlide extends Component { } return _.assign(pre, { [cur]: form.getFormDatas()[cur].value }); }, {}); - const payload = _.omitBy(form.getFormParams(), _.isEmpty); + const payload = _.omitBy(form.getFormParams(), _.isNil); this.setState({ loading: true }); const APIFOX = !id ? save : update; APIFOX(id ? { ...payload, id } : payload).then(({ status, errormsg }) => { @@ -98,7 +94,7 @@ class ExternalPersonManageEditSlide extends Component { }; handleFormChange = (res) => { const { form, id } = this.props; - if (!id && (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId")) { + if (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId") { const key = _.replace(_.keys(res)[0], "Id", "Name"); form.updateFields({ [key]: res[_.keys(res)[0]].valueSpan || "" }); } diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js index f150bfdc..c208e585 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -67,7 +67,8 @@ export const condition = [ label: "部门名称", labelcol: 6, value: "", - viewAttr: 2 + hasBorder: true, + viewAttr: 1 }, { browserConditionParam: { @@ -107,7 +108,8 @@ export const condition = [ label: "分部名称", labelcol: 6, value: "", - viewAttr: 2 + hasBorder: true, + viewAttr: 1 }, // { // browserConditionParam: { diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index f49caf6e..6298e782 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -4,47 +4,16 @@ import { WeaAlertPage, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ec const getLabel = WeaLocaleProvider.getLabel; -// 渲染form表单: 一般对form的渲染都统一使用该方法 -export const getCustomSearchs = (form, condition, col, isCenter) => { - const { isFormInit } = form; - const formParams = form.getFormParams(); - let items = []; - let group = []; - isFormInit && condition && - condition.map(c => { - c.items.map(fields => { - items.push({ - com: ( - - - ), - colSpan: 1 - }); - }); +// 获取condition的domKey值 +export const getConditionDomkeys = (condition) => { + let domkeyList = []; + _.forEach(condition, item => { + const tmpV = _.reduce(item.items, (pre, cur) => { + return [...pre, cur["domkey"][0]]; + }, []); + domkeyList = domkeyList.concat(tmpV); }); - - if (items.length > 0) { - group.push( - ); - return group; - } + return domkeyList; }; // 渲染form表单: 一般对form的渲染都统一使用该方法 From cb9056c50a5ea9ce691a470ab27f3ade18e78734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 11 Jul 2023 17:49:31 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index dcd3f13d..a43e4b18 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -190,7 +190,8 @@ export default class SlideTaxagentUser extends React.Component { Date: Tue, 11 Jul 2023 18:07:40 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/taxAgent/slideTaxagentUser.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index a43e4b18..f2b33310 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -6,7 +6,6 @@ import ImportModal from "../../components/importModal"; import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent"; import { importEmployColumns } from "./columns"; import ExternalPersonModal from "../../components/externalPersonModal"; -import cs from "classnames"; export default class SlideTaxagentUser extends React.Component { constructor(props) { @@ -182,16 +181,22 @@ export default class SlideTaxagentUser extends React.Component { >, , - this.setState({ addTaxagentModalVisible: true })}/> + { + const key = includeType === "2" ? "externalPersonModalVisible" : "addTaxagentModalVisible"; + this.setState({ [key]: true }); + }} + /> ]; - includeType === "0" && btns.shift(); + (includeType === "0" || includeType === "2") && btns.shift(); return (
Date: Wed, 12 Jul 2023 13:43:15 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/taxAgent/personalScope.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index c91fd77b..da0bd2bb 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -139,7 +139,7 @@ export default class PersonalScope extends Component { content: `确认删除该条数据吗?`, onOk: () => { return new Promise((resolve, reject) => { - return tab == "2" ? this.taxAgentExtRangeDeleteComfirm(resolve, reject, ids) : this.taxAgentRangeDeleteComfirm(resolve, reject, ids, tab); + return tab === "2" ? this.taxAgentExtRangeDeleteComfirm(resolve, reject, ids) : this.taxAgentRangeDeleteComfirm(resolve, reject, ids, tab); }).catch(() => console.log("出错!")); } }); @@ -202,7 +202,7 @@ export default class PersonalScope extends Component { const { includeType } = module; const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore; this.setState({ submitLoading: true }); - if (includeType === 2) { + if (includeType === "2") { taxAgentRangeExtSave({ taxAgentId, ..._.pick(module, "targetIds") }).then(({ status, errormsg }) => { this.setState({ submitLoading: false }); if (status) { From 8356de0fa28993146033ef9a7010e392c34b3ee1 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, 12 Jul 2023 14:34:07 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/externalPersonManage/index.less | 11 +++++++++-- pc4mobx/hrmSalary/util/index.js | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.less b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less index 32f8b668..8b13dd6f 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/index.less +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less @@ -1,7 +1,14 @@ -.externalPerWrapper{ +.externalPerWrapper { width: 100%; height: 100%; - .externalPerCont{ + + .externalPerCont { height: 100%; } } + +.slideOuterWrapper { + .hideFormItem { + display: none !important; + } +} diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index de115ede..702a281b 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -32,6 +32,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例 error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验 tipPosition="bottom" // 错误提示的显示位置: top/bottom + className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : ""} > Date: Thu, 13 Jul 2023 10:05:16 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index 90de4d67..6e84e53f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -114,7 +114,7 @@ class ImportMenu extends Component { }; render() { - const { importType, refreshList } = this.props; + const { importType, refreshList, isExtEmp } = this.props; const { importParams, previewColumns, previewDataSource } = this.state; let params = ""; if (importParams.importType === "init" || importParams.importType === "salaryItemAdjust") { @@ -122,6 +122,7 @@ class ImportMenu extends Component { } else { params = "" + "&listType=" + importParams.importType; } + if (isExtEmp) params = "&extSalaryArchiveList=true"; return ( From e83ff0dbccfb85381ed048a3fec5cd81781e23fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 13 Jul 2023 10:31:45 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E5=BC=80=E5=8F=91=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index 6e84e53f..42f95e62 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -122,7 +122,7 @@ class ImportMenu extends Component { } else { params = "" + "&listType=" + importParams.importType; } - if (isExtEmp) params = "&extSalaryArchiveList=true"; + if (isExtEmp) params = params + "&extSalaryArchiveList=true"; return ( From 1542d8c98221c38f06486720c73ee216c6fd059a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 14 Jul 2023 14:09:27 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/ruleconfig.js | 8 +++ .../components/ledgerAssociatedPersonnel.js | 23 ++++++- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 22 +++++- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 68 +++++++++++++++---- .../pages/taxAgent/slideTaxagentUser.js | 48 ++++++++----- 5 files changed, 131 insertions(+), 38 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 2e3c0c4f..69cfa1fa 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -6,6 +6,10 @@ export const commonEnumList = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params); }; +export const sysinfo = params => { + return WeaTools.callApi("/api/bs/hrmsalary/sys/info", "GET", params); +}; + export const sysOrderRule = params => { return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params); }; @@ -47,6 +51,10 @@ export const operateTaxDeclarationFunction = (params) => { export const saveArchiveDelete = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params); }; +//保存系统规则开关 +export const saveSysOperate = (params) => { + return postFetch("/api/bs/hrmsalary/sys/operate", params); +}; //保存个税申报撤回规则 export const saveWithDrawTaxDeclaration = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params); diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index 723b56b3..76913307 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -24,6 +24,7 @@ import { import ImportModal from "../../../components/importModal"; import { importEmployColumns } from "../../taxAgent/columns"; import ExternalPersonModal from "../../../components/externalPersonModal"; +import { sysinfo } from "../../../apis/ruleconfig"; const APIFox = { listInclude: getLedgerPersonRangeInclude, @@ -55,10 +56,26 @@ class LedgerAssociatedPersonnel extends Component { visible: false, title: "关联人员", includeType: "" - } + }, + extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; } + componentDidMount() { + this.getSysinfo(); + } + + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; /* * Author: 黎永顺 * Description:外部人员保存 @@ -202,7 +219,7 @@ class LedgerAssociatedPersonnel extends Component { importParams, previewDataSource, externalPersonModalVisible, - loading + loading, extEmpsWitch } = this.state; const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props; const topTab = [ @@ -257,7 +274,7 @@ class LedgerAssociatedPersonnel extends Component { return (
{ + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + handleReceive = ({ data }) => { const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ @@ -703,7 +718,8 @@ class Index extends Component { showSearchAd, slideParams, changeSalaryVisible, - paysetParams + paysetParams, + extEmpsWitch } = this.state; const { payrollFilesStore: { tableStore } } = this.props; const renderSearch = () => { @@ -762,7 +778,7 @@ class Index extends Component { dropMenuDatas={rightMenu} > ({ key: it.value, showname: it.defaultLabel })); const orderOptions = _.map(orderRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); const ascOptions = _.map(ascOrDescEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); const employeeOptions = _.map(matchEmployeeModeEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); - const { data: { ascOrDesc, orderRule } } = orderRules; - const { data: rule } = codeRule; const { data: { - showEncryptOperationButton, - isOpenEncrypt: enctry, - isOpenTaxDeclaration: operateTaxDeclaration, - salaryAcctEmployeeRule: matchRule, - salaryArchiveDelete: confValue, withDrawTaxDeclaration + ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "", + taxDeclarationFunction: operateTaxDeclaration = "0", salaryArchiveDelete: confValue, + salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0", + OPEN_APPLICATION_ENCRYPT: enctry = "0", extEmpsWitch = "0" } - } = appSettings; + } = sysInfo; + // const { data: { ascOrDesc, orderRule } } = orderRules; + // const { data: rule } = codeRule; + // const { + // data: { + // showEncryptOperationButton, + // isOpenEncrypt: enctry + // isOpenTaxDeclaration: operateTaxDeclaration, + // salaryAcctEmployeeRule: matchRule, + // salaryArchiveDelete: confValue, + // withDrawTaxDeclaration + // } + // } = appSettings; this.setState({ matchRuleOptions, orderOptions, ascOptions, employeeOptions, showEncryptOperationButton, saveParams: { ...saveParams, - ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration + ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration, + extEmpsWitch } }); } + sysinfo = () => { + return API.sysinfo(); + }; + sysOrderRule = () => { return API.sysOrderRule(); }; @@ -210,6 +227,16 @@ export default class Index extends Component { } }); }; + saveSysOperate = (payload) => { + API.saveSysOperate({ ...payload, confValue: this.state.saveParams.extEmpsWitch }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }; withDrawTaxDeclaration = () => { API.saveWithDrawTaxDeclaration({ confValue: _.pick(this.state.saveParams, ["withDrawTaxDeclaration"]).withDrawTaxDeclaration }) .then(({ status, errormsg }) => { @@ -256,6 +283,12 @@ export default class Index extends Component { case "withDrawTaxDeclaration": this.withDrawTaxDeclaration(); break; + case "extEmpsWitch": + this.saveSysOperate({ + title: getLabel(111, "开启非系统人员"), + module: "basic", confKey: key + }); + break; default: break; } @@ -289,7 +322,8 @@ export default class Index extends Component { operateTaxDeclaration, matchRule, confValue, - withDrawTaxDeclaration + withDrawTaxDeclaration, + extEmpsWitch } = saveParams; return (
@@ -330,7 +364,7 @@ export default class Index extends Component { } - this.handleChange("operateTaxDeclaration", val)}/> @@ -351,6 +385,12 @@ export default class Index extends Component { /> + + + this.handleChange("extEmpsWitch", val)}/> + + { this.state.progressVisible && { - onChangeTab && onChangeTab(includeType); - } - ); + componentDidMount() { + this.getSysinfo(); } + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + onSelectChange = selectedRowKeys => { this.setState({ selectedRowKeys }); }; @@ -125,7 +130,7 @@ export default class SlideTaxagentUser extends React.Component { externalPersonModalVisible, importParams, previewDataSource, - showSearchAd + showSearchAd, extEmpsWitch } = this.state; const { submitLoading, @@ -193,11 +198,18 @@ export default class SlideTaxagentUser extends React.Component { return (
Date: Thu, 20 Jul 2023 13:40:42 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js index c6719241..32a53167 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js @@ -95,7 +95,7 @@ export default class SalaryFileViewSlide extends React.Component { { com: PickDate({ label: "最后发薪日期", - viewAttr: (selectedKey === "pending" || selectedKey === "fixed") ? 2 : selectedKey === "stop" ? 1 : 3, + viewAttr: (selectedKey === "pending" || selectedKey === "fixed" || selectedKey === "ext") ? 2 : selectedKey === "stop" ? 1 : 3, value: paysetParams.payEndDate, onChange: handleSetpay })