From 9c318d22b721fca48817f066f09a273ab06143b4 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, 29 Sep 2024 10:57:22 +0800 Subject: [PATCH 01/27] hotfix/2.15.1.2409.01 --- pc4mobx/hrmSalary/apis/calculate.js | 5 ++++- .../salaryCalcPersonConfirm/index.js | 20 +++++++++++++++++++ .../salaryCalcPersonConfirm/index.less | 12 +++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 85805d5c..a41a7c07 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -95,7 +95,10 @@ export const comparisonresultList = (params) => { export const refreshTaxAgent = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refreshTaxAgent", params); }; - +// 核算人员--刷新薪资核算人员的 +export const refreshAcctemployee = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refresh", params); +}; // 薪资核算-编辑表单 export const acctresultDetail = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/detail", "GET", params); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index 5a3f9abc..d4aca862 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -14,6 +14,7 @@ import { addedemployeeList, deleteAcctemployee, reducedemployeeList, + refreshAcctemployee, saveAcctemployee } from "../../../../../apis/calculate"; import { personConfirmSearchConditions } from "./condition"; @@ -90,6 +91,8 @@ class Index extends Component { > , + , ]; break; @@ -180,6 +183,23 @@ class Index extends Component { } }); }; + handleRefresh = () => { + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + const { routeParams: { salaryAcctRecordId } } = this.props; + refreshAcctemployee({ salaryAcctRecordId }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.queryPCList(); + } else { + message.error(errormsg); + } + }); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + }; render() { const { calculateStore: { PCSearchForm } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less index eb4fb73b..e912632d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -6,6 +6,18 @@ .wea-new-table { background: #fff; } + + .icon-refresh { + display: flex; + justify-content: center; + align-items: center; + width: 20px; + height: 20px; + color: #fff; + background: #55a1f8; + cursor: pointer; + border-radius: 3px; + } } .docalc-baseinfo-layout { From d73372e5c4bee0ade5ea541290c15760e2890a8f 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, 8 Oct 2024 10:07:23 +0800 Subject: [PATCH 02/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/roleManagement/index.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index e911681c..8de15ad5 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -2,7 +2,7 @@ .rolemanagement-content { height: 100%; overflow-y: auto; - padding: 16px 16px 0; + padding: 8px 16px 0; background: rgb(246, 246, 246); .wea-new-table { From 53d45c2069f9d4325698a0e57015ff0702afb7ca 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, 8 Oct 2024 13:21:55 +0800 Subject: [PATCH 03/27] =?UTF-8?q?hotfix/2.15.1.2409.01=20=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/ruleConfig/conditions.js | 243 +++++++++--------- pc4mobx/hrmSalary/pages/ruleConfig/index.less | 2 +- 2 files changed, 127 insertions(+), 118 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index d7340658..feaf423d 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -4,6 +4,21 @@ import { WeaLocaleProvider } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; export const conditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["rule"], + fieldcol: 10, + label: getLabel(543352, "人员字段"), + labelcol: 8, + options: [], + viewAttr: 2 + } + ], + title: getLabel(543357, "人员校验规则"), + defaultshow: true + }, { items: [ { @@ -28,21 +43,6 @@ export const conditions = [ title: getLabel(543356, "排序规则"), defaultshow: true }, - { - items: [ - { - conditionType: "SELECT", - domkey: ["rule"], - fieldcol: 10, - label: getLabel(543352, "人员字段"), - labelcol: 8, - options: [], - viewAttr: 2 - } - ], - title: getLabel(543357, "人员校验规则"), - defaultshow: true - }, { items: [ { @@ -57,107 +57,6 @@ export const conditions = [ title: getLabel(543358, "加密规则"), defaultshow: true }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["taxDeclarationFunction"], - fieldcol: 10, - label: getLabel(111, "系统算税"), - labelcol: 8, - viewAttr: 1 - }, - { - conditionType: "SWITCH", - domkey: ["WITHDRAW_TAX_DECLARATION"], - fieldcol: 10, - label: getLabel(111, "撤回申报表"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "算税规则"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["salaryArchiveDelete"], - fieldcol: 10, - label: getLabel(111, "允许删除档案"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(538004, "薪资档案"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["welBaseDiffByPerAndCom"], - fieldcol: 10, - label: getLabel(111, "区分个人和公司"), - labelcol: 8, - viewAttr: 2 - }, - { - conditionType: "SWITCH", - domkey: ["welBaseAutoAdjust"], - fieldcol: 10, - label: getLabel(111, "导入基数自动调整上/下限"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "福利档案基数"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SELECT", - domkey: ["matchRule"], - fieldcol: 10, - label: getLabel(111, "匹配规则"), - options: [], - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "薪资核算人员匹配规则"), - defaultshow: true - }, - { - items: [ - { - conditionType: "INPUTNUMBER", - domkey: ["salaryAcctFixedColumns"], - fieldcol: 10, - label: getLabel(111, "固定数"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "薪资核算固定列头数"), - defaultshow: true - }, - // { - // items: [ - // { - // conditionType: "SWITCH", - // domkey: ["extEmpsWitch"], - // fieldcol: 10, - // label: getLabel(111, "开启非系统人员"), - // labelcol: 8, - // viewAttr: 2 - // } - // ], - // title: getLabel(111, "非系统人员"), - // defaultshow: true - // }, { items: [ { @@ -187,7 +86,117 @@ export const conditions = [ ], title: getLabel(111, "我的薪资福利设置"), defaultshow: true - } + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["welBaseDiffByPerAndCom"], + fieldcol: 10, + label: getLabel(111, "区分个人和公司"), + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SWITCH", + domkey: ["welBaseAutoAdjust"], + fieldcol: 10, + label: getLabel(111, "导入基数自动调整上/下限"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "福利档案基数"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["salaryArchiveDelete"], + fieldcol: 10, + label: getLabel(111, "允许删除档案"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(538004, "薪资档案"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["matchRule"], + fieldcol: 10, + label: getLabel(111, "匹配规则"), + options: [], + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["salaryAcctFixedColumns"], + fieldcol: 10, + label: getLabel(111, "固定数"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资核算"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["taxDeclarationFunction"], + fieldcol: 10, + label: getLabel(111, "系统算税"), + labelcol: 8, + viewAttr: 1 + }, + { + conditionType: "SWITCH", + domkey: ["WITHDRAW_TAX_DECLARATION"], + fieldcol: 10, + label: getLabel(111, "撤回申报表"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "算税规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["abc"], + fieldcol: 10, + label: getLabel(111, "组织信息"), + options: [], + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资报表"), + defaultshow: true + }, + // { + // items: [ + // { + // conditionType: "SWITCH", + // domkey: ["extEmpsWitch"], + // fieldcol: 10, + // label: getLabel(111, "开启非系统人员"), + // labelcol: 8, + // viewAttr: 2 + // } + // ], + // title: getLabel(111, "非系统人员"), + // defaultshow: true + // }, ]; export const payloadList = [ { enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" }, diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.less b/pc4mobx/hrmSalary/pages/ruleConfig/index.less index a4599477..a7a7c267 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.less +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.less @@ -3,7 +3,7 @@ overflow: hidden !important; .ruleWrapper { - padding: 16px; + padding: 8px 16px 0; background: #e5e5e5; height: 100%; overflow: hidden auto; From f6789a0ea8d3e36ef8df1c4c80f27474a4b81731 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, 8 Oct 2024 14:08:16 +0800 Subject: [PATCH 04/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 2 +- .../pages/salary/components/baseSettings.js | 48 +++ .../pages/salary/components/comHint.js | 42 +++ .../pages/salary/components/constants.js | 294 +++++++++++++++ .../pages/salary/components/index.less | 135 +++++++ .../pages/salary/components/personalScope.js | 272 ++++++++++++++ .../salary/components/personalScopeModal.js | 191 ++++++++++ .../salary/components/personalScopeTable.js | 137 +++++++ .../pages/salary/components/taxAgentSlide.js | 342 ++++++++++++++++++ .../pages/salary/components/taxAgentTable.js | 137 +++++++ .../salary/components/taxDeclarationInfo.js | 146 ++++++++ .../salary/components/taxFillingInfoDialog.js | 132 +++++++ pc4mobx/hrmSalary/pages/salary/index.less | 43 +++ pc4mobx/hrmSalary/pages/salary/taxAgent.js | 254 +++++++++++++ 14 files changed, 2174 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/pages/salary/components/baseSettings.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/comHint.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/constants.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/index.less create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScope.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js create mode 100644 pc4mobx/hrmSalary/pages/salary/index.less create mode 100644 pc4mobx/hrmSalary/pages/salary/taxAgent.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 7b5cf863..96d4af12 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -28,7 +28,7 @@ import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; // import Declare from "./pages/declare"; import Declare from "./pages/declare/declare"; //重构的个税申报表 import TaxRate from "./pages/taxRate"; -import TaxAgent from "./pages/taxAgent"; +import TaxAgent from "./pages/salary/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; diff --git a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js new file mode 100644 index 00000000..5e24cb5c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js @@ -0,0 +1,48 @@ +/* + * Author: 黎永顺 + * name: 基础设置 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; +import { getSearchs } from "../../../util"; + +@inject("taxAgentStore") +@observer +class BaseSettings extends Component { + + componentDidMount() { + + } + + render() { + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props; + return ( +
+ { + decentralization === "0" ? + getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) : + getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false) + } +
+ ); + } +} + +export default BaseSettings; + +export const convertConditon = (condition, bool) => { + return _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + return { + ...child, + viewAttr: bool ? 1 : child.viewAttr + }; + }) + }; + }); +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/comHint.js b/pc4mobx/hrmSalary/pages/salary/components/comHint.js new file mode 100644 index 00000000..da3f5fb0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/comHint.js @@ -0,0 +1,42 @@ +/* + * Author: 黎永顺 + * name: 个税扣缴义务人小提示组件 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import "./index.less"; + +class ComHint extends Component { + /* + * Author: 黎永顺 + * Description: 提示语注释 + * Params: isChief=总管理员 + * Date: 2022/11/22 + */ + renderTips = () => { + const { isChief = true } = this.props; + if (isChief) { + return [ +

1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;

, +

2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;

, +

3、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;

+ ]; + } else { + return []; + } + }; + + render() { + return ( +
+
小提示
+
+ {this.renderTips()} +
+
+ ); + } +} + +export default ComHint; diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js new file mode 100644 index 00000000..8682937c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -0,0 +1,294 @@ +export const fieldList = [ + { + key: "name", + label: "名称", + lanId: 33439, + type: "TEXT", + viewAttr: 1 + }, + { + key: "taxCode", + label: "税号", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "city", + label: "报税所属区域", + lanId: 111, + type: "SELECT", + viewAttr: 3 + }, + { + key: "areaCode", + label: "行政区划代码", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "passwordType", + label: "密码校验类型", + lanId: 111, + type: "RADIO", + viewAttr: 3, + options: [ + { + key: "TAX_NET_PASSWORD", + showname: "个税网报密码", + lanId: 111 + }, + { + key: "REAL_NAME_PASSWORD", + showname: "实名账号密码", + lanId: 111 + } + ] + }, + { + key: "account", + label: "实名账号", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "realNamePassword", + label: "实名账号密码", + lanId: 111, + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "netPassword", + label: "个税网报密码", + lanId: 111, + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "taxRegistrationNumber", + label: "登记序号", + type: "TEXT", + lanId: 111, + viewAttr: 1 + }, + { + key: "departmentCode", + label: "部门编码", + lanId: 111, + type: "TEXT", + viewAttr: 1 + }, + { + key: "checkStatus", + label: "报税信息验证状态", + lanId: 111, + type: "TEXT", + viewAttr: 1 + } +]; + +export const taxFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAgentName"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxRegistrationNumber"], + fieldcol: 14, + label: "登记序号", + lanId: 545138, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxpayerStatus"], + fieldcol: 14, + label: "纳税人状态", + lanId: 545139, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["legalPersonName"], + fieldcol: 14, + label: "法人姓名", + lanId: 545140, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["mobile"], + fieldcol: 14, + label: "联系电话", + lanId: 545141, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["businessAddress"], + fieldcol: 14, + label: "生产经营地址", + lanId: 545142, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["industryName"], + fieldcol: 14, + label: "行业名称", + lanId: 545143, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAuthorities"], + fieldcol: 14, + label: "主管税务机关", + lanId: 545144, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxBranch"], + fieldcol: 14, + label: "主管税务科所", + lanId: 545145, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["divideFiling"], + fieldcol: 14, + label: "是否分部门备案", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + } + ], + defaultshow: true + } +]; +export const deptFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 14, + label: "部门名称", + lanId: 536641, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentCode"], + fieldcol: 14, + label: "部门编码", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; + +export const taxFillColumns = [ + { + dataIndex: "taxCode", + title: "税号", + titleId: "", + fixed: "left" + }, + { + dataIndex: "taxAgentName", + title: "个税扣缴义务人", + titleId: "537996" + }, + { + dataIndex: "taxRegistrationNumber", + title: "登记序号", + titleId: "545138" + }, + { + dataIndex: "taxpayerStatus", + title: "纳税人状态", + titleId: "545139" + }, + { + dataIndex: "taxAuthorities", + title: "主管税务机关", + titleId: "545144" + }, + { + dataIndex: "taxBranch", + title: "主管税务科所", + titleId: "545145" + }, + { + dataIndex: "businessAddress", + title: "生产经营地址", + titleId: "545142" + }, + { + dataIndex: "industryName", + title: "行业名称", + titleId: "545143" + }, + { + dataIndex: "legalPersonName", + title: "法人姓名", + titleId: "545140" + }, + { + dataIndex: "mobile", + title: "联系电话", + titleId: "545141" + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less new file mode 100644 index 00000000..be539899 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -0,0 +1,135 @@ +.taxAgentSlideContent { + .baseSettingWrapper, .taxDeclarationInfoWrapper { + padding: 12px 12px 12px 20px; + + .wea-search-group { + padding: 0; + border: 1px solid #e5e5e5; + border-bottom: none; + + .wea-content { + padding: 0; + + .wea-form-cell, .wea-form-item { + border-bottom: 1px solid #e5e5e5; + padding: 5px 10px 5px 30px; + + .wea-form-item { + padding: 0 !important; + border-bottom: none !important; + } + } + } + } + } +} + +.comHint { + width: 100%; + margin: 16px 0; + border: 1px solid #e5e5e5; + + .hintHeader { + background: #f6f6f6; + height: 40px; + border-bottom: 1px solid #e5e5e5; + padding-left: 16px; + line-height: 40px; + } + + .hintTips { + width: 100%; + color: #999; + line-height: 20px; + padding: 0 16px; + display: inline-block; + + p { + margin: 1rem 0; + } + } +} + +.slideOuterWrapper { + .wea-slide-modal-title { + height: initial; + line-height: initial; + text-align: left; + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + +} + +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; + } + } +} + +@media screen and (min-width: 1060px) and (max-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; + } + } +} + +//添加关联人员弹框中的下拉框样式 +.personalScopeModalWrapper { + .wea-select, .ant-select-selection, .ant-select { + width: 100%; + } + + .wea-select { + display: inline-block; + position: relative; + } + + .ant-select-selection { + height: 30px; + border-radius: 0; + } +} + +.taxfillingDialog { + .ant-modal-title { + .text-elli { + color: #111; + font-weight: 700; + } + } + + .taxfillingDialogContent { + height: 100%; + padding: 16px; + background: #f6f6f6; + overflow-y: auto; + + .wea-search-group { + padding: 0; + background: #FFF; + border: 1px solid #e5e5e5; + border-bottom: 0; + + .ant-row, .wea-form-cell { + padding: 0; + } + + .wea-form-item { + padding: 5px 16px; + border-bottom: 1px solid #e5e5e5; + } + } + + .wea-new-table { + background: #FFF; + } + + } +} diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js new file mode 100644 index 00000000..66070632 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -0,0 +1,272 @@ +/* + * Author: 黎永顺 + * name: 人员范围 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; +import { + taxAgentRangeDelete, + taxAgentRangeExtDelete, + taxAgentRangeExtSave, + taxAgentRangeImportData, + taxAgentRangePreview +} from "../../../apis/taxAgent"; +import { sysinfo } from "../../../apis/ruleconfig"; +import PersonalScopeTable from "./personalScopeTable"; +import PersonalScopeModal from "./personalScopeModal"; +import ImportModal from "../../../components/importModal"; +import ExternalPersonModal from "../../../components/externalPersonModal"; +import { importEmployColumns } from "../../taxAgent/columns"; + +@inject("taxAgentStore") +@observer +class PersonalScope extends Component { + constructor(props) { + super(props); + this.state = { + searchValue: "", selectedKey: "listInclude", + rowKeys: [], personalAddModal: { + visible: false, externalVisible: false, + title: "关联人员", includeType: "" + }, + previewDataSource: [], importParams: { + visible: false, + step: 0, + importResult: {} + }, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 + loading: false + }; + this.personalScopeTableRef = null; + } + + componentDidMount() { + const { taxAgentStore: { hasIconInTax } } = this.props; + hasIconInTax(); + this.getSysinfo(); + } + + /* + * Author: 黎永顺 + * Description:非系统人员开关查询 + * Params: + * Date: 2023/11/9 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + /* + * Author: 黎永顺 + * Description: 删除人员范围 + * Params: + * Date: 2022/11/30 + */ + taxAgentRangeDelete = () => { + Modal.confirm({ + title: "信息确认", + content: "确认要删除吗?", + onOk: () => { + const { selectedKey } = this.state; + const API = selectedKey === "listExt" ? taxAgentRangeExtDelete : taxAgentRangeDelete; + API(this.state.rowKeys).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description:新增人员范围 + * Params: + * Date: 2022/11/30 + */ + handleAddPersonal = () => { + const { personalAddModal, selectedKey } = this.state; + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: selectedKey !== "listExt", + externalVisible: selectedKey === "listExt", + includeType: selectedKey === "listInclude" ? 1 : 0 + } + }); + }; + salaryArchivePreview = (params) => { + taxAgentRangePreview(params).then(({ status, data }) => { + if (status) { + const { preview } = data; + this.setState({ + previewDataSource: preview + }); + } + }); + }; + handleImportFile = (params) => { + const { taxAgentId } = this.props; + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + if (status) { + this.setState({ + importParams: { + ...this.state.importParams, + importResult: data + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 保存非系统人员 + * Params: + * Date: 2023/11/9 + */ + handleSaveExtPersons = (payload = {}) => { + const { taxAgentId } = this.props; + const { personalAddModal } = this.state; + this.setState({ loading: false }); + taxAgentRangeExtSave({ taxAgentId, ...payload }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + personalAddModal: { + ...personalAddModal, + externalVisible: false + } + }, () => this.personalScopeTableRef.getPersonalScopeList()); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { + selectedKey, searchValue, rowKeys, personalAddModal, + importParams, previewDataSource, extEmpsWitch, loading + } = this.state; + const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props; + const topTab = [ + { + title: "管理范围", + viewcondition: "listInclude" + }, + { + title: "从范围中排除", + viewcondition: "listExclude" + }, + { + title: "非系统人员范围", + viewcondition: "listExt" + } + ]; + const btns = (hideIconInTax || showSalaryItemBtn) ? [ + , + , + , + this.setState({ searchValue })} + placeholder="请输入对象" + onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + /> + ] : [ this.setState({ searchValue })} + placeholder="请输入对象" + onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + />]; + (selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift(); + return ( +
+ this.setState({ selectedKey })} + /> + this.personalScopeTableRef = dom} + taxAgentId={taxAgentId} + tabActive={selectedKey} + searchValue={searchValue} + onChangeSelectKey={rowKeys => this.setState({ rowKeys })} + /> + {/*非系统人员添加*/} + this.setState({ personalAddModal: { ...personalAddModal, externalVisible: false } })} + onExternalPersonSave={this.handleSaveExtPersons} + /> + this.personalScopeTableRef.getPersonalScopeList()} + onCancel={() => + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: false, + includeType: "" + } + }) + } + /> + {importParams.visible && ( + { + this.setState({ importParams: { ...this.state.importParams, step } }); + }} + importResult={importParams.importResult} + onFinish={() => { + this.setState({ + importParams: { + ...this.state.importParams, + visible: false + } + }, () => this.personalScopeTableRef.getPersonalScopeList()); + }} + previewImport={(params) => this.salaryArchivePreview(params)} + importFile={(params) => this.handleImportFile(params)} + templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} + visiable={importParams.visible} + onCancel={() => { + this.setState({ importParams: { ...this.state.importParams, visible: false } }); + }} + /> + )} +
+ ); + } +} + +export default PersonalScope; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js new file mode 100644 index 00000000..9e4c09af --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -0,0 +1,191 @@ +/* + * Author: 黎永顺 + * name: 新增人员范围弹框 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, message, Modal } from "antd"; +import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; +import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; +import "./index.less"; + +class PersonalScopeModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + employeeStatus: [], + targetTypeList: [], + targetType: "EMPLOYEE", + targetTypeIds: "", + targetTypeIdsNames: "", + status: "", + statusAll: "" + }; + } + + componentDidMount() { + this.getTaxAgentRangeForm(); + } + + getTaxAgentRangeForm = () => { + getTaxAgentRangeForm().then(({ status, data }) => { + if (status) { + const { employeeStatus, targetTypeList } = data; + this.setState({ + targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), + employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + }); + } + }); + }; + taxAgentRangeSave = () => { + const { status, targetTypeIds, targetType } = this.state; + const { includeType, taxAgentId, onSuccess, onCancel } = this.props; + if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + taxAgentId + }; + this.setState({ loading: true }); + taxAgentRangeSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; + renderBrowser = () => { + const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; + let browserType = {}; + switch (targetType) { + case "EMPLOYEE": + browserType = { ...browserType, type: 17, title: "人员选择" }; + break; + case "DEPT": + browserType = { ...browserType, type: 57, title: "部门选择" }; + break; + case "SUBCOMPANY": + browserType = { ...browserType, type: 164, title: "分部选择" }; + break; + case "POSITION": + browserType = { ...browserType, type: 278, title: "岗位选择" }; + break; + default: + break; + } + return { + this.setState({ targetTypeIds, targetTypeIdsNames }); + }} + />; + }; + handleReset = () => { + this.setState({ + targetType: "EMPLOYEE", + targetTypeIds: "", + status: "", + statusAll: "" + }); + }; + + render() { + const { onCancel, title, visible } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const buttons = [ + , + + ]; + return ( + { + this.handleReset(); + onCancel(); + }} + > + + +
+ this.setState({ targetType })} + /> + {this.renderBrowser()} +
+
+ { + SelectWithAll({ + label: "选择员工状态", + options: employeeStatus, + detailtype: 2, + valueAll: statusAll, + value: status, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ + status: _.map(employeeStatus, it => it.key).join(","), + statusAll: selected + }); + } else { + this.setState({ + status: "", + statusAll: selected + }); + } + }, + onChange: ({ selected }) => { + const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); + if (bool) { + this.setState({ + status: selected, + statusAll: "0" + }); + } else { + this.setState({ + status: selected, + statusAll: "" + }); + } + } + }) + } +
+
+ ); + } +} + +export default PersonalScopeModal; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js new file mode 100644 index 00000000..59a6007b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js @@ -0,0 +1,137 @@ +/* + * Author: 黎永顺 + * name: 人员范围列表数据 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { getTaxAgentRangeListExclude, getTaxAgentRangeListInclude, taxAgentRangelistExt } from "../../../apis/taxAgent"; +import "./index.less"; +import { calcPageNo } from "../../../util"; + +const APIFox = { + listInclude: getTaxAgentRangeListInclude, + listExclude: getTaxAgentRangeListExclude, + listExt: taxAgentRangelistExt +}; + +class PersonalScopeTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getPersonalScopeList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.tabActive !== this.props.tabActive) { + this.setState({ selectedRowKeys: [] }, () => { + this.getPersonalScopeList(nextProps.tabActive); + nextProps.onChangeSelectKey([]); + }); + } + } + + getPersonalScopeList = (tabActive = this.props.tabActive) => { + const { searchValue, taxAgentId } = this.props; + const { pageInfo, loading } = this.state; + const payload = { + taxAgentId, + targetName: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + APIFox[tabActive](payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + /* + * Author: 黎永顺 + * Description: 清空选中项 + * Params: + * Date: 2022/11/30 + */ + clearRowkeys = () => { + const { pageInfo, selectedRowKeys } = this.state; + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, + current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length) + } + }, () => { + this.getPersonalScopeList(); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; + const { onChangeSelectKey } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getPersonalScopeList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => { + this.setState({ selectedRowKeys }, () => { + onChangeSelectKey(this.state.selectedRowKeys); + }); + } + }; + return ( + + ); + } +} + +export default PersonalScopeTable; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js new file mode 100644 index 00000000..97ebff1e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -0,0 +1,342 @@ +/* + * Author: 黎永顺 + * name: 新增/编辑个税扣缴义务人 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; +import SlideModalTitle from "../../../components/slideModalTitle"; +import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; +import BaseSettings, { convertConditon } from "./baseSettings"; +import PersonalScope from "./personalScope"; +import TaxDeclarationInfo from "./taxDeclarationInfo"; +import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; +import * as API from "../../../apis/taxAgent"; +import { registrationCheck } from "../../../apis/taxAgent"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +@inject("taxAgentStore") +@observer +class TaxAgentSlide extends Component { + constructor(props) { + super(props); + this.state = { + current: 0, loading: false, verifyLoading: false, taxAgentId: "", + taxFilingInfoDialofg: { + visible: false, title: "", checkPayload: {}, + isEdit: false, jumpAll: false, loading: false, + taxAgentTaxReturnCheckFormDTO: null + } + }; + this.taxInfoRef = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) { + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps; + decentralization === "0" ? + salarytaxAgentForm.setCondition(convertConditon(decentralizationConditions, !isChief), true) : + salarytaxAgentForm.setCondition(convertConditon(editConditions, !isChief), true); + this.setState({ current: nextProps.current, taxAgentId: nextProps.taxAgentId }, () => { + if (this.state.taxAgentId) this.getTaxAgentForm(); + }); + } + } + + getTaxAgentForm = () => { + const { taxAgentId } = this.state; + const { taxAgentStore: { salarytaxAgentForm } } = this.props; + API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => { + if (status) { + const { name, description, adminUserIds, sortedIndex } = data; + salarytaxAgentForm.updateFields({ + name: { value: name }, + adminUserIds: { + value: _.map(adminUserIds, it => it.id.toString()).join(","), + valueSpan: _.map(adminUserIds, it => it.content).join(",") + }, + sortedIndex: { value: sortedIndex }, + description: { value: description } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 保存个税扣缴义务人 + * Params: + * Date: 2022/12/1 + */ + saveTaxAgent = (payload) => { + const { onOk, salaryOn } = this.props; + const { current } = this.state; + this.setState({ loading: true }); + API.saveTaxAgent(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(22619, "保存成功")); + this.setState({ + current: !salaryOn ? current + 2 : current + 1, + taxAgentId: data + }, () => onOk()); + } else { + message.error(errormsg || getLabel(22620, "保存失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + /* + * Author: 黎永顺 + * Description: 编辑个税扣缴义务人 + * Params: + * Date: 2022/12/1 + */ + updateTaxAgent = (payload) => { + const { onCancel } = this.props; + this.setState({ loading: true }); + API.updateTaxAgent(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(31439, "更新成功")); + onCancel(true); + } else { + message.error(errormsg || getLabel(31825, "更新失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + + handleSave = () => { + const { taxAgentStore: { salarytaxAgentForm } } = this.props; + const { taxAgentId } = this.state; + salarytaxAgentForm.validateForm().then((f) => { + if (f.isValid) { + const formData = salarytaxAgentForm.getFormParams(); + const payload = { + ...formData, + adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : [] + }; + taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload); + } else { + f.showErrors(); + } + }); + }; + handleSaveAndVerify = (jumpAll = false) => { + const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state; + const { fieldForm, fieldItem } = this.taxInfoRef.state; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; + const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]); + if (!boolean) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined"); + if (!proBool) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "请展开选择报税所属区域!") + }); + return; + } + // requestType: 1:保存并验证 2:保存 + const payload = { + ...extra, nation, province, city, + taxAgentId, requestType: 1, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "" + }; + this.setState({ verifyLoading: true }); + API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => { + this.setState({ verifyLoading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: true, + isEdit, jumpAll, title: fieldForm.name, checkPayload: payload, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list + } + }); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => this.setState({ verifyLoading: false })); + }; + renderChildren = () => { + const { current, taxAgentId } = this.state; + const { decentralization, isChief } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = ; + break; + case 1: + CurrentDom = this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/>; + break; + case 2: + CurrentDom = ; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + renderCustomOperate = () => { + const { isChief, isEdit, salaryOn } = this.props; + const { current, loading, verifyLoading } = this.state; + let CurrentDom = []; + //总管理员权限 + if (isChief) { + switch (current) { + case 0: + CurrentDom = [ + + ]; + break; + case 1: + const tmpV = []; + const tmpJ = [ + , + + ]; + CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ]; + break; + case 2: + CurrentDom = (!isEdit && salaryOn) ? + [] + : []; + break; + default: + break; + } + } + return CurrentDom; + }; + handleChangeSlideTab = (current) => { + this.setState({ current: Number(current) }); + }; + + handleSubmit = (selectKey) => { + const { taxFilingInfoDialofg, taxAgentId } = this.state; + const { fieldForm } = this.taxInfoRef.state; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const { taxAgentTaxReturnCheckFormDTO } = taxFilingInfoDialofg; + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: true } + }); + registrationCheck({ + ...extra, nation, province, city, + taxAgentId, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "", + ..._.find(taxAgentTaxReturnCheckFormDTO, it => it.index === selectKey) + }).then(({ status, data, errormsg }) => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO + } + }); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + }); + }; + + render() { + const tabs = [ + { key: 0, title: getLabel(82751, "基础设置") }, + { key: 1, title: getLabel(544342, "报税信息") }, + { key: 2, title: getLabel(124810, "人员范围") } + ]; + const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props; + const { current, taxAgentId, taxFilingInfoDialofg } = this.state; + const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + return ( + { + }} + selectedTab={current} + customOperate={this.renderCustomOperate()} + subItemChange={this.handleChangeSlideTab} + /> + } + content={ +
+ { + !isEdit && + + { + _.map(tabData, item => { + const { key, title } = item; + return ; + }) + } + + } + { + this.renderChildren() + } + { + const { jumpAll } = taxFilingInfoDialofg; + this.setState({ + current: jumpAll ? this.state.current + 1 : this.state.current, + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: false, + taxAgentTaxReturnCheckFormDTO: null + } + }, () => { + isRefresh && this.taxInfoRef.taxReturnGetForm(); + jumpAll && this.props.onCancel(true); + }); + }} + /> +
+ } + onClose={() => onCancel()} + /> + ); + } +} + +export default TaxAgentSlide; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js new file mode 100644 index 00000000..c21d1d41 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js @@ -0,0 +1,137 @@ +/* + * Author: 黎永顺 + * name: 个税扣缴义务人列表 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { Dropdown, Menu } from "antd"; +import * as API from "../../../apis/taxAgent"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class TaxAgentTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getTaxAgentList(); + } + + getTaxAgentList = () => { + const { pageInfo, loading } = this.state; + const { searchValue, onOperate } = this.props; + const payload = { + name: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + API.getTaxAgentList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + if (item.dataIndex === "employeeRange") { + return { + ...item, + render: (text, record) => { + return onOperate("edit", record.id, 2)}>{text}; + } + }; + } + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading } = this.state; + const { onOperate, isChief } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showSizeChanger: true, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.getTaxAgentList(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getTaxAgentList(); + }); + } + }; + return ( + + + } + ]} + /> + ); + } +} + +export default TaxAgentTable; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js new file mode 100644 index 00000000..11f5e4d3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -0,0 +1,146 @@ +/* + * Author: 黎永顺 + * name: 报税信息 + * Description: + * Date: 2022/12/1 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; +import { fieldList } from "./constants"; +import { taxReturnGetForm } from "../../../apis/taxAgent"; + +const { getLabel } = WeaLocaleProvider; + +class TaxDeclarationInfo extends Component { + constructor(props) { + super(props); + this.state = { + fieldForm: { + name: "", + taxCode: "", + city: "", + cityVal: [], + areaCode: null, + passwordType: "TAX_NET_PASSWORD", + account: "", + realNamePassword: "", + netPassword: null, + taxRegistrationNumber: "", + departmentCode: "", + checkStatus: "" + }, + fieldItem: [] + }; + } + + componentDidMount() { + this.setState({ + fieldItem: _.filter(_.map(fieldList, item => ({ + ...item, + label: getLabel(item.lanId, item.label), + viewAttr: this.props.isChief ? item.viewAttr : 1 + })), it => it.key !== "account" && it.key !== "realNamePassword") + }, () => { + this.taxReturnGetForm(); + }); + } + + taxReturnGetForm = () => { + const { taxAgentId } = this.props; + taxReturnGetForm({ taxAgentId }).then(({ status, data }) => { + if (status) { + const { fieldForm } = this.state; + this.setState({ + fieldForm: { + ...fieldForm, + ..._.reduce(_.keys(fieldForm), (pre, cur) => { + if (cur !== "city") { + if (cur === "checkStatus") { + const checkStatusMap = { + "NOT_COMMIT": getLabel(111, "未验证"), + "SUCCESS": getLabel(111, "成功"), + "FAIL": getLabel(111, "失败") + }; + return { ...pre, [cur]: checkStatusMap[data[cur]] }; + } + return { ...pre, [cur]: data[cur] }; + } + return { + ...pre, + [cur]: `${data["nation"]}-${data["province"]}-${data[cur]}` + }; + }, {}), + cityVal: (data["city"] && data["cityName"]) ? [{ id: data["city"], name: data["cityName"] }] : [] + } + }); + } + }); + }; + handleChangeValue = (key, value, cityVal = []) => { + const { fieldForm } = this.state; + this.setState({ + fieldForm: !_.isEmpty(cityVal) ? { + ...fieldForm, [key]: value, cityVal + } : { ...fieldForm, [key]: value } + }, () => { + if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "netPassword"), + fieldForm: { ...this.state.fieldForm, account: null, realNamePassword: null, netPassword: null } + }); + } else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"), + fieldForm: { ...this.state.fieldForm, netPassword: null, account: null, realNamePassword: null } + }); + } + }); + }; + + render() { + const { fieldItem, fieldForm } = this.state; + return ( +
+ + { + _.map(fieldItem, item => { + const { key, label, type, viewAttr, options = [] } = item; + return + { + (type === "TEXT" || type === "PASSWORD") && + this.handleChangeValue(key, v)}/> + } + { + type === "SELECT" && + { + if (!_.isEmpty(datas)) { + this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({ + id: it.id, + name: it.name + }))); + } else { + this.handleChangeValue(key, "", []); + } + }} + /> + } + { + type === "RADIO" && + ({ ...it, showname: getLabel(it.lanId, it.showname) }))} + viewAttr={viewAttr} + onChange={(v) => this.handleChangeValue(key, v)}/> + } + ; + }) + } + +
+ ); + } +} + +export default TaxDeclarationInfo; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js new file mode 100644 index 00000000..3a02b4b7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js @@ -0,0 +1,132 @@ +/* + * Author: 黎永顺 + * name: 个税申报-异常、失败详情 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Button, message } from "antd"; +import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants"; +import { getSearchs } from "../../../util"; +import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore") +@observer +class TaxFilingInfoDialofg extends Component { + constructor(props) { + super(props); + this.state = { + selectedRowKeys: [], checkLoading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) && + Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]" + ) { + const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps; + taxfillInfoForm.initFormFields(taxFillCondition); + deptfillInfoForm.initFormFields(deptFillCondition); + const fields = _.map(taxFillCondition[0].items, it => { + return it.domkey[0]; + }); + fields.map(item => { + taxfillInfoForm.updateFields({ + [item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否")) + }); + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps; + setTaxfillInfoForm(); + initDeptfillInfoForm(); + } + } + + handleSaveOrKnow = () => { + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props; + if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) { + deptfillInfoForm.validateForm().then(f => { + if (f.isValid) { + this.setState({ checkLoading: true }); + saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val))) + .then(({ status, errormsg }) => { + this.setState({ checkLoading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ checkLoading: false })); + } else { + f.showErrors(); + } + }); + } else { + this.props.onCancel(); + } + }; + + render() { + const { selectedRowKeys, checkLoading } = this.state; + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props; + const rowSelection = { + type: "radio", + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( + + {taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") ? getLabel(537558, "保存") : getLabel(545147, "知道了")} + + ] : [ + + ] + } + style={{ + width: 850, + height: 480, + minHeight: 200, + minWidth: 380, + maxHeight: "50%", + maxWidth: "50%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ { + Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? + + {getSearchs(taxfillInfoForm, taxFillCondition, 1)} + {taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)} + : + ({ + dataIndex: o.dataIndex, + width: 200, + title: getLabel(o.titleId, o.title) + }))} + scroll={{ x: 1200 }} rowSelection={rowSelection} + /> + } +
+
+ ); + } +} + +export default TaxFilingInfoDialofg; diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less new file mode 100644 index 00000000..de04ce9f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -0,0 +1,43 @@ +.salaryAgentWrapper { + .comContent { + + .customTitleWrapper { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + .ant-btn { + margin-left: 10px; + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 20px; + line-height: 20px; + } + + .ant-btn.ant-btn-primary[disabled] { + color: #d8d8d8; + } + + .ant-btn.ant-btn-primary { + color: #55a1f8; + } + } + + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .ant-col-10 { + span:nth-child(2) { + //margin-top: -6px; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js new file mode 100644 index 00000000..4ab69a82 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -0,0 +1,254 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom"; +import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; +import ComHint from "./components/comHint"; +import TaxAgentTable from "./components/taxAgentTable"; +import TaxAgentSlide from "./components/taxAgentSlide"; +import * as API from "../../apis/taxAgent"; +import LogDialog from "../../components/logViewModal"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore") +@observer +class TaxAgent extends Component { + constructor(props) { + super(props); + this.state = { + syncLoading: false, //同步人员范围loading + searchValue: "", + decentralization: "0", //启用分权 + permission: {}, + taxAgentSlideProps: { + isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"), + taxAgentId: "", current: 0, salaryOn: true + }, + logDialogVisible: false, + filterConditions: "[]" + }; + this.taxAgentTableRef = null; + } + + componentDidMount() { + this.getTaxAgentBaseForm(); + this.getPermission(); + this.apiflowBillingConfigStatus(); + } + + getTaxAgentBaseForm = () => { + API.getTaxAgentBaseForm().then(({ status, data }) => { + if (status) { + const { devolutionStatus } = data; + this.setState({ decentralization: String(devolutionStatus || 0) }); + } + }); + }; + getPermission = () => { + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ status, data }) => { + if (status) { + this.setState({ permission: data }); + } + }); + }; + apiflowBillingConfigStatus = () => { + const { taxAgentSlideProps } = this.state; + apiflowBillingConfigStatus().then(({ status, data }) => { + if (status) this.setState({ taxAgentSlideProps: { ...taxAgentSlideProps, salaryOn: data } }); + }); + }; + /* + * Author: 黎永顺 + * Description:开启关闭个税扣缴义务人开关 + * Params: + * Date: 2022/11/29 + */ + taxAgentBaseSave = devolutionStatus => { + this.setState({ decentralization: this.state.decentralization }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: `${getLabel(33703, "确认")}${devolutionStatus === "0" ? getLabel(26471, "停用") : getLabel(26472, "启用")}${getLabel(524044, "分权")}?`, + onOk: () => { + const paylaod = { devolutionStatus }; + const { taxAgentStore } = this.props; + const { taxAgentBaseSave, setSalarytaxAgentForm } = taxAgentStore; + taxAgentBaseSave(paylaod).then(({ status, errormsg }) => { + if (status) { + message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`); + this.getTaxAgentBaseForm(); + this.getPermission(); + this.taxAgentTableRef.getTaxAgentList(); + setSalarytaxAgentForm(); + } else { + message.error(errormsg || `${devolutionStatus === "0" ? "停用" : "启用"}分权失败`); + } + }); + } + }); + }); + }; + /* + * Author: 黎永顺 + * Description: + * Params:添加个税扣缴义务人 + * Date: 2022/11/29 + */ + handleAddTaxAgent = () => { + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + visible: true, current: 0 + } + }); + }; + /* + * Author: 黎永顺 + * Description:启用分权 + * Params: + * Date: 2022/12/1 + */ + taxAgentRangeSync = () => { + const { taxAgentStore } = this.props; + const { taxAgentRangeSync } = taxAgentStore; + this.setState({ syncLoading: true }); + taxAgentRangeSync({}).then(({ status, data, errormsg }) => { + this.setState({ syncLoading: false }); + if (status) { + message.success(data || getLabel(30700, "操作成功")); + this.taxAgentTableRef.getTaxAgentList(); + } else { + message.error(data || errormsg || getLabel(30651, "操作失败")); + } + }); + }; + handelResetSlide = (isUpdate = false) => { + const { taxAgentStore } = this.props; + const { salarytaxAgentForm } = taxAgentStore; + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + isEdit: false, + visible: false, + title: getLabel(543629, "新增个税扣缴义务人"), + taxAgentId: "", + current: 0 + } + }, () => { + isUpdate && this.taxAgentTableRef.getTaxAgentList(); + salarytaxAgentForm.resetForm(); + }); + }; + handleOperate = (type, itemId, current = 0) => { + switch (type) { + case "edit": + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + visible: true, title: getLabel(543632, "编辑个税扣缴义务人"), + taxAgentId: itemId, current, isEdit: true + } + }); + break; + case "delete": + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功")); + this.taxAgentTableRef.getTaxAgentList(); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }); + } + }); + break; + case "log": + this.setState({ + logDialogVisible: true, + filterConditions: itemId ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${itemId}\"}]` : "[]" + }); + break; + default: + break; + } + }; + + render() { + const { + searchValue, decentralization, taxAgentSlideProps, + permission, syncLoading, logDialogVisible, filterConditions + } = this.state; + const btns = [ + , + this.setState({ searchValue })} + placeholder={getLabel(543634, "请输入个税扣缴义务人名称")} + onSearch={() => this.taxAgentTableRef.getTaxAgentList()} + /> + ]; + const customTitle =
+ {getLabel(537996, "个税扣缴义务人")} + { + permission.isChief && + + } +
; + return ( +
+ } + iconBgcolor="#F14A2D" + buttons={btns} + showDropIcon onDropMenuClick={key => this.handleOperate(key)} + dropMenuDatas={[ + { + key: "log", icon: , + content: getLabel(545781, "操作日志") + } + ]} + > +
+ { + permission.isChief && + + + + + + } + + this.taxAgentTableRef = dom}/> + +
+ + this.taxAgentTableRef.getTaxAgentList()} + onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)} + /> + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> +
+
+ ); + } +} + +export default TaxAgent; From f55898b8a08ec3e824ddc1999ae6a08e82837e21 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, 8 Oct 2024 14:29:24 +0800 Subject: [PATCH 05/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salary/taxAgent.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index 4ab69a82..03e55f5d 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -2,7 +2,6 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom"; -import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; import ComHint from "./components/comHint"; import TaxAgentTable from "./components/taxAgentTable"; import TaxAgentSlide from "./components/taxAgentSlide"; @@ -35,7 +34,6 @@ class TaxAgent extends Component { componentDidMount() { this.getTaxAgentBaseForm(); this.getPermission(); - this.apiflowBillingConfigStatus(); } getTaxAgentBaseForm = () => { @@ -54,12 +52,6 @@ class TaxAgent extends Component { } }); }; - apiflowBillingConfigStatus = () => { - const { taxAgentSlideProps } = this.state; - apiflowBillingConfigStatus().then(({ status, data }) => { - if (status) this.setState({ taxAgentSlideProps: { ...taxAgentSlideProps, salaryOn: data } }); - }); - }; /* * Author: 黎永顺 * Description:开启关闭个税扣缴义务人开关 From bd93223774e90d3d6b28c2a204b5648f68a08dbc 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, 8 Oct 2024 15:08:00 +0800 Subject: [PATCH 06/27] =?UTF-8?q?hotfix/2.15.1.2409.01=20=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=E6=B7=BB=E5=8A=A0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=B8=AD=E7=9A=84=E7=BB=84=E7=BB=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=BE=E7=BD=AE=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/ruleConfig/conditions.js | 87 ++++++++++++------- .../hrmSalary/pages/ruleConfig/ruleConfig.js | 18 +++- 2 files changed, 69 insertions(+), 36 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index feaf423d..bb22f65e 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -1,8 +1,3 @@ -import React from "react"; -import { WeaLocaleProvider } from "ecCom"; - -const getLabel = WeaLocaleProvider.getLabel; - export const conditions = [ { items: [ @@ -10,13 +5,15 @@ export const conditions = [ conditionType: "SELECT", domkey: ["rule"], fieldcol: 10, - label: getLabel(543352, "人员字段"), + label: "人员字段", + lanId: 543352, labelcol: 8, options: [], viewAttr: 2 } ], - title: getLabel(543357, "人员校验规则"), + title: "人员校验规则", + lanId: 543357, defaultshow: true }, { @@ -25,7 +22,8 @@ export const conditions = [ conditionType: "SELECT", domkey: ["orderRule"], fieldcol: 10, - label: getLabel(15512, "排序字段"), + label: "排序字段", + lanId: 15512, labelcol: 8, options: [], viewAttr: 2 @@ -34,13 +32,15 @@ export const conditions = [ conditionType: "SELECT", domkey: ["ascOrDesc"], fieldcol: 10, - label: getLabel(543351, "正序/倒序"), + label: "正序/倒序", + lanId: 543351, labelcol: 8, options: [], viewAttr: 2 } ], - title: getLabel(543356, "排序规则"), + title: "排序规则", + lanId: 543356, defaultshow: true }, { @@ -49,12 +49,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["OPEN_APPLICATION_ENCRYPT"], fieldcol: 10, - label: getLabel(526997, "加密设置"), + label: "加密设置", + lanId: 526997, labelcol: 8, viewAttr: 2 } ], - title: getLabel(543358, "加密规则"), + title: "加密规则", + lanId: 543358, defaultshow: true }, { @@ -63,7 +65,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["salaryShowStatus"], fieldcol: 10, - label: getLabel(111, "显示工资单页签"), + label: "显示工资单页签", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -71,7 +74,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["adjustShowStatus"], fieldcol: 10, - label: getLabel(111, "显示调薪记录页签"), + label: "显示调薪记录页签", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -79,12 +83,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["taxAgentShowStatus"], fieldcol: 10, - label: getLabel(111, "显示【个税扣缴义务人】信息"), + label: "显示【个税扣缴义务人】信息", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "我的薪资福利设置"), + title: "我的薪资福利设置", + lanId: 111, defaultshow: true }, { @@ -93,7 +99,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["welBaseDiffByPerAndCom"], fieldcol: 10, - label: getLabel(111, "区分个人和公司"), + label: "区分个人和公司", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -101,12 +108,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["welBaseAutoAdjust"], fieldcol: 10, - label: getLabel(111, "导入基数自动调整上/下限"), + label: "导入基数自动调整上/下限", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "福利档案基数"), + title: "福利档案基数", + lanId: 111, defaultshow: true }, { @@ -115,12 +124,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["salaryArchiveDelete"], fieldcol: 10, - label: getLabel(111, "允许删除档案"), + label: "允许删除档案", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(538004, "薪资档案"), + title: "薪资档案", + lanId: 538004, defaultshow: true }, { @@ -129,7 +140,8 @@ export const conditions = [ conditionType: "SELECT", domkey: ["matchRule"], fieldcol: 10, - label: getLabel(111, "匹配规则"), + label: "匹配规则", + lanId: 111, options: [], labelcol: 8, viewAttr: 2 @@ -138,12 +150,14 @@ export const conditions = [ conditionType: "INPUTNUMBER", domkey: ["salaryAcctFixedColumns"], fieldcol: 10, - label: getLabel(111, "固定数"), + label: "固定数", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "薪资核算"), + title: "薪资核算", + lanId: 111, defaultshow: true }, { @@ -152,7 +166,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["taxDeclarationFunction"], fieldcol: 10, - label: getLabel(111, "系统算税"), + label: "系统算税", + lanId: 111, labelcol: 8, viewAttr: 1 }, @@ -160,41 +175,47 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["WITHDRAW_TAX_DECLARATION"], fieldcol: 10, - label: getLabel(111, "撤回申报表"), + label: "撤回申报表", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "算税规则"), + title: "算税规则", + lanId: 111, defaultshow: true }, { items: [ { conditionType: "SELECT", - domkey: ["abc"], + domkey: ["REPORT_ORGANIZATIN_TYPE"], fieldcol: 10, - label: getLabel(111, "组织信息"), + label: "组织信息", + lanId: 111, options: [], labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "薪资报表"), + title: "薪资报表", + lanId: 111, defaultshow: true - }, + } // { // items: [ // { // conditionType: "SWITCH", // domkey: ["extEmpsWitch"], // fieldcol: 10, - // label: getLabel(111, "开启非系统人员"), + // label: "开启非系统人员", + // lanId: 111, // labelcol: 8, // viewAttr: 2 // } // ], - // title: getLabel(111, "非系统人员"), + // title: "非系统人员", + // lanId: 111, // defaultshow: true // }, ]; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index d1dcdc12..8c56b847 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -39,10 +39,18 @@ class RuleConfig extends Component { const optionsList = { matchRule, orderRule, ascOrDesc, rule }; this.setState({ sysinfo, conditions: _.map(conditions, item => ({ - ...item, + ...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; if (getKey(o) === "matchRule" || getKey(o) === "orderRule" || getKey(o) === "ascOrDesc" || getKey(o) === "rule") { return { ...o, options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel })) }; + } else if (getKey(o) === "REPORT_ORGANIZATIN_TYPE") { + return { + ...o, options: [ + { key: "0", showname: getLabel(111, "核算时组织信息"), selected: true }, + { key: "1", showname: getLabel(111, "实时组织信息"), selected: false } + ] + }; } else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") { return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 }; } else if (getKey(o) === "taxDeclarationFunction") { @@ -69,7 +77,9 @@ class RuleConfig extends Component { } else if (item === "matchRule") { form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } }); } else if (item === "taxDeclarationFunction") { - form.updateFields({ [item]: { value: sysinfo["taxDeclarationFunction"] === "0" ? "0" : "1" } }); + form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } }); + } else if (item === "REPORT_ORGANIZATIN_TYPE") { + form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } }); } else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") { form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); } else if (item === "OPEN_APPLICATION_ENCRYPT") { @@ -117,6 +127,7 @@ class RuleConfig extends Component { case "taxAgentShowStatus": case "salaryShowStatus": case "adjustShowStatus": + case "REPORT_ORGANIZATIN_TYPE": if (!this.handleDebounce) { this.handleDebounce = _.debounce(() => { const confTitle = { @@ -126,7 +137,8 @@ class RuleConfig extends Component { extEmpsWitch: getLabel(544097, "开启非系统人员"), taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"), salaryShowStatus: getLabel(111, "显示工资单页签"), - adjustShowStatus: getLabel(111, "显示调薪记录页签") + adjustShowStatus: getLabel(111, "显示调薪记录页签"), + REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息") }; this.unifiedSettings(key, confTitle[key]); this.handleDebounce = null; From dd82ecf44545267765ac89b1a71c65c7350b0419 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, 8 Oct 2024 17:57:10 +0800 Subject: [PATCH 07/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/comHint.js | 12 ++-- .../pages/salary/components/index.less | 1 + .../pages/salary/components/taxAgentSlide.js | 57 ++++++++++++++----- .../pages/salary/components/taxAgentTable.js | 6 +- pc4mobx/hrmSalary/pages/salary/index.less | 32 +++++++++++ pc4mobx/hrmSalary/pages/salary/taxAgent.js | 26 +++------ pc4mobx/hrmSalary/stores/taxAgent.js | 7 +++ 7 files changed, 103 insertions(+), 38 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/comHint.js b/pc4mobx/hrmSalary/pages/salary/components/comHint.js index da3f5fb0..aea13257 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/comHint.js +++ b/pc4mobx/hrmSalary/pages/salary/components/comHint.js @@ -5,8 +5,11 @@ * Date: 2022/11/22 */ import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; import "./index.less"; +const { getLabel } = WeaLocaleProvider; + class ComHint extends Component { /* * Author: 黎永顺 @@ -18,9 +21,10 @@ class ComHint extends Component { const { isChief = true } = this.props; if (isChief) { return [ -

1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;

, -

2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;

, -

3、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;

+

{getLabel(111, "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;")}

, +

{getLabel(111, "2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;")}

, +

{getLabel(111, "3、只有薪酬总管理员能够操作个税扣缴义务人的增减和开启/关闭分权;")}

, +

{getLabel(111, "4、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;")}

]; } else { return []; @@ -30,7 +34,7 @@ class ComHint extends Component { render() { return (
-
小提示
+
{getLabel(111, "小提示")}
{this.renderTips()}
diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index be539899..0bd7ee92 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -28,6 +28,7 @@ width: 100%; margin: 16px 0; border: 1px solid #e5e5e5; + background: #FFF; .hintHeader { background: #f6f6f6; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 97ebff1e..074d2590 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -229,7 +229,6 @@ class TaxAgentSlide extends Component { handleChangeSlideTab = (current) => { this.setState({ current: Number(current) }); }; - handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -267,14 +266,48 @@ class TaxAgentSlide extends Component { }; render() { - const tabs = [ - { key: 0, title: getLabel(82751, "基础设置") }, - { key: 1, title: getLabel(544342, "报税信息") }, - { key: 2, title: getLabel(124810, "人员范围") } + const { + isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { showOperateBtn } + } = this.props; + const { current, taxAgentId, taxFilingInfoDialofg, loading, verifyLoading } = this.state; + let tabs = [ + { + key: 0, title: getLabel(82751, "基础设置"), + createBtns: [ + + ], + editBtns: [ + + ], + children: + }, + { + key: 1, title: getLabel(544342, "报税信息"), + createBtns: [ + , + + ], + editBtns: [ + + ], + children: this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/> + }, + { + key: 2, title: getLabel(124810, "人员范围"), + createBtns: [ + + ], + editBtns: [], + children: + } ]; - const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props; - const { current, taxAgentId, taxFilingInfoDialofg } = this.state; - const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + tabs = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; return ( { - _.map(tabData, item => { + _.map(tabs, item => { const { key, title } = item; return ; }) } } - { - this.renderChildren() - } + {_.find(tabs, o => current === o.key).children}
- onOperate("edit", record.id)}>{getLabel(501169, "编辑")} { isChief && - onOperate("delete", record.id)}>{getLabel(535052, "删除")} } - onOperate("log", record.id)}>{getLabel(545781, "操作日志")} diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less index de04ce9f..6c63517f 100644 --- a/pc4mobx/hrmSalary/pages/salary/index.less +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -1,5 +1,37 @@ .salaryAgentWrapper { + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0; + } + + .wea-new-top { + .wea-input-focus { + height: 31.36px; + line-height: 0; + } + } + .comContent { + .wea-search-group:first-child { + margin-bottom: 16px; + } + + .wea-search-group { + padding: 0; + background: #fff; + + .wea-title { + padding: 0 10px; + } + + .wea-content { + padding: 0; + + .wea-form-item { + padding-left: 18px; + } + } + } .customTitleWrapper { width: 100%; diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index 03e55f5d..300037c3 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -5,8 +5,8 @@ import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchG import ComHint from "./components/comHint"; import TaxAgentTable from "./components/taxAgentTable"; import TaxAgentSlide from "./components/taxAgentSlide"; -import * as API from "../../apis/taxAgent"; import LogDialog from "../../components/logViewModal"; +import * as API from "../../apis/taxAgent"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -20,10 +20,9 @@ class TaxAgent extends Component { syncLoading: false, //同步人员范围loading searchValue: "", decentralization: "0", //启用分权 - permission: {}, taxAgentSlideProps: { isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"), - taxAgentId: "", current: 0, salaryOn: true + taxAgentId: "", current: 0, salaryOn: false }, logDialogVisible: false, filterConditions: "[]" @@ -33,7 +32,6 @@ class TaxAgent extends Component { componentDidMount() { this.getTaxAgentBaseForm(); - this.getPermission(); } getTaxAgentBaseForm = () => { @@ -44,14 +42,6 @@ class TaxAgent extends Component { } }); }; - getPermission = () => { - const { taxAgentStore: { getPermission } } = this.props; - getPermission().then(({ status, data }) => { - if (status) { - this.setState({ permission: data }); - } - }); - }; /* * Author: 黎永顺 * Description:开启关闭个税扣缴义务人开关 @@ -71,7 +61,6 @@ class TaxAgent extends Component { if (status) { message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`); this.getTaxAgentBaseForm(); - this.getPermission(); this.taxAgentTableRef.getTaxAgentList(); setSalarytaxAgentForm(); } else { @@ -172,9 +161,9 @@ class TaxAgent extends Component { }; render() { + const { taxAgentStore: { PageAndOptAuth: permission } } = this.props; const { - searchValue, decentralization, taxAgentSlideProps, - permission, syncLoading, logDialogVisible, filterConditions + searchValue, decentralization, taxAgentSlideProps, syncLoading, logDialogVisible, filterConditions } = this.state; const btns = [
; + const showOperateBtn = permission.opts.includes("admin"); return (
} iconBgcolor="#F14A2D" - buttons={btns} + buttons={showOperateBtn ? btns : btns.slice(1)} showDropIcon onDropMenuClick={key => this.handleOperate(key)} dropMenuDatas={[ { @@ -214,13 +204,13 @@ class TaxAgent extends Component {
{ permission.isChief && - + } - + this.taxAgentTableRef = dom}/> diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 94d9898f..d4e25ec5 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -9,6 +9,11 @@ import { PAGE } from "../config"; const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 + @observable taxfillInfoForm = new WeaForm(); //报税信息查看form + @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 + @observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form + @action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化 @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 @observable roleForm = new WeaForm(); //权限-角色form表单 @action initRoleForm = () => this.roleForm = new WeaForm(); @@ -52,6 +57,8 @@ export class TaxAgentStore { @action setStatisticsReportBtn = bool => (this.statisticsReportBtn = bool);//薪酬统计报表权限 @action setPayrollPermission = bool => (this.payrollPermission = bool);// 薪资核算页面权限 + @action setSalarytaxAgentForm = () => (this.salarytaxAgentForm = new WeaForm());//薪资项目权限 + // 初始化操作 @action doInit = params => { From 255e8d87602a2a8cda3469f57f2528097e3fe3b6 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, 9 Oct 2024 10:22:00 +0800 Subject: [PATCH 08/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-title/weaReqTitle/index.js | 2 +- .../custom-title/weaTopTitle/index.js | 2 +- .../pages/salary/components/baseSettings.js | 2 +- .../pages/salary/components/index.less | 17 ++++++++++ .../pages/salary/components/personalScope.js | 6 ++-- .../salary/components/personalScopeTable.js | 7 ++-- .../pages/salary/components/taxAgentSlide.js | 33 +++++-------------- pc4mobx/hrmSalary/pages/salary/index.less | 26 +++++++++++++++ 8 files changed, 61 insertions(+), 34 deletions(-) diff --git a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js index 69766076..7ff800ce 100644 --- a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js +++ b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js @@ -7,7 +7,7 @@ class Index extends Component { render() { return ( } iconBgcolor="#F14A2D" + title={this.props.title || getLabel(111, "编辑账套")} icon={} iconBgcolor="#F14A2D" showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props} /> ); diff --git a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js index d265c8eb..0e90c2e2 100644 --- a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js +++ b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js @@ -6,7 +6,7 @@ const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { return ( - } + } iconBgcolor="#F14A2D" {...this.props}/> ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js index 5e24cb5c..a534feb0 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js +++ b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js @@ -20,7 +20,7 @@ class BaseSettings extends Component { render() { const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props; return ( -
+
{ decentralization === "0" ? getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) : diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index 0bd7ee92..921c6451 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -1,4 +1,21 @@ .taxAgentSlideContent { + height: 100%; + background: #F6F6F6; + + .ant-steps { + margin: 0 0 20px 0 !important; + padding-top: 20px; + } + + .personal-scope { + padding: 8px 16px; + height: 100%; + + .wea-tab, .wea-new-table { + background: #FFF; + } + } + .baseSettingWrapper, .taxDeclarationInfoWrapper { padding: 12px 12px 12px 20px; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 66070632..37356d3d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -191,18 +191,18 @@ class PersonalScope extends Component { value={searchValue} onChange={searchValue => this.setState({ searchValue })} placeholder="请输入对象" - onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)} /> ] : [ this.setState({ searchValue })} placeholder="请输入对象" - onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)} />]; (selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift(); return ( -
+
{ + getPersonalScopeList = (tabActive = this.props.tabActive, current) => { const { searchValue, taxAgentId } = this.props; const { pageInfo, loading } = this.state; const payload = { - taxAgentId, - targetName: searchValue, - ...pageInfo + taxAgentId, targetName: searchValue, ...pageInfo, current: current || pageInfo.current }; this.setState({ loading: { ...loading, query: true } }); APIFox[tabActive](payload).then(({ status, data }) => { @@ -129,6 +127,7 @@ class PersonalScopeTable extends Component { pagination={pagination} loading={loading.query} columns={columns} + scroll={{ y: `calc(100vh - 230px)` }} /> ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 074d2590..1a6140cd 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -8,12 +8,13 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; -import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; import BaseSettings, { convertConditon } from "./baseSettings"; import PersonalScope from "./personalScope"; import TaxDeclarationInfo from "./taxDeclarationInfo"; import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; +import WeaTopTitle from "../../../components/custom-title/weaTopTitle"; +import WeaReqTitle from "../../../components/custom-title/weaReqTitle"; import * as API from "../../../apis/taxAgent"; import { registrationCheck } from "../../../apis/taxAgent"; import "./index.less"; @@ -226,9 +227,6 @@ class TaxAgentSlide extends Component { } return CurrentDom; }; - handleChangeSlideTab = (current) => { - this.setState({ current: Number(current) }); - }; handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -267,7 +265,7 @@ class TaxAgentSlide extends Component { render() { const { - isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { showOperateBtn } + isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { PageAndOptAuth } } = this.props; const { current, taxAgentId, taxFilingInfoDialofg, loading, verifyLoading } = this.state; let tabs = [ @@ -308,28 +306,15 @@ class TaxAgentSlide extends Component { } ]; tabs = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); return ( { - }} - selectedTab={current} - customOperate={this.renderCustomOperate()} - subItemChange={this.handleChangeSlideTab} - /> + !taxAgentId ? current === o.key).createBtns}/> : + current === o.key).editBtns : []} + tabDatas={tabs} selectedKey={String(current)} title={title} + onChange={cur => this.setState({ current: parseInt(cur) })}/> } content={
diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less index 6c63517f..e6dacf00 100644 --- a/pc4mobx/hrmSalary/pages/salary/index.less +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -72,4 +72,30 @@ //margin-top: -6px; } } + + .taxAgentSlide { + .wea-slide-modal-title { + height: auto; + line-height: normal; + text-align: left; + background: #FFF; + + .wea-new-top .ant-col-10 { + padding-right: 45px !important; + } + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + + .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { + right: 45px !important; + } + + .wea-slide-modal-content { + height: 100%; + } + } } From b23662c09eb82229403c2d2318bba7892bdd3872 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, 9 Oct 2024 11:10:21 +0800 Subject: [PATCH 09/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/personalScope.js | 5 +- .../pages/salary/components/taxAgentSlide.js | 63 ++----------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 37356d3d..fa392444 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -157,7 +157,8 @@ class PersonalScope extends Component { selectedKey, searchValue, rowKeys, personalAddModal, importParams, previewDataSource, extEmpsWitch, loading } = this.state; - const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props; + const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const topTab = [ { title: "管理范围", @@ -172,7 +173,7 @@ class PersonalScope extends Component { viewcondition: "listExt" } ]; - const btns = (hideIconInTax || showSalaryItemBtn) ? [ + const btns = showOperateBtn ? [ - ]; - break; - case 1: - const tmpV = []; - const tmpJ = [ - , - - ]; - CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ]; - break; - case 2: - CurrentDom = (!isEdit && salaryOn) ? - [] - : []; - break; - default: - break; - } - } - return CurrentDom; - }; handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -299,7 +243,7 @@ class TaxAgentSlide extends Component { key: 2, title: getLabel(124810, "人员范围"), createBtns: [ + onClick={() => this.setState({ current: !salaryOn ? current - 2 : current - 1 })}>{getLabel(1876, "上一步")} ], editBtns: [], children: @@ -311,7 +255,8 @@ class TaxAgentSlide extends Component { current === o.key).createBtns}/> : + !this.props.taxAgentId ? + current === o.key).createBtns}/> : current === o.key).editBtns : []} tabDatas={tabs} selectedKey={String(current)} title={title} onChange={cur => this.setState({ current: parseInt(cur) })}/> From 215094dac85b8a2395a5f0cfa8c1d5427a77a566 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, 9 Oct 2024 11:25:50 +0800 Subject: [PATCH 10/27] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/apis/variableSalary.js | 2 +- pc4mobx/hrmSalary/pages/variableSalary/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/variableSalary.js b/pc4mobx/hrmSalary/apis/variableSalary.js index 8cd818b5..1bd063d0 100644 --- a/pc4mobx/hrmSalary/apis/variableSalary.js +++ b/pc4mobx/hrmSalary/apis/variableSalary.js @@ -44,7 +44,7 @@ export const getVariableSalaryDetail = params => { }; // 获取当前管理员下的所有的个税扣缴义务人 export const getAdminTaxAgentList = () => { - return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {}); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare: false }); }; // 浮动薪酬档案导出 export const exportVariableSalary = (params) => { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 76e364e4..f8b13f3b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -43,7 +43,7 @@ class Index extends Component { componentDidMount() { API.getAdminTaxAgentList().then(({ status, data }) => { if (status) { - const taxAgentOption = _.map(data, (o, i) => ({ key: String(o.id), showname: o.name })); + const taxAgentOption = _.map(data, (o, i) => ({ key: o.id, showname: o.content })); this.setState({ taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","), SIDialog: { ...this.state.SIDialog, taxAgentOption }, From 94a4d3a93005dee9046fcea8eb64a2608346d006 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, 9 Oct 2024 14:51:55 +0800 Subject: [PATCH 11/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 32 +++- .../salary/components/personalScopeModal.js | 169 ++++++++++-------- pc4mobx/hrmSalary/stores/taxAgent.js | 2 + 3 files changed, 128 insertions(+), 75 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index 8682937c..58da8c6b 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -238,7 +238,6 @@ export const deptFillCondition = [ defaultshow: true } ]; - export const taxFillColumns = [ { dataIndex: "taxCode", @@ -292,3 +291,34 @@ export const taxFillColumns = [ titleId: "545141" } ]; +export const personScopeConditions = [ + { + items: [ + { + conditionType: "SELECT_LINKAGE", + domkey: ["targetParams"], + fieldcol: 16, + label: "对象类型", + lanId: 111, + labelcol: 8, + options: [], + rules: "required|string", + selectLinkageDatas: {}, + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["employeeStatus"], + fieldcol: 16, + label: "选择员工状态", + lanId: 111, + labelcol: 8, + value: "", + detailtype: "2", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index 9e4c09af..a5ad7786 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -5,17 +5,23 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaBrowser, WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; -import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; -import "./index.less"; +import { personScopeConditions } from "./constants"; +import { getSearchs } from "../../../util"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer class PersonalScopeModal extends Component { constructor(props) { super(props); this.state = { - loading: false, + loading: false, conditions: [], employeeStatus: [], targetTypeList: [], targetType: "EMPLOYEE", @@ -26,8 +32,15 @@ class PersonalScopeModal extends Component { }; } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.props.taxAgentStore.initPersonScopeForm(); + } + } + componentDidMount() { - this.getTaxAgentRangeForm(); + // this.getTaxAgentRangeForm(); } getTaxAgentRangeForm = () => { @@ -36,8 +49,22 @@ class PersonalScopeModal extends Component { const { employeeStatus, targetTypeList } = data; this.setState({ targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), - employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) - }); + employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })), + conditions: _.map(personScopeConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "employeeStatus") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })) + }; + }) + })) + }, () => this.props.taxAgentStore.personScopeForm.initFormFields(this.state.conditions)); } }); }; @@ -111,78 +138,72 @@ class PersonalScopeModal extends Component { }; render() { - const { onCancel, title, visible } = this.props; - const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , ]; return ( - { - this.handleReset(); - onCancel(); - }} - > - - -
- this.setState({ targetType })} - /> - {this.renderBrowser()} -
-
- { - SelectWithAll({ - label: "选择员工状态", - options: employeeStatus, - detailtype: 2, - valueAll: statusAll, - value: status, - onChangeAll: ({ selected }) => { - if (selected) { - this.setState({ - status: _.map(employeeStatus, it => it.key).join(","), - statusAll: selected - }); - } else { - this.setState({ - status: "", - statusAll: selected - }); - } - }, - onChange: ({ selected }) => { - const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); - if (bool) { - this.setState({ - status: selected, - statusAll: "0" - }); - } else { - this.setState({ - status: selected, - statusAll: "" - }); - } - } - }) - } -
+ { + this.handleReset(); + onCancel(); + }}> +
{getSearchs(personScopeForm, conditions, 1, false)}
+ {/**/} + {/* */} + {/*
*/} + {/* this.setState({ targetType })}*/} + {/* />*/} + {/* {this.renderBrowser()}*/} + {/*
*/} + {/* */} + {/* {*/} + {/* SelectWithAll({*/} + {/* label: "选择员工状态",*/} + {/* options: employeeStatus,*/} + {/* detailtype: 2,*/} + {/* valueAll: statusAll,*/} + {/* value: status,*/} + {/* onChangeAll: ({ selected }) => {*/} + {/* if (selected) {*/} + {/* this.setState({*/} + {/* status: _.map(employeeStatus, it => it.key).join(","),*/} + {/* statusAll: selected*/} + {/* });*/} + {/* } else {*/} + {/* this.setState({*/} + {/* status: "",*/} + {/* statusAll: selected*/} + {/* });*/} + {/* }*/} + {/* },*/} + {/* onChange: ({ selected }) => {*/} + {/* const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item));*/} + {/* if (bool) {*/} + {/* this.setState({*/} + {/* status: selected,*/} + {/* statusAll: "0"*/} + {/* });*/} + {/* } else {*/} + {/* this.setState({*/} + {/* status: selected,*/} + {/* statusAll: ""*/} + {/* });*/} + {/* }*/} + {/* }*/} + {/* })*/} + {/* }*/} + {/*
*/}
); } diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index d4e25ec5..45fe8041 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -12,6 +12,8 @@ export class TaxAgentStore { @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 @observable taxfillInfoForm = new WeaForm(); //报税信息查看form @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 + @observable personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form + @action initPersonScopeForm = () => this.personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form初始化 @observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form @action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化 @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 From 307f954eace713b4f44514a79fd893834fe271d4 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, 9 Oct 2024 14:55:11 +0800 Subject: [PATCH 12/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/payrollFiles/components/salaryFileList/index.js | 2 +- .../welfareArchive/components/welfareTableList/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js index efe2605b..24f3cd63 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js @@ -150,7 +150,7 @@ class Index extends Component { "操作日志": getLabel(545781, "操作日志") }; const childFrameObj = document.getElementById("atdTable"); - childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getSalaryFileList = (props, init = false) => { const { pageInfo } = this.state; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index a9029a86..11524d22 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -238,7 +238,7 @@ class Index extends Component { "操作日志": getLabel(545781, "操作日志") }; const childFrameObj = document.getElementById("atdTable"); - childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; handleChangeProgramme = (type, schemeId, payload) => { this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId }) From cd768fff67e12635c0cc98cbad4b39b528dcc451 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, 9 Oct 2024 17:02:14 +0800 Subject: [PATCH 13/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 21 +++++++++++---- .../salary/components/personalScopeModal.js | 26 ++++++++++++++----- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index 58da8c6b..b457ae44 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -297,22 +297,33 @@ export const personScopeConditions = [ { conditionType: "SELECT_LINKAGE", domkey: ["targetParams"], - fieldcol: 16, + fieldcol: 18, label: "对象类型", lanId: 111, - labelcol: 8, + labelcol: 6, options: [], rules: "required|string", - selectLinkageDatas: {}, + selectLinkageDatas: { + EMPLOYEE: { + conditionType: "TEXTAREA", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required|string", + viewAttr: 3 + } + }, viewAttr: 3 }, { conditionType: "SELECT", domkey: ["employeeStatus"], - fieldcol: 16, + fieldcol: 18, label: "选择员工状态", lanId: 111, - labelcol: 8, + labelcol: 6, value: "", detailtype: "2", rules: "required|string", diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index a5ad7786..f8aced8d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -23,7 +23,6 @@ class PersonalScopeModal extends Component { this.state = { loading: false, conditions: [], employeeStatus: [], - targetTypeList: [], targetType: "EMPLOYEE", targetTypeIds: "", targetTypeIdsNames: "", @@ -48,14 +47,15 @@ class PersonalScopeModal extends Component { if (status) { const { employeeStatus, targetTypeList } = data; this.setState({ - targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), - employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })), - conditions: _.map(personScopeConditions, item => ({ + employeeStatus, conditions: _.map(personScopeConditions, item => ({ ...item, items: _.map(item.items, o => { if (getKey(o) === "employeeStatus") { return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + options: [ + { key: "ALL", showname: getLabel(111, "全选") }, + ..._.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + ] }; } return { @@ -128,6 +128,20 @@ class PersonalScopeModal extends Component { }} />; }; + handleChange = (params) => { + const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; + const key = _.keys(params)[0], value = params[key].value; + if ( + (key === "employeeStatus" && value.indexOf("ALL") !== -1) + // (key === "employeeStatus" && value.indexOf("ALL") === -1 && _.every(employeeStatus, o => value.indexOf(o.id) !== -1)) + ) { + personScopeForm.updateFields({ [key]: { value: "ALL," + _.map(employeeStatus, o => o.id).join(",") } }); + } else if (key === "employeeStatus" && value.indexOf("ALL") === -1) { + console.log(1) + // personScopeForm.updateFields({ [key]: { value: "" } }); + } + console.log(params); + }; handleReset = () => { this.setState({ targetType: "EMPLOYEE", @@ -150,7 +164,7 @@ class PersonalScopeModal extends Component { this.handleReset(); onCancel(); }}> -
{getSearchs(personScopeForm, conditions, 1, false)}
+
{getSearchs(personScopeForm, conditions, 1, false, this.handleChange)}
{/**/} {/* Date: Wed, 9 Oct 2024 18:12:06 +0800 Subject: [PATCH 14/27] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index f1ad9a67..fce37671 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,6 +30,7 @@ class Layout extends Component { } componentDidMount() { + this.checkData(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -41,8 +42,26 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } + window.addEventListener("storage", this.checkData); } + componentWillUnmount() { + window.removeEventListener("storage", this.checkData); + } + + checkData = () => { + const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; + if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { + const src = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + const link = document.createElement("link"); + link.setAttribute("rel", "stylesheet"); + link.setAttribute("type", "text/css"); + link.setAttribute("href", src); + let header = document.getElementById("container"); + header.appendChild(link); + } + }; + render() { return ( {this.props.children} From ca3c9079a100fa78d0596c6fe68d36da8338bd97 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, 10 Oct 2024 13:57:09 +0800 Subject: [PATCH 15/27] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 24 ++++++++++++------- .../components/payrollTempBaseSet/index.js | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index fce37671..df3d02d3 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,7 +30,6 @@ class Layout extends Component { } componentDidMount() { - this.checkData(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -42,23 +41,32 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } - window.addEventListener("storage", this.checkData); + window.addEventListener("storage", this.setFontSize); } componentWillUnmount() { - window.removeEventListener("storage", this.checkData); + window.removeEventListener("storage", this.setFontSize); } - checkData = () => { + componentDidUpdate(prevProps, prevState, snapshot) { + this.setFontSize(); + } + + setFontSize = (init = false) => { const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { - const src = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + const href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + jQuery("#theme-font").remove(); + window.parent.jQuery("#theme-font1").remove(); + jQuery(jQuery("head")[0]).append(``); const link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("type", "text/css"); - link.setAttribute("href", src); - let header = document.getElementById("container"); - header.appendChild(link); + link.setAttribute("href", href); + link.setAttribute("id", "theme-font1"); + setTimeout(() => { + window.parent.document.head.appendChild(link); + }, 500); } }; diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js index 904d9ca4..fbb75a46 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js @@ -174,7 +174,7 @@ class Index extends Component { if (it === "ackFeedbackStatus" || it === "feedbackStatus") { payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" }); } else { - payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); + payrollTempFeedbackForm.updateFields({ [it]: (!_.isNil(fieldsEchoData[it]) && fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); } }); this.setState({ From bdd4b4e446ffa663aa94b12d874191aa9cd1b066 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, 10 Oct 2024 15:32:41 +0800 Subject: [PATCH 16/27] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 7 ++----- .../doCalc/components/salaryEditCalcImport/index.js | 2 +- pc4mobx/hrmSalary/pages/calculate/doCalc/index.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index df3d02d3..39c9d174 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,6 +30,7 @@ class Layout extends Component { } componentDidMount() { + this.setFontSize(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -48,11 +49,7 @@ class Layout extends Component { window.removeEventListener("storage", this.setFontSize); } - componentDidUpdate(prevProps, prevState, snapshot) { - this.setFontSize(); - } - - setFontSize = (init = false) => { + setFontSize = () => { const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { const href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index ce58c616..accd461f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -156,7 +156,7 @@ class Index extends Component { } }, () => { const { selectItems: salaryItems } = this.state.headerFieldsDialog; - cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] }) + cacheImportField({ salaryAcctRecordId, salaryItems: salaryItems ? salaryItems.split(",") : [] }) .then(({ status, errormsg }) => { if (status) { const payload = { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 0d1c87fc..fc07e2f2 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -125,6 +125,15 @@ class Index extends Component { case "offlineCompare": window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcOc/${salaryAcctRecordId}`, "_blank"); break; + case "LOCK": + case "UNLOCK": + const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state; + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(543303, "请选择表格数据!")); + return; + } + this.calc.calcTableRef.wrappedInstance.updateEmpLockStatus({ lockStatus: key, acctEmpIds: selectedRowKeys }); + break; default: break; } @@ -145,6 +154,8 @@ class Index extends Component { {getLabel(81272, "导出全部")} {getLabel(544270, "自定义导出")} {getLabel(543249, "线下对比")} + {getLabel(111, "批量锁定")} + {getLabel(111, "批量解锁")} ); reqBtns = [ From 6aa662d432e429669cf52cf38ce0a9d5e1dd7e70 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, 11 Oct 2024 10:01:46 +0800 Subject: [PATCH 17/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 137 +++++++++++++++-- .../salary/components/personalScopeModal.js | 142 ++++++++++-------- 2 files changed, 202 insertions(+), 77 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index b457ae44..ac81a719 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -302,20 +302,9 @@ export const personScopeConditions = [ lanId: 111, labelcol: 6, options: [], - rules: "required|string", - selectLinkageDatas: { - EMPLOYEE: { - conditionType: "TEXTAREA", - domkey: ["target"], - fieldcol: 24, - label: "", - labelcol: 0, - value: "", - rules: "required|string", - viewAttr: 3 - } - }, - viewAttr: 3 + viewAttr: 3, + rules: "selectLinkageRequired", + selectLinkageDatas: {} }, { conditionType: "SELECT", @@ -326,10 +315,126 @@ export const personScopeConditions = [ labelcol: 6, value: "", detailtype: "2", - rules: "required|string", + rules: "required", viewAttr: 3 - } + }, ], defaultshow: true } ]; +export const scopeSelectLinkageDatas = { + EMPLOYEE:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "17", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + DEPT:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "57", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + SUBCOMPANY:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "164", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + POSITION:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "278", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + SQL: { + conditionType: "TEXTAREA", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + } +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index f8aced8d..9ad50c15 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -6,11 +6,11 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaBrowser, WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { WeaSwitch } from "comsMobx"; +import { WeaBrowser, WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; -import { personScopeConditions } from "./constants"; -import { getSearchs } from "../../../util"; +import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -33,9 +33,7 @@ class PersonalScopeModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); - if (nextProps.visible !== this.props.visible && !nextProps.visible) { - this.props.taxAgentStore.initPersonScopeForm(); - } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); } componentDidMount() { @@ -52,15 +50,13 @@ class PersonalScopeModal extends Component { if (getKey(o) === "employeeStatus") { return { ...o, label: getLabel(o.lanId, o.label), - options: [ - { key: "ALL", showname: getLabel(111, "全选") }, - ..._.map(employeeStatus, it => ({ key: it.id, showname: it.name })) - ] + options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) }; } return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })) + options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), + selectLinkageDatas: scopeSelectLinkageDatas[_.head(targetTypeList).id] }; }) })) @@ -69,33 +65,44 @@ class PersonalScopeModal extends Component { }); }; taxAgentRangeSave = () => { - const { status, targetTypeIds, targetType } = this.state; - const { includeType, taxAgentId, onSuccess, onCancel } = this.props; - if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - employeeStatus: status.split(","), - includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - taxAgentId - }; - this.setState({ loading: true }); - taxAgentRangeSave(payload).then(({ status, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success("保存成功"); - this.handleReset(); - onSuccess(); - onCancel(); + const { taxAgentStore: { personScopeForm } } = this.props; + personScopeForm.validateForm().then(f => { + if (f.isValid) { + console.log(70, personScopeForm.getFormParams()); + + + const { status, targetTypeIds, targetType } = this.state; + const { includeType, taxAgentId, onSuccess, onCancel } = this.props; + if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + taxAgentId + }; + this.setState({ loading: true }); + taxAgentRangeSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); } else { - message.error(errormsg || "保存失败"); + f.showErrors(); + this.forceUpdate(); } - }).catch(() => this.setState({ loading: true })); + }); }; renderBrowser = () => { const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; @@ -128,27 +135,44 @@ class PersonalScopeModal extends Component { }} />; }; + renderForm = () => { + const { taxAgentStore: { personScopeForm } } = this.props; + const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm, + formParams = personScopeForm.getFormParams(); + const checked = formParams.employeeStatus && _.every(_.map(employeeStatus, o => o.id), k => formParams.employeeStatus.indexOf(k) !== -1); + let group = []; + isFormInit && conditions.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + getKey(fields) === "employeeStatus" && + + } + + ), + hide: fields.hide + }); + }); + group.push(); + }); + return group; + }; + handleChangeAll = (val) => { + const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; + val === "1" ? personScopeForm.updateFields({ employeeStatus: { value: _.map(employeeStatus, o => o.id).join(",") } }) : + personScopeForm.updateFields({ employeeStatus: { value: "" } }); + }; handleChange = (params) => { const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; const key = _.keys(params)[0], value = params[key].value; - if ( - (key === "employeeStatus" && value.indexOf("ALL") !== -1) - // (key === "employeeStatus" && value.indexOf("ALL") === -1 && _.every(employeeStatus, o => value.indexOf(o.id) !== -1)) - ) { - personScopeForm.updateFields({ [key]: { value: "ALL," + _.map(employeeStatus, o => o.id).join(",") } }); - } else if (key === "employeeStatus" && value.indexOf("ALL") === -1) { - console.log(1) - // personScopeForm.updateFields({ [key]: { value: "" } }); - } - console.log(params); - }; - handleReset = () => { - this.setState({ - targetType: "EMPLOYEE", - targetTypeIds: "", - status: "", - statusAll: "" - }); + console.log(params, key, value); }; render() { @@ -156,15 +180,11 @@ class PersonalScopeModal extends Component { const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , - + ]; return ( - { - this.handleReset(); - onCancel(); - }}> -
{getSearchs(personScopeForm, conditions, 1, false, this.handleChange)}
+ +
{this.renderForm()}
{/**/} {/* Date: Fri, 11 Oct 2024 11:11:06 +0800 Subject: [PATCH 18/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 2 +- .../pages/salary/components/personalScope.js | 10 ++-- .../salary/components/personalScopeModal.js | 48 ++++++------------- 3 files changed, 19 insertions(+), 41 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index ac81a719..dc2422a0 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -296,7 +296,7 @@ export const personScopeConditions = [ items: [ { conditionType: "SELECT_LINKAGE", - domkey: ["targetParams"], + domkey: ["targetType"], fieldcol: 18, label: "对象类型", lanId: 111, diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index fa392444..698d181d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -228,14 +228,10 @@ class PersonalScope extends Component { {...personalAddModal} taxAgentId={taxAgentId} onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()} - onCancel={() => + onCancel={(callback) => this.setState({ - personalAddModal: { - ...personalAddModal, - visible: false, - includeType: "" - } - }) + personalAddModal: { ...personalAddModal, visible: false, includeType: "" } + }, () => callback && callback()) } /> {importParams.visible && ( diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index 9ad50c15..ab9d5dcb 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -8,7 +8,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; import { WeaBrowser, WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; -import { Button, message, Modal } from "antd"; +import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -55,8 +55,10 @@ class PersonalScopeModal extends Component { } return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), - selectLinkageDatas: scopeSelectLinkageDatas[_.head(targetTypeList).id] + options: _.map(targetTypeList, it => ({ + key: it.id, showname: it.name, selected: it.id === "EMPLOYEE" + })), + selectLinkageDatas: { ...scopeSelectLinkageDatas } }; }) })) @@ -68,39 +70,25 @@ class PersonalScopeModal extends Component { const { taxAgentStore: { personScopeForm } } = this.props; personScopeForm.validateForm().then(f => { if (f.isValid) { - console.log(70, personScopeForm.getFormParams()); - - - const { status, targetTypeIds, targetType } = this.state; - const { includeType, taxAgentId, onSuccess, onCancel } = this.props; - if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } + const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); + const { includeType, taxAgentId } = this.props; const payload = { - employeeStatus: status.split(","), - includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - taxAgentId + includeType, taxAgentId, + employeeStatus: employeeStatus.split(","), + targetParams: _.map(target.split(","), it => ({ targetType, targetId: it })) }; this.setState({ loading: true }); taxAgentRangeSave(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success("保存成功"); - this.handleReset(); - onSuccess(); - onCancel(); + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(this.props.onSuccess); } else { - message.error(errormsg || "保存失败"); + message.error(errormsg); } }).catch(() => this.setState({ loading: true })); } else { f.showErrors(); - this.forceUpdate(); } }); }; @@ -154,8 +142,7 @@ class PersonalScopeModal extends Component { } - + ), hide: fields.hide }); @@ -169,18 +156,13 @@ class PersonalScopeModal extends Component { val === "1" ? personScopeForm.updateFields({ employeeStatus: { value: _.map(employeeStatus, o => o.id).join(",") } }) : personScopeForm.updateFields({ employeeStatus: { value: "" } }); }; - handleChange = (params) => { - const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; - const key = _.keys(params)[0], value = params[key].value; - console.log(params, key, value); - }; render() { const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , - + ]; return ( From 167c2c5a2013addca927c488d237455ec0e5dc60 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, 11 Oct 2024 15:19:38 +0800 Subject: [PATCH 19/27] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/index.less | 12 ++ .../pages/salary/components/personalScope.js | 106 ++++++---------- .../salary/components/personalScopeModal.js | 113 ++---------------- 3 files changed, 56 insertions(+), 175 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index 921c6451..9eed4669 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -14,6 +14,18 @@ .wea-tab, .wea-new-table { background: #FFF; } + + .icon-refresh { + display: flex; + justify-content: center; + align-items: center; + width: 20px; + height: 20px; + color: #fff; + background: #55a1f8; + cursor: pointer; + border-radius: 3px; + } } .baseSettingWrapper, .taxDeclarationInfoWrapper { diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 698d181d..451fbda8 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -5,22 +5,22 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { Button, message, Modal } from "antd"; +import { message, Modal } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; +import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaTab } from "ecCom"; import { taxAgentRangeDelete, taxAgentRangeExtDelete, taxAgentRangeExtSave, - taxAgentRangeImportData, - taxAgentRangePreview + taxAgentRangeImportData } from "../../../apis/taxAgent"; import { sysinfo } from "../../../apis/ruleconfig"; import PersonalScopeTable from "./personalScopeTable"; import PersonalScopeModal from "./personalScopeModal"; -import ImportModal from "../../../components/importModal"; +import ImportDialog from "../../../components/importDialog"; import ExternalPersonModal from "../../../components/externalPersonModal"; -import { importEmployColumns } from "../../taxAgent/columns"; + +const getLabel = WeaLocaleProvider.getLabel; @inject("taxAgentStore") @observer @@ -28,17 +28,14 @@ class PersonalScope extends Component { constructor(props) { super(props); this.state = { - searchValue: "", selectedKey: "listInclude", - rowKeys: [], personalAddModal: { - visible: false, externalVisible: false, - title: "关联人员", includeType: "" - }, - previewDataSource: [], importParams: { - visible: false, - step: 0, - importResult: {} - }, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 - loading: false + searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false, + extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 + personalAddModal: { visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "" }, + importParams: { + visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "", + link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`, + previewUrl: "/api/bs/hrmsalary/taxAgent/range/preview" + } }; this.personalScopeTableRef = null; } @@ -103,26 +100,15 @@ class PersonalScope extends Component { } }); }; - salaryArchivePreview = (params) => { - taxAgentRangePreview(params).then(({ status, data }) => { - if (status) { - const { preview } = data; - this.setState({ - previewDataSource: preview - }); - } - }); - }; handleImportFile = (params) => { - const { taxAgentId } = this.props; - taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + const { taxAgentId } = this.props, { importParams } = this.state; + this.setState({ importParams: { ...importParams, nextloading: true } }); + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, errormsg, data }) => { + this.setState({ importParams: { ...importParams, nextloading: false } }); if (status) { - this.setState({ - importParams: { - ...this.state.importParams, - importResult: data - } - }); + this.setState({ importParams: { ...importParams, importResult: data } }); + } else { + message.warning(errormsg); } }); }; @@ -153,10 +139,7 @@ class PersonalScope extends Component { }; render() { - const { - selectedKey, searchValue, rowKeys, personalAddModal, - importParams, previewDataSource, extEmpsWitch, loading - } = this.state; + const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, extEmpsWitch, loading } = this.state; const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props; const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const topTab = [ @@ -174,12 +157,9 @@ class PersonalScope extends Component { } ]; const btns = showOperateBtn ? [ - , + { + this.setState({ importParams: { ...importParams, visible: true } }); + }}>, callback && callback()) } /> - {importParams.visible && ( - { - this.setState({ importParams: { ...this.state.importParams, step } }); - }} - importResult={importParams.importResult} - onFinish={() => { - this.setState({ - importParams: { - ...this.state.importParams, - visible: false - } - }, () => this.personalScopeTableRef.getPersonalScopeList()); - }} - previewImport={(params) => this.salaryArchivePreview(params)} - importFile={(params) => this.handleImportFile(params)} - templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} - visiable={importParams.visible} - onCancel={() => { - this.setState({ importParams: { ...this.state.importParams, visible: false } }); - }} - /> - )} + this.setState({ importParams: { ...importParams, imageId } })} + nextUplaodCallback={imageId => this.handleImportFile({ imageId })} + onResetImportResult={() => this.setState(({ + importParams: { ...importParams, importResult: {}, imageId: "" } + }))} + onCancel={(callback) => this.setState({ + importParams: { ...importParams, visible: false } + }, () => callback && this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1))}/>
); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index ab9d5dcb..3e649880 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; -import { WeaBrowser, WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -21,13 +21,7 @@ class PersonalScopeModal extends Component { constructor(props) { super(props); this.state = { - loading: false, conditions: [], - employeeStatus: [], - targetType: "EMPLOYEE", - targetTypeIds: "", - targetTypeIdsNames: "", - status: "", - statusAll: "" + loading: false, conditions: [], employeeStatus: [] }; } @@ -36,10 +30,6 @@ class PersonalScopeModal extends Component { if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); } - componentDidMount() { - // this.getTaxAgentRangeForm(); - } - getTaxAgentRangeForm = () => { getTaxAgentRangeForm().then(({ status, data }) => { if (status) { @@ -73,9 +63,11 @@ class PersonalScopeModal extends Component { const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); const { includeType, taxAgentId } = this.props; const payload = { - includeType, taxAgentId, - employeeStatus: employeeStatus.split(","), - targetParams: _.map(target.split(","), it => ({ targetType, targetId: it })) + includeType, taxAgentId, employeeStatus: employeeStatus.split(","), + targetParams: _.map(target.split(","), it => ({ + targetType, targetId: targetType === "SQL" ? "0" : it, + target: targetType === "SQL" ? target : "" + })) }; this.setState({ loading: true }); taxAgentRangeSave(payload).then(({ status, errormsg }) => { @@ -92,37 +84,6 @@ class PersonalScopeModal extends Component { } }); }; - renderBrowser = () => { - const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; - let browserType = {}; - switch (targetType) { - case "EMPLOYEE": - browserType = { ...browserType, type: 17, title: "人员选择" }; - break; - case "DEPT": - browserType = { ...browserType, type: 57, title: "部门选择" }; - break; - case "SUBCOMPANY": - browserType = { ...browserType, type: 164, title: "分部选择" }; - break; - case "POSITION": - browserType = { ...browserType, type: 278, title: "岗位选择" }; - break; - default: - break; - } - return { - this.setState({ targetTypeIds, targetTypeIdsNames }); - }} - />; - }; renderForm = () => { const { taxAgentStore: { personScopeForm } } = this.props; const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm, @@ -158,68 +119,14 @@ class PersonalScopeModal extends Component { }; render() { - const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; - const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; + const { title, taxAgentStore: { personScopeForm } } = this.props, { loading } = this.state; const buttons = [ - , - + , + ]; return (
{this.renderForm()}
- {/**/} - {/* */} - {/*
*/} - {/* this.setState({ targetType })}*/} - {/* />*/} - {/* {this.renderBrowser()}*/} - {/*
*/} - {/* */} - {/* {*/} - {/* SelectWithAll({*/} - {/* label: "选择员工状态",*/} - {/* options: employeeStatus,*/} - {/* detailtype: 2,*/} - {/* valueAll: statusAll,*/} - {/* value: status,*/} - {/* onChangeAll: ({ selected }) => {*/} - {/* if (selected) {*/} - {/* this.setState({*/} - {/* status: _.map(employeeStatus, it => it.key).join(","),*/} - {/* statusAll: selected*/} - {/* });*/} - {/* } else {*/} - {/* this.setState({*/} - {/* status: "",*/} - {/* statusAll: selected*/} - {/* });*/} - {/* }*/} - {/* },*/} - {/* onChange: ({ selected }) => {*/} - {/* const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item));*/} - {/* if (bool) {*/} - {/* this.setState({*/} - {/* status: selected,*/} - {/* statusAll: "0"*/} - {/* });*/} - {/* } else {*/} - {/* this.setState({*/} - {/* status: selected,*/} - {/* statusAll: ""*/} - {/* });*/} - {/* }*/} - {/* }*/} - {/* })*/} - {/* }*/} - {/*
*/}
); } From 90470c3a5784d3e5ff51cb04e26088b778149ca6 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, 11 Oct 2024 17:06:54 +0800 Subject: [PATCH 20/27] =?UTF-8?q?feature/2.15.2.2409.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AssociativeSearchSingle.js | 26 ++ .../components/associativeSearchMult.js | 165 ++++++++++ .../components/associativeTreeMult.js | 84 +++++ .../components/customBrowserDialog.js | 299 ++++++++++++++++++ .../components/customBrowserMutiLeft.js | 81 +++++ .../components/customBrowserMutiRight.js | 91 ++++++ .../components/customBrowserOperation.js | 64 ++++ .../components/customTransferDialog.js | 226 +++++++++++++ .../components/CustomBrowser/index.js | 136 ++++++++ .../components/CustomBrowser/index.less | 72 +++++ .../components/salaryDetails.js | 28 +- .../pages/analysisOfSalaryStatistics/index.js | 12 +- pc4mobx/hrmSalary/stores/taxAgent.js | 10 + 13 files changed, 1283 insertions(+), 11 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.less diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js new file mode 100644 index 00000000..6e6f9555 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js @@ -0,0 +1,26 @@ +/* + * 自定义浏览框组件 + * 单选 + * @Author: 黎永顺 + * @Date: 2024/9/3 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import AssociativeSearchMult from "./associativeSearchMult"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeSearchSingle extends Component { + + + render() { + return ( + + ); + } +} + +export default AssociativeSearchSingle; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js new file mode 100644 index 00000000..3f1dbc54 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -0,0 +1,165 @@ +/* + * 自定义浏览框组件 + * 多选 + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, Icon, Select } from "antd"; +import { postFetch } from "../../../util/request"; +import classNames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; +const Option = Select.Option; + +class AssociativeSearchMult extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, data: [], activeKey: "", dropdownWidth: 200 + }; + this.selectedData = {}; + } + + componentDidMount() { + const { dropdownWidth } = this.state; + const w = $(this.refs.searchWrapperMui).outerWidth(); + if (dropdownWidth < w) { + this.setState({ dropdownWidth: w }); + } + } + + handleSearch = (value) => { + this.setState({ loading: true }); + this.getData(value); + }; + getData = (name = "") => { + const { browserConditionParam } = this.props; + const { + completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {} + } = browserConditionParam; + if (_.trim(name)) { + let payload = { ...dataParams }; + searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + this.setState({ + data: convertDatasource ? convertDatasource(data.list) : data.list, + activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) + }); + } else { + this.setState({ + data: filterByName ? _.filter(_.map(data, o => ({ + ...o, id: String(o.id), name: o.name + })), k => k.name.indexOf(name) !== -1) : _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), + activeKey: this.getActiveKey(data) + }); + } + }); + } else { + this.setState({ data: [], loading: false, activeKey: "" }); + } + }; + getActiveKey = (data) => { + const { selectedValues = [] } = this.props; + let v = ""; + if (data && data.length > 0) { + let target = data.filter((d) => selectedValues.indexOf(d.id) === -1); + if (!_.isEmpty(target)) v = String(target[0].id); + } + return v; + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + this.setState({ activeKey: "" }); + }; + handleBlur = () => this.setState({ data: [], activeKey: "" }); + handleClick = (e) => { + e && e.preventDefault(); + const { datas, selectedValues } = this.props; + if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas); + }; + isReadOnly = () => { + const { viewAttr } = this.props; + return viewAttr === 1 || viewAttr === "1"; + }; + + render() { + const { data, dropdownWidth } = this.state; + const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues), + "mr12": viewAttr === "3" && _.isEmpty(selectedValues), + "wea-associative-single": (isSingle || browserConditionParam.isSingle), + "wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle) + }); + if (this.isReadOnly()) { + let arr = []; + selectedValues && selectedValues.map(v => { + let item = datas[v].name; + if (_.isString(item)) { + arr.push({item}); + } else { + arr.push( ); + } + }); + return ( + {arr} + ); + } + let options = data.map(d => ); + selectedValues && selectedValues.map((v) => { + v && options.unshift(); + }); + const select = ; + return ( +
+ {select} + +
+
+
+ ); + } +} + +export default AssociativeSearchMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js new file mode 100644 index 00000000..f7e975c3 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js @@ -0,0 +1,84 @@ +/* + * 自定义组件 + * 下拉树选择框 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { TreeSelect } from "antd"; +import classNames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeTreeMult extends Component { + constructor(props) { + super(props); + this.state = { + data: [] + }; + this.selectedData = {}; + } + + componentDidMount() { + const { treeData } = this.props; + this.setState({ data: this.filterTree(treeData) }); + } + + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + filterTree = (nodes) => { + const selectableNodes = []; + const recurse = (nodes) => { + nodes.forEach((node) => { + if (node.selectable) selectableNodes.push(node); + if (node.children) recurse(node.children); + }); + }; + recurse(nodes); + return selectableNodes; + }; + + render() { + const { viewAttr, selectedValues, datas, isSingle, treeData } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues) + }); + const tProps = { + treeData, + multiple: true, + allowClear: false, + treeCheckable: true, + style: { width: "100%" }, + treeDefaultExpandAll: true, + value: selectedValues, + onChange: this.handleChange, + dropdownMatchSelectWidth: true, + dropdownStyle: { minWidth: 200, maxHeight: 280, overflowY: "auto" }, + getPopupContainer: (triggerNode) => triggerNode.parentNode + }; + return ( + + ); + } +} + +export default AssociativeTreeMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js new file mode 100644 index 00000000..4cb5a125 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -0,0 +1,299 @@ +/* + * 自定义浏览框组件 + * 弹框选择 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable, WeaTransfer } from "ecCom"; +import { Button, Col, Row, Spin } from "antd"; +import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; +import CustomBrowserMutiRight from "./customBrowserMutiRight"; +import CustomBrowserOperation from "./customBrowserOperation"; +import { postFetch } from "../../../util/request"; + +const WeaTransferList = WeaTransfer.list; +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], + query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + leftListSelectedKeys: [], // 左侧table选择的keys + leftListSelectedData: [], // 左侧table选择的数据 + rightCheckedKeys: [], //右侧选择的keys + rightDatas: [] // 右侧展示的数据 + }; + this.selectedData = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.getData(); + this.setState({ + selectedRowKeys: nextProps.selectedValues, + leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) + }); + } else { + this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] + }); + this.selectedData = {}; + } + } + + getData = () => { + const { pageInfo, query } = this.state; + const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props; + let payload = { ...dataParams, ...query }; + dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query }); + this.setState({ loading: true }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) }); + } + }); + }; + handleRowClick = record => { + if (!this.props.isSingle) return; + const values = [record.id]; + const selectedData = { [record["id"]]: record }; + this.props.onCancel(); + this.props.onChange && this.props.onChange(values, selectedData); + }; + handleClear = () => { + this.props.onCancel(); + this.props.onChange && this.props.onChange([], {}); + }; + handleOk = () => { + const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; + const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; + convertSelectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state; + if (this.selectedData[id]) return this.selectedData[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (String(id) === String(listDatas[i].id)) return listDatas[i]; + } + } + }; + onLeftListCheck = (keys, datas) => { + const { leftListSelectedData } = this.state; + let targets = leftListSelectedData.concat(datas); + targets = _.uniqBy(targets, "id"); + targets = targets.filter((t) => keys.indexOf(t["id"]) > -1); + this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets }); + }; + onleftDoubleClick = (data) => { + const { rightDatas } = this.state; + this.setState({ + rightDatas: rightDatas.concat(data), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + }; + onRightDoubleClick = (key) => { + const { rightDatas } = this.state; + const newRightDatas = rightDatas.filter(item => String(item.id) !== key); + this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] }); + }; + moveTo = (direction) => { + const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; + if (direction === "right") { + this.setState({ + rightDatas: rightDatas.concat(leftListSelectedData), + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } else if (direction === "left") { + this.setState({ + rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)), + rightCheckedKeys: [] + }); + } else if (direction === "allToLeft") { + this.setState({ rightDatas: [], rightCheckedKeys: [] }); + } else if (direction === "allToRight") { + if (this.leftListAllActive()) { + this.setState({ + rightDatas: rightDatas.concat(listDatas), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } + } + }; + leftListAllActive = () => { + const { rightDatas, listDatas } = this.state; + let bool = true; + if (_.isEmpty(listDatas)) bool = false; + if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) { + bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0; + } + return bool; + }; + renderTitle = () => { + const { dialogType, searchParamsKey, isSingle } = this.props, { + query, pageInfo, selectedRowKeys, singleFilterVal + } = this.state; + return (
+ {getLabel(111, "数据选择")} + { + dialogType === "table" ? + this.setState({ query: { ...query, [searchParamsKey]: value } })} + onSearch={() => { + this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }}/> : isSingle ? + this.setState({ singleFilterVal })}/> : +
+ } +
); + }; + + render() { + const { + loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, + singleFilterVal + } = this.state; + const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; + const sheight = this.dialog ? this.dialog.state.height - 116 : 260; + const buttons = [ + , + , + ]; + let rightActive = false, leftActive = false, rightAllActive = false; + if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; + if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; + if (rightDatas && rightDatas.length > 0) rightAllActive = true; + let dom = +
+ { + !isSingle ? +
+ + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> + + +
+ + + +
+
+
+ this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} + /> +
+
+ this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} + /> +
+
: + this.handleRowClick(_.find(listDatas, item => item.id === id))} + data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> + } +
+
; + if (dialogType === "table") { + 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.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + dom =
+ +
; + } + dialogType === "table" && isSingle && buttons.splice(0, 1); + return ( + this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={buttons}>{dom} + ); + } +} + +export default CustomBrowserDialog; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js new file mode 100644 index 00000000..94343950 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js @@ -0,0 +1,81 @@ +/* + * 自定义浏览框组件 + * 选择框左边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +let timeout = null; + +class CustomBrowserMutiLeft extends Component { + constructor(props) { + super(props); + this.dataObj = {}; + } + + onClick = (data) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + let { selectedKeys } = this.props; + let keys = selectedKeys ? [...selectedKeys] : []; + let datas = []; + if (keys.indexOf(data.id) > -1) { + keys = keys.filter((k) => k !== data.id); + } else { + keys.push(data.id); + } + keys.forEach((k) => this.dataObj[k] && datas.push(this.dataObj[k])); + this.props.onClick && this.props.onClick(keys, datas); + }, 200); + }; + onDoubleClick = (data) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick([data]); + }; + cls = (item) => { + const { selectedKeys, filterData } = this.props; + let cls = []; + if (selectedKeys && selectedKeys.indexOf(item.id) > -1) { + cls.push("selected"); + } + if (filterData && filterData.filter((d) => d.id === item.id).length > 0) { + cls.push("hide"); + } + return cls.join(" "); + }; + + render() { + const { datas, selectedKeys } = this.props; + const list = datas.map(item => { + this.dataObj[item.id] = item; + return
  • this.onClick(item)} + onDoubleClick={() => this.onDoubleClick(item)}> +
    {item.name}
    +
    + +
  • ; + }); + return ( +
    +
      + {list} +
    + { + list.length === 0 && +
    + {getLabel(111, "没有可显示的数据")} +
    + } +
    + ); + } +} + +export default CustomBrowserMutiLeft; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js new file mode 100644 index 00000000..ed56dd09 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -0,0 +1,91 @@ +/* + * 自定义浏览框组件 + * 选择框右边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { Tree } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; +const TreeNode = Tree.TreeNode; + +let timeout = null; + +class CustomBrowserMutiRight extends Component { + constructor(props) { + super(props); + this.state = { + key: "" + }; + this.nodeIds = []; + this.nodeObj = {}; + } + + generateTreeNodes = () => { + const { data } = this.props, { key } = this.state; + const treeNodes = []; + let showData = [...data]; + if (_.trim(key)) { + showData = showData.filter((item) => { + return item.name.indexOf(_.trim(key)) > -1; + }); + } + showData = _.uniqBy(showData, "id"); + this.nodeIds = []; + this.nodeObj = {}; + showData.map((item) => { + let title = ( +
    +
    +
    + {item.name} +
    +
    +
    +
    + ); + treeNodes.push(); + this.nodeIds.push(item["id"]); + this.nodeObj[item["id"]] = item; + }); + return treeNodes; + }; + handleSearchChange = (v) => this.setState({ key: v }); + checkHandler = (v) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + this.props.checkedCb && this.props.checkedCb(v); + }, 200); + }; + onDoubleClick = (key) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick(key); + }; + + render() { + const { height, checkedKeys } = this.props; + return ( +
    + +
    + + + {this.generateTreeNodes()} + + +
    +
    + ); + } +} + +export default CustomBrowserMutiRight; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js new file mode 100644 index 00000000..ab56ef02 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js @@ -0,0 +1,64 @@ +/* + * 自定义浏览框组件 + * 弹框操作栏 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserOperation extends Component { + render() { + const { + moveToLeft, + moveToRight, + leftArrowText, + rightArrowText, + leftActive, + rightActive, + className, + leftAllActive, + moveAllToLeft, + rightAllActive, + moveAllToRight + } = this.props; + + const moveToLeftButton = ( + + ); + const moveToRightButton = ( + + ); + + const moveAllToLeftButton = ( + + ); + const moveAllToRightButton = ( + + ); + return ( +
    + {moveToLeftButton} + {moveToRightButton} + {moveAllToLeftButton} + {moveAllToRightButton} +
    + ); + } +} + +export default CustomBrowserOperation; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js new file mode 100644 index 00000000..25ed3916 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js @@ -0,0 +1,226 @@ +/* + * 自定义穿梭框组件 + * 弹框选择 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { Button, Col, Row, Spin } from "antd"; +import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; +import CustomBrowserMutiRight from "./customBrowserMutiRight"; +import CustomBrowserOperation from "./customBrowserOperation"; +import { postFetch } from "../../../util/request"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomTransferDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], + query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + leftListSelectedKeys: [], // 左侧table选择的keys + leftListSelectedData: [], // 左侧table选择的数据 + rightCheckedKeys: [], //右侧选择的keys + rightDatas: [] // 右侧展示的数据 + }; + this.selectedData = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.getData(true); + if (nextProps.datas) { + this.setState({ + leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) + }); + } + } else { + this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] + }); + this.selectedData = {}; + } + } + + getData = (init = false) => { + const { pageInfo, query } = this.state; + const { completeURL, convertDatasource, dataParams = {} } = this.props; + let payload = { ...dataParams, ...query }; + this.setState({ loading: true }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + console.log(64, data); + this.setState({ + listDatas: convertDatasource ? convertDatasource(data) : [], + leftListSelectedData: init ? _.values(nextProps.datas) : [], + rightDatas: init ? _.values(nextProps.datas) : [] + }); + } + }); + }; + handleOk = () => { + const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; + const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; + convertSelectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state; + if (this.selectedData[id]) return this.selectedData[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (String(id) === String(listDatas[i].id)) return listDatas[i]; + } + } + }; + onLeftListCheck = (keys, datas) => { + const { leftListSelectedData } = this.state; + let targets = leftListSelectedData.concat(datas); + targets = _.uniqBy(targets, "id"); + targets = targets.filter((t) => keys.indexOf(t["id"]) > -1); + this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets }); + }; + onleftDoubleClick = (data) => { + const { rightDatas } = this.state; + this.setState({ + rightDatas: rightDatas.concat(data), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + }; + onRightDoubleClick = (key) => { + const { rightDatas } = this.state; + const newRightDatas = rightDatas.filter(item => String(item.id) !== key); + this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] }); + }; + moveTo = (direction) => { + const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; + if (direction === "right") { + this.setState({ + rightDatas: rightDatas.concat(leftListSelectedData), + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } else if (direction === "left") { + this.setState({ + rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)), + rightCheckedKeys: [] + }); + } else if (direction === "allToLeft") { + this.setState({ rightDatas: [], rightCheckedKeys: [] }); + } else if (direction === "allToRight") { + if (this.leftListAllActive()) { + this.setState({ + rightDatas: rightDatas.concat(listDatas), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } + } + }; + leftListAllActive = () => { + const { rightDatas, listDatas } = this.state; + let bool = true; + if (_.isEmpty(listDatas)) bool = false; + if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) { + bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0; + } + return bool; + }; + renderTitle = () => { + return (
    + {getLabel(111, "数据选择")} +
    +
    ); + }; + + render() { + const { + loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, + singleFilterVal + } = this.state; + const { dialogType, isSingle, searchParamsKey } = this.props; + const buttons = [ + , + ]; + let rightActive = false, leftActive = false, rightAllActive = false; + if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; + if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; + if (rightDatas && rightDatas.length > 0) rightAllActive = true; + let dom = +
    +
    + + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> + + +
    + + + +
    +
    +
    + this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} + /> +
    +
    + this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} + /> +
    +
    +
    ; + return ( + this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={buttons}>{dom} + ); + } +} + +export default CustomTransferDialog; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js new file mode 100644 index 00000000..f77d566d --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -0,0 +1,136 @@ +/* + * 自定义浏览框组件 + * + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import AssociativeTreeMult from "./components/associativeTreeMult"; +import AssociativeSearchMult from "./components/associativeSearchMult"; +import AssociativeSearchSingle from "./components/AssociativeSearchSingle"; +import CustomBrowserDialog from "./components/customBrowserDialog"; +import classNames from "classnames"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + browserDialog: { visible: false }, + selectedData: {}, searchKeys: [], // 搜索按钮选择的数据和keys + rightDatas: [] // 右侧展示的数据 + }; + } + + componentDidMount() { + const { value, fieldConfig } = this.props; + const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig; + if ((value || defaultValue) && replaceDatas.length > 0) { + this.setState({ + searchKeys: (value || defaultValue).split(","), + selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {}) + }); + } + } + + componentWillReceiveProps(nextProps, nextContext) { + if ( + (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) || + (nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value)) + ) { + this.setState({ searchKeys: [], selectedData: [] }); + } + } + + renderSingle = () => { + const { fieldConfig } = this.props; + const { selectedData, searchKeys } = this.state; + return (
    + +
    ); + }; + renderMult = () => { + const { fieldConfig } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + const { selectedData, searchKeys } = this.state; + return (
    + { + browserConditionParam.treeSelect ? + : + + } +
    ); + }; + onBrowerChangeHandler = (values, datas) => { + const { form, fieldConfig, isSingle } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + this.setState({ + searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values, + selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas + }, () => { + this.props.onChange && this.props.onChange(values.join(",")); + this.props.onCustomChange && this.props.onCustomChange(this.state.selectedData); + if (form) { + form.updateFields({ + [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } + }); + } + }); + }; + onBrowerClick = (keys, selectedObj) => { + if (_.isEmpty(keys)) { + this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] }); + } + this.setState({ browserDialog: { visible: true } }); + }; + + render() { + const { browserDialog, selectedData, searchKeys } = this.state; + const { isSingle, viewAttr, fieldConfig = {} } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + const className = classNames({ + "wea-browser": true, + "wea-field-readonly": viewAttr === "1" || fieldConfig.viewAttr === "1" + }); + const browser = (isSingle || browserConditionParam.isSingle) ? this.renderSingle() : this.renderMult(); + const style = {}; + if (this.props.resize) style.visibility = "hidden"; + return ( +
    {browser}
    + this.setState({ browserDialog: { visible: false } })} + datas={selectedData} selectedValues={searchKeys}/> +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less new file mode 100644 index 00000000..d4d61a16 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -0,0 +1,72 @@ +.custom_browser_dialog { + .wea-hr-muti-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .wea-hr-muti-input-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } + } + + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } + + .wea-hr-muti-dialog { + height: 100%; + background: #f6f6f6; + padding: 8px 16px; + + .wea-hr-muti-input-left, .wea-hr-muti-input-right { + background: #FFF; + } + + .wea-transfer-list { + background: #FFF; + border: 1px solid #e9e9e9; + } + + .wea-input-focus { + height: 35px !important; + width: 100% !important; + + input { + height: 100% !important; + } + } + + .wea-transfer-list-wrapper { + border: none !important; + + .transfer-tree { + padding: 0 !important; + + & > li { + margin: 0; + cursor: pointer; + width: 100%; + position: relative; + padding: 6px 0 6px 20px !important; + border-bottom: 1px solid #e9e9e9; + color: #333; + overflow: hidden; + + .ant-tree-switcher { + display: none !important; + } + + .tree-title { + line-height: 30px; + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 3f01a8bf..aeafccb6 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -6,13 +6,14 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { WeaTableNew } from "comsMobx"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { message, Spin } from "antd"; -import * as API from "../../../apis/statistics"; +import { toJS } from "mobx"; import { getIframeParentHeight } from "../../../util"; import { sysConfCodeRule } from "../../../apis/ruleconfig"; +import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog"; +import * as API from "../../../apis/statistics"; import "../index.less"; const WeaTableComx = WeaTableNew.WeaTable; @@ -26,7 +27,12 @@ class SalaryDetails extends Component { this.state = { loading: false, dataSource: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, - showTotalCell: false, updateSum: true + showTotalCell: false, updateSum: true, + transferDialog: { + visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting" + // convertDatasource: null + } }; } @@ -113,10 +119,10 @@ class SalaryDetails extends Component { }; getColumns = () => { const { attendanceStore: { tableStore } } = this.props; - const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum } = this.state; + const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; - if (!_.isEmpty(columns)) { + if (!_.isEmpty(columns) && !transferDialog.visible) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRowlistUrl, payload: { ...payload, updateSum }, @@ -130,9 +136,12 @@ class SalaryDetails extends Component { } return []; }; + handleSetDefCols = () => { + this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + }; render() { - const { loading, dataSource } = this.state; + const { loading, dataSource, transferDialog } = this.state; const { attendanceStore: { tableStore } } = this.props; return (
    + {/*默认显示列*/} + this.setState({ + transferDialog: { ...transferDialog, visible: false } + })}/>
    ); } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 121e334a..f8ac8451 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -275,7 +275,7 @@ class Index extends Component { render() { const { - taxAgentStore: { statisticsReportBtn }, + taxAgentStore: { statisticsReportBtn, PageAndOptAuth }, attendanceStore: { statisticsForm, reportForm, tableStore } } = this.props; const { @@ -313,7 +313,7 @@ class Index extends Component { ]; - const dropMenuDatas = [ + let dropMenuDatas = [ { key: "log", icon: , content: getLabel(545781, "操作日志") @@ -333,6 +333,11 @@ class Index extends Component { { key: "detail", title: getLabel(111, "员工明细") }, { key: "salaryDetail", title: getLabel(111, "薪资明细") } ]; + dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1); + (PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, { + key: "DEF_COLUMN", icon: , content: getLabel(111, "默认显示列"), + onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols() + }]); return ( } selectedKey={selectedKey} @@ -340,8 +345,7 @@ class Index extends Component { buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())} showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1)} - > + dropMenuDatas={dropMenuDatas}>
    this.setState({ showSearchAd: false })} onAdSearch={this.onAdSearch}/>
    diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index ef5cfe2d..33b74a55 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -8,6 +8,15 @@ import { decentralizationConditions, editConditions } from "../pages/taxAgent/ed const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 + @observable roleForm = new WeaForm(); //权限-角色form表单 + @action initRoleForm = () => this.roleForm = new WeaForm(); + @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单 + @action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm(); + @observable PageAndOptAuth = { able: false, opts: [] }; // 业务线页面权限 + @action initPageAndOptAuth = () => this.PageAndOptAuth = { able: true, opts: ["query", "admin"] };// 设置业务线页面权限 + + @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); //表单实体 @observable formDecentralization = new WeaForm(); //关闭分权表单 @@ -140,6 +149,7 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getPermission(params).then(({ status, data }) => { if (status) { + this.PageAndOptAuth = data; const { isAdminEnable, isChief, isOpenDevolution } = data; this.setShowOperateBtn( !isOpenDevolution ? true : isAdminEnable ? true : false From 0754316e770568dcd0dc2c8ddfa96ffab1c6af84 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, 11 Oct 2024 17:13:19 +0800 Subject: [PATCH 21/27] =?UTF-8?q?feature/2.15.2.2409.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryDetails.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index aeafccb6..ef85c253 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -30,8 +30,7 @@ class SalaryDetails extends Component { showTotalCell: false, updateSum: true, transferDialog: { visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, - completeURL: "/api/bs/hrmsalary/common/pageList/get/setting" - // convertDatasource: null + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: null } }; } @@ -137,7 +136,12 @@ class SalaryDetails extends Component { return []; }; handleSetDefCols = () => { - this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + this.setState({ + transferDialog: { + ...this.state.transferDialog, visible: true, + convertDatasource: datas => _.map(datas.setting, o => ({ id: o.id, name: o.name })) + } + }); }; render() { From 591f29d934f805fed6951c7112148bf9a3c1ccf5 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, 11 Oct 2024 17:15:11 +0800 Subject: [PATCH 22/27] release/2.15.2.2409.01 --- .../calculate/doCalc/components/salaryEditCalcImport/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index accd461f..901cb803 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -156,7 +156,7 @@ class Index extends Component { } }, () => { const { selectItems: salaryItems } = this.state.headerFieldsDialog; - cacheImportField({ salaryAcctRecordId, salaryItems: salaryItems ? salaryItems.split(",") : [] }) + cacheImportField({ salaryAcctRecordId, salaryItemIds: salaryItems ? salaryItems.split(",") : [] }) .then(({ status, errormsg }) => { if (status) { const payload = { From 5b3a645dfc69dbf498c285751a2de503fe425e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 12 Oct 2024 10:07:36 +0800 Subject: [PATCH 23/27] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/apis/statistics.js | 4 ++ .../components/customTransferDialog.js | 52 ++++++------------- .../components/salaryDetails.js | 47 ++++++++++++----- 3 files changed, 54 insertions(+), 49 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index 76056002..17323093 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -134,3 +134,7 @@ export const getSalaryListSum = (params) => { export const exportSalaryList = (params) => { return postExportFetch("/api/bs/hrmsalary/report/statistics/employee/exportSalaryList", params); }; +//薪酬统计报表-保存全局自定义列配置 +export const savePageListSetting = (params) => { + return postFetch("/api/bs/hrmsalary/common/pageList/save/setting", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js index 25ed3916..919ec05c 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js @@ -22,8 +22,8 @@ class CustomTransferDialog extends Component { constructor(props) { super(props); this.state = { - loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], - query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + loading: false, listDatas: [], + query: { [props.searchParamsKey]: "" }, leftListSelectedKeys: [], // 左侧table选择的keys leftListSelectedData: [], // 左侧table选择的数据 rightCheckedKeys: [], //右侧选择的keys @@ -40,9 +40,9 @@ class CustomTransferDialog extends Component { leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) }); } - } else { + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { this.setState({ - pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + query: { [this.props.searchParamsKey]: "" }, rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] }); this.selectedData = {}; @@ -50,7 +50,7 @@ class CustomTransferDialog extends Component { } getData = (init = false) => { - const { pageInfo, query } = this.state; + const { query } = this.state; const { completeURL, convertDatasource, dataParams = {} } = this.props; let payload = { ...dataParams, ...query }; this.setState({ loading: true }); @@ -59,37 +59,20 @@ class CustomTransferDialog extends Component { if (status && data.list) { const { pageNum: current, pageSize, total } = data; this.setState({ - listDatas: convertDatasource ? convertDatasource(data.list) : data.list, - pageInfo: { ...pageInfo, current, pageSize, total } + listDatas: convertDatasource ? convertDatasource(data.list) : data.list }); } else { - console.log(64, data); this.setState({ - listDatas: convertDatasource ? convertDatasource(data) : [], - leftListSelectedData: init ? _.values(nextProps.datas) : [], - rightDatas: init ? _.values(nextProps.datas) : [] + listDatas: convertDatasource ? convertDatasource(data).listDatas : [], + leftListSelectedData: (init && convertDatasource) ? convertDatasource(data).checked : this.state.leftListSelectedData, + rightDatas: (init && convertDatasource) ? convertDatasource(data).checked : this.state.rightDatas }); } }); }; handleOk = () => { - const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; - const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; - convertSelectedRowKeys.forEach((v) => { - let item = this.getItemById(v); - if (item) this.selectedData[v] = item; - }); - this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); - this.props.onCancel && this.props.onCancel(); - }; - getItemById = (id) => { - const { listDatas } = this.state; - if (this.selectedData[id]) return this.selectedData[id]; - if (!_.isEmpty(listDatas)) { - for (let i = 0; i < listDatas.length; i++) { - if (String(id) === String(listDatas[i].id)) return listDatas[i]; - } - } + const { rightDatas } = this.state; + this.props.onChange && this.props.onChange(rightDatas); }; onLeftListCheck = (keys, datas) => { const { leftListSelectedData } = this.state; @@ -155,14 +138,11 @@ class CustomTransferDialog extends Component { }; render() { - const { - loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, - singleFilterVal - } = this.state; - const { dialogType, isSingle, searchParamsKey } = this.props; + const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state; + const { searchParamsKey, saveLoading } = this.props; const buttons = [ - , + , ]; let rightActive = false, leftActive = false, rightAllActive = false; if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; @@ -173,7 +153,7 @@ class CustomTransferDialog extends Component {
    - this.getData()} onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })} /> diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index ef85c253..59995acd 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -29,8 +29,13 @@ class SalaryDetails extends Component { pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, showTotalCell: false, updateSum: true, transferDialog: { - visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, - completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: null + visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false, + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: datas => { + return { + listDatas: _.map(datas.setting, o => ({ id: o.id, name: o.name })), + checked: this.converCheckedCol(datas) + }; + } } }; } @@ -78,10 +83,10 @@ class SalaryDetails extends Component { childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getSalaryList = (props) => { - const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props; + const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props; const [startDateStr, endDateStr] = dateRange; const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); - const { pageInfo } = this.state; + const { pageInfo, transferDialog } = this.state; const payload = { taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], departmentIds: departmentIds ? departmentIds.split(",") : [], @@ -98,7 +103,7 @@ class SalaryDetails extends Component { const { list: dataSource, pageNum: current, total, pageSize } = pageparams; this.setState({ dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload, - showTotalCell: confCode === "1" + showTotalCell: confCode === "1", transferDialog: { ...transferDialog, cancel: false } }, () => tableStore.getDatas(dataKey.datas)); } }).catch(() => this.setState({ loading: false })); @@ -121,7 +126,7 @@ class SalaryDetails extends Component { const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; - if (!_.isEmpty(columns) && !transferDialog.visible) { + if (!_.isEmpty(columns) && !transferDialog.visible && !transferDialog.cancel) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRowlistUrl, payload: { ...payload, updateSum }, @@ -135,11 +140,27 @@ class SalaryDetails extends Component { } return []; }; - handleSetDefCols = () => { - this.setState({ - transferDialog: { - ...this.state.transferDialog, visible: true, - convertDatasource: datas => _.map(datas.setting, o => ({ id: o.id, name: o.name })) + handleSetDefCols = () => this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + converCheckedCol = (data) => { + return _.reduce(data.checked, (pre, cur) => { + const item = _.find(data.setting, k => k.id === cur); + if (!_.isEmpty(item)) return [...pre, item]; + return pre; + }, []); + }; + savePageListSetting = (values) => { + const payload = { + page: "salary_details_report", + setting: _.map(values, o => o.id) + }; + this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } }); + API.savePageListSetting(payload).then(({ status, errormsg }) => { + this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ transferDialog: { ...this.state.transferDialog, visible: false } }, () => this.getSalaryList()); + } else { + message.error(errormsg); } }); }; @@ -165,9 +186,9 @@ class SalaryDetails extends Component { columns={this.getColumns()} /> {/*默认显示列*/} - this.setState({ - transferDialog: { ...transferDialog, visible: false } + transferDialog: { ...transferDialog, visible: false, cancel: true } })}/>
    ); From 7980acc6c253864d8167cf5d6ffb0d7737f39338 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, 14 Oct 2024 14:20:02 +0800 Subject: [PATCH 24/27] release/2.15.2.2409.01 --- .../components/salaryFileDialog/index.js | 15 ++-- .../salaryFileImportDialog/index.js | 22 +++--- .../components/salaryFileList/index.js | 26 ++++--- .../components/searchPannel/index.js | 16 ++++- .../pages/variableSalary/conditions.js | 26 ++++++- .../hrmSalary/pages/variableSalary/index.js | 72 ++++++++----------- .../hrmSalary/pages/variableSalary/index.less | 6 +- 7 files changed, 107 insertions(+), 76 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..d0b0d7f4 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -38,8 +38,9 @@ class Index extends Component { } } - initForm = (props) => { - const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props; + initForm = async (props) => { + const { baseTableStore: { VSSalaryFileForm }, detail } = props; + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ @@ -48,7 +49,8 @@ class Index extends Component { if (getKey(o) === "taxAgentIds") { return { ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - options: taxAgentOption, value: detail[getKey(o)] || "" + value: detail[getKey(o)] || "", + options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content })) }; } return { @@ -65,7 +67,7 @@ class Index extends Component { label: o.name, labelcol: 6, value: detail[`${String(o.id)}_variableItem`] || "", - viewAttr: !_.isEmpty(detail) ? 1 : 2 + viewAttr: 2 })), title: "", col: 2, defaultshow: true @@ -124,10 +126,7 @@ class Index extends Component {
    {title}
    - { - _.isEmpty(detail) && - - } +
    ; }; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index c8917e45..53a96c2b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,12 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps; - const payload = { - salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData - }; + const { baseTableStore: { VSalryForm } } = nextProps; + const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; this.setState({ - importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + importDialog: { + ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + link: `${importDialog.link}?${convertToUrlString(payload)}` + } }); } else { this.setState({ @@ -48,9 +49,10 @@ class Index extends Component { } handleImport = (payload) => { - const { taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; + const { taxAgentIds } = VSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -64,14 +66,14 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
    { - const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; + const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -98,9 +100,9 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f3b0e52a..6b4fcf8b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -24,7 +24,8 @@ class Index extends Component { constructor(props) { super(props); this.state = { - pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [] + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], + selectedRowKeys: [] }; } @@ -56,10 +57,14 @@ class Index extends Component { pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getVariableSalaryList()); break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; case "DEL": this.handleDelete([params.id]); break; - case "VIEW": + case "EDIT": this.handleView(params.id); break; default: @@ -68,13 +73,14 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds } = VSalryForm.getFormParams(); + const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), - ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] + ...pageInfo, ...VSalryForm.getFormParams(), + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { @@ -100,7 +106,7 @@ class Index extends Component { API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "删除成功")); - this.getVariableSalaryList(); + this.setState({ selectedRowKeys: [] }, () => this.getVariableSalaryList()); } else { message.error(errormsg); } @@ -116,15 +122,15 @@ class Index extends Component { })); if (!_.isEmpty(columns)) { this.postMessageToChild({ - columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 98, - pageInfo: this.state.pageInfo, unitTableType: "variableSalary" + columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 95, + pageInfo: this.state.pageInfo, unitTableType: "variableSalary", selectedRowKeys: this.state.selectedRowKeys }); } return columns; }; postMessageToChild = (payload = {}) => { const i18n = { - "操作": getLabel(30585, "操作"), "查看详情": getLabel(111, "查看详情"), + "操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "删除": getLabel(111, "删除") }; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index d5b274a9..8d47fc7a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -6,10 +6,12 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; +import * as API from "../../../../apis/variableSalary"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; +import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -24,12 +26,19 @@ class VariableSalarySearchPannel extends Component { }; } - componentDidMount() { + async componentDidMount() { + const { data } = await API.getAdminTaxAgentList(); this.setState({ searchConditions: _.map(conditions, item => { return { ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(data, o => ({ key: o.id, showname: o.content, selected: true })) + }; + } return { ...child, label: getLabel(child.lanId, child.label) }; }) }; @@ -54,7 +63,10 @@ class VariableSalarySearchPannel extends Component { - + diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js index 72ff44cf..8486fdb7 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js @@ -1,3 +1,5 @@ +import moment from "moment"; + export const conditions = [ { items: [ @@ -22,6 +24,28 @@ export const conditions = [ value: "", viewAttr: 2 }, + { + conditionType: "MONTHPICKER", + domkey: ["salaryMonth"], + fieldcol: 14, + label: "薪资所属月", + lanId: 111, + labelcol: 6, + value: moment(new Date()).format("YYYY-MM"), + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + value: "", + options: [], + multiple: true, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, @@ -157,7 +181,7 @@ export const salaryFileConditions = [ lanId: 111, labelcol: 8, value: "", - rules: "required|string", + rules: "required", viewAttr: 3 } ], diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index f8b13f3b..f2ea52c1 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop } from "ecCom"; import * as API from "../../apis/variableSalary"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SearchPannel from "./components/searchPannel"; @@ -19,8 +19,7 @@ import SalaryFileDialog from "./components/salaryFileDialog"; import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; -import moment from "moment"; -import { Button } from "antd"; +import { Button, message } from "antd"; import cs from "classnames"; import "./index.less"; @@ -32,27 +31,13 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "", - salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [], - SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框 - SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框 + selectedKey: "salaryFile", isQuery: false, showSearchAd: false, + SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框 + SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框 SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入 }; } - componentDidMount() { - API.getAdminTaxAgentList().then(({ status, data }) => { - if (status) { - const taxAgentOption = _.map(data, (o, i) => ({ key: o.id, showname: o.content })); - this.setState({ - taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","), - SIDialog: { ...this.state.SIDialog, taxAgentOption }, - SFDialog: { ...this.state.SFDialog, taxAgentOption } - }); - } - }); - } - handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); handleOperate = (type, detail = {}) => { @@ -62,7 +47,7 @@ class Index extends Component { this.setState({ SFDialog: { ...this.state.SFDialog, visible: true, detail, - title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "查看薪资档案") + title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "编辑薪资档案") } }); break; @@ -71,12 +56,12 @@ class Index extends Component { break; case "export": const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex); - const { salaryMonth, taxAgentIds } = this.state; + const { taxAgentIds, departmentIds } = VSalryForm.getFormParams(); const payload = { ...VSalryForm.getFormParams(), taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [], - departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [], - salaryMonth, columns + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + columns }; WeaLoadingGlobal.start(); const promise = API.exportVariableSalary(payload); @@ -85,16 +70,22 @@ class Index extends Component { SFTableStore.setColSetVisible(true); SFTableStore.tableColSet(true); break; + case "batchDel": + const { state: { selectedRowKeys }, handleDelete } = this.salaryListRef.wrappedInstance; + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(111, "请选择数据!")); + return; + } + handleDelete(selectedRowKeys); + break; default: break; } }; render() { - const { - selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds - } = this.state; - const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props; + const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state; + const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props; const tabs = [ { title: getLabel(111, "浮动数据"), key: "salaryFile", showDropIcon: true, @@ -107,22 +98,16 @@ class Index extends Component { buttons: showOperateBtn ? [ , , - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + , this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], - children: this.handleOperate("create", data)}/> + children: !_.isEmpty(VSalryForm.getFormParams()) ? + this.salaryListRef = dom} + onViewSalaryFile={(data) => this.handleOperate("create", data)}/> : null }, { title: getLabel(111, "字段管理"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [], @@ -141,7 +126,7 @@ class Index extends Component { ]; return ( } selectedKey={selectedKey} + title={getLabel(111, "浮动数据")} icon={} selectedKey={selectedKey} iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper" buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })} @@ -161,11 +146,10 @@ class Index extends Component { SFDialog: { ...SFDialog, visible: false } }, () => callback && callback())}/> {/* 薪资档案导入*/} - { - this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, - () => callback && this.handleAdvanceSearch()); - }}/> + { + this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, + () => callback && this.handleAdvanceSearch()); + }}/> ); } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index 55dbb34b..ffe361cd 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -4,6 +4,7 @@ } .wea-new-top-req-content { + padding: 8px 16px 0 16px; .wea-new-table { background: #FFF; @@ -30,7 +31,7 @@ } .wea-advanced-searchsAd { - height: 108px; + height: 155px; overflow: hidden auto; .formItem-delete { @@ -56,6 +57,9 @@ } } + .wea-form-item-wrapper { + display: block !important; + } } } From b954e1696eb383992ef554ca2a92e2dfb1cd8e6c 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, 14 Oct 2024 16:02:12 +0800 Subject: [PATCH 25/27] release/2.15.2.2409.01 --- .../salaryFileImportDialog/index.js | 26 ++++++---- .../components/salaryFileList/index.js | 52 +++++++++++++++---- .../components/searchPannel/index.js | 20 ++----- .../pages/variableSalary/conditions.js | 52 +++++++++++-------- .../hrmSalary/pages/variableSalary/index.js | 32 ++++-------- .../hrmSalary/pages/variableSalary/index.less | 24 ++++++++- pc4mobx/hrmSalary/stores/baseTable.js | 1 + 7 files changed, 127 insertions(+), 80 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index 53a96c2b..415f7e33 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,11 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm } } = nextProps; - const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData + }; this.setState({ importDialog: { - ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + ...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } }); @@ -49,10 +51,10 @@ class Index extends Component { } handleImport = (payload) => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; - const { taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -66,14 +68,17 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
    { - const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + salaryMonth: val, hasData + }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -100,9 +105,12 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { + salaryMonth, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + hasData: val === "1" + }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index 6b4fcf8b..01969697 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -9,14 +9,20 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; import { WeaTableNew } from "comsMobx"; import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; +import { getSearchs } from "../../../../util"; +import { extraConditions } from "../../conditions"; +import AdvanceInputBtn from "../advanceInputBtn"; +import SearchPannel from "../searchPannel"; import { toJS } from "mobx"; +import cs from "classnames"; const WeaTableComx = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("baseTableStore") @observer @@ -25,11 +31,30 @@ class Index extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], - selectedRowKeys: [] + selectedRowKeys: [], condtions: [], showSearchAd: false }; } - componentDidMount() { + async componentDidMount() { + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + this.setState({ + condtions: _.map(extraConditions, item => { + return { + ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, label: getLabel(child.lanId, child.label) }; + }) + }; + }) + }, () => { + const { baseTableStore: { VExtraSalryForm } } = this.props; + VExtraSalryForm.initFormFields(this.state.condtions); + }); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); this.getVariableSalaryList(); @@ -73,12 +98,12 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, ...VSalryForm.getFormParams(), + ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { @@ -137,17 +162,26 @@ class Index extends Component { const childFrameObj = document.getElementById("unitTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; + openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); render() { - const { loading, dataSource } = this.state; - const { baseTableStore: { SFTableStore } } = this.props; + const { loading, dataSource, condtions, showSearchAd } = this.state; + const { baseTableStore: { SFTableStore, VExtraSalryForm } } = this.props; const dom = document.querySelector(".wea-new-top-req-content"); let height = 280; if (dom && dataSource.length > 0) { - height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 16; + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62; } return ( +
    + {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())} + this.openAdvanceSearch()} + onAdvanceSearch={() => this.getVariableSalaryList()}/> +
    +
    + this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/> +