diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 85805d5c..5f74cc6b 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -278,5 +278,23 @@ export const getCompareSobConfig = params => { export const updateSobConfig = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); }; - - +//薪资核算-计算个税 +export const acctresultCalcTax = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTax", params); +}; +//薪资核算-获取个税计算反馈 +export const calcTaxFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTaxFeedback", params); +}; +//薪资核算-人员异常 +export const listPage4NotDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/listPage4NotDeclare", params); +}; +// 核算结果--核算税后工资 +export const afterTaxAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/afterTaxAccounting", params); +}; +// 核算税后工资进度条 +export const getAfterTaxAccountingProgress = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); +}; diff --git a/pc4mobx/hrmSalary/apis/index.js b/pc4mobx/hrmSalary/apis/index.js index ccc70771..553733d0 100644 --- a/pc4mobx/hrmSalary/apis/index.js +++ b/pc4mobx/hrmSalary/apis/index.js @@ -37,7 +37,7 @@ export const getDetailChanges = params => { }; //获取薪资账套全列表 export const getSalarysobListAll = params => { - return postFetch("/api/bs/hrmsalary/salarysob/listAll", params); + return postFetch("/api/bs/hrmsalary/salarysob/listAllByAuth", params); }; //补算 export const supplementAcctRecord = (params) => { diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index ab4ff6c2..180b22d0 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; // 薪资项目-获取列表 export const getItemList = params => { @@ -84,3 +84,19 @@ export const getSalarySobBySalaryItem = params => { export const syncSalaryItemToSalarySobItem = params => { return postFetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem", params); }; + +// 导出薪资项目 +export const exportSalaryitem = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryitem/export", params); +}; +// 下载模板 +export const downloadTemplate = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryitem/downloadTemplate", params); +}; + +// 导入薪资项目 +export const importSalaryitem = (params) => { + return postFetch("/api/bs/hrmsalary/salaryitem/import", params); +}; + + diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 9c9d625e..59f898d4 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -25,6 +25,10 @@ export const deleteLedger = params => { export const getLedgerBasicForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/basic/getForm", "get", params); }; +//薪资帐套基本信息工资类型接口 +export const getIncomeCategoryList = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/incomeCategoryList", "get", params); +}; //保存薪资帐套基本信息 export const saveLedgerBasic = params => { @@ -143,6 +147,10 @@ export const getBackitemForm = params => { export const taxreportruleGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxreportrule/getForm", "GET", params); }; +//薪资账套下的个税字段对应-个税字段对应 +export const taxruleGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxrule/getForm", "GET", params); +}; //薪资账套下的个税申报-累计字段对应 export const addupruleGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/adduprule/getForm", "GET", params); @@ -151,6 +159,10 @@ export const addupruleGetForm = params => { export const taxreportruleSave = params => { return postFetch("/api/bs/hrmsalary/salarysob/taxreportrule/save", params); }; +//保存薪资账套下的个税字段对应规则 +export const taxruleSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/taxrule/save", params); +}; //保存薪资账套下的累计字段对应关系 export const addupruleSave = params => { return postFetch("/api/bs/hrmsalary/salarysob/adduprule/save", params); diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 8ca9fab7..48fcecb2 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; import { convertToUrlString } from "../util/url"; //工资单-工资单发放列表 @@ -248,3 +248,8 @@ export const genPdfBeforeExport = (params) => { export const salaryBillPreview = (params) => { return postFetch("/api/bs/hrmsalary/salaryBill/preview", params); }; +// 工资单查看详情导出-重构 +export const exportDetailList_reconfig = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", params); +}; + diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index b5f4f87f..eebd320f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //通用字典表 {enumClass:""} export const commonEnumList = (params) => { @@ -75,3 +75,15 @@ export const reportGetForm = params => { export const saveSalarySendFeedback = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); }; +// 数据分析列表导出 +export const exportDataReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params); +}; +//迁入配置 +export const uploadConfig = (params) => { + return postFetch("/api/bs/hrmsalary/sys/uploadConfig", params); +}; +//迁入配置 +export const downloadConfig = (params) => { + return postExportFetch("/api/bs/hrmsalary/sys/downloadConfig", params); +}; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index b6fd6ffb..d0718a2f 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -5,13 +5,24 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { + WeaBrowser, + WeaDialog, + WeaFormItem, + WeaHelpfulTip, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTextarea +} from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm } from "../../apis/taxAgent"; import { commonEnumList } from "../../apis/ruleconfig"; import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; + class PersonalScopeModal extends Component { constructor(props) { super(props); @@ -91,6 +102,11 @@ class PersonalScopeModal extends Component { key: "POSITION", showname: "岗位", selected: false + }, + { + key: "SQL", + showname: "SQL", + selected: false } ]; this.setState({ @@ -124,7 +140,9 @@ class PersonalScopeModal extends Component { const payload = { employeeStatus: status.split(","), includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + targetParams: targetType !== "SQL" ? + _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) : + [{ targetType, targetId: "0", target: targetTypeIds }], [saveKeyVal["key"]]: saveKeyVal["value"] }; this.setState({ loading: true }); @@ -156,6 +174,12 @@ class PersonalScopeModal extends Component { case "POSITION": browserType = { ...browserType, type: 278, title: "岗位选择" }; break; + case "SQL": + return
+ this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/> + }/> +
; default: break; } @@ -259,3 +283,13 @@ class PersonalScopeModal extends Component { } export default PersonalScopeModal; + +export const SQLHelpTip = () => { + return
+

{getLabel(111, "注意事项:")}

+

{getLabel(111, "1、sql需返回人员id")}

+

{getLabel(111, "2、sql结尾不需要 ; go /等符号")}

+

{getLabel(111, "使用例子:定义获取岗位是开发的人员")}

+

{getLabel(111, "select id from hrmresource where JOBTITLE = 17")}

+
; +}; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index a98b2d58..5ca73075 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -33,7 +33,8 @@ class ImpStep1 extends Component { multiple: false, action: "/api/doc/upload/uploadFile", fileList, - onChange: this.handleChange + onChange: this.handleChange, + ...this.props.customDragger }; return (
@@ -45,7 +46,7 @@ class ImpStep1 extends Component { {this.props.importParams}
} -
{getLabel(543202, "导入Excel")}
+ {_.isEmpty(this.props.customDragger) &&
{getLabel(543202, "导入Excel")}
}

@@ -56,36 +57,39 @@ class ImpStep1 extends Component {

+ { + (_.isNil(this.props.customDragger) || this.props.customDragger.showOperateDesc) && + +
+
{getLabel(27577, "操作步骤")}
+

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

+

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

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
-
-
{getLabel(27577, "操作步骤")}
-

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

-

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

-

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

-

- {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} -

-
- -
-
{getLabel(543223, "Excel文件说明")}
-

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

-

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

-

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

-
- +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+
+ } ); } diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js index df9575ef..82ed0adb 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -7,6 +7,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; import successImg from "../../importModal/success.svg"; +import MoveInResult from "./moveInResult"; const getLabel = WeaLocaleProvider.getLabel; @@ -16,32 +17,41 @@ class ImpStep3 extends Component { return (
{ - !_.isEmpty(importResult) ? -
-

-

- {getLabel(389249, "已导入")} - {importResult.successCount}   - {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} - {importResult.errorCount}  {getLabel(30690, "条数据")} -

-
: -
-

{getLabel(111, "导入失败")}

-
- } - { - (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && - : + { - title: getLabel(25700, "错误信息"), - dataIndex: "message" + !_.isEmpty(importResult) ? +
+

+ { + importResult.successCount && +

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+ } +
: +
+

{getLabel(111, "导入失败")}

+
} - ]} - dataSource={importResult.errorData || importResult.errorNotice} pagination={false} - scroll={{ y: `calc(100vh - 387px)` }} - /> + { + !_.isEmpty(importResult) && (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && + + } +
}
); diff --git a/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js b/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js new file mode 100644 index 00000000..2a6358a6 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/moveInResult.js @@ -0,0 +1,56 @@ +/* + * 薪酬迁入结果展示 + * + * @Author: 黎永顺 + * @Date: 2024/8/16 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class MoveInResult extends Component { + downloadTxtfile = (value, type) => { + if (!value) return; + const element = document.createElement("a"); + const file = new Blob([value], { type: "text/plain" }); + element.href = URL.createObjectURL(file); + element.download = `导入${type}信息.txt`; + document.body.appendChild(element); + element.click(); + }; + + render() { + const { dataSource } = this.props; + return ( + ( + this.downloadTxtfile(record.success.join("\n"), getLabel(111, "成功"))}> + {record.success.length} + this.downloadTxtfile(record.warning.join("\n"), getLabel(111, "警告"))}>{record.warning.length} + this.downloadTxtfile(record.error.join("\n"), getLabel(111, "错误"))}>{record.error.length} + ) + } + ]} + dataSource={dataSource} pagination={false} bordered scroll={{ y: `calc(100vh - 333px)` }} + /> + ); + } +} + +export default MoveInResult; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index 796358d3..41e76e23 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -36,13 +36,17 @@ class Index extends Component { } renderChildren = () => { - const { current } = this.state, { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + const { current } = this.state, { + importParams, link, excludeKey, importResult, + exportDataDom = null, customDragger + } = this.props; const scrollHeight = this.importRef ? this.importRef.state.height - 232 : 606.6; let CurrentDom = null; switch (current) { case 0: - CurrentDom = this.step1Ref = dom}/>; + CurrentDom = + this.step1Ref = dom}/>; break; case 1: CurrentDom = ; @@ -100,13 +104,16 @@ class Index extends Component { } const [file] = fileList; const { response } = file; - this.setState({ - current: this.state.current + 1, - fileid: response.data.fileid - }, () => { - !excludeKey && this.props.nextCallback && this.props.nextCallback(this.state.fileid); - excludeKey && this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid); - }); + if (!excludeKey) { + this.setState({ + current: this.state.current + 1, + fileid: response.data.fileid + }, () => { + this.props.nextCallback && this.props.nextCallback(this.state.fileid); + }); + } else { + this.props.nextUplaodCallback && this.props.nextUplaodCallback(response.data.fileid); + } } else { this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid); } diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index c3c33dc8..3751c137 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -24,7 +24,7 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页 // import Payroll from "./pages/payroll"; import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面 import PayrollGrant from "./pages/payroll/payrollGrant"; -import PayrollDetail from "./pages/payroll/payrollDetail"; +import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; // import Declare from "./pages/declare"; import DeclareDetail from "./pages/declareDetail"; import DeclareOnlineComparison from "./pages/declareOnlineComparison"; @@ -61,6 +61,7 @@ import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; import TopologyMap from "./pages/topologyMap"; import SupplementaryCalc from "./pages/supplementaryCalc"; +import Layout from "./layout"; //二开页面路由 import PersonalConfirm from "./pages/custom-pages/angli/personalConfirm"; import SalaryAccounting from "./pages/custom-pages/angli/salaryAccounting" @@ -129,7 +130,7 @@ const DataAcquisition = (props) => props.children; // intelligentCalculateSalarySettings 智能算薪 const Routes = ( - + @@ -139,8 +140,8 @@ const Routes = ( - - + + diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js new file mode 100644 index 00000000..f1ad9a67 --- /dev/null +++ b/pc4mobx/hrmSalary/layout.js @@ -0,0 +1,53 @@ +/* + * 薪酬管理- + * layout组件 + * @Author: 黎永顺 + * @Date: 2024/8/15 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import stores from "./stores"; + +const { ls } = WeaTools; +const { getLabel } = WeaLocaleProvider; + +class Layout extends Component { + constructor(props) { + super(props); + this.state = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { + if (window.location.hash.indexOf("payroll") !== -1) { + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-showset"); + } + } + } + + componentDidMount() { + if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { + const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; + const link = document.createElement("link"); + link.setAttribute("rel", "stylesheet"); + link.setAttribute("type", "text/css"); + link.setAttribute("href", src); + let header = document.getElementById("container"); + header.appendChild(link); + top.$(".ant-message").remove(); + window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); + } + } + + render() { + return ( + {this.props.children} + ); + } +} + +export default Layout; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js index d2c71fb3..d1fd2bb9 100644 --- a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js @@ -97,7 +97,7 @@ class Index extends Component { effectiveTime: effectiveTime1 ? `${effectiveTime1},${effectiveTime2}` : "", operateTime: operateTime1 ? `${operateTime1},${operateTime2}` : "" }; - window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_target"); + window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_blank"); this.handleDebounce = null; }, 500); } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 9d8d2816..3f01a8bf 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -99,13 +99,17 @@ class SalaryDetails extends Component { }).catch(() => this.setState({ loading: false })); }; handleExportSalaryList = (key) => { + const { attendanceStore: { tableStore } } = this.props; let { selectedRowKeys, payload } = this.state; if (key === "SELECTED" && selectedRowKeys.length === 0) { message.warning(getLabel(543345, "请选择需要导出的数据!")); return; } WeaLoadingGlobal.start(); - const promise = API.exportSalaryList({ ...payload, ids: key === "SELECTED" ? selectedRowKeys : [] }); + const promise = API.exportSalaryList({ + ...payload, ids: key === "SELECTED" ? selectedRowKeys : [], + columns: _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"), o => o.dataIndex) + }); }; getColumns = () => { const { attendanceStore: { tableStore } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index a7b3d7ce..e13000eb 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -5,7 +5,17 @@ * Date: 2022-09-27 18:17:02 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaTop } from "ecCom"; +import { + WeaCheckbox, + WeaDatePicker, + WeaFormItem, + WeaInput, + WeaLoadingGlobal, + WeaLocaleProvider, + WeaSearchGroup, + WeaTop +} from "ecCom"; +import MoveInDialog from "./moveInDialog"; import * as API from "../../apis/ruleconfig"; import { Button, message } from "antd"; import "./index.less"; @@ -18,6 +28,7 @@ const Input = (props) => { ); }; +const getLabel = WeaLocaleProvider.getLabel; class AppConfig extends Component { constructor(props) { @@ -28,7 +39,8 @@ class AppConfig extends Component { isLog: "0", openFormulaForcedEditing: "0", version: "", - loading: false + loading: false, + moveInDialog: { visible: false, title: getLabel(111, "数据迁入") } }; } @@ -62,10 +74,29 @@ class AppConfig extends Component { } }); }; + handleOperate = (type) => { + switch (type) { + case "import": + this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: true } }); + break; + case "export": + WeaLoadingGlobal.start(); + const promise = API.downloadConfig(); + break; + default: + break; + } + }; render() { - const { openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version } = this.state; - const btns = []; + const { + openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version, moveInDialog + } = this.state; + const btns = [ + , + , + + ]; const items = [ { com: Input({ @@ -115,6 +146,8 @@ class AppConfig extends Component { buttons={btns} /> + this.setState({ moveInDialog: { ...this.state.moveInDialog, visible: false } })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js b/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js new file mode 100644 index 00000000..afdf3765 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/appConfig/moveInDialog.js @@ -0,0 +1,73 @@ +/* + * 数据迁入 + * + * @Author: 黎永顺 + * @Date: 2024/8/12 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { message } from "antd"; +import ImportDialog from "../../components/importDialog"; +import * as API from "../../apis/ruleconfig"; + +const getLabel = WeaLocaleProvider.getLabel; + +class MoveInDialog extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + nextloading: false, importResult: {}, imageId: "", + customDragger: { showOperateDesc: false, accept: ".xml" } + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ + importDialog: { + ...this.state.importDialog, + importResult: {}, imageId: "", + customDragger: { showOperateDesc: false, accept: ".xml" } + } + }); + } + } + + handleImport = (payload) => { + const { importDialog } = this.state; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + API.uploadConfig({ ...payload }).then(({ data, status, errormsg }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog } = this.state; + return ( + this.setState({ + importDialog: { + ...importDialog, importResult: {}, imageId: "", link: "" + } + })} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default MoveInDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index eb4deb00..f65b40e6 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -276,13 +276,21 @@ class Index extends Component { this.setState({ selectedKey: v }, () => this.queryPCList())} + onChange={v => this.setState({ + selectedKey: v, + pageInfo: { ...pageInfo, current: 1 } + }, () => this.queryPCList())} + onSearch={v => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.queryPCList())} + onAdSearch={v => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => 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 /> { + const { fieldValue, canEdit, fieldValueObj } = it; + if (canEdit) { + const { id: value, name: valueSpan } = fieldValueObj || fieldValue; + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + })); + } + } + + renderBrowser = (item) => { + const { fieldType, fieldValue, fieldCode } = item; + const { id: value, name: valueSpan } = fieldValue; + let browserType = {}; + switch (fieldType) { + case "subcompanyBrowser": + browserType = { ...browserType, type: 164, title: getLabel(111, "选择分部") }; + break; + case "departmentBrowser": + browserType = { ...browserType, type: 4, title: getLabel(111, "选择部门") }; + break; + case "jobtitleBrowser": + browserType = { ...browserType, type: 24, title: getLabel(111, "选择岗位") }; + break; + case "jobcallBrowser": + browserType = { ...browserType, type: 260, title: getLabel(111, "选择职称") }; + break; + default: + break; + } + return this.props.onChange(_.map(this.props.baseInfo, it => { + if (fieldCode === it.fieldCode) { + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + }))}/>; + }; + render() { const { baseInfo } = this.props; return ( @@ -32,7 +74,7 @@ class EditSalaryBaseInfo extends Component { { _.map(baseInfo, (item, index) => { - const { fieldName, fieldValue } = item; + const { fieldName, fieldType, fieldValue, fieldValueObj } = item; return ( {fieldName} - {fieldValue} + + { + fieldType.indexOf("Browser") !== -1 ? + this.renderBrowser({ ...item, fieldValue: fieldValueObj || fieldValue }) : + fieldValue + } + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 58f353f1..867ca7ba 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -271,6 +271,9 @@ class EditCalcTable extends Component { } }).catch(() => this.setState({ loading: false })); }; + handleQuery = () => { + this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.queryCalcResultList()); + }; handleBatchEditing = () => { }; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 16cacd2c..235bac13 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -5,7 +5,7 @@ * Date: 2023/9/25 */ import React, { Component } from "react"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaTab } from "ecCom"; import EditSalaryBaseInfo from "./baseInfo"; import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable"; @@ -87,9 +87,16 @@ class EditSalaryCalcSlide extends Component { }; save = () => { const { id: salaryAcctEmpId } = this.props; - const { issuedAndReissueItems, itemsByGroup } = this.state; + const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; + if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } const payload = { - salaryAcctEmpId, + salaryAcctEmpId, employeeInfos: baseInfo, items: [ ..._.reduce(itemsByGroup, (pre, cur) => { return [ @@ -97,14 +104,14 @@ class EditSalaryCalcSlide extends Component { ..._.map(cur.salaryItems, it => { return { salaryItemId: it.salaryItemId, - resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue + resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, !_.isNil(it.pattern) ? it.pattern : 2) : it.resultValue }; }) ]; }, []), ...issuedAndReissueItems.map(item => ({ salaryItemId: item.salaryItemId, - resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue + resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, !_.isNil(item.pattern) ? item.pattern : 2) : item.resultValue })) ] }; @@ -133,7 +140,8 @@ class EditSalaryCalcSlide extends Component { top={0} width={60} height={100} measure={"%"} direction={"right"} title={this.renderTitle()} content={
- + this.setState({ baseInfo })}/> this.setState({ selectedKey: v })} datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index ee91061b..5a70bb18 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -12,6 +12,7 @@ import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; import SalaryCalcLayout from "./salaryCalcLayout"; +import PersonAbnormalDialog from "./personAbnormalDialog"; import cs from "classnames"; import "./index.less"; @@ -22,13 +23,14 @@ class Index extends Component { super(props); this.state = { salarySobCycle: {}, showSearchAd: false, - columnDesc: {}, formulaTd: "", showTotalCell: false + columnDesc: {}, formulaTd: "", showTotalCell: false, + perAbnormalDialog: { visible: false, salaryAcctRecordId: "" } }; } openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); onAdSearch = (bool = true) => { - this.calcTableRef.wrappedInstance.queryCalcResultList(); + this.calcTableRef.wrappedInstance.handleQuery(); bool && this.openAdvanceSearch(); }; init = async () => { @@ -50,7 +52,7 @@ class Index extends Component { }; render() { - const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; + const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell, perAbnormalDialog } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; return ( this.onAdSearch(false)}> @@ -65,7 +67,13 @@ class Index extends Component { style={{ marginLeft: 10 }} />
-
+
+
this.setState({ + perAbnormalDialog: { visible: true, salaryAcctRecordId } + })}>{getLabel(111, "未报送人员")}:{salarySobCycle.abnormalEmployeeNum} +
+
@@ -87,6 +95,10 @@ class Index extends Component { this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId} {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/> + this.setState({ + perAbnormalDialog: { ...perAbnormalDialog, visible: false } + })}/>
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 3d23810b..0514dc38 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -14,6 +14,11 @@ padding-bottom: 0; height: 46px; margin-bottom: 0; + + .abnormal-text { + color: #ef9502; + cursor: pointer; + } } .formula-detail-area { @@ -28,6 +33,15 @@ display: flex; align-items: center; width: 100%; + + & > span:first-child { + display: inline-block; + min-width: 44px; + } + + & > span:last-child { + flex: 1; + } } } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js new file mode 100644 index 00000000..1498fc02 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js @@ -0,0 +1,84 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-人员异常 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { listPage4NotDeclare } from "../../../../../apis/calculate"; + +const { getLabel } = WeaLocaleProvider; + +class PersonAbnormalDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.queryList(nextProps); + } + + queryList = (props) => { + const { salaryAcctRecordId } = props, { pageInfo } = this.state; + const payload = { ...pageInfo, recordId: salaryAcctRecordId }; + this.setState({ loading: true }); + listPage4NotDeclare(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns + }); + } else { + + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, columns, dataSource, pageInfo } = 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.queryList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.queryList(this.props)); + } + }; + return ( + +
+ +
+
+ ); + } +} + +export default PersonAbnormalDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 17d4b09e..213c802b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -9,7 +9,7 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; -import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate"; +import * as API from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryEditCalc from "./components/salaryEditCalc"; @@ -29,7 +29,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "person", progressVisible: false, progress: 0, + selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false }, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, accountExceptInfo: "" //核算报错信息, @@ -61,11 +61,11 @@ class Index extends Component { this.setState({ progress: 0 }); let payload = { salaryAcctRecordId }; if (key === "calc_selected") payload = _.assign(payload, { ids: selectedRowKeys }); - acctresultAccounting(payload).then(() => { + API.acctresultAccounting(payload).then(() => { this.setState({ progressVisible: true }); if (this.timer) clearInterval(this.timer); this.timer = setInterval(() => { - getCalculateProgress(salaryAcctRecordId).then(({ data }) => { + API.getCalculateProgress(salaryAcctRecordId).then(({ data }) => { let progress = data.progress; if (progress === 1 && this.timer) { clearInterval(this.timer); @@ -105,7 +105,7 @@ class Index extends Component { window.open(`${window.ecologyContentPath || ""}${url}`, "_blank"); break; case "export_custom": - getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => { if (status) { const { checkItems, itemsByGroup } = data; this.setState({ @@ -133,8 +133,71 @@ class Index extends Component { break; } }; + acctresultCalcTax = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, calcTax: true } }); + API.acctresultCalcTax({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, calcTax: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.calc.onAdSearch(false); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, calcTax: false } })); + }; + calcTaxFeedback = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, feedback: true } }); + API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, feedback: false } }); + if (status) { + this.calc.onAdSearch(false); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "成功获取个税信息,是否继续计算税后工资?"), + onOk: () => this.afterTaxAccounting() + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } })); + }; + afterTaxAccounting = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ progress: 0 }); + let payload = { salaryAcctRecordId }; + API.afterTaxAccounting(payload).then(() => { + this.setState({ progressVisible: true }); + if (this.timer) clearInterval(this.timer); + this.timer = setInterval(() => { + API.getAfterTaxAccountingProgress(salaryAcctRecordId).then(({ data }) => { + let progress = data.progress; + if (progress === 1 && this.timer) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.success(getLabel(111, "操作完成")); + this.calc.onAdSearch(false); + } else if (!data.status) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.error(data.message); + } + this.setState({ progress: Number(progress) * 100 }); + }); + }, 1000); + }); + }; renderReqBtns = () => { - const { selectedKey, accountExceptInfo } = this.state; + const { selectedKey, accountExceptInfo, loading } = this.state; let reqBtns = []; switch (selectedKey) { case "calc": @@ -155,6 +218,10 @@ class Index extends Component { this.doCacl("ALL")} overlay={menu} type="primary"> {getLabel(543545, "核算所有人")} , + , + , , this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js index 33a90a08..9d2ddfce 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js @@ -40,7 +40,7 @@ class PayrollItemsTable extends Component { const { canEdit, dataType, pattern } = record; return dataType === "number" ? onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)} /> : ({ ...o, width: 150, fixed: null })) + columns: _.map(columns, o => ({ ...o, width: 150, fixed: null })) }); } }).catch(() => this.setState({ loading: { ...loading, query: false } })); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js index 14de4956..c8fdb4b9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js @@ -55,7 +55,7 @@ class AttendanceRefrenceDataModal extends Component { ...item, items: _.map(items, child => { const { domkey } = child; - if (domkey[0] === "salarySobId") { + if (domkey[0] === "salarySobIds") { return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) }; } return { ...child }; @@ -77,19 +77,23 @@ class AttendanceRefrenceDataModal extends Component { refenceform.validateForm().then(f => { if (f.isValid) { const payload = refenceform.getFormParams(); - const checkPayload = { salaryYearMonthStr: payload.salaryYearMonth, salarySobId: payload.salarySobId }; + const checkPayload = { + salaryYearMonthStr: payload.salaryYearMonth, + salarySobIds: payload.salarySobIds.split(",") + }; this.setState({ loading: true }); checkOperation(checkPayload).then(({ status, errormsg: errormessage }) => { if (status) { - syncAttendanceRefer(payload).then(({ status, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success("同步成功"); - onCancel(true); - } else { - message.error(errormsg || "同步失败"); - } - }).catch(() => this.setState({ loading: false })); + syncAttendanceRefer({ ...payload, salarySobIds: payload.salarySobIds.split(",") }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("同步成功"); + onCancel(true); + } else { + message.error(errormsg || "同步失败"); + } + }).catch(() => this.setState({ loading: false })); } else { this.setState({ loading: false }); message.error(errormessage); @@ -212,9 +216,9 @@ class AttendanceRefrenceDataModal extends Component { ]; return ( - +
- {getSearchs(refenceform, condition, 1)} + {getSearchs(refenceform, condition, 1, false, null, "", "multiple_select")}
{/* 表头设置 */} this.setState({ targetid: "" })} > this.setState({ cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } })} diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js index cb9ce2fe..7a9046ba 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js @@ -86,6 +86,18 @@ export const paymentBankConditions = [ value: "", viewAttr: 1, options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["paymentNumber"], + fieldcol: 12, + label: "缴款帐号", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1, + options: [] } ], defaultshow: true diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js index 4f6ad59f..6fca282a 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js @@ -5,9 +5,9 @@ * Date: 2023/8/22 */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaLoadingGlobal } from "ecCom"; import { inject, observer } from "mobx-react"; -import { Button, Dropdown, Menu, message, Modal } from "antd"; +import { Button, message, Modal } from "antd"; import PaymentDialog from "./paymentDialog"; import { taxPaymentAgreemenPay, @@ -122,6 +122,7 @@ class PaymentBtn extends Component { }; getBankAccountInfo = (payload) => { let loop = () => { + WeaLoadingGlobal.start({ tip: getLabel(111, "获取三方信息中...") }); clearTimeout(this.timer); this.timer = setTimeout(async () => { let response = await taxPaymentgetAgreementFeedback(payload); @@ -129,6 +130,7 @@ class PaymentBtn extends Component { if (status) { const { finish, form } = data; if (finish) { + WeaLoadingGlobal.destroy(); const { feedbacks, bankForm } = form; const { paymentDialog } = this.state; this.setState({ @@ -155,6 +157,12 @@ class PaymentBtn extends Component { value: !_.isEmpty(bankForm) ? bankForm.bank : "", options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.khhhh })) }; + } else if (key === "paymentNumber") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.jkzh })) + }; } return { ...it }; }) @@ -168,6 +176,7 @@ class PaymentBtn extends Component { } else { message.warning(errormsg); clearTimeout(this.timer); + WeaLoadingGlobal.destroy(); } }, 800); }; @@ -176,15 +185,16 @@ class PaymentBtn extends Component { taxPaymentAgreemenPay = () => { const { paymentDialog } = this.state; const { taxAmount } = paymentDialog; - const { declareStore: { paymentForm } } = this.props; + const { declareStore: { paymentForm }, reportType } = this.props; const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; paymentForm.validateForm().then(f => { if (f.isValid) { - const { protocolNumber } = paymentForm.getFormParams(); + const { protocolNumber, paymentNumber } = paymentForm.getFormDatas(); const payload = { taxDeclareRecordId: getQueryString("id"), taxYearMonth: taxYearMonth + "-01", - taxAgentId, taxAmount, protocolNumber + taxAgentId, taxAmount, protocolNumber: protocolNumber.value, + reportType, paymentNumber: paymentNumber.valueSpan }; this.setState({ paymentDialog: { @@ -332,15 +342,16 @@ class PaymentBtn extends Component { const { paymentDialog } = this.state; return ( - - {getLabel(111, "银行端凭证缴款")} - {getLabel(111, "作废缴款凭证")} - - } - type="ghost">{getLabel(111, "三方缴款")} + + {/**/} + {/* {getLabel(111, "银行端凭证缴款")}*/} + {/* {getLabel(111, "作废缴款凭证")}*/} + {/* */} + {/* }*/} + {/* type="ghost">{getLabel(111, "三方缴款")}*/} - + {/*个税接口改造*/} + {/**/} + { const [__, taxDeclarationId] = this.state.selectedKey.split("%%"); - window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_target"); + window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_blank"); }; handleTabEdit = (tabKey, type) => { if (type === "remove") { @@ -388,9 +388,9 @@ class Index extends Component { , - + // )); if (!intelCalcSalaryStatus) { if (["NOT_DECLARE", "DECLARE_FAIL"].includes(declareInfo.declareStatus)) { diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js index ed7805cf..f9783c57 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -21,7 +21,8 @@ import { employeedeclareList4Add, employeedeclareList4Update, employeedeclareRefresh, - employeeDelete, employeeInvalid, + employeeDelete, + employeeInvalid, getDeclareFeedback } from "../../apis/declare"; import { advanceConditions, submitStatus } from "./constants"; @@ -146,7 +147,8 @@ class Index extends Component { "总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"), "操作": getLabel(30585, "操作"), "删除": getLabel(535052, "删除"), "共": getLabel(83698, "共"), "条": getLabel(18256, "条"), - "加载中": getLabel(83698, "加载中"), "作废": getLabel(111, "作废") + "加载中": getLabel(83698, "加载中") + // "作废": getLabel(111, "作废") }; const childFrameObj = document.getElementById("atdTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js new file mode 100644 index 00000000..3df66b4c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js @@ -0,0 +1,148 @@ +/* + * + * 个税字段对应 + * @Author: 黎永顺 + * @Date: 2024/6/17 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import LedgerFieldsItemPopver from "./ledgerFieldsItemPopver"; +import { taxruleGetForm } from "../../../apis/ledger"; +import LedgerFieldsTable from "./ledgerFieldsTable"; +import uuidV4 from "uuid/v4"; + +const { getLabel } = WeaLocaleProvider; + +class IncomeTaxFields extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "", tabs: [], + incomeTaxFields: [], keywords: "" + }; + } + + componentDidMount() { + this.taxruleGetForm(); + } + + taxruleGetForm = () => { + const { editId, saveSalarySobId } = this.props; + taxruleGetForm({ id: editId || saveSalarySobId }).then(({ status, data }) => { + if (status && !_.isEmpty(data)) { + this.setState({ + tabs: _.map(data, it => ({ viewcondition: it.incomeCategoryId, title: it.incomeCategoryName })), + selectedKey: _.take(data)[0].incomeCategoryId, + incomeTaxFields: _.map(data, it => ({ + ...it, taxReportRules: _.map(it.taxRules, o => ({ + ...o, canEdit: o.canEdit, id: uuidV4(), reportColumnDataIndex: o.taxIndex, reportColumnName: o.name, + salaryItem: [{ id: o.salaryItemId, name: o.salaryItemName }] + })) + })) + }, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey)); + } + }); + }; + handleChangeSwitch = (visible, id) => { + const { incomeTaxFields, selectedKey } = this.state; + this.setState({ + incomeTaxFields: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.map(it.taxReportRules, child => { + if (child.id === id) { + return { ...child, visible }; + } + return { ...child, visible: false }; + }) + }; + } + return { ...it }; + }) + }, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey)); + }; + handleChangeIncomeFieldsItem = (salaryItem, recordRuleId) => { + const { incomeTaxFields, selectedKey } = this.state; + this.setState({ + incomeTaxFields: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.map(it.taxReportRules, child => { + if (child.id === recordRuleId) { + return { ...child, visible: false, salaryItem }; + } + return { ...child, visible: false }; + }) + }; + } + return { ...it }; + }) + }, () => { + this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey); + }); + }; + + render() { + const { editId, saveSalarySobId } = this.props; + const { selectedKey, tabs, incomeTaxFields, keywords } = this.state; + const list = _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.filter(it.taxReportRules, item => item.reportColumnName.indexOf(keywords) !== -1) + }; + } + return { ...it }; + }); + const dataSource = _.takeWhile(list, it => it.incomeCategoryId === selectedKey); + return ( + + this.setState({ keywords: val })} + /> +
+ } + > + + {getLabel(111, "个税申报表字段")} + {/**/} + , + width: "50%", + dataIndex: "reportColumnName" + }, + { + title: getLabel(111, "对应本账套薪资项目"), + width: "50%", + dataIndex: "salaryItem", + render: (_, record) => ( + + ) + } + ]} + dataSource={dataSource} + /> +
+ ); + } +} + +export default IncomeTaxFields; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index eaef2a08..add0af5c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -5,11 +5,11 @@ * Date: 2022/12/9 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom"; import { Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { baseSettingFormItem } from "../config"; -import { getLedgerBasicForm } from "../../../apis/ledger"; +import { getIncomeCategoryList, getLedgerBasicForm } from "../../../apis/ledger"; import { generateBasicInfo, getAddMonthYearMonth, @@ -18,10 +18,12 @@ import { getSubtractMonthYearMonth, prefixAddZero } from "../../../util/date"; -import { commonEnumList } from "../../../apis/ruleconfig"; import moment from "moment"; +import cs from "classnames"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore") @observer class LedgerBaseSetting extends Component { @@ -128,10 +130,7 @@ class LedgerBaseSetting extends Component { }); }; commonEenumList = () => { - const payload = { - enumClass: "com.engine.salary.enums.salarysob.IncomeCategoryEnum" - }; - commonEnumList(payload).then(({ status, data }) => { + getIncomeCategoryList().then(({ status, data }) => { if (status) { const { baseForm } = this.state; this.setState({ @@ -139,7 +138,16 @@ class LedgerBaseSetting extends Component { if (it.key === "taxableItems") { return { ...it, - options: _.map(data, it => ({ key: it.value.toString(), showname: it.defaultLabel })) + options: _.map(data, it => ({ + key: it.value.toString(), + showname:
+ {it.defaultLabel} + + {it.reportTypeName} + +
+ })) }; } return { ...it }; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index 2bb99eb1..eaf6e97e 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -8,20 +8,23 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; import { Button, message, Modal } from "antd"; -import SlideModalTitle from "../../../components/slideModalTitle"; import LedgerBaseSetting from "./ledgerBaseSetting"; import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel"; import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules"; import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem"; import LedgerSalaryItem from "./ledgerSalaryItem"; import IncomeTaxFields from "./incomeTaxFields"; +import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding"; import CumulativeFields from "./cumulativeFields"; +import WeaTopTitle from "../../../components/custom-title/weaTopTitle"; +import WeaReqTitle from "../../../components/custom-title/weaReqTitle"; import { addupruleSave, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem, - taxreportruleSave + taxreportruleSave, + taxruleSave } from "../../../apis/ledger"; import "./index.less"; @@ -39,6 +42,7 @@ class LedgerSlide extends Component { baseSettingInfo: {}, adjustRules: [], empFields: [], itemGroups: [], + taxruleFields: [], taxruleKeys: "", //个税字段对应 incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应 addupruleFields: [], addupruleKeys: "", //累计字段对应 saveSalarySobId: "", @@ -101,7 +105,6 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success("保存成功"); - this.handleClose(); } else { message.success(errormsg || "保存失败"); } @@ -125,7 +128,8 @@ class LedgerSlide extends Component { return { ...item, items: _.map(item.items, it => { - // delete it.formulaContent; + delete it.originFormulaContent; + delete it.originSqlContent; // if (it.id && it.id.length > 4) delete it.id; return { ...it }; }) @@ -133,7 +137,8 @@ class LedgerSlide extends Component { }), items: _.map(_.find(itemGroups, it => it.name === "未分类").items, child => { // if (child.id && child.id.length > 4) delete child.id; - // delete child.formulaContent; + delete child.originFormulaContent; + delete child.originSqlContent; return { ...child }; }) || [], salarySobId: salarySobId || saveSalarySobId @@ -148,6 +153,46 @@ class LedgerSlide extends Component { } }).catch(() => this.setState({ loading: false })); }; + /* + * Author: 黎永顺 + * Description:个税字段对应-保存 + * Params: + * Date: 2023/8/16 + */ + taxRuleSave = () => { + const { editId } = this.props; + const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems } = this.state; + const payload = { + salarySobId: editId || saveSalarySobId, + incomeCategoryParams: _.map(taxruleFields, it => { + if (it.incomeCategoryId === taxruleKeys) { + return { + incomeCategory: it.incomeCategoryId, + taxRuleParams: _.map(it.taxReportRules, child => { + return { + taxIndex: child.reportColumnDataIndex, + salaryItemId: _.map(child.salaryItem, o => o.id).join(",") + }; + }) + }; + } + return { + incomeCategory: it.incomeCategoryId, + taxRuleParams: [] + }; + }) + }; + this.setState({ loading: true }); + taxruleSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + !editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && this.handleClose(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => this.setState({ loading: false })); + }; /* * Author: 黎永顺 * Description:个税申报字段对应-保存 @@ -155,33 +200,29 @@ class LedgerSlide extends Component { * Date: 2023/8/16 */ taxreportruleSave = () => { - const { taxableItems, incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state; const { editId } = this.props; - if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) { - this.saveLedgerAdjustRule(); - } else { - const payload = { - salarySobId: editId || saveSalarySobId, - incomeCategoryParams: _.map(incomeTaxFields, it => { - if (it.incomeCategoryId === incomeTaxKeys) { - return { - incomeCategory: it.incomeCategoryId, - taxReportRuleParams: _.map(it.taxReportRules, child => { - return { - reportColumnDataIndex: child.reportColumnDataIndex, - salaryItemId: _.map(child.salaryItem, o => o.id).join(",") - }; - }) - }; - } + const { incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state; + const payload = { + salarySobId: editId || saveSalarySobId, + incomeCategoryParams: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === incomeTaxKeys) { return { incomeCategory: it.incomeCategoryId, - taxReportRuleParams: [] + taxReportRuleParams: _.map(it.taxReportRules, child => { + return { + reportColumnDataIndex: child.reportColumnDataIndex, + salaryItemId: _.map(child.salaryItem, o => o.id).join(",") + }; + }) }; - }) - }; - this.saveTaxreportrule(payload); - } + } + return { + incomeCategory: it.incomeCategoryId, + taxReportRuleParams: [] + }; + }) + }; + this.saveTaxreportrule(payload); }; saveTaxreportrule = (payload) => { this.setState({ loading: true }); @@ -201,7 +242,10 @@ class LedgerSlide extends Component { * Date: 2023/8/17 */ addupruleSave = () => { - const { taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields, addupruleKeys, saveSalarySobId } = this.state; + const { + taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields, + addupruleKeys, saveSalarySobId + } = this.state; const { editId } = this.props; if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) { const payload = { @@ -251,27 +295,21 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success(getLabel(22619, "保存成功!")); + !editId && this.handleClose(); } else { message.error(errormsg || getLabel(22620, "保存失败!")); } }).catch(() => this.setState({ loading: false })); } }; - handleChangeSlideTab = (current) => { - this.setState({ current: Number(current) }); - }; - handleClose = () => { - this.setState({ current: 0 }, () => this.props.onCancel()); - }; + handleClose = () => this.setState({ current: 0, baseSettingInfo: {} }, () => this.props.onCancel()); /* * Author: 黎永顺 * Description: 基础信息字段切换 * Params: * Date: 2022/12/9 */ - handleChangeSaveParams = (baseSettingInfo) => { - this.setState({ baseSettingInfo }); - }; + handleChangeSaveParams = (baseSettingInfo) => this.setState({ baseSettingInfo }); /* * Author: 黎永顺 * Description: 薪资项目保存数据 @@ -281,179 +319,138 @@ class LedgerSlide extends Component { handleSaveSalaryItemParams = (empFields, itemGroups) => { this.setState({ empFields, itemGroups }); }; - renderChildren = () => { - const { editId } = this.props; - const { current, saveSalarySobId, taxableItems } = this.state; - let CurrentDom = null; - switch (current) { - case 0: - CurrentDom = this.setState({ taxableItems: val })} - />; - break; - case 1: - CurrentDom = ; - break; - case 2: - CurrentDom = ; - break; - case 3: - CurrentDom = ; - break; - case 4: - CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? - this.setState({ - incomeTaxFields, - incomeTaxKeys: selectedKey - })}/> : - this.setState({ - addupruleFields, - addupruleKeys: selectedKey - })}/>; - break; - case 5: - CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? - this.setState({ adjustRules })}/> : - this.setState({ - incomeTaxFields, - incomeTaxKeys: selectedKey - })}/>; - break; - case 6: - CurrentDom = - this.setState({ adjustRules })}/>; - break; - default: - CurrentDom = null; - break; - } - return CurrentDom; - }; - renderCustomOperate = () => { - const { taxAgentStore: { showOperateBtn }, editId } = this.props; - const { current, loading, taxableItems } = this.state; - let CurrentDom = []; - //管理员操作权限 - if (showOperateBtn) { - switch (current) { - case 0: - CurrentDom = [ - - ]; - break; - case 1: - CurrentDom = !editId ? [ - , - - ] : []; - break; - case 2: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 3: - CurrentDom = !editId ? - [ - , - , - - ] : []; - break; - case 4: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 5: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 6: - CurrentDom = !editId ? - [ - , - - ] : [ - - ]; - break; - default: - break; - } - } - return CurrentDom; - }; render() { + const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props; + const { current, taxableItems, saveSalarySobId, loading } = this.state; let tabs = [ - { key: 0, title: getLabel(82751, "基础设置") }, - { key: 1, title: getLabel(543467, "关联人员") }, - { key: 2, title: getLabel(542362, "薪资项目") }, - { key: 3, title: getLabel(543468, "回算薪资项目") }, - { key: 4, title: getLabel(111, "累计字段对应") }, - { key: 5, title: getLabel(111, "个税申报字段对应") }, - { key: 6, title: getLabel(543469, "调薪计薪规则") } + { + key: 0, title: getLabel(82751, "基础设置"), + createBtns: [ + + ], + editBtns: [ + + ], + children: this.setState({ taxableItems: val })} + /> + }, + { + key: 1, title: getLabel(543467, "关联人员"), + createBtns: [ + , + + ], + editBtns: [], + children: + }, + { + key: 2, title: getLabel(542362, "薪资项目"), + createBtns: [ + , + , + + ], + editBtns: [ + + ], + children: + }, + { + key: 3, title: getLabel(543468, "回算薪资项目"), + createBtns: [ + , + , + + ], + editBtns: [], + children: + }, + { + key: 4, title: getLabel(543469, "调薪计薪规则"), + createBtns: [ + , + , + + ], + editBtns: [ + + ], + children: this.setState({ adjustRules })}/> + }, + { + key: 5, title: getLabel(111, "个税申报配置"), + createBtns: [ + , + , + + ], + editBtns: [], + children: this.setState({ + incomeTaxFields, + incomeTaxKeys: selectedKey + })}/> + }, + { + key: 6, title: getLabel(111, "同步个税配置"), + createBtns: + !(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? + [ + , + , + + ] : [ + , + + ], + editBtns: [], + children: this.setState({ + taxruleFields, taxruleKeys: selectedKey + })}/> + }, + { + key: 7, title: getLabel(111, "累计字段对应"), + createBtns: [ + , + + ], + editBtns: [], + children: this.setState({ + addupruleFields, addupruleKeys: selectedKey + })}/> + } ]; - const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props; - const { current, taxableItems } = this.state; - (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && (tabs = _.filter(tabs, o => o.key !== 4)); + (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && + (tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j }))); return ( { - }} - selectedTab={current} - customOperate={this.renderCustomOperate()} - subItemChange={this.handleChangeSlideTab} - /> + !editId ? current === o.key).createBtns}/> : + current === o.key).editBtns : []} + tabDatas={tabs} selectedKey={String(current)} + onChange={cur => this.setState({ current: parseInt(cur) })}/> } content={
@@ -487,9 +476,7 @@ class LedgerSlide extends Component { } } - { - this.renderChildren() - } + {_.find(tabs, o => current === o.key).children}
} onClose={this.handleClose} diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js new file mode 100644 index 00000000..82c06533 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/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("payrollStore") +@observer +class Index extends Component { + render() { + const { payrollStore: { detailListConditionForm } } = this.props; + return ( +
+ detailListConditionForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/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/payroll/payrollDetail/components/salaryDetailList/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js new file mode 100644 index 00000000..3c5e23b5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js @@ -0,0 +1,145 @@ +/* + * + * 查看工资单详情-列表 + * @Author: 黎永顺 + * @Date: 2024/7/15 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaLocaleProvider } from "ecCom"; +import { Spin } from "antd"; +import { WeaTableNew } from "comsMobx"; +import * as API from "../../../../../apis/payroll"; +import { getQueryString } from "../../../../../util/url"; + +const getLabel = WeaLocaleProvider.getLabel; +const WeaTableComx = WeaTableNew.WeaTable; + +@inject("payrollStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], visible: false, updateSum: true, payload: {}, + pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.setState({ updateSum: true }, () => this.getPayrollDetailList()); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getPayrollDetailList(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + const { pageNum: current, size: pageSize } = params; + this.setState({ + pageInfo: { ...this.state.pageInfo, current, pageSize }, + updateSum: false + }, () => this.getPayrollDetailList()); + break; + default: + break; + } + } + }; + getPayrollDetailList = () => { + const { pageInfo } = this.state; + const salarySendId = getQueryString("id"); + const { payrollStore: { detailListConditionForm: form, salaryTableStore } } = this.props; + const payload = { + salarySendId, ...pageInfo, ...form.getFormParams(), + departmentIds: form.getFormParams().departmentIds ? form.getFormParams().departmentIds.split(",") : [], + subCompanyIds: form.getFormParams().subCompanyIds ? form.getFormParams().subCompanyIds.split(",") : [] + }; + this.setState({ loading: true }); + API.getPayrollDetailList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { dataKey, pageInfo: pageResult, datas: dataSource } = data; + const { datas } = dataKey; + const { pageNum: current, pageSize, total } = pageResult; + salaryTableStore.getDatas(datas); + this.setState({ payload, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); + } + }); + }; + getColumns = () => { + const { payrollStore: { salaryTableStore }, showTotalCell } = this.props; + const { dataSource, pageInfo, selectedRowKeys, payload, updateSum } = this.state; + const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true"); + const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryBill/send/sum" : ""; + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, + tableScrollHeight: pageInfo.total === 0 ? 90 : 156, + sumRowlistUrl, payload: { ...payload, updateSum }, + columns: _.map(columns, (it, idx) => ({ + ...it, width: it.oldWidth, fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", + ellipsis: true + })) + }); + } + return []; + }; + postMessageToChild = (payload) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + handleSetCustomCols = () => { + const { payrollStore: { salaryTableStore } } = this.props; + this.setState({ updateSum: true }, () => { + salaryTableStore.setColSetVisible(true); + salaryTableStore.tableColSet(true); + }); + }; + + + render() { + const { payrollStore: { salaryTableStore } } = this.props; + const { loading, pageInfo } = this.state; + const { pageSize, total } = pageInfo; + const columnNum = total > 10 ? pageSize + 1 : total + 1; + return ( +
+ +