diff --git a/pc4mobx/hrmSalary/apis/payrollFiles.js b/pc4mobx/hrmSalary/apis/payrollFiles.js index 74cf1d72..7ebdb6bb 100644 --- a/pc4mobx/hrmSalary/apis/payrollFiles.js +++ b/pc4mobx/hrmSalary/apis/payrollFiles.js @@ -65,3 +65,11 @@ export const deletePendingTodo = (params) => { export const deleteSuspendTodo = (params) => { return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSuspendTodo', params); } +// 待定薪、停薪员工 是否允许删除薪资档案 +export const salaryArchiveDelete = (params) => { + return WeaTools.callApi('/api/bs/hrmsalary/sys/conf/code?code=salaryArchiveDelete', 'GET', params); +} +// 删除薪资档案 +export const deleteSalaryArchive = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSalaryArchive', params); +} diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 7ff084ce..513f50b4 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -43,6 +43,10 @@ export const getEncryptProgress = params => { export const operateTaxDeclarationFunction = (params) => { return postFetch("/api/bs/hrmsalary/sys/operateTaxDeclarationFunction", params); }; +//保存档案删除规则 +export const saveArchiveDelete = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params); +}; //保存匹配规则 export const saveSalaryAcctEmployeeRule = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalaryAcctEmployeeRule", params); diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index 974ed260..a38f22ce 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -1,146 +1,150 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; import { postFetch } from "../util/request"; export const tips = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/tips', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/tips", "get", params); }; export const getCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params); }; //社保福利档案列表 export const queryList = (params) => { - return postFetch('/api/bs/hrmsalary/archives/getTable', params); + return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); }; //删除待办-待增员 export const updateRunStatus = (params) => { - return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params); + return postFetch("/api/bs/hrmsalary/archives/updateRunStatus", params); }; //删除待办-待减员 export const cancelStayDel = (params) => { - return postFetch('/api/bs/hrmsalary/archives/cancelStayDel', params); + return postFetch("/api/bs/hrmsalary/archives/cancelStayDel", params); }; //全量增员 export const allStayAddToPay = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/allStayAddToPay", "GET", params); }; //全量减员 export const allStayDelToStop = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayDelToStop', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/allStayDelToStop", "GET", params); }; //增员 export const stayAddToPay = (params) => { - return postFetch('/api/bs/hrmsalary/archives/stayAddToPay', params); + return postFetch("/api/bs/hrmsalary/archives/stayAddToPay", params); }; //减员 export const stayDelToStop = (params) => { - return postFetch('/api/bs/hrmsalary/archives/stayDelToStop', params); + return postFetch("/api/bs/hrmsalary/archives/stayDelToStop", params); +}; +//删除社保档案 +export const deleteArchive = (params) => { + return postFetch("/api/bs/hrmsalary/archives/deleteArchive", params); }; //取消停缴 export const cancelStopPayment = (params) => { - return postFetch('/api/bs/hrmsalary/archives/cancelStopPayment', params); + return postFetch("/api/bs/hrmsalary/archives/cancelStopPayment", params); }; export const getTable = params => { - return fetch('/api/bs/hrmsalary/archives/getTable', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/archives/getTable", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const getBaseForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getBaseForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getBaseForm", "get", params); }; export const getPaymentForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getPaymentForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getPaymentForm", "get", params); }; // 保存 export const save = params => { - return fetch('/api/bs/hrmsalary/archives/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/archives/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; // 导出档案 export const exportDocument = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/export', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/export", "get", params); }; // 导入档案 - 获取组件的一些前置参数 export const getImportDocumentParams = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getImportParams', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getImportParams", "get", params); }; // 导入档案- 导出现有数据 export const exportCurData = params => { - fetch('/api/bs/hrmsalary/scheme/template/export',{ - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.blob().then(blob => { - var filename=`社保福利档案模板.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) + fetch("/api/bs/hrmsalary/scheme/template/export", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.blob().then(blob => { + var filename = `社保福利档案模板.xlsx`; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })); }; // 导入档案-预览 export const previewCurData = (params) => { - return fetch('/api/bs/hrmsalary/scheme/preview', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/scheme/preview", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 档案导入 export const importBatch = (params) => { - return fetch('/api/bs/hrmsalary/scheme/importBatch', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/scheme/importBatch", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导出档案 export const exportArchives = (ids) => { - fetch('/api/bs/hrmsalary/scheme/export?ids=' + ids).then(res => res.blob().then(blob => { - var filename=`社保福利档案.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) -} + fetch("/api/bs/hrmsalary/scheme/export?ids=" + ids).then(res => res.blob().then(blob => { + var filename = `社保福利档案.xlsx`; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })); +}; diff --git a/pc4mobx/hrmSalary/components/UnifiedTable/index.js b/pc4mobx/hrmSalary/components/UnifiedTable/index.js index 8f406f4f..f8cbff97 100644 --- a/pc4mobx/hrmSalary/components/UnifiedTable/index.js +++ b/pc4mobx/hrmSalary/components/UnifiedTable/index.js @@ -13,7 +13,7 @@ class Index extends Component { return { ...item, fixed: "left", width: 176 }; } if (item.dataIndex === "operate") { - return { ...item, fixed: "right", width: "120px" }; + return { ...item, fixed: "right", width: item.width || "120px" }; } return { ...item, width: "33%" }; }); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index f094e5b0..0ad6737c 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -14,6 +14,7 @@ import { WeaFormItem, WeaHelpfulTip, WeaInput, + WeaLocaleProvider, WeaPopoverHrm, WeaSearchGroup, WeaSelect, @@ -32,6 +33,7 @@ import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide"; import ChangeSalaryModal from "../salaryFile/changeSalaryModal"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; const WeaTableComx = WeaTableNew.WeaTable; @inject("payrollFilesStore", "taxAgentStore", "salaryFileStore") @@ -83,7 +85,8 @@ class Index extends Component { paysetParams: { payStartDate: "", payEndDate: "" - } + }, + salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 }; } @@ -163,7 +166,7 @@ class Index extends Component { const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ dataIndex: it.dataIndex, - width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 120 : it.dataIndex === "taxAgentName" ? 176 : 150, + width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 150 : it.dataIndex === "taxAgentName" ? 176 : 150, title: it.title, align: "left", fixed: (idx === 0 || idx === 1 || idx === 2) ? "left" : it.dataIndex === "operate" ? "right" : "", ellipsis: true @@ -197,14 +200,16 @@ class Index extends Component { postMessageToChild = (payload) => { const childFrameObj = document.getElementById("atdTable"); const { dataSource, columns, showSum, pageInfo, showOperateBtn, selectedKey, selectedRowKeys } = payload; + const { salaryArchiveDelete } = this.state; childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, showSum, pageInfo, showOperateBtn, selectedKey, selectedRowKeys + dataSource, columns, showSum, pageInfo, showOperateBtn, selectedKey, selectedRowKeys, salaryArchiveDelete }), "*"); }; init = async () => { const { data: archiveStatusList } = await this.commonEnumList({ enumClass: "com.engine.salary.enums.salaryarchive.ArchiveStatusEnum" }); const { data: userStatusList } = await this.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }); + const { data: salaryArchiveDelete } = await this.salaryArchiveDelete(); this.setState({ archiveStatusList: [{ key: "", @@ -219,7 +224,8 @@ class Index extends Component { }, ..._.map(userStatusList, it => ({ key: String(it.value), showname: it.defaultLabel - }))] + }))], + salaryArchiveDelete }, () => this.getImportTypes()); }; @@ -290,6 +296,9 @@ class Index extends Component { commonEnumList = (params) => { return API.commonEnumList(params); }; + salaryArchiveDelete = () => { + return API.salaryArchiveDelete(); + }; getImportTypes = () => { API.getImportTypes().then(({ data, status }) => { if (status) { @@ -498,7 +507,7 @@ class Index extends Component { const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ dataIndex: it.dataIndex, - width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 120 : it.dataIndex === "taxAgentName" ? 176 : 150, + width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 150 : it.dataIndex === "taxAgentName" ? 176 : 150, title: it.title, align: "left", fixed: (idx === 0 || idx === 1 || idx === 2) ? "left" : it.dataIndex === "operate" ? "right" : "", ellipsis: true @@ -548,6 +557,21 @@ class Index extends Component { this.deleteSuspendTodo([id]); } else if (key === "view") { this.handleEdit(id); + } else if (key === "deleteAchives") { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + API.deleteSalaryArchive([id]).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功")); + this.query(); + } else { + message.error(errormsg || getLabel(30651, "操作失败")); + } + }); + } + }); } }; // 查看 Slide 头部操作按钮 diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 6f088528..2cc2f31b 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -25,7 +25,8 @@ export default class Index extends Component { rule: "", enctry: "", operateTaxDeclaration: "", - matchRule: "" + matchRule: "", + confValue: "0" }, showEncryptOperationButton: "", progressVisible: false, @@ -53,7 +54,8 @@ export default class Index extends Component { showEncryptOperationButton, isOpenEncrypt: enctry, isOpenTaxDeclaration: operateTaxDeclaration, - salaryAcctEmployeeRule: matchRule + salaryAcctEmployeeRule: matchRule, + salaryArchiveDelete: confValue } } = appSettings; this.setState({ @@ -61,7 +63,7 @@ export default class Index extends Component { showEncryptOperationButton, saveParams: { ...saveParams, - ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule + ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue } }); } @@ -197,6 +199,16 @@ export default class Index extends Component { } }); }; + saveArchiveDelete = () => { + API.saveArchiveDelete(_.pick(this.state.saveParams, ["confValue"])) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }; handleChange = (key, val) => { const { saveParams } = this.state; @@ -227,6 +239,9 @@ export default class Index extends Component { case "enctry": this.saveEncryptSetting(); break; + case "confValue": + this.saveArchiveDelete(); + break; default: break; } @@ -252,7 +267,7 @@ export default class Index extends Component { employeeOptions, showEncryptOperationButton } = this.state; - const { orderRule, ascOrDesc, rule, enctry, operateTaxDeclaration, matchRule } = saveParams; + const { orderRule, ascOrDesc, rule, enctry, operateTaxDeclaration, matchRule, confValue } = saveParams; return (
this.handleChange("operateTaxDeclaration", val)}/> + + + this.handleChange("confValue", val)}/> + + { + salaryArchiveDelete().then(({ status, data }) => { + if (status) { + this.setState({ + salaryArchiveDelete: data + }); + } + }); + }; handleEdit = (record) => { this.record = record; @@ -103,7 +116,7 @@ export default class Archives extends React.Component { }; getColumns = () => { - const { columns, pageInfo, selectedKey } = this.state; + const { columns, salaryArchiveDelete, selectedKey } = this.state; const { taxAgentStore: { showOperateBtn } } = this.props; let tmpV = _.map(columns.filter(item => item.display === "TRUE"), item => { return { @@ -118,31 +131,68 @@ export default class Archives extends React.Component { return tmpV.length > 0 ? [ ...tmpV, { title: "操作", + width: 150, dataIndex: "operate", render: (text, record) => { return (
this.handleEdit(record)}>{(showOperateBtn && selectedKey !== "stop") ? "编辑" : "查看"} + { + showOperateBtn && selectedKey === "pending" && + this.stayAddToPay([record.baseInfo])}>增员 + } + { + showOperateBtn && selectedKey === "suspend" && + this.stayDelToStop([record.baseInfo])}>减员 + } + { + showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" && + this.deleteSocialArchive([record.baseInfo])}>删除档案 + } + { + showOperateBtn && selectedKey === "stop" && salaryArchiveDelete !== "1" && + this.cancelStopPayment([record.baseInfo])}>取消停缴 + } { showOperateBtn && selectedKey === "pending" && { - if (key === "addMember") { - this.stayAddToPay([record.baseInfo]); - } else { - Modal.warning({ - title: "信息确认", - content: `确定要删除该条待办人员吗?`, - onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] }) - }); - } - }}> - 增员 - 删除待办 - } title=""> + content={ + salaryArchiveDelete === "1" ? + { + if (key === "deleteAchives") { + this.deleteSocialArchive([record.baseInfo]); + } else { + Modal.warning({ + title: "信息确认", + content: `确定要删除该条待办人员吗?`, + onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] }) + }); + } + }}> + 删除档案 + 删除待办 + : + { + if (key === "deleteAchives") { + this.deleteSocialArchive([record.baseInfo]); + } else { + Modal.warning({ + title: "信息确认", + content: `确定要删除该条待办人员吗?`, + onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] }) + }); + } + }}> + 删除待办 + + } title=""> } @@ -158,18 +208,15 @@ export default class Archives extends React.Component { content: `确定要删除该条待办人员吗?`, onOk: () => this.cancelStayDel({ runStatus: "3", ids: [record.baseInfo] }) }); - } else { - this.stayDelToStop([record.baseInfo]); } }}> - 减员 删除待办 } title=""> } { - showOperateBtn && selectedKey === "stop" && + showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" && { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + API.deleteArchive(params).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功")); + this.query(); + } else { + message.error(errormsg || getLabel(30651, "操作失败")); + } + }); + } + }); + }; //取消停缴 cancelStopPayment = (payload) => { API.cancelStopPayment(payload).then(({ status, errormsg }) => {