diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 4c9e41a7..e9a77f3b 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //社会福利台账-获取正常缴纳列表 export const getCommonList = (params) => { @@ -7,9 +8,9 @@ export const getCommonList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -25,9 +26,9 @@ export const getNormalList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-获取补缴列表 @@ -36,9 +37,9 @@ export const getSupplementaryList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -48,9 +49,9 @@ export const getOverViewList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -60,9 +61,9 @@ export const getChangeList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-保存并进入核算 @@ -71,9 +72,9 @@ export const save = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-归档 @@ -82,9 +83,9 @@ export const siaccountFile = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-核算异常列表 @@ -93,9 +94,9 @@ export const inspectList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-删除正常缴纳人员 @@ -104,9 +105,9 @@ export const siaccountCommonDelete = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-添加正常缴纳人员 @@ -115,9 +116,9 @@ export const siaccountCommonSave = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-添加补缴人员 @@ -126,9 +127,9 @@ export const siaccountSupplementarySave = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-删除月份表单 @@ -137,9 +138,9 @@ export const siaccountDelete = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-正常缴纳添加缴纳人员表单 @@ -165,9 +166,9 @@ export const commonAccount = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -177,9 +178,9 @@ export const socialSecurityBenefitsRecalculate = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -191,7 +192,7 @@ export const getAdminTaxAgentList = () => { "get", {} ); -} +}; // 表单字段对应的接口 export const getWelfareList = () => { @@ -200,7 +201,7 @@ export const getWelfareList = () => { "get", {} ); -} +}; // 社保福利台账-导入预览 export const welfarePreview = (params) => { @@ -208,11 +209,11 @@ export const welfarePreview = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; // 社保福利台账-核算数据导入 export const importInsuranceAcctDetail = (params) => { @@ -220,11 +221,11 @@ export const importInsuranceAcctDetail = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; // 社保福利台账-线下对比数据导入 export const importExcelInsuranceDetail = (params) => { @@ -232,8 +233,35 @@ export const importExcelInsuranceDetail = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; + +//获取当前登录人所控制的人员范围 +export const getEmployeeListByTaxAgent = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListByTaxAgent", params); +}; +//新增退差数据 +export const saveRecession = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/saveRecession", params); +}; +//查询退差列表 +export const recessionList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); +}; +//删除退差数据 +export const delRecession = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); +}; +//获取核算项个人和公司社保福利缴纳详情 +export const getPaymentById = ({ id }) => { + return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index b57b8860..f241aca8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -36,17 +36,17 @@ class AddItems extends Component { taxAgentId: nextProps.editId.taxAgentId, taxAgentName: nextProps.editId.taxAgentName, employeeId: nextProps.editId.employeeId, - employeeName: nextProps.editId.username, + employeeName: nextProps.editId.username } }); - const fields= _.map(nextProps.condition[0].items, it =>{ - return it.domkey[0] - }) + const fields = _.map(nextProps.condition[0].items, it => { + return it.domkey[0]; + }); fields.map(item => { nextProps.form.updateFields({ - [item]: nextProps.editId[item] || '' - }) - }) + [item]: nextProps.editId[item] || "" + }); + }); } } @@ -84,7 +84,7 @@ class AddItems extends Component { viewAttr: _.isEmpty(editId) ? 3 : 1, value: baseInfo.employeeId, valueSpan: baseInfo.employeeName, - onChange: ({ids, names}) => { + onChange: ({ ids, names }) => { this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) @@ -136,7 +136,7 @@ class AddItems extends Component { viewAttr: _.isEmpty(editId) ? 3 : 1, value: baseInfo.employeeId, valueSpan: baseInfo.employeeName, - onChange: ({ids, names}) => { + onChange: ({ ids, names }) => { this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) @@ -180,15 +180,16 @@ class AddItems extends Component { export default AddItems; export const Browser = payload => { - const { label, onChange, viewAttr = 3, value, valueSpan } = payload; + const { label, onChange, viewAttr = 3, value, valueSpan, type = 1, isSingle = true } = payload; return ( onChange({ids, names})}/> + onChange={(ids, names) => onChange({ ids, names })}/> ); }; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 485dd1dd..38acfb8b 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -339,10 +339,25 @@ class Index extends Component { export default Index; export const Select = payload => { - const { label, onChange, value, options = [], viewAttr = 3 } = payload; + const { + label, + onChange, + value, + options = [], + viewAttr = 3, + detailtype = 1, + multiple = false, + showSearch = false + } = payload; return ( - onChange({ type: label, selected, showName })}/> ); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index 78aefbbb..6dd3e2cc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -45,7 +45,12 @@ export default class StandingBook extends React.Component { list: [], total: 0 }, - adminData: {}, + adminData: { + isDefaultOpen: false, + isAdminEnable: false, + isChief: false, + isOpenDevolution: false + }, progressVisible: false, progress: 0 }; @@ -113,12 +118,12 @@ export default class StandingBook extends React.Component { it = { ...it, render: (text, r) => { - const { billMonth } = r; + const { billMonth, creator } = r; return ( this.handleGoDetail(billMonth, "detail", r.paymentOrganizationId)}> + onClick={() => this.handleGoDetail(billMonth, "detail", r.paymentOrganizationId, creator)}> {text} ); @@ -127,71 +132,73 @@ export default class StandingBook extends React.Component { } return { ...it }; }); + if (!this.state.adminData.isDefaultOpen || (this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable)) { + columns = [ + ...columns, + { + title: "操作", + dataIndex: "action", + key: "action", + fixed: "right", + render: (text, r) => { + const { billStatus, billMonth, creator } = r; + return ( + + {billStatus === "未归档" && ( + this.handleGoDetail(billMonth, "", r.paymentOrganizationId, creator)}> + 核算 + + )} + {billStatus === "已归档" && ( + this.socialSecurityBenefitsRecalculate({ id: r.id })}> + 重新核算 + + )} + {billStatus === "未归档" && ( + + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + }> + 归档 + {/* 异常详情 */} + 删除 + {/* 操作日志 */} + + }> + + + )} + {billStatus === "已归档" && ( + + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + }> + 查看 + + }> + + + )} + + ); + } + } + ]; + } this.setState({ tableData: { list, - columns: [ - ...columns, - (!this.state.adminData.isDefaultOpen || (this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable)) ? { - title: "操作", - dataIndex: "action", - key: "action", - fixed: "right", - render: (text, r) => { - const { billStatus, billMonth } = r; - return ( - - {billStatus === "未归档" && ( - this.handleGoDetail(billMonth, "", r.paymentOrganizationId)}> - 核算 - - )} - {billStatus === "已归档" && ( - this.socialSecurityBenefitsRecalculate({ id: r.id })}> - 重新核算 - - )} - {billStatus === "未归档" && ( - - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) - }> - 归档 - {/* 异常详情 */} - 删除 - {/* 操作日志 */} - - }> - - - )} - {billStatus === "已归档" && ( - - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) - }> - 查看 - {/* 操作日志 */} - - }> - - - )} - - ); - } - } : {} - ], + columns, total }, current: pageNum @@ -236,21 +243,21 @@ export default class StandingBook extends React.Component { }); } - handleGoDetail = (billMonth, detail, paymentOrganization) => { + handleGoDetail = (billMonth, detail, paymentOrganization, creator) => { if (detail) { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&creator=${creator}` ); } else { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&creator=${creator}` ); } }; handleOperate = (payload) => { const { siaccountFile, siaccountDelete, deleteLoading } = this.props.standingBookStore; - const { key, billMonth, paymentOrganizationId } = payload; + const { key, billMonth, paymentOrganizationId, creator } = payload; switch (key) { case "archive": Modal.confirm({ @@ -295,7 +302,7 @@ export default class StandingBook extends React.Component { }); break; case "view": - this.handleGoDetail(billMonth, "detail", paymentOrganizationId); + this.handleGoDetail(billMonth, "detail", paymentOrganizationId, creator); break; default: break; @@ -361,15 +368,6 @@ export default class StandingBook extends React.Component { }); }; - handlePageChange(value) { - this.setState({ current: value }); - this.pageInfo.current = value; - this.getCommonList({ - ...this.state.tableParams, - ...this.pageInfo - }); - } - handleShowSizeChange(pageInfo) { this.getCommonList({ ...this.state.tableParams, @@ -383,13 +381,7 @@ export default class StandingBook extends React.Component { inspectLoading, loading, hasRight, - form, - condition, tableStore, - showSearchAd, - getTableDatas, - doSearch, - setShowSearchAd } = standingBookStore; const { list, columns, total } = this.state.tableData; const { startTime, endTime } = this.state.tableParams; @@ -448,9 +440,6 @@ export default class StandingBook extends React.Component { icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 buttons={showOperateBtn ? rightBtns : []} - // showDropIcon={true} // 是否显示下拉按钮 - // dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - // dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 >
账单月份:
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 0cf8e6be..4170ae45 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -24,7 +24,7 @@ padding: 8px 20px; justify-content: flex-end; - i,button { + i, button { cursor: pointer; margin-right: 10px; } @@ -37,4 +37,56 @@ margin-right: 0px; } } -} \ No newline at end of file +} + +//退差 +.regressionWrapper { + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .optWrapper { + display: flex; + align-items: center; + + i { + cursor: pointer; + } + } + + .wea-new-top-wapper .wea-new-top { + background: #FFF; + + .wea-new-top-title { + font-size: 12px; + + & > span:first-child { + display: none; + } + } + } + + .wea-new-top { + .ant-btn { + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 18px; + line-height: 18px; + } + + .ant-btn.ant-btn-primary[disabled] { + color: #d8d8d8; + background: transparent; + } + + .ant-btn.ant-btn-primary { + color: #2db7f5; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js new file mode 100644 index 00000000..81e19839 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -0,0 +1,227 @@ +/* + * Author: 黎永顺 + * name: 添加退差人员弹框 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, Modal } from "antd"; +import { Select } from "../../../ruleConfig"; +import * as API from "../../../../apis/standingBook"; + +class RegAddEmployee extends Component { + constructor(props) { + super(props); + this.state = { + baseInfo: { + billMonth: "", + items: "", + itemsAll: "" + }, + returnPersonInfo: { + employee: "", + employeeOptions: [] + }, + selectPersonInfo: { + employee: "", + employeeOptions: [] + } + }; + } + + componentDidMount() { + this.getEmployeeListByTaxAgent(); + } + + getEmployeeListByTaxAgent = () => { + const { returnPersonInfo, selectPersonInfo } = this.state; + const payload = { + pageNum: 1, + pageSize: 10000, + name: null + }; + API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => { + if (status) { + const { list } = data; + this.setState({ + returnPersonInfo: { + ...returnPersonInfo, + employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username })) + }, + selectPersonInfo: { + ...selectPersonInfo, + employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username })) + } + }); + } + }); + }; + handleReset = () => { + this.setState({ + baseInfo: { + billMonth: "", + items: "", + itemsAll: "" + }, + returnPersonInfo: { + ...this.state.returnPersonInfo, + employee: "" + }, + selectPersonInfo: { + ...this.state.selectPersonInfo, + employee: "" + } + }); + }; + handleSave = () => { + const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; + const { onSave } = this.props; + const payload = { + recessionMonthList: baseInfo.billMonth.split(","), + projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","), + includes: returnPersonInfo.employee.split(","), + excludes: selectPersonInfo.employee.split(",") + }; + if (_.isEmpty(baseInfo.billMonth) || _.isEmpty(baseInfo.items) || _.isEmpty(returnPersonInfo.employee)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + onSave(payload); + }; + + render() { + const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; + const buttons = [ + , + + ]; + const baseItems = [ + { + com: Picker({ + label: "退差月份", + value: baseInfo.billMonth, + onChange: (billMonth) => { + this.setState({ baseInfo: { ...baseInfo, billMonth } }); + } + }) + }, + { + com: SelectWithAll({ + label: "退差项目", + options: [ + { key: "1", showname: "社保" }, + { key: "2", showname: "公积金" }, + { key: "3", showname: "企业年金及其他福利" } + ], + detailtype: 2, + valueAll: baseInfo.itemsAll, + value: baseInfo.items, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ baseInfo: { ...baseInfo, itemsAll: selected, items: "1,2,3" } }); + } else { + this.setState({ baseInfo: { ...baseInfo, itemsAll: selected, items: "" } }); + } + }, + onChange: ({ selected }) => { + const bool1 = selected.split(",").includes("1"); + const bool2 = selected.split(",").includes("2"); + const bool3 = selected.split(",").includes("3"); + if (bool1 && bool2 && bool3) { + this.setState({ baseInfo: { ...baseInfo, itemsAll: "0", items: selected } }); + } else { + this.setState({ baseInfo: { ...baseInfo, itemsAll: "", items: selected } }); + } + } + }) + } + ]; + const returnPersonItems = [ + { + com: Select({ + multiple: true, + label: "对象", + viewAttr: 3, + showSearch: true, + options: returnPersonInfo.employeeOptions, + value: returnPersonInfo.employee, + onChange: ({ selected }) => { + this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } }); + } + }) + } + ]; + const selectPersonItems = [ + { + com: Select({ + multiple: true, + label: "选择人员", + viewAttr: 2, + showSearch: true, + options: selectPersonInfo.employeeOptions, + value: selectPersonInfo.employee, + onChange: ({ selected }) => { + this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } }); + } + }) + } + ]; + return ( + + + + + + ); + } +} + +export default RegAddEmployee; + + +export const Picker = payload => { + const { label, onChange, value, viewAttr = 3, format = "YYYY-MM" } = payload; + return ( + + + + ); +}; +export const SelectWithAll = payload => { + const { label, onChange, value, valueAll, onChangeAll, options = [], viewAttr = 3, detailtype = 1 } = payload; + return ( + +
+ onChangeAll({ selected, showName })} + style={{ width: "inherit" }} + /> + onChange({ type: label, selected, showName })} + style={{ width: "inherit" }} + /> +
+
+ ); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js new file mode 100644 index 00000000..0e8dcb21 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -0,0 +1,53 @@ +/* + * Author: 黎永顺 + * name:退差编辑页面 + * Description: + * Date: 2022/11/23 + */ +import React, { Component } from "react"; +import { WeaSlideModal } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import SlideModalTitle from "../../../../components/slideModalTitle"; + +class RegEditDetial extends Component { + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.editId !== this.props.editId && nextProps.editId) { + this.getPaymentById(nextProps.editId); + } + } + + getPaymentById = (id) => { + const payload = { id }; + API.getPaymentById(payload).then(res => { + console.log(res); + }); + }; + + render() { + const { visible, title, onCancel } = this.props; + return ( + + } + content={
123
} + onClose={onCancel} + showMask={true} + /> + ); + } +} + +export default RegEditDetial; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js new file mode 100644 index 00000000..99486ef8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -0,0 +1,153 @@ +/* + * Author: 黎永顺 + * name: 退差列表 + * Description: + * Date: 2022/11/23 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { getQueryString } from "../../../../util/url"; +import * as API from "../../../../apis/standingBook"; +import "./index.less"; + +class RegList extends Component { + constructor(props) { + super(props); + this.state = { + columns: [], + dataSource: [], + selectedRowKeys: [], + loading: { + query: false + }, + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.recessionList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + this.recessionList(); + } + } + + recessionList = (userName = "") => { + const { loading, pageInfo } = this.state; + const billMonth = getQueryString("billMonth"); + const creator = Number(getQueryString("creator")); + const paymentStatus = getQueryString("paymentOrganization"); + const payload = { + billMonth, paymentStatus, + creator, userName, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + API.recessionList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageInfo: list } = data; + const { columns, list: dataSource, pageNum: current, pageSize, total } = list; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => { + if (items.dataIndex === "employeeId") { + return { + ...items, + width: 110, + title: "姓名", + fixed: "left", + render: (text, r) => { + const { userName } = r; + return ( + {userName} + ); + } + }; + } + return { + ...items, + title: , + width: 120, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + handleChangeRow = (selectedRowKeys) => { + const { onChangeRowkey } = this.props; + this.setState({ selectedRowKeys }); + onChangeRowkey(selectedRowKeys); + }; + + render() { + const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state; + const { onEdit } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => { + this.recessionList(); + }); + }, + onChange: (current) => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => { + this.recessionList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: this.handleChangeRow + }; + return ( + { + return ( + + ); + } + } + ]} + dataSource={dataSource} + loading={loading.query} + pagination={pagination} + rowSelection={rowSelection} + scroll={{ x: 900 }} + /> + ); + } +} + +export default RegList; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js new file mode 100644 index 00000000..96107ed0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -0,0 +1,72 @@ +import React, { Component } from "react"; +import { Button } from "antd"; +import { WeaHelpfulTip, WeaInputSearch, WeaTop } from "ecCom"; +import { getQueryString } from "../../../../util/url"; + +class RegTop extends Component { + constructor(props) { + super(props); + this.state = { + name: "" + }; + } + + renderTopBtns = () => { + const { name } = this.state; + const { onChange, selectKey } = this.props; + const type = getQueryString("type"); + let dom = [ + +
提示:
+
个人合计=社保个人合计+公积金个人合计+其他福利个人合计
+
单位合计=社保单位合计+公积金单位合计+其他福利单位合计
+
社保合计=社保个人合计+社保单位合计
+
公积金合计=公积金个人合计+公积金单位合计
+
其他福利合计=其他福利个人合计+其他福利单位合计
+
合计=社保合计+公积金合计+其他福利合计
+
+ } + placement="bottomRight" + width={250} + />, + , + this.setState({ name })} + onSearch={() => onChange("search")} + /> + ]; + if (!type) { + const [dom1, ...extra] = dom; + dom = [ + dom1, + , + , + ...extra + ]; + } + return dom; + }; + + render() { + const { billMonth } = this.props; + return ( + 账单月份{billMonth}} + buttons={this.renderTopBtns()} + /> + ); + } +} + +export default RegTop; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js new file mode 100644 index 00000000..a38ce115 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js @@ -0,0 +1,145 @@ +/* + * Author: 黎永顺 + * name: 退差组件 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import { message, Modal } from "antd"; +import RegTop from "./regTop"; +import RegList from "./regList"; +import RegAddEmployee from "./regAddEmployee"; +import RegEditDetial from "./regEditDetial"; +import { getQueryString } from "../../../../util/url"; +import * as API from "../../../../apis/standingBook"; +import "./index.less"; + +class Regression extends Component { + constructor(props) { + super(props); + this.state = { + selectKey: [], + returnPersonModal: { + title: "添加退差人员", + visible: false + }, + returnEditPersonSlide: { + title: "", + editId: "", + visible: false + } + }; + this.regEmmployeeRef = null; + this.regListRef = null; + this.regTopRef = null; + } + + delRecession = () => { + const { selectKey } = this.state; + API.delRecession(selectKey).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.regListRef.recessionList(); + this.setState({ selectKey: [] }); + } else { + message.error(errormsg || "删除失败"); + } + }); + }; + handleSave = (params) => { + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + const payload = { + ...params, + billMonth, + paymentOrganization + }; + API.saveRecession(payload).then(({ status, errormsg }) => { + if (status) { + message.success("操作成功。若退差月无核算明细,账单月则无法获取退差数据。"); + this.handleCloseModal(); + } else { + message.error(errormsg || "操作失败"); + } + }); + }; + handleChangeOpt = (key) => { + const { returnPersonModal } = this.state; + const name = this.regTopRef.state.name; + const billMonth = getQueryString("billMonth"); + const creator = Number(getQueryString("creator")); + switch (key) { + case "add": + this.setState({ returnPersonModal: { ...returnPersonModal, visible: true } }); + break; + case "delete": + Modal.confirm({ + title: "信息确认", + content: "删除人员本账单月将不包含该人员的退差数据!", + onOk: () => { + this.delRecession(); + }, + onCancel: () => { + } + }); + break; + case "export": + const url = `${window.location.origin}/api/bs/hrmsalary/welfare/recession/export?creator=${creator}&billMonth=${billMonth}`; + window.open(url, "_self"); + break; + case "search": + this.regListRef.recessionList(name); + break; + default: + break; + } + }; + handleCloseModal = () => { + const { returnPersonModal, returnEditPersonSlide } = this.state; + this.setState({ + returnPersonModal: { ...returnPersonModal, visible: false, title: "添加退差人员" }, + returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } + }, () => { + this.regEmmployeeRef.handleReset(); + }); + }; + handleEdit = (record) => { + const { userName, id: editId } = record; + const { returnEditPersonSlide } = this.state; + this.setState({ + returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId } + }); + }; + + render() { + const billMonth = getQueryString("billMonth"); + const { returnPersonModal, returnEditPersonSlide, selectKey } = this.state; + return ( +
+ this.regTopRef = dom} + billMonth={billMonth} + onChange={this.handleChangeOpt} + selectKey={selectKey} + /> + this.regListRef = dom} + visible={returnPersonModal.visible} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/* 弹框 */} + this.regEmmployeeRef = dom} + {...returnPersonModal} + onCancel={this.handleCloseModal} + onSave={this.handleSave} + /> +
+ ); + } +} + +export default Regression; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index 9fa45933..75b41a1b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -10,6 +10,7 @@ import { WeaTab } from "ecCom"; import NormalIndex from "./components/normal"; import OverViewIndex from "./components/overView"; import AbnormalListIndex from "./components/abnormalList"; +import Regression from "./components/regression"; @inject("standingBookStore") @observer @@ -27,7 +28,6 @@ class StandingBookDetail extends Component { } componentDidMount() { - this.getTabList(); } @@ -39,6 +39,7 @@ class StandingBookDetail extends Component { getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => { const { tabList, remarks, billMonth } = data; let newTabList = tabList.filter(item => item.id != "2"); + newTabList[newTabList.length - 2] = newTabList.splice(newTabList.length - 1, 1, newTabList[newTabList.length - 2])[0] this.setState({ selectedKey: newTabList[0].id, tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })), @@ -72,6 +73,9 @@ class StandingBookDetail extends Component { selectedKey === "4" && } + { + selectedKey === "5" && + } ); }