diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index c03ac28a..371a8763 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -333,6 +333,17 @@ export const fileSalaryAcct = (params) => { } }).then(res => res.json()); }; +// 薪资记录-回算 +export const backCalculate = (params) => { + return fetch("/api/bs/hrmsalary/salaryacct/backCalculate", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 薪资记录-重新核算 export const reAccounting = (params) => { diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 2d411cd3..254c4643 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -268,3 +268,17 @@ export const listAdjustmentRule = params => { body: JSON.stringify(params) }).then(res => res.json()); }; + +//获取回算薪资项目 +export const getAggregate = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getAggregate", "GET", params); +}; + +//编辑回算薪资项目详情 +export const getBackitemForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getForm", "GET", params); +}; +//保存回算薪资项目详情 +export const salarysobBackitemSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index c4182a0a..80011331 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -315,6 +315,29 @@ export const grantProxy = params => { }).then(res => res.json()); }; +// 工资单发放-新建时获取补发工资单模板薪资项目设置 +export const getReplenishForm = params => { + return fetch("/api/bs/hrmsalary/salaryBill/template/getReplenishForm", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; + +// 工资单发放-获取规则设置下拉框 +export const getReplenishRuleSetOptions = ({ salarySobId }) => { + return fetch(`/api/bs/hrmsalary/salaryBill/template/getReplenishRuleSetOptions?salarySobId=${salarySobId}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); +}; + //添加发送和撤回人员范围列表 export const sendRangeList = (params) => { return postFetch('/api/bs/hrmsalary/salaryBill/send/range/list', params); diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 745b3706..9f8b28b1 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -202,6 +202,14 @@ export const getWelfareList = () => { {} ); }; +// 补差表单字段对应的接口 +export const getBalanceWelfareList = () => { + return WeaTools.callApi( + "/api/bs/hrmsalary/siaccount/getBalanceWelfareList", + "get", + {} + ); +}; // 社保福利台账-导入预览 export const welfarePreview = (params) => { @@ -226,6 +234,17 @@ export const importInsuranceAcctDetail = (params) => { body: JSON.stringify(params) }).then((res) => res.json()); }; +// 社保福利台账-补差数据导入 +export const importBalanceInsuranceDetail = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", { + method: "post", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then((res) => res.json()); +}; // 社保福利台账-线下对比数据导入 export const importExcelInsuranceDetail = (params) => { @@ -251,10 +270,18 @@ export const saveRecession = (params) => { export const recessionList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); }; +//查询补差列表 +export const balanceList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); +}; //删除退差数据 export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); }; +//删除补差数据 +export const delBalance = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/delBalance", params); +}; //编辑社保福利缴纳数据 export const editAccount = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params); 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/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js new file mode 100644 index 00000000..1668de36 --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -0,0 +1,227 @@ +/* + * Author: 黎永顺 + * name: 新增人员范围弹框 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, message, Modal } from "antd"; +import { getTaxAgentRangeForm } from "../../apis/taxAgent"; +import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; +import "./index.less"; + +class PersonalScopeModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + employeeStatus: [], + targetTypeList: [], + targetType: "EMPLOYEE", + targetTypeIds: "", + targetTypeIdsNames: "", + status: "", + statusAll: "" + }; + } + + componentDidMount() { + const { isTaxgent = true } = this.props; + if (isTaxgent) { + this.getTaxAgentRangeForm(); + } else { + const employeeStatus = [ + { key: "TRIAL", showname: "试用" }, + { key: "FORMAL", showname: "正式" }, + { key: "TEMPORARY", showname: "临时" }, + { key: "DELAY", showname: "试用延期" }, + { key: "FIRE", showname: "解雇" }, + { key: "DEPARTURE", showname: "离职" }, + { key: "RETIRED", showname: "退休" } + ]; + const targetTypeList = [ + { + key: "EMPLOYEE", + showname: "人员", + selected: false + }, + { + key: "SUBCOMPANY", + showname: "分部", + selected: false + }, + { + key: "DEPT", + showname: "部门", + selected: false + }, + { + key: "POSITION", + showname: "岗位", + selected: false + } + ]; + this.setState({ targetTypeList, employeeStatus }); + } + } + + getTaxAgentRangeForm = () => { + getTaxAgentRangeForm().then(({ status, data }) => { + if (status) { + const { employeeStatus, targetTypeList } = data; + this.setState({ + targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), + employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + }); + } + }); + }; + handleSubmit = () => { + const { status, targetTypeIds, targetType } = this.state; + const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox } = this.props; + if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + [saveKeyVal["key"]]: saveKeyVal["value"], + }; + this.setState({ loading: true }); + APISaveFox["save"](payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; + renderBrowser = () => { + const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; + let browserType = {}; + switch (targetType) { + case "EMPLOYEE": + browserType = { ...browserType, type: 17, title: "人员选择" }; + break; + case "DEPT": + browserType = { ...browserType, type: 57, title: "部门选择" }; + break; + case "SUBCOMPANY": + browserType = { ...browserType, type: 164, title: "分部选择" }; + break; + case "POSITION": + browserType = { ...browserType, type: 278, title: "岗位选择" }; + break; + default: + break; + } + return { + this.setState({ targetTypeIds, targetTypeIdsNames }); + }} + />; + }; + handleReset = () => { + this.setState({ + targetType: "EMPLOYEE", + targetTypeIds: "", + status: "", + statusAll: "" + }); + }; + + render() { + const { onCancel, title, visible } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const buttons = [ + , + + ]; + return ( + { + this.handleReset(); + onCancel(); + }} + > + + +
+ this.setState({ targetType })} + /> + {this.renderBrowser()} +
+
+ { + SelectWithAll({ + label: "选择员工状态", + options: employeeStatus, + detailtype: 2, + valueAll: statusAll, + value: status, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ + status: _.map(employeeStatus, it => it.key).join(","), + statusAll: selected + }); + } else { + this.setState({ + status: "", + statusAll: selected + }); + } + }, + onChange: ({ selected }) => { + const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); + if (bool) { + this.setState({ + status: selected, + statusAll: "0" + }); + } else { + this.setState({ + status: selected, + statusAll: "" + }); + } + } + }) + } +
+
+ ); + } +} + +export default PersonalScopeModal; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less new file mode 100644 index 00000000..0c603d8e --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less @@ -0,0 +1,14 @@ +//添加关联人员弹框中的下拉框样式 +.personalScopeModalWrapper{ + .wea-select,.ant-select-selection,.ant-select{ + width: 100%; + } + .wea-select{ + display: inline-block; + position: relative; + } + .ant-select-selection{ + height: 30px; + border-radius: 0; + } +} diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js new file mode 100644 index 00000000..fcb80bf7 --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js @@ -0,0 +1,130 @@ +/* + * Author: 黎永顺 + * name: 人员范围列表数据 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { calcPageNo } from "../../util"; +import "./index.less"; + +class PersonalScopeTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getPersonalScopeList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.tabActive !== this.props.tabActive) { + this.setState({ selectedRowKeys: [] }, () => { + this.getPersonalScopeList(nextProps.tabActive); + nextProps.onChangeSelectKey([]); + }); + } + } + + getPersonalScopeList = (tabActive = this.props.tabActive) => { + const { searchValue, searchKeyVal, APIFox } = this.props; + const { pageInfo, loading } = this.state; + const payload = { + [searchKeyVal["key"]]: searchKeyVal["value"], + targetName: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + APIFox[tabActive](payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + /* + * Author: 黎永顺 + * Description: 清空选中项 + * Params: + * Date: 2022/11/30 + */ + clearRowkeys = () => { + const { pageInfo, selectedRowKeys } = this.state; + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, + current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length) + } + }, () => { + this.getPersonalScopeList(); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; + const { onChangeSelectKey } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getPersonalScopeList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => { + this.setState({ selectedRowKeys }, () => { + onChangeSelectKey(this.state.selectedRowKeys); + }); + } + }; + return ( + + ); + } +} + +export default PersonalScopeTable; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less new file mode 100644 index 00000000..3f90918b --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less @@ -0,0 +1,11 @@ +.ledgerWrapper { + height: 100%; + + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} diff --git a/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js b/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js index 4a4918d9..35d4ac22 100644 --- a/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js +++ b/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js @@ -1,28 +1,29 @@ -import React from 'react'; -import { WeaSteps } from 'ecCom' +import React from "react"; +import { WeaSteps } from "ecCom"; +import "./index.less"; + const Step = WeaSteps.Step; -import "./index.less" export default class StepSlideHeader extends React.Component { - render() { - return ( -
-
- - { - this.props.steps && this.props.steps.map(item => - ( - - ) - ) - } - -
-
- {this.props.children} -
-
- - ) - } -} \ No newline at end of file + render() { + return ( +
+
+ + { + this.props.steps && this.props.steps.map(item => + ( + + ) + ) + } + +
+
+ {this.props.children} +
+
+ + ); + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 626b9ca2..9f796db5 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -14,7 +14,7 @@ import OtherDeduct from "./pages/dataAcquisition/otherDeduct"; import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; import SpecialAddDeduction from "./pages/dataAcquisition/specialAddDeduction"; -import Ledger from "./pages/ledger"; +import Ledger from "./pages/ledgerPage"; import Calculate from "./pages/calculate"; import Payroll from "./pages/payroll"; import PayrollGrant from "./pages/payroll/payrollGrant"; diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index ff83ab84..cf287595 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -1,15 +1,15 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd"; +import { Button, DatePicker, Dropdown, Menu, message, Modal, Tag } from "antd"; import { WeaInputSearch, WeaTop } from "ecCom"; import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; - -import { columns } from "./columns"; import moment from "moment"; import BaseFormModal from "./baseFormModal"; import CustomPaginationTable from "../../components/customPaginationTable"; import ProgressModal from "../../components/progressModal"; +import "./index.less"; +import { deleteLedgerPersonRange } from "../../apis/ledger"; const MonthPicker = DatePicker.MonthPicker; @@ -26,25 +26,7 @@ export default class Calculate extends React.Component { searchValue: "", startDate: moment(new Date()).startOf("year").format("YYYY-MM"), endDate: moment(new Date()).startOf("month").format("YYYY-MM"), - current: 1, - columns: columns.map(item => { - if (item.dataIndex == "cz") { - item.render = () => -
- 核算 - 归档 - - window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail" - )}> - 查看 - - 删除 -
; - } - }) + current: 1 }; this.pageInfo = { current: 1, pageSize: 10 }; } @@ -141,6 +123,12 @@ export default class Calculate extends React.Component { message.success("归档成功"); this.handleSearch(this.state.searchValue); }); + }).catch(() => { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + }); }); } @@ -152,6 +140,20 @@ export default class Calculate extends React.Component { }); } + // 回算 + handleBackCalculate = (record) => { + Modal.confirm({ + title: "信息确认", + content: "确定回算吗?\n 回算后,正常核算的数据会被覆盖,正常核算的工资单不能继续发放或撤回!", + onOk: () => { + const { calculateStore: { backCalculate } } = this.props; + backCalculate(record.id).then(() => { + this.handleSearch(this.state.searchValue); + }); + } + }); + }; + // 查看详情回调 handleDetail(record) { window.open( @@ -161,13 +163,28 @@ export default class Calculate extends React.Component { } // 获取列表 - getColumns() { + getColumns = () => { const { calculateStore: { salaryListColumns }, taxAgentStore: { showOperateBtn } } = this.props; - let columns = [...salaryListColumns]; + let columns = [...salaryListColumns].filter(item => item.dataIndex !== "backCalcStatus" && item.dataIndex !== "acctTimes"); columns.map(item => { + if (item.dataIndex === "salarySobName") { + item.width = 300; + item.render = (text, record) => { + return
+ {text} +
+ { + record.backCalcStatus === 1 && + + } + {`第${record.acctTimes}次`} +
+
; + }; + } if (item.title == "操作" && showOperateBtn) { item.render = (text, record) => { const accountBtn = _.filter( @@ -222,6 +239,8 @@ export default class Calculate extends React.Component { this.handleReaccount(record); } else if (cz.text == "查看") { this.handleDetail(record); + } else if (cz.text == "回算") { + this.handleBackCalculate(record); } }}> {cz.text} @@ -242,7 +261,7 @@ export default class Calculate extends React.Component { } }); return showOperateBtn ? columns : _.filter(columns, it => it.title != "操作"); - } + }; // 分页 handleDataPageChange(value) { diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 1a510f08..59c90584 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -13,3 +13,19 @@ } } } + +.salarySobNameWrapper{ + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + .salarySobNameTagWrapper{ + display: flex; + align-items: center; + i{ + color: #5d9cec; + margin-right: 10px; + cursor: pointer; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js index 44d0a208..86b4be54 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js @@ -37,7 +37,7 @@ export default class AcctResultImportModal extends React.Component { // 获取模板 handleAccResultTemplateLink() { - const { isStandingBook, standingBookTabKey } = this.props; + const { isStandingBook, standingBookTabKey, standingBookType } = this.props; let url = ""; if (_.isEmpty(this.state.modalParam.salaryItemIds)) { message.warning("请选择表单字段"); @@ -52,6 +52,8 @@ export default class AcctResultImportModal extends React.Component { url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/importtemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; } else if (standingBookTabKey === "3") { url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; + } else if (standingBookType === "difference") { + url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; } } window.open(url, "_self"); @@ -162,8 +164,10 @@ export default class AcctResultImportModal extends React.Component { } render() { + const billMonth = getQueryString("billMonth"); //isStandingBook: 是否是社保福利台账核算的导入标识 - const { calculateStore, standingBookStore, isStandingBook, visiable } = this.props; + //standingBookType: 是否是补差的导入标识 + const { calculateStore, standingBookStore, isStandingBook, visiable, standingBookType } = this.props; const { fetchPreviewAcctResult, previewAcctResultColumns, @@ -176,7 +180,8 @@ export default class AcctResultImportModal extends React.Component { previewStandingBookAcctResultColumns, previewStandingBookAcctResultDataSource, importStandingBookAcctResult, - importInsuranceAcctDetail + importInsuranceAcctDetail, + importBalanceInsuranceDetail } = standingBookStore; const { step, selectFieldVisible, modalParam } = this.state; return ( @@ -184,6 +189,7 @@ export default class AcctResultImportModal extends React.Component { { visiable && { this.handleImportModalInit(); }} @@ -200,7 +206,11 @@ export default class AcctResultImportModal extends React.Component { !isStandingBook ? fetchPreviewAcctResult(params) : welfarePreview(params); }} importFile={(params) => { - !isStandingBook ? fetchImportAcctResult(params) : importInsuranceAcctDetail(params); + !isStandingBook ? + fetchImportAcctResult(params) : + standingBookType === "difference" ? + importBalanceInsuranceDetail({...params, billMonth}) : + importInsuranceAcctDetail(params); }} templateLink={() => { this.handleAccResultTemplateLink(); @@ -215,6 +225,7 @@ export default class AcctResultImportModal extends React.Component { { selectFieldVisible && { let fieldData = {}; @@ -43,7 +49,8 @@ export default class SelectFieldModal extends React.Component { this.fieldData = fieldData; }); } else { - getWelfareList().then(result => { + const APIFox = standingBookType === "difference" ? getBalanceWelfareList : getWelfareList; + APIFox().then(result => { let fieldData = {}; let formulaItems = []; formulaItems = _.map(result, it => ({ ...it, salaryItemId: it.salaryItemName })); @@ -146,9 +153,9 @@ export default class SelectFieldModal extends React.Component { const { isStandingBook } = this.props; return ( { this.props.onCancel(); }} @@ -161,7 +168,7 @@ export default class SelectFieldModal extends React.Component {
{ !_.isEmpty(fieldData.formulaItems) && -
+
{ this.handleTitleCheckboxChange(value, "formula"); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js index 385fa87b..075c55a1 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js @@ -1,40 +1,58 @@ import React from "react"; -import { WeaHelpfulTip, WeaInput } from "ecCom"; +import { WeaHelpfulTip, WeaInput, WeaTab } from "ecCom"; +import IssuedAndReissueTable from "./issuedAndReissueTable"; import { Col, Row } from "antd"; import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; import cs from "classnames"; import "./index.less"; @inject("calculateStore") @observer export default class EditSalaryDetail extends React.Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "0" + }; + } + componentWillMount() { const { calculateStore: { acctresultDetail } } = this.props; acctresultDetail(this.props.id); } - handleItemValueChange(field, value, isInput) { + handleItemValueChange = (field, value, isInput) => { + console.log(field, value, isInput); const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm } } = this.props; let form = { ...acctresultDetailForm }; - if (isInput) { + if (isInput === "inputItems") { form.inputItems = acctresultDetailForm.inputItems.map(item => { item = { ...item }; - if (item.salaryItemName == field) { + if (item.salaryItemName === field) { item.resultValue = value; } return item; }); - } else { + } else if (isInput === "formulaItems") { form.formulaItems = acctresultDetailForm.formulaItems.map(item => { item = { ...item }; - if (item.salaryItemName == field) { + if (item.salaryItemName === field) { + item.resultValue = value; + } + return item; + }); + } else if (isInput === "issuedAndReissueItems") { + form.issuedAndReissueItems = acctresultDetailForm.issuedAndReissueItems.map(item => { + item = { ...item }; + if (item.salaryItemName === field) { item.resultValue = value; } return item; }); } setAcctresultDetailForm(form); - } + }; renderTableTr = (data, isInput) => { const tables = []; @@ -62,6 +80,17 @@ export default class EditSalaryDetail extends React.Component { render() { const { calculateStore: { acctresultDetailForm } } = this.props; + const { selectedKey } = this.state; + const topTab = [ + { + title: "正常工资薪金所得", + viewcondition: "0" + }, + { + title: "已发补发", + viewcondition: "1" + } + ]; return (
@@ -84,39 +113,45 @@ export default class EditSalaryDetail extends React.Component { }
- -
-
- 输入项 -
- - { - acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => { - const len = acctresultDetailForm.inputItems.length; - return ( - - - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, true); - }}/> - - - ); - }) - } - + { + !_.isEmpty(toJS(acctresultDetailForm.issuedAndReissueItems)) && + this.setState({ selectedKey: v })} + /> + } + { + selectedKey === "0" && +
+
+ 输入项 +
+ + { + acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => { + const len = acctresultDetailForm.inputItems.length; + return ( + + + {item.salaryItemName} + { + this.handleItemValueChange(item.salaryItemName, value, "inputItems"); + }}/> + + + ); + }) + } + +
-
-
- - -
-
+
公式项 -
- - { - acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => { - const len = acctresultDetailForm.formulaItems.length; - return ( - - - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, false); - }}/> - - - ); - }) - } - +
+ + { + acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => { + const len = acctresultDetailForm.formulaItems.length; + return ( + + + {item.salaryItemName} + { + this.handleItemValueChange(item.salaryItemName, value, "formulaItems"); + }}/> + + + ); + }) + } + +
-
+ } + { + selectedKey === "1" && + + }
); } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js new file mode 100644 index 00000000..f18e620f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js @@ -0,0 +1,68 @@ +/* + * Author: 黎永顺 + * name: 已发补发列表 + * Description: + * Date: 2022/12/14 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaInputNumber, WeaTable } from "ecCom"; + +class IssuedAndReissueTable extends Component { + render() { + const { dataSource, onChangeIssueReissueValue } = this.props; + const columns = [ + { + dataIndex: "salaryItemName", + title: "薪资项目", + render: (text) => { + return {text}; + } + }, + { + dataIndex: "resultValue", + title: + 项目值 + + , + render: (text, record) => { + const { canEdit } = record; + return onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")} + />; + } + }, + { + dataIndex: "salaryBackItemFormula", + title: + 核算公式 + + , + render: (text, record) => { + return {_.isNil(text) ? "输入" : text}; + } + } + ]; + return ( + + ); + } +} + +export default IssuedAndReissueTable; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index a7791cba..749c7be0 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -52,6 +52,8 @@ export default class SalaryDetail extends React.Component { if (type === "PR") { if (id === "EDIT") { this.handleEdit(record); + } else if (id === "COSTCENTER") { + window.open(record ? record.url : "", "_blank"); } else if (id === "COLUMNINDEX") { if (!extraId) { this.setState({ columnIndex: record }); @@ -266,7 +268,7 @@ export default class SalaryDetail extends React.Component { measure={"%"} title={ this.handleEditSlideSave()} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index c6b0938a..e74a8d8a 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -4,7 +4,6 @@ import { WeaBrowser, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaSe import { inject, observer } from "mobx-react"; import "./index.less"; import { getQueryString } from "../../util/url"; -import { calcPageNo } from "../../util"; @inject("calculateStore", "salaryFileStore") @observer @@ -87,8 +86,8 @@ export default class UserSure extends React.Component { this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -122,6 +121,8 @@ export default class UserSure extends React.Component { childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); //window.postMessage } else if (id === "DELETE") { this.handleDeleteItem(record); + } else if (id === "COSTCENTER") { + window.open(record.url, "_blank"); } else if (id === "BATCHDELETE") { this.onSelectChange(record); } else if (id === "PAGEINFO") { @@ -144,7 +145,7 @@ export default class UserSure extends React.Component { const payload = { type: "PC", listType: "MA", - url: this.state.selectedKey === '1'?"/api/bs/hrmsalary/salaryacct/reducedemployee/list":"/api/bs/hrmsalary/salaryacct/addedemployee/list", + url: this.state.selectedKey === "1" ? "/api/bs/hrmsalary/salaryacct/reducedemployee/list" : "/api/bs/hrmsalary/salaryacct/addedemployee/list", queryParams: { salaryAcctRecordId, employeeName: this.state.userListSearchValue, @@ -223,7 +224,7 @@ export default class UserSure extends React.Component { salaryAcctRecordId, employeeName: this.state.userListSearchValue, ...this.pageInfo, - current: 1, + current: 1 } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -253,7 +254,7 @@ export default class UserSure extends React.Component { queryParams: { salaryAcctRecordId, employeeName: this.state.userListSearchValue, - ...this.pageInfo, + ...this.pageInfo } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -570,6 +571,7 @@ export default class UserSure extends React.Component {