diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index b14015a7..28067063 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -1,141 +1,5 @@ import { WeaTools } from "ecCom"; -//薪资核算-薪资核算列表 -export const getCalcList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/list", "POST", params); -}; - - -//薪资核算-删除薪资核算记录 -export const deleteCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/delete", "POST", params); -}; - -//薪资核算-归档薪资核算记录 -export const fileCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/file", "POST", params); -}; - -//薪资核算-薪资核算详情 -export const getCalcForm = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getForm", "get", params); -}; - -//薪资核算-保存薪资核算的基本信息 -export const saveCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/basic/save", "POST", params); -}; - -//薪资核算-获取薪资核算提示信息 -export const getCalcInfo = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getSalarySobCycle", "get", params); -}; - -//薪资核算-薪资核算人员确认列表 -export const getCalcPersonList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/list", "POST", params); -}; - -//薪资核算-薪资核算人员高级搜索 -export const getCalcPersonSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/getSearchCondition", "get", params); -}; - -//薪资核算-删除薪资核算人员 -export const deleteCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/delete", "POST", params); -}; - -//薪资核算-添加薪资核算人员 -export const saveCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/save", "POST", params); -}; - -//薪资核算-导出人员范围 -export const exportCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/export", "POST", params); -}; - -//薪资核算-薪资核算环比上期减少人员列表 -export const getCalcPersonSubList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/list", "POST", params); -}; - -//薪资核算-导出环比减少人员 -export const exportCalcPersonSub = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/export", "POST", params); -}; - - -//薪资核算-执行薪资核算 -export const doScCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/accounting", "POST", params); -}; - - -//薪资核算-获取薪资核算结果高级搜索 -export const getScSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getSearchCondition", "get", params); -}; - -//薪资核算-薪资核算结果列表 -export const getScList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/list", "post", params); -}; - - -//薪资核算-导出薪资核算 -export const exportSc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/export", "post", params); -}; - -//薪资核算-导出线下对比结果 -export const exportOc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/comparisonResult/export", "post", params); -}; - - -//薪资核算-薪资核算结果详情 -export const getScDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/detail", "get", params); -}; - -//薪资核算-薪资核算合并计税详情 -export const getScMergeTaxDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getConsolidatedTaxDetail", "get", params); -}; - -//薪资核算-编辑薪资核算结果 -export const editScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/save", "post", params); -}; - -//薪资核算-薪资核算结果校验 -export const checkScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/check", "post", params); -}; - - -//薪资核算-获取校验结果(异常)总数 -export const getScResultExceptionCount = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/getCount", "get", params); -}; - -//薪资核算-校验结果列表 -export const getCheckResultList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/list", "POST", params); -}; - -//薪资核算-校验结果明细列表 -export const getCheckResultDetailList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - -//薪资核算-获取导入组件前置参数 -export const getImportParams = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - // 薪资记录--薪资核算列表 export const getSalaryAcctList = params => { return fetch("/api/bs/hrmsalary/salaryacct/list", { @@ -176,6 +40,17 @@ export const reducedemployeeList = params => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 核算人员--薪资核算环比上月增加人员 +export const addedemployeeList = params => { + return fetch("/api/bs/hrmsalary/salaryacct/addedemployee/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 核算人员--薪资核算人员确认列表 export const acctemployeeList = params => { @@ -206,7 +81,6 @@ export const getSalarySobCycle = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/getSalarySobCycle", "GET", params); }; - // 核算人员--添加薪资核算人员 export const saveAcctemployee = params => { return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/save", { @@ -232,7 +106,6 @@ export const exportReducedEmployee = (id) => { })); }; - // 核算人员--导出人员范围 export const exportAcctEmployee = (id) => { fetch("/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=" + id).then(res => res.blob().then(blob => { @@ -374,7 +247,6 @@ export const getImportField = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/importField", "GET", params); }; - // 核算结果-导入模板 export const getImportTemplate = (salaryItemIds, salaryAcctRecordId) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?salaryItemIds=" + salaryItemIds + "&salaryAcctRecordId=" + salaryAcctRecordId).then(res => res.blob().then(blob => { @@ -412,7 +284,6 @@ export const importAcctResult = (params) => { }).then(res => res.json()); }; - // 核算结果-导出全部 export const exportAcctResult = (salaryAcctRecordId, ids) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + salaryAcctRecordId + "&ids=" + ids).then(res => res.blob().then(blob => { @@ -509,50 +380,6 @@ export const updateLockStatus = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; -// 社保福利台账合计接口 -export const siaccountDetailCommonListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账补缴合计接口 -export const siaccountDetailSupplementaryListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账退差合计接口 -export const siaccountDetailRecessionListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账补差合计接口 -export const siaccountDetailBalanceListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", { diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index c87cd3ab..e985ac5a 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { convertToUrlString } from "../util/url"; // 工资单列表 export const mySalaryBillList = params => { @@ -25,7 +26,13 @@ export const recordList = params => { // 工资查看详情 export const mySalaryBill = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/mySalaryBill", "GET", params); + return fetch(`/api/bs/hrmsalary/salaryBill/mySalaryBill?${convertToUrlString(params)}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); }; export const isNeedSecondPwdVerify = params => { diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index 7e0bf3db..a98b2d58 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -61,8 +61,15 @@ class ImpStep1 extends Component {
{getLabel(27577, "操作步骤")}

