diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 2ffee227..b14015a7 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -568,3 +568,20 @@ export const cacheImportField = (params) => { export const salaryacctAcctresultCheckAuth = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params); }; + +//薪资核算-导出核算结果前生成可选的薪资项目 +export const getExportField = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/exportField", "GET", params); +}; + +//薪资核算-导出薪资核算添加表头字段缓存 +export const customCacheExportField = (params) => { + return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/apis/externalPersonManage.js b/pc4mobx/hrmSalary/apis/externalPersonManage.js new file mode 100644 index 00000000..91854ebb --- /dev/null +++ b/pc4mobx/hrmSalary/apis/externalPersonManage.js @@ -0,0 +1,27 @@ +import { postFetch } from "../util/request"; +import { WeaTools } from "ecCom"; + +//非系统人员-保存 +export const save = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/save", params); +}; + +//非系统人员-修改 +export const update = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/update", params); +}; + +//非系统人员-列表 +export const listPage = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/listPage", params); +}; + +//非系统人员-删除 +export const deleteExtEmp = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/delete", params); +}; + +//非系统人员-详情 +export const detail = params => { + return WeaTools.callApi("/api/bs/hrmsalary/extEmp/detail", "get", params); +}; diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index b04e881e..834a6c47 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -71,6 +71,17 @@ export const saveLedgerBasic = params => { }).then(res => res.json()); }; +//薪资帐套外部人员范围(包含)列表 +export const getLedgerPersonRangeExtList = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资帐套人员范围(包含)列表 export const getLedgerPersonRangeInclude = params => { return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", { @@ -104,6 +115,28 @@ export const getLedgerPersonRangeForm = params => { ); }; +//保存薪资帐套外部人员范围 +export const saveLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/ext/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//删除薪资帐套外部人员范围 +export const deleteLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //保存薪资帐套人员范围 export const saveLedgerPersonRange = params => { return fetch("/api/bs/hrmsalary/salarysob/range/save", { diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 1f9b1d64..14c949d5 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -375,6 +375,14 @@ export const sendMobileCode = (params) => { export const payrollCheckType = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params); }; +//工资单-反馈验证 +export const feedBackSalaryBill = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/feedBackSalaryBill", "GET", params); +}; +//工资单-确认 +export const confirmSalaryBill = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/confirmSalaryBill", "GET", params); +}; // 工资单基础设置-获取设置列表 export const getSalaryBillBaseSetForm = (id) => { diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 2e3c0c4f..b5f4f87f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -6,6 +6,10 @@ export const commonEnumList = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params); }; +export const sysinfo = params => { + return WeaTools.callApi("/api/bs/hrmsalary/sys/info", "GET", params); +}; + export const sysOrderRule = params => { return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params); }; @@ -47,6 +51,10 @@ export const operateTaxDeclarationFunction = (params) => { export const saveArchiveDelete = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params); }; +//保存系统规则开关 +export const saveSysOperate = (params) => { + return postFetch("/api/bs/hrmsalary/sys/operate", params); +}; //保存个税申报撤回规则 export const saveWithDrawTaxDeclaration = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params); @@ -63,3 +71,7 @@ export const reportStatisticsReportSave = (params) => { export const reportGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/getForm", "GET", params); }; +//工资单反馈 +export const saveSalarySendFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index f22de23d..8225e46e 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -70,6 +70,18 @@ export const deleteTaxAgent = (params) => { export const taxAgentRangeSave = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params); }; +//非系统人员范围查询 +export const taxAgentRangelistExt = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params); +}; +//非系统人员范围删除 +export const taxAgentRangeExtDelete = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/delete", params); +}; +//非系统人员范围保存 +export const taxAgentRangeExtSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/save", params); +}; //人员范围删除 export const taxAgentRangeDelete = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params); diff --git a/pc4mobx/hrmSalary/components/externalPersonModal/index.js b/pc4mobx/hrmSalary/components/externalPersonModal/index.js new file mode 100644 index 00000000..64f21fbf --- /dev/null +++ b/pc4mobx/hrmSalary/components/externalPersonModal/index.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 外部人员添加弹框 + * Description: + * Date: 2023/3/14 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup } from "ecCom"; +import { Button, Modal } from "antd"; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + targetIds: "", + targetNames: "" + }; + } + + handleExternalPersonSave = () => { + const { targetIds } = this.state; + const { onExternalPersonSave } = this.props; + if (!_.isEmpty(targetIds)) { + onExternalPersonSave({ targetIds: targetIds.split(",") }); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }; + + render() { + const { targetIds, targetNames } = this.state; + const { onCancel, visible, loading } = this.props; + const buttons = [ + , + + ]; + return ( + + + + this.setState({ targetIds, targetNames })} + /> + + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js new file mode 100644 index 00000000..9e24dbf5 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤一 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Icon, Upload, message } from "antd"; + +const Dragger = Upload.Dragger; +const { getLabel } = WeaLocaleProvider; + +class ImpStep1 extends Component { + constructor(props) { + super(props); + this.state = { + fileList: [] + }; + } + + handleChange = (data) => { + const { fileList, file } = data; + if (file.response && typeof (file.response) != "undefined") message.success(getLabel(111, "上传成功")); + this.setState({ fileList }); + }; + + render() { + const { fileList } = this.state; + const dragger = { + accept: ".xlsx", + name: "file", + multiple: false, + action: "/api/doc/upload/uploadFile", + fileList, + onChange: this.handleChange + }; + return ( +
+ {/* 导入选项 */} + { + this.props.importParams && +
+
{getLabel(543201, "导入选项")}
+ {this.props.importParams} +
+ } +
{getLabel(543202, "导入Excel")}
+

