diff --git a/pc4mobx/hrmSalary/apis/welfareScheme.js b/pc4mobx/hrmSalary/apis/welfareScheme.js index e7d1f3e7..cd5aab94 100644 --- a/pc4mobx/hrmSalary/apis/welfareScheme.js +++ b/pc4mobx/hrmSalary/apis/welfareScheme.js @@ -1,107 +1,108 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; export const getForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/scheme/getForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/scheme/getForm", "get", params); }; export const getTable = params => { - // return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params); - return fetch('/api/bs/hrmsalary/scheme/getTable', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + // return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params); + return fetch("/api/bs/hrmsalary/scheme/getTable", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const createScheme = params => { - return fetch('/api/bs/hrmsalary/scheme/insert', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/scheme/insert", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const updateScheme = params => { - return fetch('/api/bs/hrmsalary/scheme/update', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/scheme/update", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const getCopyForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/scheme/copyForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/scheme/copyForm", "get", params); }; export const copyScheme = params => { - return fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, { - method: 'GET', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - }).then(res => res.json()) + return fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); }; export const deleteScheme = params => { - return fetch('/api/bs/hrmsalary/scheme/delete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/scheme/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const getCustomCategoryForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/sicategory/customCategoryForm", "get", params); }; export const getCustomCategoryList = params => { - // return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params); - return fetch('/api/bs/hrmsalary/sicategory/customCategoryList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + // return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params); + return fetch("/api/bs/hrmsalary/sicategory/customCategoryList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const createSICategory = params => { - return fetch('/api/bs/hrmsalary/sicategory/createSICategory', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/sicategory/createSICategory", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const updateCustomCategory = params => { - return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategoryName', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryName", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; -export const deleteCustomCategory = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sicategory/deleteCustomCategory', 'post', params); +export const deleteCustomCategory = (params) => { + return postFetch("/api/bs/hrmsalary/sicategory/deleteCustomCategory", params); }; export const updateCustomCategoryStatus = params => { - return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; diff --git a/pc4mobx/hrmSalary/components/customForm/index.js b/pc4mobx/hrmSalary/components/customForm/index.js index 5041a53d..4348762d 100644 --- a/pc4mobx/hrmSalary/components/customForm/index.js +++ b/pc4mobx/hrmSalary/components/customForm/index.js @@ -45,7 +45,7 @@ export default class CustomForm extends React.Component { item.options && ({ showname: o.showname, key: o.key }))} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js index 601890a1..62b0b617 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js @@ -36,7 +36,7 @@ class CustomExportDialog extends Component { const { itemsCheckeds } = this.state; customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => { if (status) { - const { consolidatedTaxation, ...extra } = searchItemsValue; + const { consolidatedTaxation = "0", ...extra } = searchItemsValue; const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; window.open( `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${getQueryString("id")}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}` diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 8ab69098..e3c795e8 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -2,13 +2,16 @@ import React from "react"; import { toJS } from "mobx"; import CustomTab from "../../components/customTab"; import { Dropdown, Menu, message } from "antd"; -import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal } from "ecCom"; +import { WeaHelpfulTip, WeaInputSearch, WeaLocaleProvider, WeaSlideModal } from "ecCom"; import SlideModalTitle from "../../components/slideModalTitle"; import FileMergeDetail from "./fileMergeDetail"; import { getQueryString } from "../../util/url"; import { inject, observer } from "mobx-react"; +import { getExportField } from "../../apis/calculate"; import "./index.less"; +import CustomExportDialog from "./customExportDialog"; +const getLabel = WeaLocaleProvider.getLabel; @inject("calculateStore") @observer export default class PlaceOnFileDetail extends React.Component { @@ -18,7 +21,10 @@ export default class PlaceOnFileDetail extends React.Component { slideVisiable: false, selectedRowKeys: [], searchValue: "", - columnIndex: "" + columnIndex: "", + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } }; this.id = ""; } @@ -95,15 +101,33 @@ export default class PlaceOnFileDetail extends React.Component { childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); }; - handleMenuClick() { - const { calculateStore: { exportAll } } = this.props; - const { selectedRowKeys } = this.state; - if (selectedRowKeys.length === 0) { - message.warning("未选择条目"); - return; + handleMenuClick = ({ key }) => { + if (key === "3") { + const { calculateStore: { exportAll } } = this.props; + const { selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { + message.warning("未选择条目"); + return; + } + exportAll(this.id, selectedRowKeys.join(",")); + } else if (key === "4") { + this.getExportField(); } - exportAll(this.id, selectedRowKeys.join(",")); - } + }; + + getExportField = () => { + getExportField({ salaryAcctRecordId: getQueryString("id") }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExportParams: { + visible: true, + checkItems, itemsByGroup + } + }); + } + }); + }; handleExportAll = () => { const { calculateStore: { exportAll } } = this.props; @@ -113,11 +137,12 @@ export default class PlaceOnFileDetail extends React.Component { render() { const { calculateStore } = this.props; const { baseSalarySobCycle, columnDescList } = calculateStore; - const { slideVisiable, columnIndex } = this.state; + const { slideVisiable, columnIndex, customExportParams } = this.state; const menu = ( this.handleMenuClick(e)}> 导出所选 + {getLabel(111, "自定义导出")} ); @@ -171,6 +196,17 @@ export default class PlaceOnFileDetail extends React.Component { id="atdTable" /> + { + this.setState({ + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } + }); + }} + /> { slideVisiable &&
this.handleAdd()}>新建 ] : []} searchType={["base", "advanced"]} showSearchAd={showSearchAd} @@ -143,7 +146,7 @@ class Index extends Component {
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index 76913307..8b7af5a4 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -274,7 +274,7 @@ class LedgerAssociatedPersonnel extends Component { return (
{ notSetting && -
+ } diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 24bf675e..67374438 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -59,13 +59,17 @@ class MySalaryView extends Component { title: getLabel(131329, "信息确认"), content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), onOk: () => { - const { params: { salaryInfoId } } = this.props; + const { params: { salaryInfoId }, mySalaryStore: { getMySalaryBill } } = this.props; feedBackSalaryBill({ salaryInfoId }).then(({ status, errorMsg }) => { if (status) { const { mySalaryStore } = this.state; const { salaryTemplate } = mySalaryStore; const { feedbackUrl } = salaryTemplate; - window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + getMySalaryBill(Number(salaryInfoId)).then(data => { + this.setState({ mySalaryStore: data }, () => { + window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + }); + }); } else { message.error(errorMsg); } diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js index cb3e598c..b363134b 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js @@ -219,6 +219,8 @@ class SalaryItemSettings extends Component { } }; handleEditSalaryItemName = (item, field, viewAttr) => { + //暂时关闭 + return const { groupId } = item, { salaryItemId } = field, { dataList } = this.state; if (groupId === "111111111111111111") return; this.setState({ diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 73f7e302..1cf37553 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -778,7 +778,7 @@ class Index extends Component { dropMenuDatas={rightMenu} > this.handleChange("confValue", val)}/> - - + + this.handleChange("matchRule", val)} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index c0111c45..8b078187 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -251,7 +251,7 @@ export default class Archives extends React.Component { }); return; } - save("SOCIAL_SECURITY").then(() => { + save("SOCIAL_SECURITY", this.record.paymentOrganization).then(() => { this.query(); }); } else if (selectedTab == 2) { @@ -264,7 +264,7 @@ export default class Archives extends React.Component { }); return; } - save("ACCUMULATION_FUND").then(() => { + save("ACCUMULATION_FUND", this.record.paymentOrganization).then(() => { this.query(); }); } else if (selectedTab == 3) { @@ -277,7 +277,7 @@ export default class Archives extends React.Component { }); return; } - save("OTHER").then(() => { + save("OTHER", this.record.paymentOrganization).then(() => { this.query(); }); } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js index ab5cb070..fe4bc74c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/customBenefitsTable.js @@ -5,9 +5,11 @@ * Date: 2023/3/2 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaTable } from "ecCom"; +import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom"; import { message, Modal } from "antd"; -import { getCustomCategoryList, updateCustomCategoryStatus } from "../../../apis/welfareScheme"; +import { deleteCustomCategory, getCustomCategoryList, updateCustomCategoryStatus } from "../../../apis/welfareScheme"; + +const { getLabel } = WeaLocaleProvider; class CustomBenefitsTable extends Component { constructor(props) { @@ -77,7 +79,11 @@ class CustomBenefitsTable extends Component { return ( ); @@ -98,6 +104,38 @@ class CustomBenefitsTable extends Component { message.error(errormsg || "操作失败"); } }); + }, + onCancel: () => { + this.setState({ + dataSource: _.map(this.state.dataSource, item => { + if (item.id === id) { + return { + ...item, isUse: item.isUse + }; + } + return { ...item }; + }) + }); + } + }); + }; + deleteCustomCategory = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543231, "确认删除本条数据吗?"), + onOk: () => { + message.destroy(); + message.loading("正在删除中...", 0); + const payload = { id }; + deleteCustomCategory(payload).then(({ status, errormsg }) => { + message.destroy(); + if (status) { + message.success(getLabel(502230, "删除成功")); + this.getCustomCategoryList(); + } else { + message.error(errormsg || getLabel(30651, "操作失败")); + } + }).catch(() => message.destroy()); } }); }; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index f144e14b..d60cc7f4 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -28,6 +28,7 @@ export default class SlideTaxagentUser extends React.Component { extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; } + componentDidMount() { this.getSysinfo(); } @@ -199,10 +200,10 @@ export default class SlideTaxagentUser extends React.Component {
{ + save = (welfareType, paymentOrganization) => { let baseForm = ""; let paymentForm = ""; if (welfareType === "SOCIAL_SECURITY") { - baseForm = JSON.stringify(this.socialSecurityForm.data); + baseForm = JSON.stringify({ ...this.socialSecurityForm.data, paymentOrganization }); if (this.socialSecurityForm.data.socialSchemeId) { const socialSecurityPaymentData = toJS(this.socialSecurityPaymentForm).data; const socialSecurityPaymentItems = toJS(this.socialSecurityPaymentForm).items[0].items; @@ -259,7 +259,7 @@ export class ArchivesStore { paymentForm = JSON.stringify(payload); } } else if (welfareType === "ACCUMULATION_FUND") { - baseForm = JSON.stringify(this.accumulationFundForm.data); + baseForm = JSON.stringify({ ...this.accumulationFundForm.data, paymentOrganization }); if (this.accumulationFundForm.data.fundSchemeId) { const accumulationFundPaymentData = toJS(this.accumulationFundPaymentForm).data; const accumulationFundPaymentItems = toJS(this.accumulationFundPaymentForm).items[0].items; @@ -270,7 +270,7 @@ export class ArchivesStore { paymentForm = JSON.stringify(payload); } } else if (welfareType === "OTHER") { - baseForm = JSON.stringify(this.otherForm.data); + baseForm = JSON.stringify({ ...this.otherForm.data, paymentOrganization }); if (this.otherForm.data.otherSchemeId) { const otherPaymentData = toJS(this.otherPaymentForm).data; const otherPaymentItems = toJS(this.otherPaymentForm).items[0].items; diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js index b6d994d0..3cbc9c91 100644 --- a/pc4mobx/hrmSalary/stores/programme.js +++ b/pc4mobx/hrmSalary/stores/programme.js @@ -325,7 +325,10 @@ export class ProgrammeStore { @action updateCustomCategory = (params) => { return new Promise((resolve, reject) => { - API.updateCustomCategory(_.pick(params, ["id", "insuranceName"])).then(res => { + API.updateCustomCategory({ + ..._.pick(params, ["id", "insuranceName"]), + paymentScope: _.pick(params, ["paymentScope"]).paymentScope.split(",") + }).then(res => { if (res.status) { message.success("编辑成功"); resolve();