{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   - {getLabel(543207, "点击这里下载模板")}   + { + typeof this.props.link === "string" ? + {getLabel(543207, "点击这里下载模板")} : + {getLabel(543207, "点击这里下载模板")} + } +    {this.props.exportDataDom}

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js index 8a7373d4..71c6e099 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -21,8 +21,8 @@ class ImpStep2 extends Component { } init = () => { - const { previewUrl, imageId } = this.props; - const payload = { imageId }; + const { previewUrl, imageId, extraPreview = {} } = this.props; + const payload = { imageId, ...extraPreview }; this.setState({ loading: true }); postFetch(previewUrl, payload).then(({ status, data }) => { this.setState({ loading: false }); diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 683ad7d8..baa09e15 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -31,6 +31,8 @@ import TaxAgent from "./pages/salary/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; 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 GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import TemplatePreview from "./pages/payroll/templatePreview"; import MobilePayroll from "./pages/mobilePayroll"; @@ -80,6 +82,8 @@ const DataAcquisition = (props) => props.children; // ledger 薪资账套 // calculate 薪资核算 // calculateDetail 核算详情 +// DoCalcDetail 核算详情页面-新 +// OfflineCompare 薪资核算线下对比-新 // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 // payroll 工资单发放 @@ -140,6 +144,8 @@ const Routes = ( + + diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js new file mode 100644 index 00000000..10f92051 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js @@ -0,0 +1,71 @@ +/* + * Author: 黎永顺 + * name: 薪資核算-线下对比导入 + * Description: + * Date: 2023/9/27 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import ImportDialog from "../../../../components/importDialog"; +import { importComparisonExcelAcctResult } from "../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcOcImport extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + visible: false, title: "", nextloading: false, importResult: {}, imageId: "", + link: "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=", + previewUrl: "/api/bs/hrmsalary/salaryacct/comparisonresult/preview", + extraPreview: { salaryAcctRecordId: "" } + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + const { importDialog } = this.state; + this.setState({ + importDialog: { + ...this.state.importDialog, + link: `${importDialog.link}${nextProps.salaryAcctRecordId}`, + visible: nextProps.visible, importResult: {}, + title: nextProps.title, imageId: "", + extraPreview: { salaryAcctRecordId: nextProps.salaryAcctRecordId } + } + }); + } + } + + handleImport = (payload) => { + const { importDialog } = this.state; + const { salaryAcctRecordId } = this.props; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + importComparisonExcelAcctResult({ ...payload, salaryAcctRecordId }) + .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; + return ( + this.setState(({ + importDialog: { ...importDialog, importResult: {}, imageId: "" } + }))} + nextCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default SalaryCalcOcImport; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js new file mode 100644 index 00000000..e3dda5fb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js @@ -0,0 +1,126 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-线下对比列表 + * Description: + * Date: 2023/9/26 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { Alert } from "antd"; +import { comparisonResultList } from "../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcOcList extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + columns: [], dataSource: [], formulaDesc: "" + }; + } + + componentDidMount() { + this.comparisonResultList(this.props); + } + + componentWillReceiveProps(nextProps, nextContext) { + if ( + (nextProps.form.onlyDiffEmployee !== this.props.form.onlyDiffEmployee) || + (nextProps.form.onlyDiffSalaryItem !== this.props.form.onlyDiffSalaryItem) || + (nextProps.searchBool !== this.props.searchBool) + ) { + this.comparisonResultList(nextProps); + } + } + + comparisonResultList = (props) => { + const { form, routeParams: { salaryAcctRecordId } } = props; + const { pageInfo } = this.state; + this.setState({ loading: true }); + const payload = { ...pageInfo, ...form, salaryAcctRecordId }; + comparisonResultList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, columns, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading, columns, pageInfo, formulaDesc } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.comparisonResultList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.comparisonResultList(this.props)); + } + }; + return ( + + + { + if (i > 1) { + if (i > 2) { + return { + ...o, width: 180, + render: (__, record) => { + const formulaDesc = record["customParameters"][`${o["dataIndex"]}`]; + const showDifference = record[`${o["dataIndex"]}_type`] === "number"; + const { acctResultValue, excelResultValue } = record[o["dataIndex"]]; + return
this.setState({ formulaDesc })}> +
+ {getLabel(543280, "系统值")}: + {acctResultValue} +
+
+ {getLabel(543281, "线下值")}: + {excelResultValue} +
+ { + showDifference && +
+ {getLabel(543282, "差值")}: + {calculateDifference(acctResultValue, excelResultValue)} +
+ } +
; + } + }; + } + return { ...o, width: 180 }; + } + return { ...o, width: 150, fixed: "left" }; + })} + /> +
+ ); + } +} + +export default SalaryCalcOcList; +// 计算差值 +const calculateDifference = (systemValue, excelValue) => { + if (_.isNil(systemValue) || _.isNil(excelValue)) return ""; + const systemNum = Number(systemValue); + const excelNum = Number(excelValue); + return (systemNum - excelNum).toFixed(2); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js new file mode 100644 index 00000000..62e0a92d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js @@ -0,0 +1,85 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-线下对比 + * Description: + * Date: 2023/9/26 + */ +import React, { Component } from "react"; +import { Button } from "antd"; +import { WeaCheckbox, WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import SalaryCalcOcList from "./components/salaryCalcOcList"; +import SalaryCalcOcImport from "./components/salaryCalcOcImport"; +import Layout from "../doCalc/layout"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + salaryOcImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, + form: { + onlyDiffEmployee: true, onlyDiffSalaryItem: true, + employeeName: "" + }, searchBool: false + }; + } + + handleFiledChange = (key, value) => { + const { form } = this.state; + this.setState({ + form: { ...form, [key]: value } + }); + }; + + handleExportClick = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + window.open(`/api/bs/hrmsalary/salaryacct/comparisonresult/export?salaryAcctRecordId=${salaryAcctRecordId}`, "_blank"); + }; + handleImportClick = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ + salaryOcImpDialog: { visible: true, title: getLabel(24023, "数据导入"), salaryAcctRecordId } + }); + }; + + render() { + const { form, searchBool, salaryOcImpDialog } = this.state; + return ( + +
+
+
+ this.handleFiledChange("onlyDiffEmployee", v === "1")}/> + this.handleFiledChange("onlyDiffSalaryItem", v === "1")}/> +
+
+ + + this.handleFiledChange("employeeName", v)} + onSearch={() => this.setState({ searchBool: !searchBool })}/> +
+
+
+ + this.setState({ + salaryOcImpDialog: { ...salaryOcImpDialog, visible: false }, + searchBool: typeof isFresh === "boolean" ? !searchBool : searchBool + })} + /> +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less new file mode 100644 index 00000000..7ec01822 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less @@ -0,0 +1,83 @@ +.salary-calc-oc { + width: 100%; + height: 100%; + overflow: hidden; + background: #f6f6f6; + display: flex; + flex-direction: column; + + .compare-header { + padding-left: 16px; + display: flex; + justify-content: space-between; + align-items: center; + + .left-search { + display: flex; + align-items: center; + } + + .weapp-salary-btn-flex { + display: flex; + align-items: center; + justify-content: flex-end; + cursor: auto; + + & > button { + margin-right: 10px; + } + + .wea-input-focus { + background: #f6f6f6; + margin-top: -4px; + + .ant-input { + background: #f6f6f6; + } + } + } + + .header { + height: 48px; + padding: 0 16px; + font-size: 12px; + color: #111; + } + } + + .header-border-bottom { + border-bottom: 1px solid #e5e5e5; + } + + .salary-calc-oc-body { + flex: 1; + padding: 16px; + overflow-y: hidden; + + .wea-new-table { + background: #FFF; + height: calc(100% - 44px); + + .ant-table-tbody { + td { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .comparison-column-item-container { + cursor: pointer; + + .comparison-single-row { + margin: 4px 0; + } + + .danger { + color: #ff4d4f; + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js new file mode 100644 index 00000000..97fe5c49 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js @@ -0,0 +1,27 @@ +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("calculateStore") +@observer +class Index extends Component { + render() { + const { calculateStore: { ECSearchForm } } = this.props; + return ( +
+ ECSearchForm.updateFields({ employeeName: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.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; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js new file mode 100644 index 00000000..9d76e00f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -0,0 +1,138 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-自定义导出 + * Description: + * Date: 2023/9/18 + */ + +import React, { Component } from "react"; +import { Button, Col, message, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { customCacheExportField } from "../../../../../apis/calculate"; +import { convertToUrlString } from "../../../../../util/url"; + +const { getLabel } = WeaLocaleProvider; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + itemsCheckeds: [], + showOnlyChecked: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : [] + }); + } + } + + customExportClick = () => { + const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props; + const { itemsCheckeds } = this.state; + customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => { + if (status) { + const { consolidatedTaxation = "0", ...extra } = ECSearchForm.getFormParams(); + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + window.open( + `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}` + ); + } else { + message.error(errorMsg); + } + }); + }; + handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) }); + handleSelectGroupAll = (groupId, checked) => { + const { itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + _.map(itemsByGroup, item => { + if (item.salarySobItemGroupId === groupId) { + if (!!Number(checked)) { + this.setState({ + itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)] + }); + } else { + this.setState({ + itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual) + }); + } + } + }); + }; + + render() { + const { showOnlyChecked, itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + let dataSource = _.map(itemsByGroup, item => { + return { + ...item, + salaryItems: _.map(item.salaryItems, child => { + return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) }; + }) + }; + }); + if (showOnlyChecked) { + dataSource = _.map(dataSource, item => { + return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) }; + }); + } + return ( + {getLabel(17416, "导出")}, + + ]} + bottomLeft={} + > + { + _.map(dataSource, item => { + const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item; + const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0"; + return this.handleSelectGroupAll(salarySobItemGroupId, val)}/>}> + + { + !_.isEmpty(salaryItems) ? + _.map(salaryItems, it => { + const { salaryItemId, salaryItemName, checked } = it; + return + this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })}/> + ; + }) : {getLabel(83553, "暂无数据")} + } + + ; + }) + } + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js new file mode 100644 index 00000000..c12b35e7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js @@ -0,0 +1,75 @@ +/* + * Author: 黎永顺 + * name: 人员信息确认-基础信息 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import SalaryMonthTip from "../salaryMonthTip"; +import { getSalarySobCycle, salaryacctGetForm } from "../../../../../apis/calculate"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class BaseInfo extends Component { + constructor(props) { + super(props); + this.state = { + salaryInfo: {}, salarySobCycle: {} + }; + } + + componentDidMount() { + const promise = this.init(); + } + + init = async () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + const [salaryInfo, salarySobCycle] = await Promise.all([salaryacctGetForm({ id: salaryAcctRecordId }), getSalarySobCycle({ salaryAcctRecordId })]); + if (salaryInfo.status && salarySobCycle.status) { + this.setState({ + salaryInfo: salaryInfo.data, salarySobCycle: salarySobCycle.data + }); + } + }; + + render() { + const { salaryInfo, salarySobCycle } = this.state; + const { formDTO } = salaryInfo || {}; + return ( + + + + + + {getLabel(542604, "薪资所属月")} + } + style={{ marginLeft: 10 }} + /> + + {formDTO && formDTO.salaryMonth} + + + + + {getLabel(519146, "核算账套")} + {formDTO && formDTO.salarySobName} + + + + + {getLabel(536726, "备注")} + {formDTO && formDTO.description} + + + + + ); + } +} + +export default BaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js new file mode 100644 index 00000000..a92c43df --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js @@ -0,0 +1,104 @@ +export const personConfirmSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js new file mode 100644 index 00000000..6c544e8f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -0,0 +1,287 @@ +/* + * Author: 黎永顺 + * name: 人员确认 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTools } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import BaseInfo from "./baseInfo"; +import { + acctemployeeList, + addedemployeeList, + deleteAcctemployee, + reducedemployeeList, + saveAcctemployee +} from "../../../../../apis/calculate"; +import { personConfirmSearchConditions } from "./condition"; +import { getSearchs } from "../../../../../util"; +import { convertToUrlString } from "../../../../../util/url"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; +const api = { + range: acctemployeeList, + sub: reducedemployeeList, + add: addedemployeeList +}; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "range", showSearchAd: false, + searchConditions: [], loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [], dataSource: [], columns: [] + }; + } + + componentDidMount() { + if ($) { + const domTabInnerList = $(".salary-calculate-do-calc-content .ant-tabs-tab-inner"); + domTabInnerList[0].setAttribute("title", ""); + domTabInnerList[1].setAttribute("title", ""); + domTabInnerList[2].setAttribute("title", ""); + } + this.setState({ + searchConditions: _.map(personConfirmSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { PCSearchForm } } = this.props; + PCSearchForm.initFormFields(this.state.searchConditions); + this.queryPCList(); + }); + } + + renderTabBtns = () => { + const { selectedKey, selectedRowKeys } = this.state; + let tabBtns = []; + switch (selectedKey) { + case "range": + tabBtns = [ + this.handleDeletePCitem()}/>, + ids && this.handleUserBrowserChange(ids.split(","))} + > + + , + + ]; + break; + case "add": + case "sub": + tabBtns = [ + + ]; + break; + default: + break; + } + return tabBtns; + }; + queryPCList = () => { + const { pageInfo, selectedKey } = this.state; + const { calculateStore: { PCSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { departmentIds, positionIds, statuses, ...extra } = PCSearchForm.getFormParams(); + const payload = { + salaryAcctRecordId, ...pageInfo, ...extra, + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], + statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] + }; + this.setState({ loading: true }); + api[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource = [], pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleDeletePCitem = (ids) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + const { selectedRowKeys } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + deleteAcctemployee({ salaryAcctRecordId, ids: !_.isEmpty(ids) ? ids : selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.queryPCList(); + _.isNil(ids) && this.setState({ selectedRowKeys: [] }); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 人员确认导出 + * Params: + * Date: 2023/9/14 + */ + handleExport = () => { + let url = ""; + const { routeParams: { salaryAcctRecordId }, calculateStore: { PCSearchForm } } = this.props; + if (this.state.selectedKey === "range") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else if (this.state.selectedKey === "sub") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/reducedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/addedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } + window.open(url, "_blank"); + }; + /* + * Author: 黎永顺 + * Description: 添加人员确认 + * Params: + * Date: 2023/9/14 + */ + handleUserBrowserChange = (employeeIds) => { + const { routeParams: { salaryAcctRecordId } } = this.props; + saveAcctemployee({ salaryAcctRecordId, employeeIds }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(541531, "添加成功!")); + this.queryPCList(); + } else { + message.error(errormsg || getLabel(111, "添加失败!")); + } + }); + }; + + render() { + const { calculateStore: { PCSearchForm } } = this.props; + const { + selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, + columns, dataSource + } = this.state; + const tabDatas = [ + { + title: + {getLabel(542307, "核算人员范围")} + + , viewcondition: "range" + }, + { + title: + {getLabel(542308, "环比上月减少人员")} + + , viewcondition: "sub" + }, + { + title: + {getLabel(542308, "环比上月增加人员")} + + , viewcondition: "add" + } + ]; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.queryPCList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.queryPCList()); + } + }; + const rowSelection = { + columnWidth: 80, + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( +
+ + this.setState({ selectedKey: v }, () => this.queryPCList())} + buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220} + showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} + searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)} + onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })} + searchsBaseValue={PCSearchForm.getFormParams().employeeName} + onSearch={this.queryPCList} onAdSearch={this.queryPCList} + onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth + /> + { + let width = ""; + const { dataIndex } = item; + switch (dataIndex) { + case "taxAgentName": + case "departmentName": + width = "15%"; + break; + default: + width = "10%"; + break; + } + return { ...item, width }; + }), + { + dataIndex: "operate", + title: getLabel(30585, "操作"), + width: 120, + render: (_, record) => ( + this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")} + ) + } + ]} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less new file mode 100644 index 00000000..eb4fb73b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -0,0 +1,47 @@ +.person-confirm-layout { + .wea-tab .wea-tab-right, .wea-input-focus { + background: transparent; + } + + .wea-new-table { + background: #fff; + } +} + +.docalc-baseinfo-layout { + padding: 0; + + .wea-title { + border-bottom: none; + padding-left: 0; + } + + .wea-content.pt15 { + padding-top: 0; + } + + .docalc-baseinfo { + background: #fff; + border: 1px solid #e5e5e5; + border-right: none; + + .ant-col-24 { + border-top: 1px solid #e5e5e5; + } + + .label { + color: #666; + } + + .value { + color: #111; + } + + & > div { + border-right: 1px solid #e5e5e5; + line-height: 30px; + padding: 5px 16px; + + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js new file mode 100644 index 00000000..3539ec72 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -0,0 +1,59 @@ +/* + * Author: 黎永顺 + * name: 薪资基本信息 + * Description: + * Date: 2023/9/25 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import cs from "classnames"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class EditSalaryBaseInfo extends Component { + render() { + const { baseInfo } = this.props; + return ( + + {getLabel(82743, "基础信息")} + + + } + > + + { + _.map(baseInfo, (item, index) => { + const { fieldName, fieldValue } = item; + return ( + + + + {fieldName} + + + {fieldValue} + + + + ); + }) + } + + + ); + } +} + +export default EditSalaryBaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js new file mode 100644 index 00000000..59fcb015 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js @@ -0,0 +1,145 @@ +export const editCalcSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyIds"], + fieldcol: 12, + label: "分部", + lanId: 33553, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "CHECKBOX", + domkey: ["consolidatedTaxation"], + fieldcol: 12, + isQuickSearch: false, + label: "合并计税", + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js new file mode 100644 index 00000000..4ddc7908 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js @@ -0,0 +1,206 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-高级搜索面板 + * Description: + * Date: 2023/9/14 + */ +import React, { Component } from "react"; +import { WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTools } from "ecCom"; +import { Button, Col, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import uuidV4 from "uuid/v4"; +import { editCalcSearchConditions } from "./condition"; +import { getExportField } from "../../../../../apis/calculate"; +import { commonEnumList } from "../../../../../apis/ruleconfig"; +import { getSearchs } from "../../../../../util"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class EditCalcAdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [], salaryItems: [], + customSearchConditions: [], filterEnum: [] + }; + } + + componentDidMount() { + this.getExportField(); + this.getFilterEnumList(); + this.setState({ + searchConditions: _.map(editCalcSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { ECSearchForm } } = this.props; + ECSearchForm.initFormFields(this.state.searchConditions); + }); + } + + getFilterEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.common.FilterEnum" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + filterEnum: _.map(data, item => ({ + key: item.value, + showname: item.defaultLabel + })) + }); + } + }); + }; + getExportField = () => { + getExportField({ salaryAcctRecordId: this.props.salaryAcctRecordId }) + .then(({ status, data }) => { + if (status) { + const { itemsByGroup } = data; + this.setState({ + salaryItems: _.map(itemsByGroup, item => ({ + key: item.salarySobItemGroupId.toString(), + label: item.salarySobItemGroupName, + options: _.map(item.salaryItems, o => ({ + key: o.salaryItemId.toString(), showname: o.salaryItemName + })) + })) + }); + } + }); + }; + handleAddCustomSearchForm = () => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions, salaryItems, filterEnum } = this.state; + const uuid = uuidV4(); + this.setState({ + customSearchConditions: [ + ...customSearchConditions, + { + com: CustomFormFields({ + uuid, salaryItems, filterEnum, onDelete: this.handleDelete, onChange: this.handleChange + }), + uuid, itemId: "", filter: "", params: "" + } + ] + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + handleChange = (uuid, params) => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions } = this.state; + this.setState({ + customSearchConditions: _.map(customSearchConditions, o => { + if (o.uuid === uuid) { + return { ...o, ...params }; + } + return { ...o }; + }) + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + handleDelete = (uuid) => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions } = this.state; + this.setState({ + customSearchConditions: _.filter(customSearchConditions, o => o.uuid !== uuid) + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + + render() { + const { searchConditions, customSearchConditions } = this.state; + const { calculateStore: { ECSearchForm, setOtherConditions } } = this.props; + return ( + +
+ {getSearchs(ECSearchForm, searchConditions, 2, false)} + +
+ +
+
+ {/**/} +
+
+
+
+ + + +
+
+
+ ); + } +} + +export default EditCalcAdvanceSearchPannel; + +const CustomFormFields = (props) => { + const { uuid, onDelete, salaryItems, filterEnum, onChange } = props; + return + + + onChange(uuid, { itemId: v })} + /> + + + + + onChange(uuid, { filter: v })}/> + + + onChange(uuid, { params: v })}/> +