diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index fe9af3ed..6faaad01 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -5,6 +5,10 @@ import { postFetch } from "../util/request"; export const getArchiveList = params => { return postFetch("/api/bs/hrmsalary/salaryArchive/list", params); }; +//薪资档案的高级搜索 +export const getSaCondition = params => { + return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params); +}; //薪资档案-获取薪资档案详情表单 export const getArchiveForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params); @@ -100,7 +104,3 @@ export const getSingleSalaryItemInfo = (params) => { export const editSingleSalaryItem = (params) => { return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", params); }; -// 基数调整记录列表 -export const getAdjustHistoryList = (params) => { - return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params); -}; diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index a8ee74c4..1cfca645 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -108,14 +108,14 @@ export const deleteSalaryacct = (params) => { // 薪资记录--归档薪资核算记录 export const fileSalaryAcct = (params) => { - return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params); - // return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { - // method: "GET", - // mode: "cors", - // headers: { - // "Content-Type": "application/json" - // } - // }).then(res => res.json()); + // return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params); + return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); }; // 薪资记录-回算 export const backCalculate = (params) => { @@ -246,3 +246,7 @@ export const getExportField = params => { export const customCacheExportField = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", params); }; +//薪资核算-批量更新 +export const salaryacctBatchUpdate = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/batchUpdate", params); +}; diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index 63153659..b204dfac 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -105,5 +105,8 @@ export const exportArchives = (ids) => { window.URL.revokeObjectURL(url); })); }; - +// 基数调整记录列表 +export const getAdjustHistoryList = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params); +}; diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.js b/pc4mobx/hrmSalary/components/mobileTemplate/index.js index 063b8b8d..18de0574 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.js +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.js @@ -7,32 +7,31 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import { dealTemplate } from "../pcTemplate"; -import moment from "moment"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { - const { theme, background, tip, tipPosi, itemTypeList } = this.props; + const { theme, background, tip, tipPosi, itemTypeList, title } = this.props; const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile"); return ( -
{getLabel(111, "薪酬预览")}
+ {/*
{title || getLabel(111, "薪酬预览")}
*/}
{theme || ""}
-
{moment().format("YYYY-MM-DD HH:mm:ss")}
- { - background && -
logo
- } + {/*
{moment().format("YYYY-MM-DD HH:mm:ss")}
*/} + {/*{*/} + {/* background &&*/} + {/*
logo
*/} + {/*}*/}
{ - !onlyOneGrup && tipPosi === "1" && tip && -
{tip}
+ !onlyOneGrup && tipPosi.toString() === "1" && tip && +
}
{ @@ -46,10 +45,11 @@ class Index extends Component { }
{ - (onlyOneGrup && tipPosi === "1" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) + (onlyOneGrup && tipPosi.toString() === "1" && tip) && ( +
+
{getLabel(111, "发放说明")}
+
{tip}
+
) } { items.map((templatItem, index) => { @@ -57,15 +57,16 @@ class Index extends Component { return
{salaryItemShowName || name || ""}
-
{salaryItemValue || "100"}
+
{salaryItemValue}
; }) } { - (onlyOneGrup && tipPosi === "2" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) + (onlyOneGrup && tipPosi.toString() === "2" && tip) && ( +
+
{getLabel(111, "发放说明")}
+
{tip}
+
) }
); @@ -73,9 +74,10 @@ class Index extends Component { }
{ - !onlyOneGrup && tipPosi === "2" && tip && -
{tip}
+ !onlyOneGrup && tipPosi.toString() === "2" && tip && +
} + {this.props.children}
diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.less b/pc4mobx/hrmSalary/components/mobileTemplate/index.less index 49f8df16..566ad60b 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.less +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.less @@ -8,7 +8,7 @@ } .pbmc-body { - height: calc(100% - 150px); + height: calc(100% - 50px); background: #f6f6f6; overflow: auto; @@ -20,6 +20,18 @@ .bill-container { background: #f6f6f6; + .space { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-end; + margin-bottom: 16px; + + .ant-btn { + margin-right: 16px; + } + } + .bill-info-header { padding-top: 16px; @@ -28,6 +40,7 @@ font-size: 19px; font-weight: 700; margin-bottom: 12px; + text-align: center; } .time { @@ -55,7 +68,6 @@ } .corporate-culture-text { - font-size: 14px; text-align: left; color: #111; padding: 8px 16px; @@ -72,15 +84,13 @@ .group-title { background: #fff; - background: var(--base-white); display: flex; - color: #2780c4; align-items: center; min-height: 45px; padding: 0 16px; border-bottom: 1px solid #f2f2f2; font-weight: bolder; - font-size: 16px; + font-size: 14px; } .group-list { @@ -92,16 +102,13 @@ background: #fff; .item-name { - font-size: 16px; padding: 8px 16px; - width: 40%; + width: 50%; display: flex; align-items: center; background: #fbfbfb; border-right: 1px solid #f2f2f2; flex-shrink: 0; - color: #2780c4; - font-weight: bolder; } .item-count { diff --git a/pc4mobx/hrmSalary/components/pcTemplate/content.js b/pc4mobx/hrmSalary/components/pcTemplate/content.js new file mode 100644 index 00000000..b8c7360b --- /dev/null +++ b/pc4mobx/hrmSalary/components/pcTemplate/content.js @@ -0,0 +1,83 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { dealTemplate } from "./index"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Content extends Component { + render() { + const { theme, background, tip, tipPosi, itemTypeList, sendTime = new Date() } = this.props; + const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc"); + return ( +
+
+
+
+
{theme || ""}
+ {/*
{moment(sendTime).format("YYYY-MM-DD HH:mm:ss")}
*/} +
+
+ {/*{*/} + {/* background &&*/} + {/*
logo
*/} + {/*}*/} + { + !onlyOneGrup && tipPosi.toString() === "1" && tip && +
+ } +
+ { + showData.map((groupItem, index) => { + // 如果当前组下没有条目 当前组直接不展示。 + if (!groupItem) return null; + const { groupId, groupName, items = [] } = groupItem; + return ( +
+ { + groupName ?
{groupName}
: null + } +
+ { + (onlyOneGrup && tipPosi.toString() === "1" && tip) && (
+
{getLabel(111, "发放说明")}
+
{tip}
+
) + } + { + items.map((templatItem, index) => { + const { salaryItemValue, name, salaryItemShowName, id } = templatItem || {}; + return
+
+ {salaryItemShowName || name || ""} +
+
{salaryItemValue || ""}
+
; + + }) + } + { + (onlyOneGrup && tipPosi.toString() === "2" && tip) && (
+
{getLabel(111, "发放说明")}
+
{tip}
+
) + } +
+
); + }) + } +
+ { + !onlyOneGrup && tipPosi.toString() === "2" && tip && +
+ } +
+
+ {this.props.children} +
+
+ ); + } +} + +export default Content; diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js index 511a42bc..ba6cd4a0 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js @@ -1,82 +1,15 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import moment from "moment"; +import Content from "./content"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { - const { theme, background, tip, tipPosi, itemTypeList } = this.props; - const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc"); return (
-
-
-
-
-
{theme || ""}
-
{moment().format("YYYY-MM-DD HH:mm:ss")}
-
-
- { - background && -
logo
- } - { - !onlyOneGrup && tipPosi === "1" && tip && -
{tip}
- } -
- { - showData.map((groupItem, index) => { - // 如果当前组下没有条目 当前组直接不展示。 - if (!groupItem) return null; - const { groupId, groupName, items = [] } = groupItem; - return ( -
- { - groupName ?
{groupName}
: null - } -
- { - (onlyOneGrup && tipPosi === "1" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } - { - items.map((templatItem, index) => { - const { salaryItemValue, name, salaryItemShowName } = templatItem || {}; - return
-
- {salaryItemShowName || name || ""} -
-
{salaryItemValue || ""}
-
; - - }) - } - { - (onlyOneGrup && tipPosi === "2" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } -
-
); - }) - } -
- { - !onlyOneGrup && tipPosi === "2" && tip && -
{tip}
- } -
-
-
-
+
); } @@ -91,15 +24,15 @@ export const dealTemplate = (itemTypeList, type) => { const { items, groupName, groupId } = group; if (items.length !== 0) { items.forEach((item) => { - item.salaryItemValue = "100"; + item.salaryItemValue = !_.isNil(item.salaryItemValue) ? item.salaryItemValue : "100"; }); if (items.length % 2 && type === "pc") items.push({}); // 未分类不展示标题 - if (!groupId.includes("222222222222222222")) { + // if (!groupId.includes("222222222222222222")) { showData.push({ groupId, groupName, items }); - } else { - showData.push({ items }); - } + // } else { + // showData.push({ items }); + // } } }); if (cloneItemTypeList.length === 1) { diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less index 1341316d..856a3d78 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.less +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less @@ -5,144 +5,6 @@ .weapp-salary-sp { background: #f6f6f6; - - .salary-preview-container { - display: flex; - justify-content: flex-start; - align-items: center; - flex-direction: column; - width: 100%; - - .edition-center { - max-width: 1000px; - display: flex; - flex-direction: column; - align-items: center; - width: 100%; - padding-bottom: 32px; - - .header { - height: 48px; - padding: 0 16px; - font-size: 12px; - color: #111; - - .header-title { - height: 22px; - font-size: 17px; - color: #111; - line-height: 22px; - font-weight: 400; - text-align: center; - } - - .header-salary-date-time { - margin-top: 16px; - text-align: center; - height: 14px; - font-size: 14px; - color: #999; - line-height: 14px; - font-weight: 400; - } - } - - .body { - width: 100%; - margin-top: 32px; - - .comp-img { - text-align: center; - - img { - width: 100%; - } - } - - .corporate-culture-text { - width: 100%; - margin-top: 16px; - text-align: center; - min-height: 12px; - font-size: 12px; - color: #111; - white-space: pre-wrap; - word-break: break-all; - } - - .data-detail { - margin-top: 16px; - - .salary-group { - margin-bottom: 16px; - - .group-title { - font-size: 14px; - } - - .group-list { - margin-top: 16px; - display: flex; - flex-wrap: wrap; - - .even { - border-left: 1px solid #e5e5e5; - } - - .zero, .first { - border-top: 1px solid #e5e5e5; - } - - .list-item { - width: 50%; - display: flex; - justify-content: left; - min-height: 40px; - align-items: center; - border-bottom: 1px solid #e5e5e5; - border-right: 1px solid #e5e5e5; - - .item-name { - flex-basis: 170px; - box-sizing: border-box; - width: 170px; - padding: 0 16px; - height: 100%; - background: #fbfbfb; - border-right: 1px solid #e5e5e5; - font-size: 12px; - color: #666; - display: flex; - justify-content: center; - align-items: center; - flex-shrink: 0; - - .text { - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; - text-overflow: ellipsis; - } - } - - .item-count { - flex-basis: 328px; - padding-left: 16px; - height: 100%; - line-height: 40px; - background: #fff; - font-size: 12px; - color: #111; - word-break: break-all; - } - } - } - } - } - } - } - } } .weapp-salary-payroll-pc-preview { @@ -151,3 +13,148 @@ overflow-y: auto; } } + +.salary-preview-container { + display: flex; + justify-content: flex-start; + align-items: center; + flex-direction: column; + width: 100%; + + .edition-center { + max-width: 1000px; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding-bottom: 32px; + + .header { + height: 48px; + padding: 0 16px; + font-size: 12px; + color: #111; + + .header-title { + height: 22px; + font-size: 25px; + color: #111; + line-height: 22px; + font-weight: 400; + text-align: center; + font-weight: bolder; + } + + .header-salary-date-time { + margin-top: 16px; + text-align: center; + height: 14px; + font-size: 14px; + color: #999; + line-height: 14px; + font-weight: 400; + } + } + + .body { + width: 100%; + //margin-top: 32px; + + .comp-img { + text-align: center; + + img { + width: 100%; + } + } + + .corporate-culture-text { + width: 100%; + text-align: left; + color: #111; + padding: 8px 16px; + white-space: pre-wrap; + word-break: break-all; + margin-top: 16px; + } + + .data-detail { + margin-top: 16px; + + .salary-group { + margin-bottom: 16px; + padding-bottom: 16px; + background: #FFF; + + .group-title { + font-size: 14px; + padding: 16px 0 0 8px; + font-weight: bolder; + } + + .group-list { + margin-top: 16px; + display: flex; + flex-wrap: wrap; + padding: 0 8px; + + .even { + border-left: 1px solid #e5e5e5; + } + + .zero, .first { + border-top: 1px solid #e5e5e5; + } + + .list-item { + width: 50%; + display: flex; + justify-content: left; + min-height: 40px; + align-items: center; + border-bottom: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + + .item-name { + //flex-basis: 170px; + //width: 170px; + flex: 1; + box-sizing: border-box; + padding: 0 16px; + height: 100%; + background: #fbfbfb; + border-right: 1px solid #e5e5e5; + font-size: 12px; + color: #666; + display: flex; + justify-content: center; + align-items: center; + flex-shrink: 0; + + .text { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + } + } + + .item-count { + //flex-basis: 328px; + flex: 1; + padding-left: 16px; + height: 100%; + line-height: 40px; + background: #fff; + font-size: 12px; + color: #111; + word-break: break-all; + } + } + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 15b96af4..c02e25dc 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -4,12 +4,14 @@ import { WeaLocaleProvider } from "ecCom"; import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/programme"; -import Archives from "./pages/socialSecurityBenefits/archives"; +// import Archivess from "./pages/socialSecurityBenefits/archives"; +import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面 import StandingBook from "./pages/socialSecurityBenefits/standingBook"; import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail"; import StandingBookOfflineComparison from "./pages/socialSecurityBenefits/standingBookOfflineComparison"; import SalaryItem from "./pages/salaryItem"; import PayrollFiles from "./pages/payrollFiles"; +import SalaryFiles from "./pages/payrollFiles/salaryFiles"; import CumDeduct from "./pages/dataAcquisition/cumDeduct"; import OtherDeduct from "./pages/dataAcquisition/otherDeduct"; import CumSituation from "./pages/dataAcquisition/cumSituation"; @@ -38,6 +40,7 @@ import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; import DoCalcDetail from "./pages/calculate/doCalc"; import OfflineCompare from "./pages/calculate/calcOc"; +import CalcView from "./pages/calculate/calcView"; import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import TemplatePreview from "./pages/payroll/templatePreview"; import PayrollTemplatePreview from "./pages/payroll/templatePreview/tmpPreview"; //重构的工资单模板预览页面 @@ -92,6 +95,7 @@ const DataAcquisition = (props) => props.children; // calculate 薪资核算 // calculateDetail 核算详情 // DoCalcDetail 核算详情页面-新 +// CalcView 核算查看页面-新 // OfflineCompare 薪资核算线下对比-新 // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 @@ -128,6 +132,7 @@ const Routes = ( component={SocialSecurityBenefits}> + {/**/} - + + - + + diff --git a/pc4mobx/hrmSalary/pages/calculate/calcView/index.js b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js new file mode 100644 index 00000000..6728c9a1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js @@ -0,0 +1,107 @@ +/* + * Author: 黎永顺 + * name: 薪资核算查看 + * Description: + * Date: 2023/12/7 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { Dropdown, Menu, message } from "antd"; +import Layout from "../doCalc/layout"; +import SalaryEditCalc from "../doCalc/components/salaryEditCalc"; +import AdvanceInputBtn from "../doCalc/components/advanceInputBtn"; +import { convertToUrlString } from "../../../util/url"; +import { getExportField } from "../../../apis/calculate"; +import CustomCalcExportDialog from "../doCalc/components/customCalcExportDialog"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + showChildren: false, + customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] } + }; + this.calc = null; + } + + init = () => this.setState({ showChildren: true }); + + handleMenuClick = ({ key }) => { + const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { consolidatedTaxation, ...extra } = ECSearchForm.getFormParams(); + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + switch (key) { + case "exportAll": + const url = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}`; + window.open(`${window.ecologyContentPath || ""}${url}`, "_blank"); + break; + case "export_selected": + const { calcTableRef: { wrappedInstance: { state: { selectedRowKeys } } } } = this.calc; + if (selectedRowKeys.length === 0) { + message.warning(getLabel(543306, "未选择条目")); + return; + } + const url1 = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=${selectedRowKeys.join(",")}&${convertToUrlString(payload)}`; + window.open(`${window.ecologyContentPath || ""}${url1}`, "_blank"); + break; + case "export_custom": + getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExpDialog: { + ...this.state.customExpDialog, visible: true, salaryAcctRecordId, + checkItems, itemsByGroup + } + }); + } + }); + break; + default: + break; + } + }; + + render() { + const { showChildren, customExpDialog } = this.state; + const btns = [ + this.handleMenuClick({ key: "exportAll" })} + overlay={ this.handleMenuClick(e)}> + {getLabel(543715, "导出所选")} + {getLabel(544270, "自定义导出")} + }>{getLabel(81272, "导出全部")}, + this.calc.openAdvanceSearch()} + onAdvanceSearch={() => this.calc.onAdSearch(false)} + /> + ]; + return ( + + } iconBgcolor="#F14A2D" + showDropIcon={false} buttons={btns} + > +
+ {showChildren && this.calc = dom}/>} + {/* 薪资核算-自定义导出*/} + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }} + /> +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcView/index.less b/pc4mobx/hrmSalary/pages/calculate/calcView/index.less new file mode 100644 index 00000000..182d61f0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcView/index.less @@ -0,0 +1,8 @@ +.salary-calculate-view { + width: 100%; + height: 100%; + background-color: #f1f1f1; + position: relative; + z-index: 0; + padding: 8px 16px; +} diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 64d75f65..48018983 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -27,7 +27,7 @@ class Calculate extends Component { queryParams: { name: "", dateRange: [ - moment(new Date()).startOf("year").format("YYYY-MM"), + moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM") ] }, isRefresh: false, @@ -123,7 +123,7 @@ class Calculate extends Component { break; case "3": //查看详情 - window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail/${id}?id=${id}`); + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcView/${id}`); break; case "4": //重新核算 diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/batchUpdateSalaryItemValDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/batchUpdateSalaryItemValDialog.js new file mode 100644 index 00000000..7f92a0cb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/batchUpdateSalaryItemValDialog.js @@ -0,0 +1,75 @@ +/* + * Author: 黎永顺 + * name: 批量更新-薪资项目的值 + * Description: + * Date: 2023/12/6 + */ +import React, { Component } from "react"; +import { Button, message } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { getSearchs, toDecimal_n } from "../../../../../util"; +import { salaryacctBatchUpdate } from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class BatchUpdateSalaryItemValDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visibe && !nextProps.visible) nextProps.calculateStore.initBatchUpdateForm(); + } + + save = () => { + const { + calculateStore: { batchUpdateForm }, salaryAcctRecordId, salaryItemId, + idList, pattern, dataType + } = this.props; + batchUpdateForm.validateForm().then(f => { + if (f.isValid) { + const { value } = batchUpdateForm.getFormParams(); + this.setState({ loading: true }); + const payload = { + salaryAcctRecordId, salaryItemId, idList, + value: dataType === "number" ? toDecimal_n(value, pattern) : value + }; + this.setState({ loading: false }); + salaryacctBatchUpdate(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { loading } = this.state; + const { conditions, calculateStore: { batchUpdateForm } } = this.props; + return ( + {getLabel(537558, "保存")} + ]} + > +
{getSearchs(batchUpdateForm, conditions, 1, false)}
+
+ ); + } +} + +export default BatchUpdateSalaryItemValDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js index 59fcb015..9340de40 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js @@ -143,3 +143,34 @@ export const editCalcSearchConditions = [ title: "常用条件" } ]; +export const batchUpdateConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["salaryItemName"], + fieldcol: 14, + label: "批量编辑项目", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUTNUMBER", + domkey: ["value"], + fieldcol: 14, + label: "批量编辑为", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 6ea72244..e5614f87 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -5,14 +5,17 @@ * Date: 2023/9/14 */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; import { message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; +import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; +import { batchUpdateConditions } from "./condition"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("calculateStore") @observer @@ -22,7 +25,11 @@ class EditCalcTable extends Component { this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], progressVisible: false, progress: 0, - salaryCalcSlide: { visible: false, id: "" } + salaryCalcSlide: { visible: false, id: "" }, originPayloadData: {}, + batchUpdateDialog: { + visible: false, salaryAcctRecordId: "", idList: [], salaryItemId: "", + conditions: [], pattern: 0, dataType: "" + } }; this.timerLock = null; } @@ -51,6 +58,10 @@ class EditCalcTable extends Component { break; case "LOCKING": const { salaryItemId, lockType: lockStatus } = params; + if (lockStatus === "BATCHUPDATE") { + this.batchUpdateSalaryItemVal(params); + return; + } this.updateLockStatus({ lockStatus, salaryItemId }); break; case "EDIT": @@ -120,6 +131,39 @@ class EditCalcTable extends Component { } }); }; + batchUpdateSalaryItemVal = (payload) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content:
+
{getLabel(111, "确认编辑所有人员(所选人员)薪资核算记录?")}
+
, + onOk: () => { + const { salaryItemId, salaryItemName, dataType, pattern } = payload; + const { routeParams: { salaryAcctRecordId }, calculateStore: { batchUpdateForm } } = this.props; + const { selectedRowKeys: idList } = this.state; + this.setState({ + batchUpdateDialog: { + ...this.state.batchUpdateDialog, visible: true, salaryAcctRecordId, salaryItemId, + idList, pattern, dataType, conditions: _.map(batchUpdateConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "value") { + const otherParams = dataType === "number" ? { precision: pattern } : {}; + return { + ...o, ...otherParams, label: getLabel(o.lanId, o.label), + conditionType: dataType === "number" ? "INPUTNUMBER" : "INPUT" + }; + } + return { ...o, label: getLabel(o.lanId, o.label) }; + }) + })) + } + }, () => { + batchUpdateForm.initFormFields(this.state.batchUpdateDialog.conditions); + batchUpdateForm.updateFields({ salaryItemName }); + }); + } + }); + }; componentWillUnmount() { window.removeEventListener("message", this.handleReceive, false); @@ -135,14 +179,19 @@ class EditCalcTable extends Component { "当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), - "批量锁定": getLabel(111, "批量锁定"), "查看拓扑图": getLabel(111, "查看拓扑图") + "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), + "查看拓扑图": getLabel(111, "查看拓扑图") }; + this.setState({ originPayloadData: { ...payload, i18n } }); const childFrameObj = document.getElementById("atdTable"); childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; queryCalcResultList = () => { const { pageInfo } = this.state; - const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props; + const { + calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId }, + calcDetail = false + } = this.props; const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams(); const payload = { salaryAcctRecordId, ...pageInfo, ...extra, otherConditions, @@ -162,18 +211,22 @@ class EditCalcTable extends Component { const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload, - columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({ + calcDetail, + columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false - })) : traverse(columns) + })) : traverse(columns, calcDetail) }); }); } }).catch(() => this.setState({ loading: false })); }; + handleBatchEditing = () => { + }; + render() { - const { loading, progressVisible, progress, salaryCalcSlide } = this.state; + const { loading, progressVisible, progress, salaryCalcSlide, batchUpdateDialog } = this.state; return (
@@ -183,6 +236,11 @@ class EditCalcTable extends Component { src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable" id="atdTable" /> + this.setState({ + batchUpdateDialog: { ...batchUpdateDialog, visible: false } + }, () => isRefresh && this.queryCalcResultList())} + /> this.setState({ salaryCalcSlide: { @@ -209,18 +267,19 @@ class EditCalcTable extends Component { export default EditCalcTable; -const traverse = (arr) => { +const traverse = (arr, calcDetail) => { return _.map(arr, item => { if (!_.isEmpty(item.children)) { return { title: item.text, width: item.width + "px", ellipsis: true, - dataIndex: item.column, children: traverse(item.children), - fixed: item.fixed || false + dataIndex: item.column, children: traverse(item.children, calcDetail), + fixed: item.fixed || false, dataType: item.dataType, align: "center" }; } else { return { title: item.text, width: item.width + "px", fixed: item.fixed || false, - dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus + dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, calcDetail, + pattern: item.pattern, dataType: item.dataType, align: "center" }; } }); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index 034d86f8..e3ed75a1 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -6,6 +6,7 @@ */ import React, { Component } from "react"; import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate"; import { sysConfCodeRule } from "../../../../../apis/ruleconfig"; import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; @@ -48,6 +49,9 @@ class Index extends Component { } }; handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex }); + handleBatchEditing = (editable) => { + this.calcTableRef.wrappedInstance.handleBatchEditing(editable); + }; render() { const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; @@ -72,7 +76,10 @@ class Index extends Component { {getLabel(18125, "公式")}= {formulaObj.formulaContent}
-
+
+ {/**/} +
{ - this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }); + this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => { + this.state.store.hasRight && this.props.init && this.props.init(); + }); }); } else { - this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }); + this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => { + this.props.init && this.props.init(); + }); } }).catch(() => this.setState({ store: { ...this.state.store, loading: false } })); }; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 4cdd5a9c..448d49f7 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -163,7 +163,7 @@ export default class PlaceOnFileDetail extends React.Component { }; return ( - + //
this.setState({ slideVisiable: false })}/> }
-
+ //
); } } diff --git a/pc4mobx/hrmSalary/pages/declare/declare.js b/pc4mobx/hrmSalary/pages/declare/declare.js index d94d88ea..545b2d3a 100644 --- a/pc4mobx/hrmSalary/pages/declare/declare.js +++ b/pc4mobx/hrmSalary/pages/declare/declare.js @@ -25,7 +25,7 @@ class Calculate extends Component { queryParams: { taxAgentName: "", dateRange: [ - moment(new Date()).startOf("year").format("YYYY-MM"), + moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM") ] }, isRefresh: false, diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index ab02fe74..8a6533ee 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -43,6 +43,7 @@ class FieldSlide extends Component { roundingMode: "1", pattern: "2", sortedIndex: "", + width: "", description: "" }; } @@ -72,6 +73,7 @@ class FieldSlide extends Component { dataType, description, sortedIndex, + width, sharedType, roundingMode, taxAgentIds, @@ -86,6 +88,7 @@ class FieldSlide extends Component { dataType, description, sortedIndex, + width, sharedType: sharedType ? sharedType.toString() : "0", roundingMode: roundingMode ? roundingMode.toString() : "0", taxAgentIds, @@ -140,6 +143,7 @@ class FieldSlide extends Component { dataType, description, sortedIndex, + width, sharedType, roundingMode, taxAgentIds, @@ -153,6 +157,7 @@ class FieldSlide extends Component { dataType, description, sortedIndex, + width, sharedType, roundingMode: Number(roundingMode), taxAgentIds, @@ -192,6 +197,7 @@ class FieldSlide extends Component { roundingMode: "1", pattern: "2", sortedIndex: "", + width: "", description: "" }); }; @@ -217,6 +223,7 @@ class FieldSlide extends Component { roundingMode, pattern, sortedIndex, + width, description } = this.state; return ( @@ -329,6 +336,11 @@ class FieldSlide extends Component { this.handleChangeFields("sortedIndex", value)}/> + + this.handleChangeFields("width", value)}/> + px + + this.setState({ visible: false }, () => clearLoading())} + title="请输入二次验证密码" visible={visible} initLoadCss + className="verifyWrapper" + hasScroll buttons={[ + + ]} + > + + this.setState({ authCode })}/> + + { + notSetting && +
+ {getLabel("514970", "您还未设置二次验证密码,点击")} + this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")} +
+ } +
+ this.setState({ pwdSetVisible: false })}/> +
; + const { + salaryTemplate, salaryGroups, employeeInformation, + sendTime, confirmStatus + } = toJS(this.props.mySalaryStore.mySalaryBill); + const salaryProps = { + theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime, + background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "", + itemTypeList: [employeeInformation, ...salaryGroups] + }; return ( -
- this.setState({ visible: false }, () => clearLoading())} - title="请输入二次验证密码" visible={visible} initLoadCss - className="verifyWrapper" - hasScroll buttons={[ - - ]} - > - - this.setState({ authCode })}/> - - { - notSetting && -
- {getLabel("514970", "您还未设置二次验证密码,点击")} - this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")} -
- } -
- this.setState({ pwdSetVisible: false })}/> + { type === "phone" ? -
-
- - { - (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && - - } - -
-
+ + { + (_.isNil(confirmStatus) || confirmStatus === "0") && + + } +
: -
-
- - { - (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && - - } - -
+
+ + { + (_.isNil(confirmStatus) || confirmStatus === "0") && + + } +
} @@ -252,7 +245,7 @@ export default class MobilePayroll extends React.Component { onCancel={() => this.setState({ captchaVisible: false })} onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} /> -
+
); } } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js index f857ff41..f857c6d6 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js @@ -82,7 +82,7 @@ class PassSetDialog extends Component { return; } if (secondaryPwd1 !== secondaryPwd2) { - message.error(getLabel("504376", "密码确认不正确!")); + message.error(getLabel(504376, "密码确认不正确!")); return; } } else { diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.less b/pc4mobx/hrmSalary/pages/mySalary/index.less index 8a2b690e..d4fd9324 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.less +++ b/pc4mobx/hrmSalary/pages/mySalary/index.less @@ -20,3 +20,33 @@ } } } + +.weapp-salary-my-salary-view-payroll { + padding: 32px 0; + height: 100vh; + overflow-y: auto; + background: #f6f6f6; + + .salary-preview-container { + max-width: 1000px; + margin: 0 auto; + border: 2px solid #FFF; + padding-top: 32px; + } + + .space { + width: 100%; + max-width: 1000px; + display: flex; + align-items: center; + justify-content: flex-end; + margin-bottom: 16px; + + .ant-btn { + margin-right: 16px; + } + } +} + +.page { +} diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 574c315d..0ddd835d 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -9,10 +9,10 @@ import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaLocaleProvider } from "ecCom"; import Authority from "./authority"; -import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; +import Content from "../../components/pcTemplate/content"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; -import "../payroll/templatePreview/index.less"; +import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -57,7 +57,7 @@ class MySalaryView extends Component { handleGoFeedback = () => { Modal.confirm({ title: getLabel(131329, "信息确认"), - content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), + content: getLabel(544271, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), onOk: () => { const { params: { salaryInfoId }, mySalaryStore: { getMySalaryBill } } = this.props; feedBackSalaryBill({ salaryInfoId }).then(({ status, errorMsg }) => { @@ -84,29 +84,26 @@ class MySalaryView extends Component { if (_.isEmpty(mySalaryStore)) { return
; } - const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation; - const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups; - const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate; + const { salaryTemplate, salaryGroups, employeeInformation, sendTime } = mySalaryStore; + const salaryProps = { + theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime, + background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "", + itemTypeList: [employeeInformation, ...salaryGroups] + }; return ( -
-
- - { - (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) && - - } - -
+
+ + { + (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && + + } +
{getLabel(111, "发放时间")} {moment(it.sendTime).format("YYYY-MM")}
- {`${getLabel(33564, "查看")}>`} + + {`${getLabel(33564, "查看")}>`} + ; }) } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js index e1fade72..0ce6b908 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js @@ -19,7 +19,9 @@ class Index extends Component { super(props); this.state = { dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")], + salaryYearMonth: [ + moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"), + moment().endOf("year").format("YYYY-MM")], isMore: true //是否还有更多数据 }; } @@ -39,7 +41,7 @@ class Index extends Component { mySalaryMobile.removeEventListener("scroll", this.handleScroll, true); } - getMySalaryBillList = () => { + getMySalaryBillList = (type) => { const { salaryYearMonth, pageInfo } = this.state; this.setState({ loading: true }); mySalaryBillList({ salaryYearMonth, ...pageInfo }).then(({ status, data }) => { @@ -48,14 +50,13 @@ class Index extends Component { const { datas: dataSource, pageInfo: pageResult } = data; const { pageNum: current, pageSize, total } = pageResult; this.setState({ - dataSource: [...this.state.dataSource, ...dataSource], + dataSource: type ? dataSource : [...this.state.dataSource, ...dataSource], pageInfo: { ...pageInfo, current, pageSize, total } }, () => this.setState({ isMore: this.state.dataSource.length < total })); } }).catch(() => this.setState({ loading: false })); }; handleLoadMore = () => { - // 为测试效果临时使用 message const { pageInfo, isMore } = this.state; if (!isMore) return; const { current } = pageInfo; @@ -71,8 +72,9 @@ class Index extends Component { const { salaryYearMonth } = this.state; const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 }, salaryYearMonth: type === "salaryStartYearMonth" ? [val, salaryEndYearMonth] : [salaryStartYearMonth, val] - }, () => this.getMySalaryBillList()); + }, () => this.getMySalaryBillList(true)); }; render() { diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js index 7d6d9fb8..d2be756f 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js @@ -105,7 +105,6 @@ export default class BaseInformForm extends React.Component { ackFeedbackStatus, autoAckDays, feedbackUrl, autoSendStatus, autoSendDayOfMonth, autoSendTimeOfDay, autoSendCycleType } = request; - return ( diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js new file mode 100644 index 00000000..3163fd29 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js @@ -0,0 +1,33 @@ +/* + * Author: 黎永顺 + * name:薪资档案页面重构-高级搜索 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + render() { + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + return ( +
+ salaryFileQueryForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less new file mode 100644 index 00000000..9081d39f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less @@ -0,0 +1,29 @@ +.achrive-advance-search { + display: flex; + align-items: center; + position: relative; + top: -1.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 1px; + } +} diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js new file mode 100644 index 00000000..d7b43cd5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js @@ -0,0 +1,87 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-高级查询 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { getSearchs } from "../../../../util"; +import * as API from "../../../../apis/payrollFiles"; +import { salaryFileSearchConditions } from "../../config"; +import { getTaxAgentSelectList } from "../../../../apis/taxAgent"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +@inject("payrollFilesStore") +@observer +class salaryFileAdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [] + }; + } + + async componentDidMount() { + const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ + API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), + getTaxAgentSelectList() + ]); + this.setState({ + searchConditions: _.map(salaryFileSearchConditions, item => { + return { + ...item, + items: _.map(item.items, child => { + if (getKey(child) === "statuses") { + return { + ...child, + options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel })) + }; + } else if (getKey(child) === "taxAgentId") { + return { + ...child, + options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child }; + }) + }; + }) + }, () => { + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + salaryFileQueryForm.initFormFields(this.state.searchConditions); + }); + } + + render() { + const { searchConditions } = this.state; + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + return ( + +
+ {getSearchs(salaryFileQueryForm, searchConditions, 2, false)} +
+
+
+ + + + + + + + + +
+
+
+ ); + } +} + +export default salaryFileAdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js new file mode 100644 index 00000000..c9a7d295 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js @@ -0,0 +1,117 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-导入弹窗 + * Description: + * Date: 2024/1/9 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaCheckbox, WeaLocaleProvider } from "ecCom"; +import ImportDialog from "../../../.././components/importDialog"; +import { convertToUrlString, getURLParameters } from "../../../../util/url"; +import { importSalaryArchive } from "../../../../apis/payrollFiles"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + nextloading: false, link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/salaryArchive/preview", + extraPreview: {} + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { payrollFilesStore: { salaryFileQueryForm }, importType, isExtEmp } = nextProps; + let payload = {}, extraPreview = {}; + if (importType !== "init" && importType !== "salaryItemAdjust") { + extraPreview = { + importType: "", listType: importType + }; + payload = { + importType: "", listType: importType, + ...salaryFileQueryForm.getFormParams() + }; + } else { + extraPreview = { + importType: importType, listType: "FIXED" + }; + payload = { + importType: importType, listType: "FIXED", + ...salaryFileQueryForm.getFormParams() + }; + } + if (isExtEmp) payload = { ...payload, extSalaryArchiveList: true }; + this.setState({ + importDialog: { + ...this.state.importDialog, extraPreview, + link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}` + } + }); + } else { + this.setState({ + importDialog: { + nextloading: false, link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/salaryArchive/preview", + extraPreview: {} + } + }); + } + } + + handleImport = (payload) => { + const { importDialog } = this.state, { isExtEmp } = this.props; + const { extraPreview } = importDialog; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + importSalaryArchive({ ...payload, ...extraPreview, isExtEmp }).then(({ data, status }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog } = this.state; + const { link } = importDialog; + return ( + this.setState({ + importDialog: { + ...importDialog, importResult: {}, imageId: "", link: "" + } + })} + exportDataDom={ + { + let payload = { ...getURLParameters(link), hasData: val === "1" }; + this.setState({ + importDialog: { + ...importDialog, + link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}` + } + }); + }} + /> + } + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js new file mode 100644 index 00000000..9ad2cd34 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js @@ -0,0 +1,223 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-列表 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaTableNew } from "comsMobx"; +import SalaryFilesEditSlide from "../salaryFilesEditSlide"; +import { toJS } from "mobx"; +import { message, Spin } from "antd"; +import * as API from "../../../../apis/payrollFiles"; + +const WeaTableComx = WeaTableNew.WeaTable; +const getLabel = WeaLocaleProvider.getLabel; +const URLLIST = { + pending: "/api/bs/hrmsalary/salaryArchive/pendingList", + fixed: "/api/bs/hrmsalary/salaryArchive/fixedList", + suspend: "/api/bs/hrmsalary/salaryArchive/suspendList", + stop: "/api/bs/hrmsalary/salaryArchive/stopList", + ext: "/api/bs/hrmsalary/salaryArchive/extList" +}; +const APILIST = { + addToSalarypayment: API.gotoFixed, //设为发薪员工 + delPenditngToDo: API.deletePendingTodo, //待定薪删除待办 + delSalaryFiles: API.deleteSalaryArchive, //删除薪资档案 + salarySuspension: API.gotoStop, //停薪 + delSuspendToDo: API.deleteSuspendTodo, //待停薪删除待办 + cancelSalarySuspension: API.cancelStop //取消停薪 +}; + +@inject("payrollFilesStore", "taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false, selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + salaryFilesEditSlide: { visible: false, salaryArchiveId: "" } + }; + this.SFSlideRef = null; + } + + componentDidMount() { + this.getSalaryFileList(this.props); + window.addEventListener("message", this.handleReceive, false); + window.addEventListener("resize", this.handleResize, false); + } + + handleResize = () => { + this.forceUpdate(); + }; + + componentWillReceiveProps(nextProps, nextContext) { + if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) { + this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 } + }, () => this.getSalaryFileList(nextProps)); + } + if ((nextProps.selectedKey !== this.props.selectedKey)) { + this.setState({ + dataSource: [], columns: [], loading: false, selectedRowKeys: [], + salaryFilesEditSlide: { ...this.state.salaryFilesEditSlide, visible: false } + }); + } + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + window.removeEventListener("resize", this.handleResize, false); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getColumns(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + this.setState({ + pageInfo: { ...this.state.pageInfo, ...params } + }, () => this.getSalaryFileList(this.props)); + break; + case "ROWSELECTION": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; + case "ADD-TO-SALARYPAYMENT": + case "DEL-PENDITNG-TO-DO": + case "DEL-SALARY-FILES": + case "SALARY-SUSPENSION": + case "DEL-SUSPEND-TO-DO": + case "CANCEL-SALARY-SUSPENSION": + const { interfaceParams } = params; + this.handleSalaryOpts(_.camelCase(id), interfaceParams); + break; + case "CHANGE-SALARY": + case "VIEW": + case "EDIT": + const { taxAgentStore: { showOperateBtn } } = this.props; + const { record: { id: salaryArchiveId } } = params; + this.setState({ + salaryFilesEditSlide: { + ...this.state.salaryFilesEditSlide, visible: true, salaryArchiveId, + runStatuses: this.props.selectedKey, showOperateBtn + } + }); + break; + default: + break; + } + } + }; + handleSalaryOpts = (type, payload) => { + WeaLoadingGlobal.start(); + APILIST[type](payload).then(({ status, data = {}, errormsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + const { msg, type } = data; + if (type === "fail" || type === "info") { + message.error(msg); + } else if (type === "success") { + message.success(msg); + this.getSalaryFileList(this.props); + this.setState({ selectedRowKeys: [] }); + } else { + message.success(getLabel(30700, "操作成功!")); + this.getSalaryFileList(this.props); + this.setState({ selectedRowKeys: [] }); + } + } else { + message.error(errormsg); + } + }); + }; + postMessageToChild = (payload = {}) => { + const i18n = { + "操作": getLabel(30585, "操作"), "调薪": getLabel(542686, "调薪"), + "增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"), + "删除待办": getLabel(543181, "删除待办"), "查看": getLabel(33564, "查看"), + "取消停薪": getLabel(543309, "取消停薪"), "共": getLabel(18609, "共"), + "条": getLabel(18256, "条"), "设为发薪人员": getLabel(543308, "设为发薪人员"), + "停薪": getLabel(542692, "停薪"), "编辑": getLabel(501169, "编辑") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + getSalaryFileList = (props) => { + const { pageInfo } = this.state; + const { + payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount + } = props; + this.setState({ loading: true }); + queryList(pageInfo, salaryFileQueryForm.getFormParams(), URLLIST[selectedKey]).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: result } = data; + const { list: dataSource, total, pageNum: current, pageSize } = result; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource + }, () => { + onChangeTopTabCount(selectedKey, total); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + getColumns = () => { + const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; + const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ + dataIndex: it.dataIndex, title: it.title, align: "left", + width: (it.dataIndex === "taxAgentName" || it.dataIndex === "operate") ? 185 : 150, + fixed: it.dataIndex === "username" ? "left" : it.dataIndex === "operate" ? "right" : "", + ellipsis: true + })); + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + columns, showOperateBtn, selectedKey: this.props.selectedKey, + showDelSalaryFileBtn: this.props.showDelSalaryFileBtn, + dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys, + showSum: false, pageInfo: this.state.pageInfo + }); + } + }; + + render() { + const { loading, dataSource, salaryFilesEditSlide } = this.state; + const { payrollFilesStore: { tableStore } } = this.props; + const dom = document.querySelector(".wea-new-top-req-content"); + let height = 280; + if (dom && dataSource.length > 0) { + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 16; + } + return ( +
+ +