Merge branch 'feature/230701-维护工具-删除档案' into release/2.8.3.2307.01
# Conflicts: # pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
This commit is contained in:
commit
54d23aeb57
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@ 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 saveWithDrawTaxDeclaration = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params);
|
||||
};
|
||||
//保存匹配规则
|
||||
export const saveSalaryAcctEmployeeRule = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/sys/saveSalaryAcctEmployeeRule", params);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 头部操作按钮
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ export default class Index extends Component {
|
|||
rule: "",
|
||||
enctry: "",
|
||||
operateTaxDeclaration: "",
|
||||
matchRule: ""
|
||||
matchRule: "",
|
||||
confValue: "0",
|
||||
withDrawTaxDeclaration: "0"
|
||||
},
|
||||
showEncryptOperationButton: "",
|
||||
progressVisible: false,
|
||||
|
|
@ -53,7 +55,8 @@ export default class Index extends Component {
|
|||
showEncryptOperationButton,
|
||||
isOpenEncrypt: enctry,
|
||||
isOpenTaxDeclaration: operateTaxDeclaration,
|
||||
salaryAcctEmployeeRule: matchRule
|
||||
salaryAcctEmployeeRule: matchRule,
|
||||
salaryArchiveDelete: confValue, withDrawTaxDeclaration
|
||||
}
|
||||
} = appSettings;
|
||||
this.setState({
|
||||
|
|
@ -61,7 +64,7 @@ export default class Index extends Component {
|
|||
showEncryptOperationButton,
|
||||
saveParams: {
|
||||
...saveParams,
|
||||
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule
|
||||
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -197,6 +200,26 @@ 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, "保存失败!"));
|
||||
}
|
||||
});
|
||||
};
|
||||
withDrawTaxDeclaration = () => {
|
||||
API.saveWithDrawTaxDeclaration({ confValue: _.pick(this.state.saveParams, ["withDrawTaxDeclaration"]).withDrawTaxDeclaration })
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(22619, "保存成功!"));
|
||||
} else {
|
||||
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleChange = (key, val) => {
|
||||
const { saveParams } = this.state;
|
||||
|
|
@ -227,6 +250,12 @@ export default class Index extends Component {
|
|||
case "enctry":
|
||||
this.saveEncryptSetting();
|
||||
break;
|
||||
case "confValue":
|
||||
this.saveArchiveDelete();
|
||||
break;
|
||||
case "withDrawTaxDeclaration":
|
||||
this.withDrawTaxDeclaration();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -252,7 +281,16 @@ 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,
|
||||
withDrawTaxDeclaration
|
||||
} = saveParams;
|
||||
return (
|
||||
<div className="ruleWrapper">
|
||||
<WeaTop
|
||||
|
|
@ -295,6 +333,16 @@ export default class Index extends Component {
|
|||
<WeaCheckbox display="switch" value={operateTaxDeclaration}
|
||||
onChange={val => this.handleChange("operateTaxDeclaration", val)}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label={getLabel(111, "允许个税申报撤回")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaCheckbox display="switch" value={withDrawTaxDeclaration}
|
||||
onChange={val => this.handleChange("withDrawTaxDeclaration", val)}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
<WeaSearchGroup title={getLabel(111, "档案删除规则")} showGroup center>
|
||||
<WeaFormItem label={getLabel(111, "允许删除档案")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaCheckbox display="switch" value={confValue}
|
||||
onChange={val => this.handleChange("confValue", val)}/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
<WeaSearchGroup title={getLabel(111, "薪资核算人员匹配规则")} showGroup center>
|
||||
<WeaFormItem label={getLabel(111, "匹配规则")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
|
||||
import { WeaHelpfulTip, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { getSearchs, renderLoading } from "../../../util";
|
||||
import BaseForm from "./baseForm";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
|
|
@ -14,8 +14,10 @@ import * as API from "../../../apis/welfareArchive";
|
|||
import ImportModal from "../../../components/importModal";
|
||||
import TipLabel from "../../../components/TipLabel";
|
||||
import UnifiedTable from "../../../components/UnifiedTable";
|
||||
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@inject("archivesStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class Archives extends React.Component {
|
||||
|
|
@ -49,7 +51,8 @@ export default class Archives extends React.Component {
|
|||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是
|
||||
};
|
||||
this.record = {};
|
||||
}
|
||||
|
|
@ -57,6 +60,7 @@ export default class Archives extends React.Component {
|
|||
componentDidMount() {
|
||||
const { archivesStore: { doInit } } = this.props;
|
||||
doInit();
|
||||
this.salaryArchiveDelete();
|
||||
this.queryList({ runStatuses: ["1"] });
|
||||
}
|
||||
|
||||
|
|
@ -92,6 +96,15 @@ export default class Archives extends React.Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
salaryArchiveDelete = () => {
|
||||
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, 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 (
|
||||
<div className="optWrapper">
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => this.handleEdit(record)}>{(showOperateBtn && selectedKey !== "stop") ? "编辑" : "查看"}</a>
|
||||
{
|
||||
showOperateBtn && selectedKey === "pending" &&
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => this.stayAddToPay([record.baseInfo])}>增员</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn && selectedKey === "suspend" &&
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => this.stayDelToStop([record.baseInfo])}>减员</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" &&
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => this.deleteSocialArchive([record.baseInfo])}>删除档案</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn && selectedKey === "stop" && salaryArchiveDelete !== "1" &&
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.cancelStopPayment([record.baseInfo])}>取消停缴</a>
|
||||
}
|
||||
{
|
||||
showOperateBtn && selectedKey === "pending" &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={({ key }) => {
|
||||
if (key === "addMember") {
|
||||
this.stayAddToPay([record.baseInfo]);
|
||||
} else {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: `确定要删除该条待办人员吗?`,
|
||||
onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] })
|
||||
});
|
||||
}
|
||||
}}>
|
||||
<Menu.Item key="addMember">增员</Menu.Item>
|
||||
<Menu.Item key="stopSalary">删除待办</Menu.Item>
|
||||
</Menu>} title="">
|
||||
content={
|
||||
salaryArchiveDelete === "1" ?
|
||||
<Menu onClick={({ key }) => {
|
||||
if (key === "deleteAchives") {
|
||||
this.deleteSocialArchive([record.baseInfo]);
|
||||
} else {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: `确定要删除该条待办人员吗?`,
|
||||
onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] })
|
||||
});
|
||||
}
|
||||
}}>
|
||||
<Menu.Item key="deleteAchives">删除档案</Menu.Item>
|
||||
<Menu.Item key="stopSalary">删除待办</Menu.Item>
|
||||
</Menu> :
|
||||
<Menu onClick={({ key }) => {
|
||||
if (key === "deleteAchives") {
|
||||
this.deleteSocialArchive([record.baseInfo]);
|
||||
} else {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: `确定要删除该条待办人员吗?`,
|
||||
onOk: () => this.deleteTodoList({ runStatus: "4", ids: [record.baseInfo] })
|
||||
});
|
||||
}
|
||||
}}>
|
||||
<Menu.Item key="stopSalary">删除待办</Menu.Item>
|
||||
</Menu>
|
||||
} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
|
|
@ -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]);
|
||||
}
|
||||
}}>
|
||||
<Menu.Item key="stayDelToStop">减员</Menu.Item>
|
||||
<Menu.Item key="stopSalary">删除待办</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
{
|
||||
showOperateBtn && selectedKey === "stop" &&
|
||||
showOperateBtn && selectedKey === "stop" && salaryArchiveDelete === "1" &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
|
|
@ -427,7 +474,23 @@ export default class Archives extends React.Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
//删除社保档案
|
||||
deleteSocialArchive = (params) => {
|
||||
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 }) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue