From b9efc6386e1f77ffe6c693c7e9f5746ff1fccd92 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 3 Jun 2025 17:22:18 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.19.1.2501.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 14 +- pc4mobx/hrmSalary/apis/declare.js | 4 + pc4mobx/hrmSalary/apis/payroll.js | 8 + pc4mobx/hrmSalary/apis/standingBook.js | 9 +- .../hrmSalary/pages/calculate/calculate.js | 79 +++++++- .../components/calculateDialog/condition.js | 85 ++++---- .../components/calculateDialog/index.js | 27 +-- .../components/calculateTablelist/index.js | 25 ++- pc4mobx/hrmSalary/pages/calculate/index.less | 45 +++++ .../components/declareDialog/condition.js | 1 + .../declare/components/declareDialog/index.js | 11 +- pc4mobx/hrmSalary/pages/declare/index.less | 43 +++++ .../components/grantTableList/index.js | 8 +- .../hrmSalary/pages/payrollRelease/index.js | 48 ++++- .../standingBook/columns.js | 1 + .../standingBook/components/accountDialog.js | 4 +- .../standingBook/components/index.less | 41 ++++ .../components/welfareRecordList.js | 8 +- .../standingBook/standingBook.js | 182 ++++++++++++------ 19 files changed, 490 insertions(+), 153 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 009a9bd8..6c7fc16a 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -10,6 +10,10 @@ export const getSalaryAcctList = params => { export const saveBasic = params => { return postFetch("/api/bs/hrmsalary/salaryacct/basic/save", params); }; +// 薪资记录--批量薪资核算 +export const batSaveBasic = params => { + return postFetch("/api/bs/hrmsalary/salaryacct/basic/batSave", params); +}; // 薪资记录--薪资核算详情 export const salaryacctGetForm = params => { @@ -120,6 +124,10 @@ export const fileSalaryAcct = (params) => { } }).then(res => res.json()); }; +// 薪资记录-批量归档 +export const batFile = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/batFile", params); +}; // 薪资记录-回算 export const backCalculate = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/backCalculate", params); @@ -129,6 +137,10 @@ export const backCalculate = (params) => { export const reAccounting = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/reAccounting", params); }; +// 薪资记录-批量重新核算 +export const batReAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/batReAccounting", params); +}; // 薪资结果-编辑表单保存 export const saveAcctResult = (params) => { @@ -219,7 +231,7 @@ export const exportComparisonResult = (salaryAcctRecordId) => { // 核算进度条 export const getCalculateProgress = (id = "", paymentOrganization = "") => { - const extra= paymentOrganization ? `_${paymentOrganization}` : paymentOrganization + const extra = paymentOrganization ? `_${paymentOrganization}` : paymentOrganization; return WeaTools.callApi(`/api/bs/hrmsalary/progress/getRate?cacheKey=ACCT_PROGRESS_${id}${extra}`, "get", {}); }; diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 2c37805d..bcfda5ca 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -10,6 +10,10 @@ export const getDeclareList = params => { export const saveDeclare = params => { return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params); }; +//个税申报表-个税申报表批量生成 +export const batSaveDeclare = params => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/batSave", params); +}; //个税申报表-个税申报表相关信息 export const getDeclareInfo = params => { diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index c322c94f..2d88f14e 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -25,11 +25,19 @@ export const getPaySa = params => { export const grantPayroll = params => { return postFetch("/api/bs/hrmsalary/salaryBill/send/grant", params); }; +//工资单-批量工资单发放 +export const batGrantPayroll = params => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/batGrant", params); +}; //工资单-工资单撤回 export const withdrawPayroll = params => { return postFetch("/api/bs/hrmsalary/salaryBill/send/withdraw", params); }; +//工资单-批量工资单撤回 +export const batWithdrawPayroll = params => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/batWithdraw", params); +}; //工资单-工资单发放详情列表 export const getPayrollDetailList = params => { diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 5182ea00..147e6e43 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -33,6 +33,10 @@ export const getChangeList = (params) => { export const save = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/save", params); }; +//社会福利台账-批量核算 +export const batSave = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/batSave", params); +}; //社会福利台账-归档 export const siaccountFile = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/file", params); @@ -75,7 +79,10 @@ export const commonAccount = (params) => { export const socialSecurityBenefitsRecalculate = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", params); }; - +// 社保福利台账批量重新核算 +export const batSocialSecurityBenefitsRecalculate = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/batSocialSecurityBenefitsRecalculate", params); +}; // 获取当前管理员下的所有的个税扣缴义务人 export const getAdminTaxAgentList = () => { diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index b23739b8..f723b931 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -8,14 +8,21 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; import { WeaForm } from "comsMobx"; -import { Button, message, Modal } from "antd"; +import { Button, Dropdown, Icon, Menu, message, Modal } from "antd"; import moment from "moment"; import CalculateQuery from "./components/calculateQuery"; import CalculateTablelist from "./components/calculateTablelist"; import CalculateDialog from "./components/calculateDialog"; import ProgressModal from "../../components/progressModal"; import LogDialog from "../../components/logViewModal"; -import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; +import { + backCalculate, + batFile, + batReAccounting, + deleteSalaryacct, + fileSalaryAcct, + reAccounting +} from "../../apis/calculate"; import FormInfo from "../../components/FormInfo"; import { queryConditions } from "./config"; import { getTaxAgentSelectList } from "../../apis/taxAgent"; @@ -38,7 +45,7 @@ class Calculate extends Component { moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM") ] - }, isRefresh: false, logDialogVisible: false, conditions: [], + }, isRefresh: false, logDialogVisible: false, conditions: [], selectedRowKeys: [], progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, calcDaialog: { visible: false, title: "" }, showAdvance: false }; @@ -63,7 +70,13 @@ class Calculate extends Component { renderCalculateOpts = () => { const { taxAgentStore: { showOperateBtn } } = this.props; - const { queryParams, isRefresh, showAdvance } = this.state; + const { queryParams, isRefresh, showAdvance, selectedRowKeys } = this.state; + const menu = ( + this.onDropMenuClick(key)}> + {getLabel(111, "批量删除")} + {getLabel(111, "批量重新核算")} + + ); let calculateOpts = [ , + + + , this.setState({ showAdvance: !showAdvance })} onChange={v => this.setState({ isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, queryParams: { ...queryParams, ...v } })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; - return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; + return !showOperateBtn ? calculateOpts.slice(2) : calculateOpts; }; handleCalcOpts = ({ key }, record) => { const { isRefresh, progressModule } = this.state, { id } = record; @@ -199,6 +217,48 @@ class Calculate extends Component { }; onDropMenuClick = (key, targetid = "") => { switch (key) { + case "batArchiving": + batFile({ ids: this.state.selectedRowKeys }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ isRefresh: !this.state.isRefresh }); + } else { + message.error(errormsg); + } + }); + break; + case "batReAcct": + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "重新核算后,选中的台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"), + onOk: () => { + batReAccounting({ salaryAcctRecordIds: this.state.selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.setState({ isRefresh: !this.state.isRefresh }); + } else { + message.error(errormsg); + } + }); + } + }); + break; + case "batDel": + Modal.confirm({ + title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + deleteSalaryacct(this.state.selectedRowKeys).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.setState({ selectedRowKeys: [], isRefresh: !this.state.isRefresh }); + } else { + message.error(errormsg); + } + }); + } + }); + break; case "log": this.setState({ logDialogVisible: true, @@ -212,7 +272,8 @@ class Calculate extends Component { render() { const { - queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance + queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance, + selectedRowKeys } = this.state; return ( } iconBgcolor="#F14A2D" @@ -237,13 +298,13 @@ class Calculate extends Component { + selectedRowKeys={selectedRowKeys} onCalcOpts={this.handleCalcOpts} + onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/> this.setState({ calcDaialog: { ...calcDaialog, visible: false }, isRefresh: bool === "refresh" ? !isRefresh : isRefresh - }, () => bool === "refresh" && window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`))} - /> + })}/> {/*操作日志*/} this.setState({ logDialogVisible: false })}/> diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js index be20527a..37e3e3c7 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js @@ -1,46 +1,39 @@ -export const calculateConditions = [ - { - items: [ - { - colSpan: 1, - conditionType: "MONTHPICKER", - domkey: ["salaryMonthStr"], - fieldcol: 14, - label: "薪资所属月", - lanId: 542604, - labelcol: 6, - value: "", - rules: "required|string", - viewAttr: 3 - }, - { - colSpan: 1, - conditionType: "SELECT", - domkey: ["salarySobId"], - fieldcol: 14, - label: "核算账套", - lanId: 519146, - labelcol: 6, - options: [], - otherParams: { - showSearch: true, optionFilterProp: "children" - }, - rules: "required|string", - viewAttr: 3 - }, - { - colSpan: 1, - conditionType: "INPUT", - domkey: ["description"], - fieldcol: 14, - label: "备注", - lanId: 536726, - labelcol: 6, - value: "", - viewAttr: 2 - } - ], - defaultshow: true, - title: "" - } -]; +export const calculateConditions = [{ + items: [{ + colSpan: 1, + conditionType: "MONTHPICKER", + domkey: ["salaryMonthStr"], + fieldcol: 14, + label: "薪资所属月", + lanId: 542604, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, { + colSpan: 1, + conditionType: "SELECT", + domkey: ["salarySobId"], + fieldcol: 14, + label: "核算账套", + lanId: 519146, + labelcol: 6, + options: [], + multiple: true, + otherParams: { + showSearch: true, optionFilterProp: "children" + }, + rules: "required|string", + viewAttr: 3 + }, { + colSpan: 1, + conditionType: "INPUT", + domkey: ["description"], + fieldcol: 14, + label: "备注", + lanId: 536726, + labelcol: 6, + value: "", + viewAttr: 2 + }], defaultshow: true, title: "" +}]; diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js index 5026322a..2c503e45 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js @@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; -import { salaryacctGetForm, saveBasic } from "../../../../apis/calculate"; +import { batSaveBasic, salaryacctGetForm } from "../../../../apis/calculate"; import { calculateConditions } from "./condition"; const getKey = WeaTools.getKey; @@ -56,17 +56,18 @@ class Index extends Component { const { calculateStore: { calculateForm } } = this.props; calculateForm.validateForm().then(f => { if (f.isValid) { - const payload = calculateForm.getFormParams(); + const { salarySobId, salaryMonthStr, ...payload } = calculateForm.getFormParams(); this.setState({ loading: true }); - saveBasic({ ...payload }).then(({ status, data, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success(getLabel(30700, "操作成功")); - this.props.onCancel("refresh", data); - } else { - message.error(errormsg); - } - }).catch(() => this.setState({ loading: false })); + batSaveBasic({ ...payload, salaryMonth: `${salaryMonthStr}-01`, salarySobIds: salarySobId.split(",") }) + .then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功")); + this.props.onCancel("refresh", data); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); } else { f.showErrors(); } @@ -78,9 +79,9 @@ class Index extends Component { const { calculateStore: { calculateForm } } = this.props; return ( {getLabel(543233, "保存并进入核算")} + ]} >
{getSearchs(calculateForm, conditions, 1, false)}
diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index 63ab2e87..78e385f2 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaHelpfulTip, WeaLocaleProvider, WeaTable } from "ecCom"; import { Dropdown, Menu, Tag } from "antd"; import { getSalaryAcctList } from "../../../../apis/calculate"; +import { calcPageNo } from "../../../../util"; const getLabel = WeaLocaleProvider.getLabel; @@ -25,7 +26,18 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.isRefresh !== this.props.isRefresh) this.getSalaryAcctList(nextProps); + if (nextProps.isRefresh !== this.props.isRefresh) { + const { selectedRowKeys } = nextProps; + const selectDelDataLen = _.isEmpty(selectedRowKeys) ? 1 : selectedRowKeys.length; + this.setState({ + pageInfo: { + ...this.state.pageInfo, + current: calcPageNo(this.state.pageInfo.total, this.state.pageInfo.current, 10, selectDelDataLen) + } + }, () => { + this.getSalaryAcctList(nextProps); + }); + } } getSalaryAcctList = (props) => { @@ -125,7 +137,10 @@ class Index extends Component { }; render() { - const { loading, dataSource, columns, pageInfo } = this.state; + const { loading, dataSource, columns, pageInfo } = this.state, { + selectedRowKeys, + onChangeSelectedRowKeys + } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -143,10 +158,14 @@ class Index extends Component { }, () => this.getSalaryAcctList(this.props)); } }; + const rowSelection = { + selectedRowKeys, + onChange: onChangeSelectedRowKeys + }; return ( ); diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 2e73f6b2..acd47a15 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -146,6 +146,49 @@ } } +.salary-acct-container { + .wea-form-item-wrapper { + display: inline-block !important; + + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + white-space: nowrap !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 426.16px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } + } +} + .calculate-dialog-layout { background: #f6f6f6; @@ -181,3 +224,5 @@ } } } + + diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js index d880c3f1..4051a5cb 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js @@ -22,6 +22,7 @@ export const declareConditions = [ lanId: 537996, labelcol: 6, options: [], + multiple: true, rules: "required|string", viewAttr: 3, }, diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js index 36ef34ea..b138a103 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js @@ -10,7 +10,7 @@ import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent"; -import { saveDeclare } from "../../../../apis/declare"; +import { batSaveDeclare } from "../../../../apis/declare"; import { declareConditions } from "./condition"; import * as API from "../../../../apis/ruleconfig"; @@ -63,10 +63,11 @@ class Index extends Component { const { declareStore: { declareForm } } = this.props; declareForm.validateForm().then(f => { if (f.isValid) { - const payload = declareForm.getFormParams(); + const { taxAgentId, ...payload } = declareForm.getFormParams(); this.setState({ loading: true }); - saveDeclare({ - ...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01` + batSaveDeclare({ + ...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01`, + taxAgentIds: taxAgentId.split(",") }).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { @@ -87,7 +88,7 @@ class Index extends Component { const { declareStore: { declareForm } } = this.props; return ( {getLabel(543618, "生成申报表")} ]} diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less index 01b8fd58..4e601dd4 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.less +++ b/pc4mobx/hrmSalary/pages/declare/index.less @@ -89,3 +89,46 @@ } } } + +.salary-declare-container { + .wea-form-item-wrapper { + display: inline-block !important; + + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + white-space: nowrap !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 426.16px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js index 64e91b27..37db1cd7 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js @@ -100,7 +100,7 @@ class Index extends Component { render() { const { loading, dataSource, columns, pageInfo } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { showOperateBtn }, selectedRowKeys, onChangeSelectedRowKeys } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -118,10 +118,14 @@ class Index extends Component { }, () => this.getPayrollList(this.props)); } }; + const rowSelection = { + selectedRowKeys, + onChange: onChangeSelectedRowKeys + }; return ( { const { taxAgentStore: { showOperateBtn } } = this.props; const { selectedKey, isRefresh, queryParams } = this.state; + const menu = ( + this.onDropMenuClick(key)}> + {getLabel(111, "全部撤回")} + + ); let reqBtns = []; switch (selectedKey) { case "grant": reqBtns = [ + + + , this.setState({ isRefresh: !isRefresh, queryParams: { ...queryParams, ...v } })}/> ]; + !showOperateBtn && reqBtns.slice(1); break; case "template": const loading = this.templateRef ? this.templateRef.wrappedInstance.state.delLoading : false; @@ -85,16 +99,16 @@ class Index extends Component { return reqBtns; }; renderContent = () => { - const { selectedKey, queryParams, isRefresh } = this.state; + const { selectedKey, queryParams, isRefresh, selectedRowKeys } = this.state; let dom = null; switch (selectedKey) { case "grant": - dom = this.setState({ selectedKey: "template" }, () => { this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, { id }); })} - onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} - />; + onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })} + onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>; break; case "template": dom = this.templateRef = dom} queryParams={queryParams} @@ -114,6 +128,28 @@ class Index extends Component { }; onDropMenuClick = (key, targetid = "") => { switch (key) { + case "batDistributed": + API.batGrantPayroll({ ids: [], salarySendIds: this.state.selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ isRefresh: !this.state.isRefresh }); + } else { + message.error(errormsg); + } + }); + break; + case "batWithdrawn": + API.batWithdrawPayroll({ ids: [], salarySendIds: this.state.selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ isRefresh: !this.state.isRefresh }); + } else { + message.error(errormsg); + } + }); + break; case "log": this.setState({ logDialogVisible: true, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js index bc9c1816..c42f0ec4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js @@ -22,6 +22,7 @@ export const socialAccountConditions = [ lanId: 537996, labelcol: 6, options: [], + multiple: true, rules: "required|string", viewAttr: 3 }, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js index fd21aba3..1e7e2807 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js @@ -64,9 +64,7 @@ class Accountdialog extends Component { style={{ width: 520, height: 156 }} initLoadCss className="accountDialogWrapper" buttons={[ - + ]}> {getSearchs(accountForm, conditions, 1, false)} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less index 2567a013..c922e696 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less @@ -33,6 +33,47 @@ border: 1px solid #e5e5e5; border-bottom: none; + .wea-form-item-wrapper { + display: inline-block !important; + + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + white-space: nowrap !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 426.16px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } + } + .wea-form-item { padding: 5px 16px; border-bottom: 1px solid #e5e5e5; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js index 27409fb5..7c8221a0 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js @@ -47,6 +47,10 @@ class WelfareRecordList extends Component { case "PAGEINFO": this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList()); break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.props.onChangeSelectedRowKeys(selectedRowKeys); + break; case "CALC": case "VIEW": const payload = { @@ -126,7 +130,7 @@ class WelfareRecordList extends Component { childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getWelfareRecordList = () => { - const { queryForm, taxAgentStore: { showOperateBtn } } = this.props; + const { queryForm, taxAgentStore: { showOperateBtn }, selectedRowKeys } = this.props; const { pageInfo } = this.state; const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] }; this.setState({ loading: true }); @@ -139,7 +143,7 @@ class WelfareRecordList extends Component { pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns }, () => this.postMessageToChild({ - scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn, + scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn, selectedRowKeys, unitTableType: "welfareRecord" })); } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js index 211cb97e..4eb49fd2 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js @@ -8,14 +8,12 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTop } from "ecCom"; -import { Button, message } from "antd"; +import { Button, Dropdown, Icon, Menu, message, Modal } from "antd"; import * as API from "../../../apis/standingBook"; -import { getCalculateProgress } from "../../../apis/calculate"; import WelfareRecordQuery from "./components/welfareRecordQuery"; import WelfareRecordList from "./components/welfareRecordList"; import Accountdialog from "./components/accountDialog"; import ProgressModal from "../../../components/progressModal"; -import { convertToUrlString } from "../../../util/url"; import LogDialog from "../../../components/logViewModal"; import moment from "moment"; import "./index.less"; @@ -32,7 +30,7 @@ class StandingBook extends Component { startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), endTime: moment(new Date()).endOf("year").format("YYYY-MM"), taxAgents: "" - }, progressVisible: false, progress: 0, + }, progressVisible: false, progress: 0, selectedRowKeys: [], accountDialog: { visible: false, title: "", loading: false, options: [] }, logDialogVisible: false, filterConditions: "[]" }; @@ -47,66 +45,112 @@ class StandingBook extends Component { * Date: 2024/1/23 */ handleAccount = async (formVal) => { - const { billMonth, ...extra } = formVal; + const { billMonth, paymentOrganization, ...extra } = formVal; const payload = { billMonth: moment(billMonth).format("YYYY-MM"), + paymentOrganizations: paymentOrganization.split(","), ...extra }; this.setState({ accountDialog: { ...this.state.accountDialog, loading: true } }); - const { data: creator, status, errormsg } = await API.save(payload); - if (status) { - this.setState({ - accountDialog: { ...this.state.accountDialog, loading: false }, - progressVisible: true - }, () => { - this.timer = setInterval(() => { - getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization) - .then(({ status, data }) => { - if (status) { - if (!data.status) { - clearInterval(this.timer); - this.setState({ progressVisible: false, progress: 0 }); - message.error(data.message); - return; - } - if (this.state.progress !== 100) { - this.setState({ - progress: (Number(data.progress).toFixed(2)) * 100 - }); - } else { - clearInterval(this.timer); - this.setState({ progressVisible: false, progress: 0 }, () => { - message.success(getLabel(543232, "核算成功")); - this.setState({ - accountDialog: { ...this.state.accountDialog, visible: false } - }, () => { - this.wfListRef.wrappedInstance.getWelfareRecordList(); - const calcPayload = { ...payload, creator }; - window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`); - }); - }); - } - } else { - clearInterval(this.timer); - this.setState({ progressVisible: false, progress: 0 }); - } - }).catch(() => { - clearInterval(this.timer); - this.setState({ progressVisible: false, progress: 0 }); - }); - }, 600); - }); - } else { - message.error(errormsg); - clearInterval(this.timer); - this.setState({ - accountDialog: { ...this.state.accountDialog, loading: false }, - progressVisible: false, progress: 0 - }); - } + API.batSave(payload).then(({ status, errormsg }) => { + this.setState({ accountDialog: { ...this.state.accountDialog, loading: false } }); + if (status) { + message.success(getLabel(543232, "核算成功")); + this.setState({ + accountDialog: { ...this.state.accountDialog, visible: false } + }, () => { + this.wfListRef.wrappedInstance.getWelfareRecordList(); + }); + } else { + message.error(errormsg); + } + }); + // const { data: creator, status, errormsg } = await API.save(payload); + // if (status) { + // this.setState({ + // accountDialog: { ...this.state.accountDialog, loading: false }, + // progressVisible: true + // }, () => { + // this.timer = setInterval(() => { + // getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization) + // .then(({ status, data }) => { + // if (status) { + // if (!data.status) { + // clearInterval(this.timer); + // this.setState({ progressVisible: false, progress: 0 }); + // message.error(data.message); + // return; + // } + // if (this.state.progress !== 100) { + // this.setState({ + // progress: (Number(data.progress).toFixed(2)) * 100 + // }); + // } else { + // clearInterval(this.timer); + // this.setState({ progressVisible: false, progress: 0 }, () => { + // message.success(getLabel(543232, "核算成功")); + // this.setState({ + // accountDialog: { ...this.state.accountDialog, visible: false } + // }, () => { + // this.wfListRef.wrappedInstance.getWelfareRecordList(); + // const calcPayload = { ...payload, creator }; + // window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`); + // }); + // }); + // } + // } else { + // clearInterval(this.timer); + // this.setState({ progressVisible: false, progress: 0 }); + // } + // }).catch(() => { + // clearInterval(this.timer); + // this.setState({ progressVisible: false, progress: 0 }); + // }); + // }, 600); + // }); + // } else { + // message.error(errormsg); + // clearInterval(this.timer); + // this.setState({ + // accountDialog: { ...this.state.accountDialog, loading: false }, + // progressVisible: false, progress: 0 + // }); + // } }; onDropMenuClick = (key, targetid = "") => { switch (key) { + case "batReAcct": + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "重新核算后,选中的台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"), + onOk: () => { + API.batSocialSecurityBenefitsRecalculate({ ids: this.state.selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.wfListRef.wrappedInstance.getWelfareRecordList(); + } else { + message.error(errormsg); + } + }); + } + }); + break; + case "batDel": + Modal.confirm({ + title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + // API.siaccountDelete(module).then(({ status, errormsg }) => { + // if (status) { + // message.success(getLabel(502230, "删除成功")); + // this.wfListRef.wrappedInstance.getWelfareRecordList(); + // } else { + // message.error(errormsg); + // } + // }); + } + }); + break; case "log": this.setState({ logDialogVisible: true, @@ -119,11 +163,24 @@ class StandingBook extends Component { }; render() { - const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state; + const { accountDialog, queryForm, logDialogVisible, filterConditions, selectedRowKeys } = this.state; const { taxAgentStore: { showOperateBtn } } = this.props; - const rightBtns = []; + const menu = ( + this.onDropMenuClick(key)}> + {getLabel(111, "批量删除")} + {getLabel(111, "批量重新核算")} + + ); + const rightBtns = [ + , + + + + ]; return (} iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record" showDropIcon onDropMenuClick={this.onDropMenuClick} @@ -142,8 +199,9 @@ class StandingBook extends Component { }} onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })} /> - this.wfListRef = dom} queryForm={queryForm} - onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/> + this.wfListRef = dom} queryForm={queryForm} selectedRowKeys={selectedRowKeys} + onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} + onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/> this.setState({