diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index 5c1a1b48..974ed260 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -17,10 +17,14 @@ export const queryList = (params) => { export const queryInsuranceTabTotal = (params) => { return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params); }; -//删除待办 +//删除待办-待增员 export const updateRunStatus = (params) => { return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params); }; +//删除待办-待减员 +export const cancelStayDel = (params) => { + return postFetch('/api/bs/hrmsalary/archives/cancelStayDel', params); +}; //全量增员 export const allStayAddToPay = (params) => { return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', params); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index d574bacb..7f451cbf 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -174,17 +174,17 @@ export default class Archives extends React.Component { placement="bottomRight" content={ { if (key === "stopSalary") { - Modal.warning({ + Modal.confirm({ title: "信息确认", content: `确定要删除该条待办人员吗?`, - onOk: () => this.deleteTodoList({ runStatus: "5", ids: [record.baseInfo] }) + onOk: () => this.cancelStayDel({ runStatus: "3", ids: [record.baseInfo] }) }); } else { this.stayDelToStop([record.baseInfo]); } }}> 减员 - {/*删除待办*/} + 删除待办 } title=""> @@ -401,6 +401,8 @@ export default class Archives extends React.Component { case "suspend": if (key === "1") { this.stayDelToStop(selectedRowKeys); + } else if (key === "2") { + this.cancelStayDel({ runStatus: "3", ids: selectedRowKeys }); } break; default: @@ -454,7 +456,7 @@ export default class Archives extends React.Component { } }); }; - //删除待办 + //删除待办-待增员 deleteTodoList = (payload) => { API.updateRunStatus(payload).then(({ status, errormsg }) => { if (status) { @@ -466,6 +468,18 @@ export default class Archives extends React.Component { } }); }; + //删除待办-待减员 + cancelStayDel = (payload) => { + API.cancelStayDel(payload).then(({ status, errormsg }) => { + if (status) { + message.success("操作成功"); + this.query(); + this.onSelectChange([]); + } else { + message.error(errormsg || "操作失败"); + } + }); + }; getTipChildren = () => { const { selectedKey } = this.state; @@ -649,6 +663,7 @@ export default class Archives extends React.Component { overlay={ 批量减员 + 批量删除待办 } type="primary" diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index d8cb4cf3..baf15d91 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -9,6 +9,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable"; import moment from "moment"; import _ from "lodash"; import ProgressModal from "../../../components/progressModal"; +import { getCalculateProgress } from "../../../apis/calculate"; import "./index.less"; const MonthPicker = DatePicker.MonthPicker; @@ -318,39 +319,54 @@ export default class StandingBook extends React.Component { break; } }; - handleOk = (formVal) => { + handleOk = async (formVal) => { const { save } = this.props.standingBookStore; const { billMonth, ...extra } = formVal; const payload = { billMonth: moment(billMonth).format("YYYY-MM"), ...extra }; - save(payload).then(({ data }) => { - this.setState({ - progressVisible: true - }, () => { - this.timer = setInterval(() => { - if (this.state.progress !== 100) { - this.setState({ - progress: this.state.progress + 10 - }); + const { data: saveData } = await save(payload); + this.setState({ + progressVisible: true + }, () => { + this.timer = setInterval(() => { + getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => { + if (status) { + 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("核算成功"); + this.handleClose(); + this.getCommonList({ + ...this.state.tableParams, + current: this.state.current + }); + this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", saveData); + }); + } } else { clearInterval(this.timer); this.setState({ progressVisible: false, progress: 0 - }, () => { - message.success("核算成功"); - this.handleClose(); - this.getCommonList({ - ...this.state.tableParams, - current: this.state.current - }); - this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", data); }); } - }, 1000); - }); + }).catch(() => { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + }); + }); + }, 600); }); }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index c3f0ab99..84b963f0 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -37,6 +37,14 @@ margin-right: 0px; } } + + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } //退差 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 5892b500..aab96473 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -14,8 +14,10 @@ import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal"; import AdjustmentSlide from "./adjustmentSlide"; +import { getCalculateProgress } from "../../../../apis/calculate"; import _ from "lodash"; import "./index.less"; +import RegEditDetial from "./regEditDetial"; @inject("standingBookStore") @observer @@ -46,6 +48,11 @@ export default class NormalIndex extends Component { fieldData: {}, //选中的表单头信息 importParams: { //导入信息的弹框表示 visible: false + }, + returnEditPersonSlide: { + title: "", + editId: "", + visible: false } }; this.timer = null; @@ -192,7 +199,6 @@ export default class NormalIndex extends Component { ...it, width: 150, fixed: "left", - render: (text, r) => { const { userName, employeeId } = r; return ( @@ -362,40 +368,52 @@ export default class NormalIndex extends Component { handleCommonAccountClick() { const { billMonth, selectedKey, paymentOrganization } = this.props; const { commonAccount } = this.props.standingBookStore; - commonAccount({ - billMonth, - paymentOrganization, - includes: [] - }).then(() => { - this.setState({ - progressVisible: true - }, () => { - this.timer = setInterval(() => { - if (this.state.progress !== 100) { - this.setState({ - progress: this.state.progress + 10 - }); + commonAccount({ billMonth, paymentOrganization, includes: [] }); + this.setState({ + progressVisible: true + }, () => { + this.timer = setInterval(() => { + getCalculateProgress(billMonth).then(({ status, data }) => { + if (status) { + 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("核算成功"); + selectedKey === "1" + ? this.getNormalList({ + billMonth, + paymentOrganization, + current: this.state.current + }) + : this.getSupplementaryList({ + billMonth, + paymentOrganization, + current: this.state.current + }); + }); + } } else { clearInterval(this.timer); - message.success("核算成功"); this.setState({ progressVisible: false, progress: 0 }); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current: this.state.current - }); } - }, 1000); - }); + }).catch(() => { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + }); + }); + }, 600); }); } @@ -410,15 +428,25 @@ export default class NormalIndex extends Component { window.open(url, "_self"); }; + handleEditNormalStandingBook = (record) => { + const { userName, id: editId } = record; + const { returnEditPersonSlide } = this.state; + this.setState({ + returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId } + }); + }; + handleCloseNormalStandingBookModal = () => { + const { returnPersonModal, returnEditPersonSlide } = this.state; + this.setState({ + returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } + }, () => { + }); + }; + render() { const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys, addProps, adjustSlide, importParams } = this.state; - const { - loading, - form, - condition, - saveLoading - } = this.props.standingBookStore; + const { selectedRowKeys, addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state; + const { loading, form, condition, saveLoading } = this.props.standingBookStore; let { list, columns, total } = this.state.tableData; const rowSelection = { selectedRowKeys, @@ -457,9 +485,43 @@ export default class NormalIndex extends Component { }); } }; + columns = _.map(toJS(columns), item => { + if (item.dataIndex === "employeeId") { + return { ...item }; + } + return { + ...item, + render: (text) => { + return {text}; + } + }; + }); + if (selectedKey === "3") { + columns = [ + ...columns, + { + title: "操作", + dataIndex: "operate", + fixed: "right", + width: "120px", + render: (text, record) => { + return ( +
+ this.handleEditNormalStandingBook(record)} + >编辑 +
+ ); + } + } + ]; + } return (
- {selectedKey === "1" && + { + selectedKey === "1" &&
@@ -478,7 +540,8 @@ export default class NormalIndex extends Component { {remarks}
-
} +
+ }
{this.props.type !== "detail" && this.props.selectedKey == "3" ? @@ -624,6 +687,8 @@ export default class NormalIndex extends Component { scroll={{ x: 1200, y: "calc(100vh - 233px)" }} /> + {/*编辑弹框*/} + {