From a27beae87e6f56c1ad57a332d0ff7d067ef601ea 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, 20 Mar 2024 10:37:26 +0800 Subject: [PATCH 01/93] =?UTF-8?q?feature/2.12.1.2403.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?-=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeeDeclareDetailSchemaEditDialog.js | 140 ++++++++++++------ .../pages/employeedeclareDetail/constants.js | 33 ++++- 2 files changed, 123 insertions(+), 50 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js index a76fecfa..23550a82 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js @@ -5,14 +5,16 @@ * Date: 2023/8/14 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; -import { Button, Col, message, Modal, Row } from "antd"; +import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom"; +import { Button, Col, message, Row } from "antd"; import { inject, observer } from "mobx-react"; import { declareConditions } from "../constants"; import { getSearchs } from "../../../util"; import { getQueryString } from "../../../util/url"; import { employeedeclareGetForm, getEmployeeSave } from "../../../apis/declare"; +import { commonEnumList } from "../../../apis/archive"; +const getKey = WeaTools.getKey; const { getLabel } = WeaLocaleProvider; @inject("employeeDeclareStore") @@ -33,7 +35,8 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { if (nextProps.visible !== this.props.visible && !nextProps.visible) this.employeeChangeInfo = {}; } - employeedeclareGetForm = (props) => { + employeedeclareGetForm = async (props) => { + const { data: cardTypeEnum } = await commonEnumList({ enumClass: `com.engine.salary.enums.employeedeclare.CardTypeEnum` }); employeedeclareGetForm(_.pick(props, ["id"])).then(({ status, data }) => { if (status) { this.setState({ @@ -41,7 +44,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { return { ...it, items: _.map(it.items, child => { - if (child.domkey[0] === "employmentStatus") { + if (getKey(child) === "employmentStatus") { return { ...child, value: _.take(props.employmentStatusList)[0].enum, @@ -50,7 +53,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { showname: getLabel(it.labelId, it.defaultLabel) })) }; - } else if (child.domkey[0] === "employmentType") { + } else if (getKey(child) === "employmentType") { return { ...child, value: _.take(props.employmentTypeList)[0].enum, @@ -59,7 +62,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { showname: getLabel(it.labelId, it.defaultLabel) })) }; - } else if (child.domkey[0] === "gender") { + } else if (getKey(child) === "gender") { return { ...child, value: "MALE", @@ -68,7 +71,11 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { { key: "FEMALE", showname: getLabel(111, "女") } ] }; - } else if (child.domkey[0] === "employeeType") { + } else if (getKey(child) === "cardType") { + return { + ...child, options: _.map(cardTypeEnum, o => ({ key: o.enum, showname: o.defaultLabel })) + }; + } else if (getKey(child) === "employeeType") { return { ...child, viewAttr: props.id ? 1 : 3, @@ -77,7 +84,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { ] }; } - if (child.conditionType === "SELECT" && child.domkey[0] !== "gender" && child.domkey[0] !== "employmentStatus" && child.domkey[0] !== "employmentType") { + if (child.conditionType === "SELECT" && getKey(child) !== "gender" && getKey(child) !== "employmentStatus" && getKey(child) !== "employmentType") { return { ...child, options: [ @@ -93,37 +100,37 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { employeeInfo: data.data }, () => { const { data: result, columns } = data; - const { employeeDeclareStore: { declareForm } } = this.props; + const { employeeDeclareStore: { declareForm }, id } = props; declareForm.initFormFields(this.state.eConditions); - const filedKes = _.map(columns, it => it.dataIndex); - _.map(filedKes, item => { - if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") { - declareForm.updateFields({ [item]: result[item] || "OFF" }); - } else if (item === "deductExpenses") { - declareForm.updateFields({ [item]: result[item] || "ON" }); - } else if (item === "gender") { - declareForm.updateFields({ [item]: result[item] || "MALE" }); - } else if (item === "employmentStatus") { - declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum }); - } else if (item === "employmentType") { - declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum }); - } else if (item === "cardType") { - declareForm.updateFields({ [item]: "居民身份证" }); - } else if (item === "employee") { - const [employeeData] = result[item] || []; - !_.isEmpty(employeeData) && declareForm.updateFields({ - employeeType: { - value: [employeeData._entityType, [employeeData.id, employeeData.name, [{ - id: employeeData.id, - lastname: employeeData.name - }]]], - valueSpan: ["employeeId"] - } - }); - } else { - declareForm.updateFields({ [item]: result[item] || "" }); - } - }); + if (id) { + const filedKes = _.map(columns, it => it.dataIndex); + _.map(filedKes, item => { + if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") { + declareForm.updateFields({ [item]: result[item] || "OFF" }); + } else if (item === "deductExpenses") { + declareForm.updateFields({ [item]: result[item] || "ON" }); + } else if (item === "gender") { + declareForm.updateFields({ [item]: result[item] || "MALE" }); + } else if (item === "employmentStatus") { + declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum }); + } else if (item === "employmentType") { + declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum }); + } else if (item === "employee") { + const [employeeData] = result[item] || []; + !_.isEmpty(employeeData) && declareForm.updateFields({ + employeeType: { + value: [employeeData._entityType, [employeeData.id, employeeData.name, [{ + id: employeeData.id, + lastname: employeeData.name + }]]], + valueSpan: ["employeeId"] + } + }); + } else { + declareForm.updateFields({ [item]: result[item] || "" }); + } + }); + } }); } }); @@ -146,7 +153,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { return { ...it, items: _.map(it.items, child => { - if (child.domkey[0] === "dismissDate") { + if (getKey(child) === "dismissDate") { return { ...child, viewAttr: value === "ABNORMAL" ? 3 : 2 @@ -176,7 +183,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { return { ...it, items: _.map(it.items, child => { - if (child.domkey[0] === "employmentDate") { + if (getKey(child) === "employmentDate") { return { ...child, viewAttr: value !== "OTHER" ? 3 : 2 @@ -200,6 +207,36 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { }); }); break; + case "cardType": + this.setState({ + eConditions: _.map(eConditions, it => { + return { + ...it, + items: _.map(it.items, child => { + if (getKey(child) === "entryDate" || getKey(child) === "departureDate") { + return { + ...child, + viewAttr: value !== "RESIDENT_IDENTITY_CARDS" ? 3 : 2 + }; + } + return { ...child }; + }) + }; + }) + }, () => { + declareForm.initFormFields(this.state.eConditions); + const [employeeData] = this.state.employeeInfo["employee"] || this.employeeChangeInfo["employee"] || []; + !_.isEmpty(employeeData) && declareForm.updateFields({ + employeeType: { + value: [employeeData._entityType, [employeeData.id, employeeData.name, [{ + id: employeeData.id, + lastname: employeeData.name + }]]], + valueSpan: ["employeeId"] + } + }); + }); + break; default: break; } @@ -209,17 +246,28 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { const { employeeDeclareStore: { declareForm: form } } = this.props; form.validateForm().then(f => { if (f.isValid) { - const { employmentType, employmentDate, employmentStatus, dismissDate, ...params } = form.getFormParams(); + const { + employmentType, employmentDate, employmentStatus, dismissDate, cardType, entryDate, departureDate, ...params + } = form.getFormParams(); if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) { - Modal.warning({ - title: getLabel(131329, "信息确认"), - content: getLabel(518702, "必要信息不完整,红色*为必填项!") - }); + form.showError("dismissDate", getLabel(111, "\"离职日期\"未填写")); + return; + } + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate && !departureDate)) { + form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写")); + form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写")); + return; + } + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate)) { + form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写")); + return; + } + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !departureDate)) { + form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写")); return; } const payload = { ...form.getFormParams(), id: this.props.id, - cardType: "RESIDENT_IDENTITY_CARDS", //暂时写死身份证类型 taxAgentId: getQueryString("id"), taxCycle: this.props.taxCycle }; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js index e602f0e4..47d1df31 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js @@ -243,18 +243,21 @@ export const declareConditions = [ lanId: 111, labelcol: 6, value: "", - viewAttr: 1 + rules: "required|string", + viewAttr: 3 }, { colSpan: 1, - conditionType: "INPUT", + conditionType: "SELECT", domkey: ["cardType"], fieldcol: 12, label: "证件类型", lanId: 111, labelcol: 6, - value: "居民身份证", - viewAttr: 1 + value: "", + options:[], + rules: "required|string", + viewAttr: 3 }, { colSpan: 1, @@ -354,6 +357,28 @@ export const declareConditions = [ value: "", viewAttr: 2 }, + { + colSpan: 1, + conditionType: "DATEPICKER", + domkey: ["entryDate"], + fieldcol: 12, + label: "首次入境时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "DATEPICKER", + domkey: ["departureDate"], + fieldcol: 12, + label: "预计离境时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, { colSpan: 1, conditionType: "SELECT", From 1deceeb3e8955c884537ced9f0b4f2e3f95a2191 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, 20 Mar 2024 16:36:56 +0800 Subject: [PATCH 02/93] =?UTF-8?q?feature/2.12.1.2403.02-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E4=BF=9D=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../welfareEditArchiveSlide/index.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index 03a89212..304724fb 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -180,7 +180,7 @@ class Index extends Component { welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true }; }; - save = async () => { + save = async (changeData = false) => { const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items), getConditionDomkeys(this.props.socialBase.comItems || [])), fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items), getConditionDomkeys(this.props.fundBase.comItems || [])), otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items), getConditionDomkeys(this.props.otherBase.comItems || [])); @@ -198,13 +198,24 @@ class Index extends Component { }, { status: otherStatus, errormsg: otherErrorMsg = "!" - }] = await Promise.all([API.save(socailPayload), API.save(fundPayload), API.save(otherPayload)]); + }] = await Promise.all([ + API.save({ ...socailPayload, changeData }), + API.save({ ...fundPayload, changeData }), + API.save({ ...otherPayload, changeData })]); this.setState({ loading: false }); if (socialStatus && fundStatus && otherStatus) { message.success(getLabel(30700, "操作成功!")); this.props.onClose(true); } else { - message.error(socialErrorMsg + fundErrorMsg + otherErrorMsg); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content:
+
{socialErrorMsg + fundErrorMsg + otherErrorMsg}
+
{getLabel(111, "是否自动将方案的上下限调整为设置值?")}
+
, + onOk: () => this.save(true), + onCancel: () => this.props.onClose() + }); } }; updateFormData = (baseData) => this.setState({ formData: { ...this.state.formData, ...baseData } }); @@ -278,7 +289,7 @@ class Index extends Component {
{ runStatuses !== "4,5" && showOperateBtn && - + }
; From 9471a5a737695fc39b98eba8e673fe95a3e19284 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, 28 Mar 2024 16:49:44 +0800 Subject: [PATCH 03/93] =?UTF-8?q?feature/2.12.1.2403.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doCalc/components/customCalcExportDialog/index.js | 10 ++++++++-- .../components/customCalcExportDialog/index.less | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index c3e1f838..7dedaa0d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -8,7 +8,7 @@ import React, { Component } from "react"; import { Button, Col, message, Row } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; import { customCacheExportField } from "../../../../../apis/calculate"; import { convertToUrlString } from "../../../../../util/url"; import "./index.less"; @@ -84,10 +84,14 @@ class Index extends Component { return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) }; }); } + const titleComp =
+ {getLabel(111, "选择字段")} + +
; return ( {getLabel(17416, "导出")}, + , + , ]} bottomLeft={ Date: Thu, 28 Mar 2024 17:25:39 +0800 Subject: [PATCH 04/93] =?UTF-8?q?feature/2.12.1.2403.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?-=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../employeeDeclareDetailSchemaEditDialog.js | 25 ++++++++++--- .../pages/employeedeclareDetail/constants.js | 35 ++++++++++++++++++- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js index 23550a82..e8ec44df 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js @@ -84,7 +84,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { ] }; } - if (child.conditionType === "SELECT" && getKey(child) !== "gender" && getKey(child) !== "employmentStatus" && getKey(child) !== "employmentType") { + if (child.conditionType === "SELECT" && getKey(child) !== "gender" && getKey(child) !== "employmentStatus" && getKey(child) !== "employmentType" && getKey(child) !== "taxReasons") { return { ...child, options: [ @@ -213,7 +213,10 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { return { ...it, items: _.map(it.items, child => { - if (getKey(child) === "entryDate" || getKey(child) === "departureDate") { + if ( + getKey(child) === "entryDate" || getKey(child) === "departureDate" || + getKey(child) === "birthplace" || getKey(child) === "taxReasons" + ) { return { ...child, viewAttr: value !== "RESIDENT_IDENTITY_CARDS" ? 3 : 2 @@ -247,15 +250,18 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { form.validateForm().then(f => { if (f.isValid) { const { - employmentType, employmentDate, employmentStatus, dismissDate, cardType, entryDate, departureDate, ...params + employmentType, employmentDate, employmentStatus, dismissDate, cardType, entryDate, departureDate, + birthplace, taxReasons, ...params } = form.getFormParams(); if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) { form.showError("dismissDate", getLabel(111, "\"离职日期\"未填写")); return; } - if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate && !departureDate)) { + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate && !departureDate && !birthplace && !taxReasons)) { form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写")); form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写")); + form.showError("birthplace", getLabel(111, "\"出生地\"未填写")); + form.showError("taxReasons", getLabel(111, "\"涉税事由\"未填写")); return; } if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate)) { @@ -266,10 +272,19 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component { form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写")); return; } + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !birthplace)) { + form.showError("birthplace", getLabel(111, "\"出生地\"未填写")); + return; + } + if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !taxReasons)) { + form.showError("taxReasons", getLabel(111, "\"涉税事由\"未填写")); + return; + } const payload = { ...form.getFormParams(), id: this.props.id, taxAgentId: getQueryString("id"), - taxCycle: this.props.taxCycle + taxCycle: this.props.taxCycle, + taxReasons: taxReasons.split(",") }; this.setState({ loading: true }); getEmployeeSave(payload).then(({ status, errormsg }) => { diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js index 47d1df31..00620b3d 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js @@ -1,3 +1,7 @@ +import React from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; export const submitStatus = [ { key: "ALL", @@ -255,7 +259,7 @@ export const declareConditions = [ lanId: 111, labelcol: 6, value: "", - options:[], + options: [], rules: "required|string", viewAttr: 3 }, @@ -284,6 +288,17 @@ export const declareConditions = [ rules: "required", options: [] }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["birthplace"], + fieldcol: 12, + label: "出生地", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, { colSpan: 1, conditionType: "DATEPICKER", @@ -379,6 +394,24 @@ export const declareConditions = [ value: "", viewAttr: 2 }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["taxReasons"], + fieldcol: 12, + label: "涉税事由", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2, + options: [ + { key: getLabel(111, "任职受雇"), showname: getLabel(111, "任职受雇") }, + { key: getLabel(111, "提供临时劳务"), showname: getLabel(111, "提供临时劳务") }, + { key: getLabel(111, "转让财产"), showname: getLabel(111, "转让财产") }, + { key: getLabel(111, "从事投资和经营活动"), showname: getLabel(111, "从事投资和经营活动") }, + { key: getLabel(111, "其他"), showname: getLabel(111, "其他") } + ] + }, { colSpan: 1, conditionType: "SELECT", From a768470afb4135d8792a2ad7bb0e4bdefa522373 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, 29 Mar 2024 10:19:33 +0800 Subject: [PATCH 05/93] =?UTF-8?q?feature/2.12.1.2403.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?-=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 8 ++ pc4mobx/hrmSalary/common/columns.js | 77 ------------ pc4mobx/hrmSalary/common/conditions.js | 24 ++++ .../customCalcExportDialog/index.js | 26 +++- .../components/expFieldsSetDialog/index.js | 117 ++++++++++++++++++ .../expFieldsSetDialog/tempDialog.js | 73 +++++++++++ .../expTempManagementDialog/index.js | 96 ++++++++++++++ pc4mobx/hrmSalary/stores/calculate.js | 2 + 8 files changed, 340 insertions(+), 83 deletions(-) delete mode 100644 pc4mobx/hrmSalary/common/columns.js create mode 100644 pc4mobx/hrmSalary/common/conditions.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 1cfca645..38c0c08b 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -250,3 +250,11 @@ export const customCacheExportField = (params) => { export const salaryacctBatchUpdate = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/batchUpdate", params); }; +//薪资核算-自定义导出模板保存新建 +export const saveExportTemplate = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/saveExportTemplate", params); +}; +//薪资核算-获取自定义导出模板列表 +export const getExportTemplateList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/exportTemplateList", params); +}; diff --git a/pc4mobx/hrmSalary/common/columns.js b/pc4mobx/hrmSalary/common/columns.js deleted file mode 100644 index 4c9dc027..00000000 --- a/pc4mobx/hrmSalary/common/columns.js +++ /dev/null @@ -1,77 +0,0 @@ -export const logColumns = [ - { - title: "操作时间", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作人", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作类型", - dataIndex: 'title', - key: 'title', - }, - { - title: "模块", - dataIndex: 'title', - key: 'title', - }, - { - title: "对象", - dataIndex: 'title', - key: 'title', - }, - { - title: "修改详情", - dataIndex: 'title', - key: 'title', - }, - { - title: "客户端IP", - dataIndex: 'title', - key: 'title', - } -] - -export const testColumns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "工号", - dataIndex: 'title', - key: 'title', - }, - { - title: "证件号码", - dataIndex: 'title', - key: 'title', - }, - { - title: "入职日期", - dataIndex: 'title', - key: 'title', - }, -] - -export const dataSource = []; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/common/conditions.js b/pc4mobx/hrmSalary/common/conditions.js new file mode 100644 index 00000000..81e041a6 --- /dev/null +++ b/pc4mobx/hrmSalary/common/conditions.js @@ -0,0 +1,24 @@ +import React from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; +//薪资核算-自定义导出-模板设置 +export const tempConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["templateName"], + fieldcol: 16, + label: getLabel(111, "导出模板名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index 7dedaa0d..2a4f2390 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -9,9 +9,11 @@ import React, { Component } from "react"; import { Button, Col, message, Row } from "antd"; import { inject, observer } from "mobx-react"; import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; +import ExpTempManagementDialog from "../expTempManagementDialog"; import { customCacheExportField } from "../../../../../apis/calculate"; import { convertToUrlString } from "../../../../../util/url"; import "./index.less"; +import TempDialog from "../expFieldsSetDialog/tempDialog"; const { getLabel } = WeaLocaleProvider; @@ -21,8 +23,8 @@ class Index extends Component { constructor(props) { super(props); this.state = { - itemsCheckeds: [], - showOnlyChecked: false + itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" }, + tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] } }; } @@ -69,8 +71,8 @@ class Index extends Component { }; render() { - const { showOnlyChecked, itemsCheckeds } = this.state; - const { itemsByGroup } = this.props; + const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog } = this.state; + const { itemsByGroup, salaryAcctRecordId } = this.props; let dataSource = _.map(itemsByGroup, item => { return { ...item, @@ -104,8 +106,13 @@ class Index extends Component { }} buttons={[ , - , - , + , + , ]} bottomLeft={; }) } + this.setState({ tempMangeDialog: { visible: false } })} + /> + {/*模板保存*/} + this.setState({ + tempDialog: { ...tempDialog, visible: false } + })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js new file mode 100644 index 00000000..6ffcfa93 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js @@ -0,0 +1,117 @@ +/* + * Author: 黎永顺 + * name:自定义导出-导出字段设置 + * Description: + * Date: 2024/3/28 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { Button, Col, Row } from "antd"; +import * as API from "../../../../../apis/calculate"; +import TempDialog from "./tempDialog"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + itemsCheckeds: [], itemsByGroup: [], + tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportField(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + itemsCheckeds: [], itemsByGroup: [] + }); + } + + getExportField = (props) => { + const { salaryAcctRecordId } = props; + API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { itemsByGroup } = data; + this.setState({ itemsByGroup }); + } + }); + }; + handleSelectGroupAll = (groupId, checked) => { + const { itemsCheckeds, itemsByGroup } = this.state; + _.map(itemsByGroup, item => { + if (item.salarySobItemGroupId === groupId) { + if (!!Number(checked)) { + this.setState({ + itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)] + }); + } else { + this.setState({ + itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual) + }); + } + } + }); + }; + + render() { + const { itemsCheckeds, itemsByGroup, tempDialog } = this.state; + const { salaryAcctRecordId, tempId: id } = this.props; + let dataSource = _.map(itemsByGroup, item => { + return { + ...item, salaryItems: _.map(item.salaryItems, child => { + return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) }; + }) + }; + }); + return ( + this.setState({ + tempDialog: { + visible: true, salaryAcctRecordId, id, salaryItemIds: itemsCheckeds + } + })}>{getLabel(111, "保存")}]} + > + { + _.map(dataSource, item => { + const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item; + const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0"; + return this.handleSelectGroupAll(salarySobItemGroupId, val)} + />}> + + { + !_.isEmpty(salaryItems) ? + _.map(salaryItems, it => { + const { salaryItemId, salaryItemName, checked } = it; + return + this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })} + /> + ; + }) : {getLabel(83553, "暂无数据")} + } + + ; + }) + } + this.setState({ + tempDialog: { ...tempDialog, visible: false } + }, () => isRefresh && this.props.onCancel(true))}/> + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js new file mode 100644 index 00000000..c6c9d754 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js @@ -0,0 +1,73 @@ +/* + * Author: 黎永顺 + * name: 导出模板保存框 + * Description: + * Date: 2024/3/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { getSearchs } from "../../../../../util"; +import { tempConditions } from "../../../../../common/conditions"; +import * as API from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class TempDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + nextProps.calculateStore.tempForm.initFormFields(tempConditions); + } else { + nextProps.calculateStore.initTempForm(); + } + } + + save = () => { + const { calculateStore: { tempForm }, salaryAcctRecordId, id, salaryItemIds } = this.props; + tempForm.validateForm().then(f => { + if (f.isValid) { + const payload = tempForm.getFormParams(); + this.setState({ loading: true }); + API.saveExportTemplate({ ...payload, salaryAcctRecordId, id, salaryItemIds }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { loading } = this.state; + const { calculateStore: { tempForm } } = this.props; + return ( + {getLabel(111, "保存")} + ]} + > +
{getSearchs(tempForm, tempConditions, 1, false)}
+
+ ); + } +} + +export default TempDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js new file mode 100644 index 00000000..8e19670e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js @@ -0,0 +1,96 @@ +/* + * Author: 黎永顺 + * name: 自定义导出-导出模板管理 + * Description: + * Date: 2024/3/28 + */ +import React, { Component } from "react"; +import { WeaButtonIcon, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTab, WeaTable } from "ecCom"; +import ExpFieldsSetDialog from "../expFieldsSetDialog"; +import * as API from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, dataSource: [], columns: [], loading: false, + fieldsSetDialog: { visible: false, salaryAcctRecordId: "" }, query: { templateName: "" }, + selectedRowKeys: [] + }; + this.dialogRef = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportTemplateList(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedRowKeys: [] }); + } + + getExportTemplateList = (props) => { + const { pageInfo, query } = this.state; + const { salaryAcctRecordId } = props; + const payload = { ...pageInfo, ...query, salaryAcctRecordId }; + this.setState({ loading: true }); + API.getExportTemplateList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const {} = data; + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { fieldsSetDialog, query, pageInfo, selectedRowKeys, dataSource, columns } = this.state; + const { salaryAcctRecordId } = this.props; + const dialogBodyHeight = this.dialogRef ? this.dialogRef.state.height : 600; + 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.getExportTemplateList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getExportTemplateList(this.props)); + } + }; + const rowSelection = { + selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( + this.dialogRef = dom} initLoadCss className="tempManageDialogLayout" + style={{ + width: 700, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "70%", + maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} + > + this.setState({ fieldsSetDialog: { visible: true, salaryAcctRecordId } })}/>, + , + this.setState({ query: { ...query, templateName: val } })} + onSearch={() => this.getExportTemplateList(this.props)}/> + ]}/> + + this.setState({ + fieldsSetDialog: { ...fieldsSetDialog, visible: false } + }, () => isRefresh && this.getExportTemplateList(this.props))}/> + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 86d3b498..262488ad 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -14,6 +14,8 @@ export class calculateStore { @observable calculateForm = new WeaForm(); //薪资核算重构-核算form @observable batchUpdateForm = new WeaForm(); //批量更新薪资项目-批量更新form @action initBatchUpdateForm = () => this.batchUpdateForm = new WeaForm(); + @observable tempForm = new WeaForm(); //导出模板设置-模板form + @action initTempForm = () => this.tempForm = new WeaForm(); @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); // nrew 一个form From 8a7f3fcb7a77614cd982da57ba6545452607392c 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, 29 Mar 2024 14:37:49 +0800 Subject: [PATCH 06/93] =?UTF-8?q?feature/2.12.1.2403.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 9 +++ .../customCalcExportDialog/index.js | 62 ++++++++++++++-- .../components/expFieldsSetDialog/index.js | 43 +++++++---- .../expTempManagementDialog/index.js | 74 +++++++++++++++++-- 4 files changed, 160 insertions(+), 28 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 38c0c08b..0abda464 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -258,3 +258,12 @@ export const saveExportTemplate = (params) => { export const getExportTemplateList = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/exportTemplateList", params); }; +//薪资核算-删除自定义导出模板列表 +export const deleteExportTemplate = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/deleteExportTemplate", params); +}; +//薪资核算-获取导出模板详细信息 +export const getExportTemplateForm = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); +}; + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index 2a4f2390..d90e5830 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -10,7 +10,12 @@ import { Button, Col, message, Row } from "antd"; import { inject, observer } from "mobx-react"; import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; import ExpTempManagementDialog from "../expTempManagementDialog"; -import { customCacheExportField } from "../../../../../apis/calculate"; +import { + customCacheExportField, + getExportField, + getExportTemplateForm, + getExportTemplateList +} from "../../../../../apis/calculate"; import { convertToUrlString } from "../../../../../util/url"; import "./index.less"; import TempDialog from "../expFieldsSetDialog/tempDialog"; @@ -24,18 +29,43 @@ class Index extends Component { super(props); this.state = { itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" }, - tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] } + tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }, + tempOptions: [ + { key: "", showname: "" }, + { key: "system", showname: getLabel(111, "系统模板") } + ] }; } - componentWillReceiveProps(nextProps, nextContext) { + async componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { this.setState({ itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : [] + }, () => this.getExportTemplateList(nextProps)); + } else { + this.setState({ + tempOptions: [ + { key: "", showname: "" }, + { key: "system", showname: getLabel(111, "系统模板") } + ] }); } } + getExportTemplateList = (props) => { + const { salaryAcctRecordId } = props; + getExportTemplateList({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { pageInfo: { list } } = data; + this.setState({ + tempOptions: [ + ...this.state.tempOptions, ..._.map(list, o => ({ key: String(o.id), showname: o.templateName })) + ] + }); + } + }); + }; + customExportClick = () => { const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props; const { itemsCheckeds } = this.state; @@ -69,9 +99,25 @@ class Index extends Component { } }); }; + handleChangeExpTemp = async (id) => { + switch (id) { + case "system": + const { salaryAcctRecordId } = this.props; + const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId }); + this.setState({ itemsCheckeds: checkeds }); + break; + case "": + this.setState({ itemsCheckeds: "" }); + break; + default: + const { data: { checkItems } } = await getExportTemplateForm({ id }); + this.setState({ itemsCheckeds: _.map(checkItems, o => parseInt(o)) }); + break; + } + }; render() { - const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog } = this.state; + const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog, tempOptions } = this.state; const { itemsByGroup, salaryAcctRecordId } = this.props; let dataSource = _.map(itemsByGroup, item => { return { @@ -88,7 +134,7 @@ class Index extends Component { } const titleComp =
{getLabel(111, "选择字段")} - +
; return ( {getLabel(17416, "导出")}, , ]} + buttons={[]} > { _.map(dataSource, item => { @@ -93,7 +110,7 @@ class Index extends Component { const { salaryItemId, salaryItemName, checked } = it; return this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })} + onChange={() => this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [String(salaryItemId)], _.isEqual) })} /> ; }) : { this.setState({ loading: false }); if (status) { - const {} = data; + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [...columns, { + dataIndex: "operate", title: getLabel(111, "操作"), width: 120, + render: (__, record) => ( + this.getExportTemplateForm(record)}>{getLabel(111, "编辑")} + this.deleteExportTemplate([record.id])}>{getLabel(111, "删除")} + ) + }] + }); } }).catch(() => this.setState({ loading: false })); }; + getExportTemplateForm = (record) => { + const { id, templateName } = record; + const { fieldsSetDialog } = this.state; + const { salaryAcctRecordId } = this.props; + API.getExportTemplateForm({ id }).then(({ status, data }) => { + if (status) { + const { checkItems } = data; + this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems + } + }); + } else { + this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems: [] + } + }); + } + }); + }; + deleteExportTemplate = (ids) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要删除吗?"), + onOk: () => { + API.deleteExportTemplate({ ids }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ selectedRowKeys: [] }, () => this.getExportTemplateList(this.props)); + } else { + message.error(errormsg); + } + }); + } + }); + }; render() { const { fieldsSetDialog, query, pageInfo, selectedRowKeys, dataSource, columns } = this.state; @@ -75,18 +125,26 @@ class Index extends Component { > this.setState({ fieldsSetDialog: { visible: true, salaryAcctRecordId } })}/>, + onClick={() => this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, visible: true, tempId: "", templateName: "", + salaryAcctRecordId, checkItems: [] + } + })}/>, , + disabled={_.isEmpty(selectedRowKeys)} + onClick={() => this.deleteExportTemplate(selectedRowKeys)}/>, this.setState({ query: { ...query, templateName: val } })} - onSearch={() => this.getExportTemplateList(this.props)}/> + onSearch={() => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getExportTemplateList(this.props))}/> ]}/> + scroll={{ y: `calc(${dialogBodyHeight}px - 148px)` }}/> this.setState({ - fieldsSetDialog: { ...fieldsSetDialog, visible: false } + fieldsSetDialog: { ...fieldsSetDialog, visible: false, checkItems: [] } }, () => isRefresh && this.getExportTemplateList(this.props))}/> ); From 3ab97c5a709fd9a59b7901e2bf253c098bac3c19 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, 29 Mar 2024 16:15:11 +0800 Subject: [PATCH 07/93] =?UTF-8?q?feature/2.12.1.2403.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customCalcExportDialog/index.js | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index d90e5830..b1ca3ffb 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -31,7 +31,7 @@ class Index extends Component { itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" }, tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }, tempOptions: [ - { key: "", showname: "" }, + { key: "NULL", showname: "" }, { key: "system", showname: getLabel(111, "系统模板") } ] }; @@ -45,7 +45,7 @@ class Index extends Component { } else { this.setState({ tempOptions: [ - { key: "", showname: "" }, + { key: "NULL", showname: "" }, { key: "system", showname: getLabel(111, "系统模板") } ] }); @@ -106,8 +106,8 @@ class Index extends Component { const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId }); this.setState({ itemsCheckeds: checkeds }); break; - case "": - this.setState({ itemsCheckeds: "" }); + case "NULL": + this.setState({ itemsCheckeds: [] }); break; default: const { data: { checkItems } } = await getExportTemplateForm({ id }); @@ -134,7 +134,8 @@ class Index extends Component { } const titleComp =
{getLabel(111, "选择字段")} - +
; return ( {getLabel(17416, "导出")}, , , ]} @@ -196,9 +205,9 @@ class Index extends Component { }, () => this.getExportTemplateList(this.props))} /> {/*模板保存*/} - this.setState({ + this.setState({ tempDialog: { ...tempDialog, visible: false } - })}/> + }, () => this.getExportTemplateList(this.props))}/> ); } From 8dac6eab6b26960d04a633f6971b63fed97f8d1e 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, 29 Mar 2024 16:52:28 +0800 Subject: [PATCH 08/93] =?UTF-8?q?feature/2.12.1.2403.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doCalc/components/customCalcExportDialog/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index b1ca3ffb..eb96a45b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -32,7 +32,7 @@ class Index extends Component { tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }, tempOptions: [ { key: "NULL", showname: "" }, - { key: "system", showname: getLabel(111, "系统模板") } + { key: "system", selected: true, showname: getLabel(111, "系统模板") } ] }; } @@ -46,7 +46,7 @@ class Index extends Component { this.setState({ tempOptions: [ { key: "NULL", showname: "" }, - { key: "system", showname: getLabel(111, "系统模板") } + { key: "system", selected: true, showname: getLabel(111, "系统模板") } ] }); } @@ -134,7 +134,7 @@ class Index extends Component { } const titleComp =
{getLabel(111, "选择字段")} -
; return ( @@ -157,7 +157,7 @@ class Index extends Component { tempDialog: { visible: true, salaryAcctRecordId, id: "", salaryItemIds: itemsCheckeds }, tempOptions: [ { key: "NULL", showname: "" }, - { key: "system", showname: getLabel(111, "系统模板") } + { key: "system", selected: true, showname: getLabel(111, "系统模板") } ] })}>{getLabel(111, "存为模板")}, , From ab6ae51b3dde863ace44e34b8d6ddf4506eb11d5 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, 29 Mar 2024 16:53:52 +0800 Subject: [PATCH 09/93] =?UTF-8?q?feature/2.12.1.2403.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?-=E5=A4=96=E7=B1=8D=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=80=81=20=E6=B6=89=E7=A8=8E=E4=BA=8B=E7=94=B1?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js index 00620b3d..a9e370ab 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js @@ -403,6 +403,7 @@ export const declareConditions = [ lanId: 111, labelcol: 6, value: "", + multiple: true, viewAttr: 2, options: [ { key: getLabel(111, "任职受雇"), showname: getLabel(111, "任职受雇") }, From 75bb200e9dc9acb0bfe8656dc372fa1e2422f3a4 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, 1 Apr 2024 14:00:50 +0800 Subject: [PATCH 10/93] =?UTF-8?q?release/2.12.1.2403.02=20=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E6=98=8E=E7=BB=86=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index a653e118..d4681ac2 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -331,7 +331,7 @@ class Index extends Component { const tabs = [ { key: "statistics", title: getLabel(111, "统计表") }, { key: "detail", title: getLabel(111, "员工明细") }, - // { key: "salaryDetail", title: getLabel(111, "薪资明细") } + { key: "salaryDetail", title: getLabel(111, "薪资明细") } ]; return ( Date: Mon, 1 Apr 2024 17:47:08 +0800 Subject: [PATCH 11/93] =?UTF-8?q?feature/2.12.1.2403.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/declare.js | 8 +- .../pages/declareDetail/components/leftTab.js | 64 ++++++++++++++ .../hrmSalary/pages/declareDetail/index.js | 87 +++++++++++-------- 3 files changed, 119 insertions(+), 40 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8c9a2a11..a780105b 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -16,9 +16,13 @@ export const saveDeclare = params => { return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params); }; +//个税申报表-获取分类 +export const getTaxReports = params => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxReports", "get", params); +}; //个税申报表-个税申报表相关信息 export const getDeclareInfo = params => { - return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params); + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", params); }; // 个税申报表详情列表 @@ -106,7 +110,7 @@ export const employeedeclareDeclare = (params) => { //个税在线对接-获取个税申报记录下的个税申报表TAB export const getTaxDeclarationTab = params => { - return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params); + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params); }; //个税在线对接-个税申报表是否已经生成 diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js new file mode 100644 index 00000000..1370d4e1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js @@ -0,0 +1,64 @@ +/* + * Author: 黎永顺 + * name: 报表查看-左侧tab标题 + * Description: + * Date: 2023/4/20 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Menu } from "antd"; +import * as API from "../../../apis/declare"; +import { getQueryString } from "../../../util/url"; + +const { getLabel } = WeaLocaleProvider; + +class LeftTab extends Component { + constructor(props) { + super(props); + this.state = { + reportName: "", + selectedKeys: "", + dataSource: [] + }; + } + + componentDidMount() { + this.getTaxReports(); + } + + getTaxReports = () => { + const { onChangeTab } = this.props; + API.getTaxReports({ id: getQueryString("id") }).then(({ status, data: dataSource }) => { + if (status) this.setState({ + dataSource, selectedKeys: !_.isEmpty(dataSource) ? _.head(dataSource).id + "" : "" + }, () => { + !_.isEmpty(this.state.dataSource) && onChangeTab(_.head(this.state.dataSource).reportType); + }); + }); + }; + + render() { + const { selectedKeys, dataSource } = this.state; + const { onChangeTab } = this.props; + return ( +
+ { + this.setState({ selectedKeys: key }, () => { + onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true); + }); + }} + > + { + _.map(dataSource, item => { + const { reportType, id } = item; + return {reportType}; + }) + } + +
+ ); + } +} + +export default LeftTab; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index 280bfc5b..505a2c16 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -5,7 +5,7 @@ * Date: 2023/8/18 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTab } from "ecCom"; +import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom"; import { Button, message, Modal, Spin } from "antd"; import TaxDeclarationInfo from "./components/taxDeclarationInfo"; import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; @@ -32,6 +32,7 @@ import { convertToUrlString, getQueryString } from "../../util/url"; import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog"; import TabEditDialog from "./components/tabEditDialog"; +import LeftTab from "./components/leftTab"; import { confirmDialog } from "./confirm"; import "./index.less"; @@ -60,7 +61,8 @@ class Index extends Component { visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: "" }, intelCalcSalaryStatus: false, //智能算薪 总开关是否开启 - declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } + declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 }, + reportType: "" }; this.timer = null; this.taxDeclareRef = null; @@ -75,7 +77,8 @@ class Index extends Component { } init = async (isInit = true) => { - const [tabsResult, infoResult, calcResult] = await Promise.all([this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]); + const [tabsResult, infoResult, calcResult] = await Promise.all([ + this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]); const { data: tabDataSource, status: tabStatus } = tabsResult; const { data: infoDataSource, status: infoStatus } = infoResult; const { data: calcSalaryStatus, status: calcStatus } = calcResult; @@ -101,10 +104,12 @@ class Index extends Component { this.getDetailList(); }; getTaxDeclarationTab = () => { - return getTaxDeclarationTab({ id: getQueryString("id") }); + const { reportType } = this.state; + return getTaxDeclarationTab({ id: getQueryString("id"), reportType }); }; getDeclareInfo = () => { - return getDeclareInfo({ id: getQueryString("id") }); + const { reportType } = this.state; + return getDeclareInfo({ id: getQueryString("id"), reportType }); }; apiflowBillingConfigStatus = () => { return apiflowBillingConfigStatus(); @@ -413,41 +418,47 @@ class Index extends Component { onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}); } return ( -
- this[fun]()}/> -
- this.setState({ selectedKey: v }, () => this.getDetailList())} - searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} - onSearchChange={keyword => this.setState({ keyword })} - onSearch={this.getDetailList} - /> - {/*个税申报表-新增编辑框*/} - this.handleTaxDescPerSlide({ visible: false, id: "", callback })} - /> - {/*个税申报表导入*/} - this.taxDeclareRef = dom} - onSuccess={this.declare} - /> - {/*个税申报表-新增tab弹框*/} - this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/> -
-
- -