diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index f6bc7cb4..1b99a609 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -13,7 +13,9 @@ import * as API from "../../../../../apis/welfareArchive"; const getLabel = WeaLocaleProvider.getLabel; const APILIST = { runStatuses: API.queryList, - ext: API.getExtTable + ext: API.getExtTable, + delToDo: API.updateRunStatus, //删除待办 + addToPay: API.stayAddToPay //增员 }; @inject("archivesStore") @@ -59,7 +61,7 @@ class Index extends Component { if (type === "init") { this.getWelfareList(this.props); } else if (type === "turn") { - const { record: { baseInfo } = {} } = params; + const { record: { baseInfo } = {}, interfaceParams = {} } = params; switch (id) { case "PAGEINFO": this.setState({ @@ -70,8 +72,10 @@ class Index extends Component { const { selectedRowKeys } = params; this.setState({ selectedRowKeys }); break; - case "INCREASE": - this.welfareStayAddToPay([baseInfo]); + case "ADD-TO-PAY": + case "DEL-TO-DO": + const module = id === "ADD-TO-PAY" ? [baseInfo] : { ids: [baseInfo], ...interfaceParams }; + this.handleWelfareOpts(_.camelCase(id), module); break; default: break; @@ -115,17 +119,24 @@ class Index extends Component { } }).catch(() => this.setState({ loading: false })); }; - stayAddToPay = () => { + /* + * Author: 黎永顺 + * Description:批量操作 + * Params: + * Date: 2023/11/3 + */ + handleBatchOpt = (type, payload) => { const { selectedRowKeys } = this.state; if (_.isEmpty(selectedRowKeys)) { message.warning(getLabel(543303, "请选择表格数据")); return; } - this.welfareStayAddToPay(selectedRowKeys); + const params = _.isNil(payload) ? selectedRowKeys : { ids: selectedRowKeys, ...payload }; + this.handleWelfareOpts(type, params); }; - welfareStayAddToPay = (payload) => { + handleWelfareOpts = (type, payload) => { WeaLoadingGlobal.start(); - API.stayAddToPay(payload).then(({ status, data, errormsg }) => { + APILIST[type](payload).then(({ status, data = {}, errormsg }) => { WeaLoadingGlobal.destroy(); if (status) { const { msg, type } = data; @@ -134,6 +145,11 @@ class Index extends Component { } else if (type === "success") { message.success(msg); this.getWelfareList(this.props); + this.setState({ selectedRowKeys: [] }); + } else { + message.success(getLabel(30700, "操作成功!")); + this.getWelfareList(this.props); + this.setState({ selectedRowKeys: [] }); } } else { message.error(errormsg); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js index 9fc3bf4d..ed657c4f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js @@ -4,6 +4,20 @@ import { Button } from "antd"; import AdvanceInputBtn from "./components/advanceInputBtn"; import { CancelHelpfulDiv, HelpfulDiv } from "./components/welfareTip"; +export const optTypeEnum = [ //批量操作列表 + //批量增员 + { + key: "batchStaffIncrease", + type: "addToPay", + payload: null + }, + // 批量删除待办 + { + key: "batchDeleteTodolist", + type: "delToDo", + payload: { runStatus: "4" } + } +]; export const tabList = [ { viewcondition: "1", lanId: 542711, title: "待增员", showcount: true, groupid: "stayAdd" }, { viewcondition: "2,3", lanId: 542504, title: "在缴员工", showcount: true, groupid: "paying" }, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js index 26446c25..88e15b41 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js @@ -12,7 +12,7 @@ import WelfareAdvanceSearchPannel from "./components/welfareAdvanceSearchPannel" import WelfareTableList from "./components/welfareTableList"; import WelfareTip from "./components/welfareTip"; import * as API from "../../../apis/welfareArchive"; -import { renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config"; +import { optTypeEnum, renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config"; import cs from "classnames"; import "./index.less"; @@ -48,7 +48,10 @@ class Index extends Component { this.allStayAddToPay(); break; case "batchStaffIncrease": - this.welfareListRef.wrappedInstance.stayAddToPay(); + case "batchDeleteTodolist": + const type = _.find(optTypeEnum, o => o.key === key).type; + const payload = _.find(optTypeEnum, o => o.key === key).payload; + this.welfareListRef.wrappedInstance.handleBatchOpt(type, payload); break; default: break;