diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 746bcf99..54c6959f 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -283,3 +283,28 @@ export const getTaxdeclarationContrastList = (params) => { export const exportContrast = params => { return postExportFetch("/api/bs/hrmsalary/taxdeclaration/exportContrast", params); }; + +//扣除名单确认-人员列表 +export const getDeductionAmountList = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/list", params); +}; +//扣除名单确认-增加人员 +export const addDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/add", params); +}; +//扣除名单确认-删除人员 +export const deleteDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/delete", params); +}; +//扣除名单确认-编辑人员 +export const editDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/edit", params); +}; +//扣除名单确认-确认人员 +export const confirmDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/confirm", params); +}; +//扣除名单确认-反馈人员 +export const feedbackDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/feedback", params); +}; diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less index 4f834426..6ea7eaa5 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.less +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less @@ -155,13 +155,14 @@ .item-count { //flex-basis: 328px; flex: 1; - padding-left: 16px; + padding: 12px 16px; height: 100%; - line-height: 40px; background: #fff; font-size: 12px; color: #5F5F5F; word-break: break-all; + display: flex; + align-items: center; } } } diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index bdfcacd5..ef891137 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -6,7 +6,6 @@ import SalaryAdjustmentRecords from "./pages/salaryAdjustmentRecords"; import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/welfarePlan"; -// import Archivess from "./pages/socialSecurityBenefits/archives"; import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面 import StandingBook from "./pages/socialSecurityBenefits/standingBook/standingBook"; //社保福利台账重构页面 import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail"; @@ -19,20 +18,16 @@ import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; import SpecialAddDeduction from "./pages/dataAcquisition/specialAddDeduction"; import Ledger from "./pages/ledgerPage"; -// import Calculate from "./pages/calculate"; import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页面 -// import Payroll from "./pages/payroll"; import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面 import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; -// import Declare from "./pages/declare"; import DeclareDetail from "./pages/declareDetail"; import DeclareOnlineComparison from "./pages/declareOnlineComparison"; import Employeedeclare from "./pages/employeedeclare"; import EnterprisePayCertificationDetail from "./pages/enterprisePayCertificationDetail"; import BankVoucherDetail from "./pages/bankVoucherDetail"; import EmployeedeclareDetail from "./pages/employeedeclareDetail"; -// import Declare from "./pages/declare"; import Declare from "./pages/declare/declare"; //重构的个税申报表 import TaxRate from "./pages/taxRate"; import TaxAgents from "./pages/taxAgent"; @@ -119,14 +114,9 @@ const Routes = ( - + - + diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index 39c9d174..a4919d5d 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -22,6 +22,8 @@ class Layout extends Component { componentWillReceiveProps(nextProps, nextContext) { if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { + stores.baseFormStore.initForm(); + stores.baseFormStore.initFormExtra(); if (window.location.hash.indexOf("payroll") !== -1) { window.localStorage.removeItem("template-basedata"); window.localStorage.removeItem("salary-showset"); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index fedc4d02..e0d5b792 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -153,6 +153,36 @@ export const salaryDetailSearchConditions = [ multiple: true, viewAttr: 2 }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "17", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["employeeIds"], + fieldcol: 16, + label: getLabel(111, "人员"), + labelcol: 8, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index e791e76e..1893e77e 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -109,12 +109,13 @@ class SalaryDetails extends Component { getSalaryList = (props) => { const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props; const [startDateStr, endDateStr] = dateRange; - const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); + const { taxAgentIds, subcompanyIds, departmentIds, employeeIds, ...extra } = salaryDetailSearchForm.getFormParams(); const { pageInfo, transferDialog, updateSum } = this.state; const payload = { taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], departmentIds: departmentIds ? departmentIds.split(",") : [], subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + employeeIds: employeeIds ? employeeIds.split(",") : [], ...extra, ...pageInfo, startDateStr, endDateStr }; this.setState({ loading: true }); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index 7d481333..1b5c5dc5 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -182,7 +182,7 @@ } .wea-advanced-searchsAd { - height: 155px; + height: 200px; overflow: hidden auto; .formItem-delete { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js new file mode 100644 index 00000000..a8cecca3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js @@ -0,0 +1,110 @@ +/* + * 核算编辑 + * 数据查看锚点 + * @Author: 黎永顺 + * @Date: 2025/2/10 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import classnames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CalcAnchorList extends Component { + constructor(props) { + super(props); + this.state = { + collapsed: false, currentIndex: 0 + }; + this.isClickRef = null; + this.timerRef = null; + } + + componentDidMount() { + document.getElementById("salary_anchor_area").addEventListener("scroll", this.handlerScroll); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + collapsed: false, + currentIndex: 0 + }); + } + + componentWillUnmount() { + document.getElementById("salary_anchor_area").removeEventListener("scroll", this.handlerScroll); + } + + handlerScroll = () => { + // 点击锚点时,不执行滚动函数 + if (this.isClickRef) return; + // 获取滚动容器的滚动高度(这里相对于#salary_anchor_area滚动的) + const scrollTop = document.getElementById("salary_anchor_area").scrollTop; + // 获取所有wea-search-group anchor_开头的元素集合 + const contentList = document.querySelectorAll("[class^='wea-search-group anchor_']"); + const offsetTopArr = []; + contentList.forEach((item) => { + // 获取每个wea-search-group anchor_开头的元素的offsetTop + offsetTopArr.push(item.offsetTop); + }); + for (let i = 0; i < offsetTopArr.length; i++) { + // 当滚动条高度达到对应wea-search-group anchor_开头的元素的滚动高度、则将锚点设置为高亮状态 + if (scrollTop + 190 >= offsetTopArr[i]) this.setState({ currentIndex: i }); + } + }; + onClickAnchor = (item, index) => { + const anchorElement = document.getElementById("salary_anchor_area"); + const el = document.querySelector(`.anchor_${item.salarySobItemGroupId}`); + if (el) { + anchorElement.scroll({ top: el.offsetTop, behavior: "smooth" }); + } + this.setState({ currentIndex: index }); + // 点击时设置为true,为了防止同时执行滚动事件 + this.isClickRef = true; + // 清除定时器,防止滚动事件触发、出现走马灯闪烁问题 + if (this.timerRef) clearTimeout(this.timerRef); + this.timerRef = setTimeout(() => { + this.isClickRef = false; + }, 1000); + }; + + render() { + const { collapsed, currentIndex } = this.state, { datas } = this.props; + return ( +
+
+ { + collapsed ? +
+ this.setState({ collapsed: !collapsed })}/> +
: + +
+ this.setState({ collapsed: !collapsed })}/> +
+
+
+ +
+ {_.map(datas, (o, i) => ( +
this.onClickAnchor(o, i)}> + {o.salarySobItemGroupName} +
) + )} +
+
+ } +
+
+ ); + } +} + +export default CalcAnchorList; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 92453039..75822c8e 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -313,10 +313,7 @@ class EditCalcTable extends Component { /> this.setState({ - salaryCalcSlide: { - visible: false, - id: "" - } + salaryCalcSlide: { visible: false, id: "", viewAttr: 2 } }, () => isFresh === "true" && this.queryCalcResultList())}/> { progressVisible && diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index fb81d7e7..5deeaecd 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -12,9 +12,9 @@ import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable"; import IssuedAndReissueTable from "../../../../calculateDetail/issuedAndReissueTable"; import { acctresultDetail, saveAcctResult } from "../../../../../apis/calculate"; import { toDecimal_n } from "../../../../../util"; +import CalcAnchorList from "./calcAnchorList"; import "./index.less"; - const getLabel = WeaLocaleProvider.getLabel; class EditSalaryCalcSlide extends Component { @@ -29,7 +29,7 @@ class EditSalaryCalcSlide extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.acctresultDetail(nextProps.id); - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }, () => document.getElementById("salary_anchor_area").scrollTop = 0); } acctresultDetail = (id) => { @@ -142,7 +142,9 @@ class EditSalaryCalcSlide extends Component { className="salary-calculate-esf-layout" {...this.props} top={0} width={60} height={100} measure={"%"} direction={"right"} title={this.renderTitle()} - content={
+ content={
+ {/*锚点*/} + this.setState({ baseInfo })}/> .anchor-list-link-title { + color: #5d9cec; + } + } + } + } } } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js index 7d6263fb..9f196d5f 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js @@ -68,7 +68,7 @@ class PayrollItemsTable extends Component { } ]; return ( - + { }; export const Input = (props) => { - const { value } = props; - return (); + const { value, label } = props; + return ( + + ); }; export const DataCollectionDateRangePick = (props) => { const { range, label, onChange, format = "YYYY-MM", key } = props; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 4c579f2c..6054413f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -336,7 +336,7 @@ class Index extends Component { const { addAllLoading, incomeTaxStatus } = this.state; const commonBtns = [ , - , + // , , (item.display === "true" && showColumns.includes(item["dataIndex"]))), o => ({ dataIndex: o.dataIndex, title: o.title, width: 150, render: (text, record) => { + if (!record[o["dataIndex"]]) return ; return Object.prototype.toString.call(record[o["dataIndex"]]) === "[object String]" ? {text} :
diff --git a/pc4mobx/hrmSalary/pages/employeedeclare/index.js b/pc4mobx/hrmSalary/pages/employeedeclare/index.js index 453bac4c..66eecfe7 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclare/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclare/index.js @@ -94,7 +94,7 @@ class Index extends Component { width: 260, render: (_, record) => ( {getLabel(83110, "查看详情")} diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js new file mode 100644 index 00000000..47a97b90 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionAmountEditDialog.js @@ -0,0 +1,78 @@ +/* + * 扣除名单确认 + * 编辑是否扣除 + * @Author: 黎永顺 + * @Date: 2025/3/27 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import { WeaForm } from "comsMobx"; +import FormInfo from "../../../components/FormInfo"; +import { deductConditions } from "../constants"; +import * as API from "../../../apis/declare"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); + +class DeductionAmountEditDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) form.resetForm(); + } + + initForm = (props) => { + const { record } = props; + this.setState({ + conditions: _.map(deductConditions, item => ({ + ...item, + items: _.map(item.items, o => ({ ...o, value: record[getKey(o)] + "", label: getLabel(o.lanId, o.label) })) + })) + }, () => form.initFormFields(this.state.conditions)); + }; + save = () => { + form.validateForm().then(f => { + if (f.isValid) { + const { id } = this.props.record; + const paylaod = { id, deductFlag: form.getFormParams().deductFlag }; + this.setState({ loading: true }); + API.editDeductionAmount(paylaod).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + + render() { + const { conditions, loading } = this.state; + const height = _.reduce(conditions, (pre, cur) => pre + cur.items.length, 0).length * 47; + return ({getLabel(111, "确定")}, + ]}> + + ); + } +} + +export default DeductionAmountEditDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js new file mode 100644 index 00000000..5513744a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmDialog.js @@ -0,0 +1,173 @@ +/* + * 扣除名单确认 + * @Author: 黎永顺 + * @Date: 2025/3/26 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom"; +import DeductionListConfirmEmployeeDialog from "./deductionListConfirmEmployeeDialog"; +import DeductionAmountEditDialog from "./deductionAmountEditDialog"; +import { Button, Col, message, Modal, Row } from "antd"; +import * as API from "../../../apis/declare"; +import { calcPageNo } from "../../../util"; + +const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools; + +class DeductionListConfirmDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, columns: [], dataSource: [], visible: false, + selectedRowKeys: [], editDialog: { visible: false, record: {} }, loadingBtn: { confirm: false, feedback: false } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getDeductionAmountList(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], selectedRowKeys: [] + }); + } + + getDeductionAmountList = (props) => { + const { pageInfo } = this.state, { id: taxAgentId } = getUrlParams(), { year } = props || this.props; + const payload = { ...pageInfo, taxAgentId, year }; + this.setState({ loading: true }); + API.getDeductionAmountList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [..._.map(columns, o => { + if (o.dataIndex === "deductFlag") { + return { ...o, render: v => ({v === 1 ? getLabel(111, "是") : getLabel(111, "否")}) }; + } + return { ...o }; + }), { + title: getLabel(111, "操作"), dataIndex: "action", + render: (v, record) => ( this.setState({ + editDialog: { visible: true, record } + })}>{getLabel(111, "编辑")}) + }] + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleDelete = () => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认删除本条数据吗?"), + onOk: () => { + API.deleteDeductionAmount({ ids: this.state.selectedRowKeys }).then(({ status, errormsg }) => { + if (status) { + const { pageInfo } = this.state, { current, pageSize, total } = pageInfo; + message.success(getLabel(111, "操作成功")); + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, current: calcPageNo(total, current, pageSize, this.state.selectedRowKeys.length) + } + }, () => this.getDeductionAmountList()); + } else { + message.error(errormsg); + } + }); + } + }); + }; + confirmDeductionAmount = () => { + const { id: taxAgentId } = getUrlParams(), { year } = this.props; + const payload = { taxAgentId, year }; + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: true } }); + API.confirmDeductionAmount(payload).then(({ status, errormsg }) => { + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: false } }); + if (status) { + message.success(getLabel(111, "操作成功")); + this.getDeductionAmountList(); + } else { + message.error(errormsg); + } + }); + }; + feedbackDeductionAmount = () => { + const { id: taxAgentId } = getUrlParams(), { year } = this.props; + const payload = { taxAgentId, year }; + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: true } }); + API.feedbackDeductionAmount(payload).then(({ status, errormsg }) => { + this.setState({ loadingBtn: { ...this.state.loadingBtn, confirm: false } }); + if (status) { + message.success(getLabel(111, "操作成功")); + this.getDeductionAmountList(); + } else { + message.error(errormsg); + } + }); + }; + + render() { + const { loading, columns, dataSource, pageInfo, visible, selectedRowKeys, editDialog, loadingBtn } = this.state; + 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.getDeductionAmountList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getDeductionAmountList()); + } + }; + const rowSelection = { + selectedRowKeys, onChange: v => this.setState({ selectedRowKeys: v }) + }; + const height = this.refs.employeeRef ? this.refs.employeeRef.state.height : 400; + return ( + + + {getLabel(111, "扣除名单确认")} + + + + + + )} + style={{ + width: 1150, height: 490, minHeight: 200, minWidth: 380, maxHeight: "90%", + maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }}> +
+
+ this.setState({ visible: true })}/> + +
+ + this.setState({ + editDialog: { visible: false, record: {} } + }, () => callback && callback())}/> + this.setState({ visible: false }, () => callback && callback())}/> +
+
+ ); + } +} + +export default DeductionListConfirmDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js new file mode 100644 index 00000000..1f094b81 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/deductionListConfirmEmployeeDialog.js @@ -0,0 +1,106 @@ +/* + * 扣除名单确认 + * 人员添加列表 + * @Author: 黎永顺 + * @Date: 2025/3/26 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import * as API from "../../../apis/declare"; + +const { getLabel } = WeaLocaleProvider, { getUrlParams } = WeaTools; +const columns = [{ title: getLabel(111, "姓名"), dataIndex: "employeeName" }, { + title: getLabel(111, "分部"), + dataIndex: "subCompanyName" +}, { title: getLabel(111, "部门"), dataIndex: "departmentName" }, { + title: getLabel(111, "个税扣缴义务人"), + dataIndex: "taxAgentName" +}, { title: getLabel(111, "工号"), dataIndex: "jobNum" }, { title: getLabel(111, "手机号码"), dataIndex: "mobile" }]; + +class DeductionListConfirmEmployeeDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], selectedRowKeys: [], + saveloading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.employeedeclareList(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], selectedRowKeys: [] + }); + } + + employeedeclareList = (props) => { + const { pageInfo } = this.state, { payload } = props || this.props; + this.setState({ loading: true }); + API.employeedeclareList({ ...payload, ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: result } = data; + const { list: dataSource, pageNum: current, pageSize, total } = result; + this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); + } + }).catch(() => this.setState({ loading: false })); + }; + save = () => { + const { selectedRowKeys: employeeDeclareIds } = this.state, { id: taxAgentId } = getUrlParams(), { year } = this.props; + const payload = { taxAgentId, year, employeeDeclareIds }; + this.setState({ saveloading: true }); + API.addDeductionAmount(payload).then(({ status, errormsg }) => { + this.setState({ saveloading: false }); + if (status) { + message.success(getLabel(111, "操作成功")); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(errormsg); + } + }); + }; + + render() { + const { loading, dataSource, pageInfo, selectedRowKeys, saveloading } = this.state; + 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.employeedeclareList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.employeedeclareList()); + } + }; + const rowSelection = { + selectedRowKeys, onChange: v => this.setState({ selectedRowKeys: v }) + }; + const height = this.refs.employeeRef ? this.refs.employeeRef.state.height : 400; + return ({getLabel(111, "确认")}, + ]} + style={{ + width: 1150, height: 490, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", + overflow: "hidden", transform: "translate(0px, 0px)" + }}> +
+ +
+
); + } +} + +export default DeductionListConfirmEmployeeDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js index b9f64232..4e2525a7 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js @@ -170,7 +170,6 @@ export const advanceConditions = [ defaultshow: true } ]; - export const declareConditions = [ { items: [ @@ -491,3 +490,31 @@ export const declareConditions = [ defaultshow: true } ]; +// 扣除名单确认 +export const deductConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + conditionType: "SWITCH", + domkey: ["deductFlag"], + fieldcol: 12, + label: "是否扣除", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js index 920d2e12..a7469897 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -12,6 +12,7 @@ import { Button, Dropdown, Menu, message, Modal, Spin } from "antd"; import BaseInfo from "./components/baseInfo"; import EmployeeDeclareDetailSchemaEditDialog from "./components/employeeDeclareDetailSchemaEditDialog"; import EmployeeDeclareDetailSchemaImportDialog from "./components/employeeDeclareDetailImportDialog"; +import DeductionListConfirmDialog from "./components/deductionListConfirmDialog"; import { commonEnumList } from "../../apis/payrollFiles"; import { employeedeclareDeclare, @@ -48,6 +49,7 @@ class Index extends Component { taxCycle: new Date(), pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: { query: false, refresh: false, feedback: false, declare: false, exportLoading: false }, declareEditDialog: { visible: false, id: "", title: "" }, + confirmationDialog: { visible: false, payload: {} }, declareStatusList: [], employmentStatusList: [], employmentTypeList: [], adConditons: [], selectedRowKeys: [], exportPayload: {}, @@ -169,7 +171,7 @@ class Index extends Component { employeeDeclareStore: { advanceForm: form }, taxAgentStore: { showOperateBtn, isTaxDeclareAdmin } } = this.props; - const { pageInfo, declareStatus, taxCycle, selectedKey, selectedRowKeys } = this.state; + const { pageInfo, declareStatus, taxCycle, selectedKey, selectedRowKeys, confirmationDialog } = this.state; const { departmentIds, positionIds, ...formParams } = form.getFormParams(); //判断税款所属期是否在两月以内 const isGreaterThanLastTwoMonths = moment(taxCycle).isAfter(moment().subtract(2, "months")); @@ -190,7 +192,8 @@ class Index extends Component { this.baseInfoRef.getEmployeeDeclareInfo(); this.setState({ azOperate: isGreaterThanLastTwoMonths, - pageInfo: { ...pageInfo, current, pageSize, total } + pageInfo: { ...pageInfo, current, pageSize, total }, + confirmationDialog: { ...confirmationDialog, payload } }, () => { const payload = { dataSource, selectedRowKeys, selectedKey, @@ -420,7 +423,7 @@ class Index extends Component { }); }; handleMenuClick = ({ key }) => { - const { selectedRowKeys } = this.state; + const { selectedRowKeys, confirmationDialog } = this.state; switch (key) { case "1": if (_.isEmpty(selectedRowKeys)) { @@ -429,6 +432,9 @@ class Index extends Component { } this.handleDeleteDeclare(selectedRowKeys); break; + case"5": + this.setState({ confirmationDialog: { ...confirmationDialog, visible: true } }); + break; default: break; } @@ -463,7 +469,7 @@ class Index extends Component { render() { const { selectedKey, showSearchAd, declareStatus, declareStatusList, taxCycle, declareEditDialog, loading, - pageInfo, adConditons, employmentTypeList, employmentStatusList, azOperate + pageInfo, adConditons, employmentTypeList, employmentStatusList, azOperate, confirmationDialog } = this.state; const { taxAgentStore: { showOperateBtn, isTaxDeclareAdmin }, employeeDeclareStore: { advanceForm: form, declareForm } @@ -474,6 +480,7 @@ class Index extends Component { {/*{getLabel(111, "批量编辑")}*/} {/*{getLabel(81272, "导出全部")}*/} {/*{getLabel(543715, "导出所选")}*/} + {getLabel(111, "扣除名单确认")} ); const buttons = [ @@ -492,7 +499,11 @@ class Index extends Component { loading={loading.refresh}>{getLabel(111, "刷新数据")},