+ +

+

+

{getLabel(543203, "点击或将文件拖拽到此区域上传")}

+

{getLabel(543204, "支持单个或批量上传,严禁上传公司内部资料及其他违禁文件")}

+
+ +

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

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

+

{`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;`}

+
+ +
+ ); + } +} + +export default ImpStep1; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js new file mode 100644 index 00000000..481813b4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤3 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import successImg from "../../importModal/success.svg"; + +const getLabel = WeaLocaleProvider.getLabel; + +class ImpStep3 extends Component { + render() { + const { importResult } = this.props; + return ( +
+ { + !_.isEmpty(importResult) ? +
+

+

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

+
: +
+

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

+
+ } + { + !_.isEmpty(importResult.errorData) && + + } +
+ ); + } +} + +export default ImpStep3; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js new file mode 100644 index 00000000..49956e37 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -0,0 +1,135 @@ +/* + * Author: 黎永顺 + * name: 导入弹框-步骤条 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; +import ImpStep1 from "./components/impStep1"; +import ImpStep3 from "./components/impStep3"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + current: 0 + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult)) { + this.setState({ + current: this.state.current + 1 + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + } + + renderChildren = () => { + const { current } = this.state; + const { importParams, link, excludeKey, importResult } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = this.step1Ref = dom}/>; + break; + case 1: + CurrentDom = null; + if (excludeKey) { + CurrentDom = ; + } + break; + case 2: + CurrentDom = null; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + + /* + * Author: 黎永顺 + * Description: 下一步 + * Params: + * Date: 2023/8/11 + */ + handleNext = () => { + const { params } = this.props; + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.error(getLabel(111, "请先上传EXCEL文件")); + return; + } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + }; + + render() { + const { current } = this.state; + const stepData = [ + { key: 0, label: getLabel(543202, "上传EXCEL") }, + { key: 1, label: getLabel(543200, "数据预览") }, + { key: 2, label: getLabel(502835, "导入数据") } + ]; + const btns = [ + , + , + + ]; + return ( + +
+
+ + {/*this.props.key: 不需要展示的步骤*/} + { + _.map(_.filter(stepData, item => item.key !== this.props.excludeKey), it => ( + )) + } + +
+
+ { + this.renderChildren() + } +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less new file mode 100644 index 00000000..8e4dbb53 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -0,0 +1,145 @@ +.importBox { + .importCont { + padding: 16px 8px; + + .weapp-batch-impsteps-picker-content-imp-steps { + width: 80%; + margin: 0 auto; + } + + .weapp-batch-impsteps-picker { + margin: 16px auto; + + .weapp-batch-impsteps-picker-content-imp-step1 { + width: 98%; + background-color: #fff; + margin: 8px auto; + border-radius: 3px; + padding: 1px 12px; + + .weapp-batch-impsteps-picker-content-imp-step1 div { + color: #111; + line-height: 22px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param { + box-sizing: border-box; + padding: 16px; + height: auto; + flex-wrap: wrap; + width: 100%; + } + + .weapp-salary-import-param { + border: 1px solid #ebedf0; + padding: 8px; + margin: 4px 0 14px; + } + + .weapp-salary-tb-filter { + display: flex; + flex-wrap: wrap; + align-items: center; + height: 46px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param .tbf-item { + display: flex; + justify-content: flex-start !important; + } + + .weapp-salary-tb-filter .tbf-item { + padding: 0 20px 0 0; + display: flex; + align-items: center; + font-size: 12px; + color: #111; + height: 40px; + } + + .weapp-salary-tb-filter .tbf-item > .tbfi-label { + flex-basis: 100px; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-right: 10px; + color: #666; + } + + .draggerUploadWrapper { + margin: 16px 0 0; + + .ant-upload-drag-container { + padding: 24px 0 16px; + + .iconUpload { + i { + color: #5d9cec; + font-size: 43px; + } + } + + .uplaod-title { + font-size: 14px; + color: #333; + height: 24px; + line-height: 24px; + margin-top: 8px; + } + + .uplaod-subTitle { + height: 22px; + font-size: 12px; + color: #666; + text-align: center; + line-height: 22px; + } + } + } + + .bottom-border, .description { + margin-top: 12px; + + p { + font-size: 12px; + color: #666; + line-height: 15px; + margin: 12px 0; + } + } + + .bottom-border { + border-bottom: 1px solid #e5e5e5; + + .weapp-salary-link { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #5d9cec; + } + } + + } + } + + .weapp-batch-impsteps-picker-content-imp-step3 { + .weapp-batch-impsteps-picker-spinText { + position: relative; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding-top: 80px; + padding-bottom: 80px; + text-align: center; + + p { + margin: 14px 0; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index dc875fdd..008aba13 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -20,6 +20,8 @@ import Payroll from "./pages/payroll"; import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail"; import Declare from "./pages/declare"; +import Employeedeclare from "./pages/employeedeclare"; +import EmployeedeclareDetail from "./pages/employeedeclareDetail"; import TaxRate from "./pages/taxRate"; import TaxAgents from "./pages/taxAgent"; import TaxAgent from "./pages/salary/taxAgent"; @@ -39,6 +41,7 @@ import ReportView from "./pages/reportView"; import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; import IntelligentCalculateSalarySettings from "./pages/intelligentCalculateSalarySettings"; +import ExternalPersonManage from "./pages/externalPersonManage"; import stores from "./stores"; import "./style/index"; @@ -88,6 +91,9 @@ const DataAcquisition = (props) => props.children; // fieldManagement 字段管理 // analysisOfSalaryStatistics 薪酬统计分析 // reportView 薪酬报表查看 +// externalPersonManage 非系统人员管理 +// employeedeclare 人员信息报送 +// employeedeclareDetail 人员信息报送详情 // intelligentCalculateSalarySettings 智能算薪 const Routes = ( @@ -151,6 +157,8 @@ const Routes = ( component={TemplatePreview} /> + + + ); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js new file mode 100644 index 00000000..62b0b617 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js @@ -0,0 +1,127 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-自定义导出字段弹框 + * Description: + * Date: 2023/7/17 + */ +import React, { Component } from "react"; +import { Button, Col, message, Row } from "antd"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { customCacheExportField } from "../../apis/calculate"; +import { convertToUrlString, getQueryString } from "../../util/url"; +import "./acctResult/importModal/index.less"; + + +const { getLabel } = WeaLocaleProvider; + +class CustomExportDialog 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 { searchItemsValue } = this.props; + const { itemsCheckeds } = this.state; + customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => { + if (status) { + const { consolidatedTaxation = "0", ...extra } = searchItemsValue; + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + window.open( + `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${getQueryString("id")}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}` + ); + } 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 CustomExportDialog; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 72ce7a6b..d43cfb66 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -3,14 +3,25 @@ import UserSure from "./userSure"; import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; -import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; +import { + WeaBrowser, + WeaCheckbox, + WeaDropdown, + WeaFormItem, + WeaInput, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTab +} from "ecCom"; import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; -import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import { getExportField, salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import CustomExportDialog from "./customExportDialog"; import Authority from "../mySalary/authority"; - +const getLabel = WeaLocaleProvider.getLabel; const { ButtonSelect } = WeaDropdown; @inject("calculateStore", "salaryFileStore", "taxAgentStore") @@ -36,7 +47,10 @@ export default class CalculateDetail extends React.Component { progress: 0, accountIds: [], accountExceptInfo: "", - calculateAuth: false + calculateAuth: false, + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } }; this.id = ""; this.timer = null; @@ -239,9 +253,26 @@ export default class CalculateDetail extends React.Component { window.open( `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(payload)}` ); + } else if (e.key === "4") { + // 自定义导出 + this.getExportField(); } }; + getExportField = () => { + getExportField({ salaryAcctRecordId: getQueryString("id") }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExportParams: { + visible: true, + checkItems, itemsByGroup + } + }); + } + }); + }; + // 导入表单添加表头回调 handleAcctModalAdd(fieldData) { this.setState({ @@ -284,13 +315,21 @@ export default class CalculateDetail extends React.Component { }; render() { - const { selectedKey, acctResultImportVisiable, showSearchAd, calculateAuth } = this.state; + const { + selectedKey, + acctResultImportVisiable, + showSearchAd, + calculateAuth, + customExportParams, + searchItemsValue + } = this.state; const { taxAgentStore: { payrollPermission } } = this.props; const menu = ( 导入 线下对比 导出全部 + {getLabel(111, "自定义导出")} ); @@ -417,6 +456,17 @@ export default class CalculateDetail extends React.Component { }} progress={this.state.progress} />} + { + this.setState({ + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } + }); + }} + /> ); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 8ab69098..e3c795e8 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -2,13 +2,16 @@ import React from "react"; import { toJS } from "mobx"; import CustomTab from "../../components/customTab"; import { Dropdown, Menu, message } from "antd"; -import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal } from "ecCom"; +import { WeaHelpfulTip, WeaInputSearch, WeaLocaleProvider, WeaSlideModal } from "ecCom"; import SlideModalTitle from "../../components/slideModalTitle"; import FileMergeDetail from "./fileMergeDetail"; import { getQueryString } from "../../util/url"; import { inject, observer } from "mobx-react"; +import { getExportField } from "../../apis/calculate"; import "./index.less"; +import CustomExportDialog from "./customExportDialog"; +const getLabel = WeaLocaleProvider.getLabel; @inject("calculateStore") @observer export default class PlaceOnFileDetail extends React.Component { @@ -18,7 +21,10 @@ export default class PlaceOnFileDetail extends React.Component { slideVisiable: false, selectedRowKeys: [], searchValue: "", - columnIndex: "" + columnIndex: "", + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } }; this.id = ""; } @@ -95,15 +101,33 @@ export default class PlaceOnFileDetail extends React.Component { childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); }; - handleMenuClick() { - const { calculateStore: { exportAll } } = this.props; - const { selectedRowKeys } = this.state; - if (selectedRowKeys.length === 0) { - message.warning("未选择条目"); - return; + handleMenuClick = ({ key }) => { + if (key === "3") { + const { calculateStore: { exportAll } } = this.props; + const { selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { + message.warning("未选择条目"); + return; + } + exportAll(this.id, selectedRowKeys.join(",")); + } else if (key === "4") { + this.getExportField(); } - exportAll(this.id, selectedRowKeys.join(",")); - } + }; + + getExportField = () => { + getExportField({ salaryAcctRecordId: getQueryString("id") }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExportParams: { + visible: true, + checkItems, itemsByGroup + } + }); + } + }); + }; handleExportAll = () => { const { calculateStore: { exportAll } } = this.props; @@ -113,11 +137,12 @@ export default class PlaceOnFileDetail extends React.Component { render() { const { calculateStore } = this.props; const { baseSalarySobCycle, columnDescList } = calculateStore; - const { slideVisiable, columnIndex } = this.state; + const { slideVisiable, columnIndex, customExportParams } = this.state; const menu = ( this.handleMenuClick(e)}> 导出所选 + {getLabel(111, "自定义导出")} ); @@ -171,6 +196,17 @@ export default class PlaceOnFileDetail extends React.Component { id="atdTable" /> + { + this.setState({ + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } + }); + }} + /> { slideVisiable && } + buttons={[ + + ]} + > +
+ + + ({getLabel(83110, "查看详情")}) + } + ]} + dataSource={[]} + 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 } + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }); + } + }} + /> + + + +
+ + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/baseInfo.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/baseInfo.js new file mode 100644 index 00000000..549a0dba --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/baseInfo.js @@ -0,0 +1,60 @@ +/* + * Author: 黎永顺 + * name: 人员信息报送-基础信息 + * Description: + * Date: 2023/8/14 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { getQueryString } from "../../../util/url"; +import EmployeeDeclareDetailCalcDialog from "./employeeDeclareDetailCalcDialog"; + +const { getLabel } = WeaLocaleProvider; + +class BaseInfo extends Component { + constructor(props) { + super(props); + this.state = { + declareCalcDialog: { + visible: false + } + }; + } + + handleOpenFailDialog = () => { + this.setState({ + declareCalcDialog: { + visible: true + } + }); + }; + + render() { + const { declareCalcDialog } = this.state; + return ( +
+
{getLabel(537996, "个税扣缴义务人")}:{getQueryString("taxName")}
+
+
+ {getLabel(111, "报送失败")}:  0 + {getLabel(111, "未报送")}:  0 +
+
+ {/*报送失败数据查看*/} + { + this.setState({ + declareCalcDialog: { + visible: false + } + }); + }} + /> +
+ ); + } +} + +export default BaseInfo; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js new file mode 100644 index 00000000..83e88345 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailCalcDialog.js @@ -0,0 +1,50 @@ +/* + * Author: 黎永顺 + * name: 报送信息-失败查看弹框 + * Description: + * Date: 2023/8/14 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Button, Col, Row } from "antd"; + +const { getLabel } = WeaLocaleProvider; + +class EmployeeDeclareDetailCalcDialog extends Component { + + render() { + return ( + + + {getLabel(111, "报送失败数据详情")} + + + + + )} + style={{ + width: 1150, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ +
+
+ ); + } +} + +export default EmployeeDeclareDetailCalcDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js new file mode 100644 index 00000000..dc483a65 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/components/employeeDeclareDetailSchemaEditDialog.js @@ -0,0 +1,63 @@ +/* + * Author: 黎永顺 + * name: 报送信息-编辑、新增弹框 + * Description: + * Date: 2023/8/14 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; +import { Button, Col, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import { declareConditions } from "../constants"; +import { getSearchs } from "../../../util"; + +const { getLabel } = WeaLocaleProvider; + +@inject("employeeDeclareStore") +@observer +class EmployeeDeclareDetailSchemaEditDialog extends Component { + componentDidMount() { + const { employeeDeclareStore: { declareForm } } = this.props; + declareForm.initFormFields(declareConditions); + } + + componentWillReceiveProps(nextProps, nextContext) { + } + + handleSubmit = () => { + const { employeeDeclareStore: { declareForm: form } } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const payload = form.getFormParams(); + console.log(payload); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { employeeDeclareStore: { declareForm: form } } = this.props; + return ( + + +
+ {getLabel(111, "本月新增数据")} + + + + + )} + content={(
{getSearchs(form, declareConditions, 1)}
)} + /> + ); + } +} + +export default EmployeeDeclareDetailSchemaEditDialog; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js new file mode 100644 index 00000000..9134619a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/constants.js @@ -0,0 +1,252 @@ +export const submitStatus = [ + { + key: "ALL", + showname: "全部(报送状态)", + lanId: 332 + }, + { + key: "NOT_DECLARE", + showname: "待报送", + lanId: 111 + }, + { + key: "DECLARING", + showname: "报送中", + lanId: 111 + }, + { + key: "DECLARE_FAIL", + showname: "报送失败", + lanId: 111 + }, + { + key: "DECLARE_SUCCESS", + showname: "报送成功", + lanId: 111 + } +]; + + +export const advanceConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["keyword"], + fieldcol: 18, + label: "姓名或工号", + lanId: 111, + labelcol: 6, + value: "" + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57" + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 18, + label: "部门", + lanId: 27511, + labelcol: 6 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "278" + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 18, + label: "岗位", + lanId: 6086, + labelcol: 6 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["employmentStatus"], + fieldcol: 18, + label: "人员状态", + lanId: 382300, + labelcol: 6, + value: "", + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["employmentType"], + fieldcol: 18, + label: "任职受雇从业类型", + lanId: 111, + labelcol: 6, + value: "", + options: [] + }, + { + colSpan: 1, + conditionType: "RANGEPICKER", + domkey: ["fromEmploymentDate", "endEmploymentDate"], + fieldcol: 18, + label: "任职受雇日期", + lanId: 111, + labelcol: 6, + value: "" + }, + { + colSpan: 1, + conditionType: "RANGEPICKER", + domkey: ["fromDismissDate", "endDismissDate"], + fieldcol: 18, + label: "离职日期", + lanId: 111, + labelcol: 6, + value: "" + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["disability"], + fieldcol: 18, + label: "是否残疾", + lanId: 111, + labelcol: 6, + value: "", + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["lonelyOld"], + fieldcol: 18, + label: "是否孤老", + lanId: 111, + labelcol: 6, + value: "", + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["martyrDependents"], + fieldcol: 18, + label: "是否是烈属", + lanId: 111, + labelcol: 6, + value: "", + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["deductExpenses"], + fieldcol: 18, + label: "是否扣除减除费用", + lanId: 111, + labelcol: 6, + value: "", + options: [] + } + ], + defaultshow: true + } +]; + +export const declareConditions = [ + { + items: [ + { + colSpan: 2, + fieldcol: 12, + labelcol: 6, + rules: "selectLinkageRequired", + conditionType: "SELECT_LINKAGE", + selectLinkageDatas: { + "1": { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "1" + }, + conditionType: "BROWSER", + domkey: ["INPUT"] + }, + "2": { + conditionType: "CHECKBOX", + domkey: ["CHECKBOX"] + } + }, + options: [ + { key: "1", showname: "今天" }, + { key: "2", showname: "本周" } + ], + domkey: ["secleve"], + label: "系统名称", + lanId: 111, + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["keyword"], + fieldcol: 12, + label: "证件姓名", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js new file mode 100644 index 00000000..022bbf27 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -0,0 +1,165 @@ +/* + * Author: 黎永顺 + * name: 人员信息报送-查看详情 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaDatePicker, WeaLocaleProvider, WeaSelect, WeaTab, WeaTop } from "ecCom"; +import { Button, Dropdown, Menu, Spin } from "antd"; +import BaseInfo from "./components/baseInfo"; +import EmployeeDeclareDetailSchemaEditDialog from "./components/employeeDeclareDetailSchemaEditDialog"; +import { advanceConditions, submitStatus } from "./constants"; +import { getSearchs } from "../../util"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore", "employeeDeclareStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "0", + showSearchAd: false, + declareStatus: "ALL", + taxCycle: new Date(), + declareEditDialog: { + visible: false + } + }; + } + + componentDidMount() { + const { employeeDeclareStore: { advanceForm } } = this.props; + document.title = getLabel(544289, "人员信息报送"); + advanceForm.initFormFields(advanceConditions); + window.addEventListener("message", this.handleReceive, false); + this.setCss(); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + setCss = () => { + $($("head")[0]).append(""); + }; + + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.postMessageToChild({}); + } else if (type === "turn") { + if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = params; + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }); + } + } + }; + postMessageToChild = (payload) => { + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({}), "*"); + }; + handleAdd = () => { + this.setState({ + declareEditDialog: { + visible: true + } + }); + }; + + render() { + const { selectedKey, showSearchAd, declareStatus, taxCycle, declareEditDialog } = this.state; + const { taxAgentStore: { showOperateBtn }, employeeDeclareStore: { advanceForm: form } } = this.props; + const menu = ( + + {getLabel(32136, "批量删除")} + {getLabel(111, "批量编辑")} + {getLabel(81272, "导出全部")} + {getLabel(543715, "导出所选")} + + ); + const buttons = [ + , + , + , + console.log(val)}/>, + +