diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index f5f4aff6..6297dfa8 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -78,3 +78,31 @@ export const statisticsEmployeeDetailList = (params) => { export const getDataPerspective = (params) => { return postFetch("/api/bs/hrmsalary/report/statistics/report/getDataPerspective", params); }; +//报表分享-确认分享 +export const salaryStatisticsPushSendMsg = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/sendMsg", params); +}; +//报表分享-表单数据 +export const salaryStatisticsPushGetForm = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/getForm", "GET", params); +}; +//报表记录-全部撤回 +export const salaryStatisticsPushcancelAll = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancelAll", "GET", params); +}; +//报表记录-撤回单条记录 +export const salaryStatisticsPushcancel = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancel", "GET", params); +}; +//报表记录-列表数据 +export const salaryStatisticsPushGetTable = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/getTable", params); +}; +//报表记录-查看分享记录详情 +export const salaryStatisticsPushGetDetail = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/getDetail", params); +}; +//报表记录-追加被分享人 +export const salaryStatisticsPushAddSharedSendMsg = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 8225e46e..8c58759d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -108,12 +108,8 @@ export const taxAgentRangeImportData = (params) => { }; //个税扣缴义务人下拉列表 -export const getTaxAgentSelectList = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/selectList", - "GET", - params - ); +export const getTaxAgentSelectList = (isShare = false) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare }); }; //当前登录人个税扣缴义务人下拉列表 diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index 1668de36..b6fd6ffb 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } 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"; @@ -31,41 +32,74 @@ class PersonalScopeModal extends Component { if (isTaxgent) { this.getTaxAgentRangeForm(); } else { - const employeeStatus = [ - { key: "TRIAL", showname: "试用" }, - { key: "FORMAL", showname: "正式" }, - { key: "TEMPORARY", showname: "临时" }, - { key: "DELAY", showname: "试用延期" }, - { key: "FIRE", showname: "解雇" }, - { key: "DEPARTURE", showname: "离职" }, - { key: "RETIRED", showname: "退休" } - ]; - const targetTypeList = [ - { - key: "EMPLOYEE", - showname: "人员", - selected: false - }, - { - key: "SUBCOMPANY", - showname: "分部", - selected: false - }, - { - key: "DEPT", - showname: "部门", - selected: false - }, - { - key: "POSITION", - showname: "岗位", - selected: false - } - ]; - this.setState({ targetTypeList, employeeStatus }); + this.commonEnumList(); + // const employeeStatus = [ + // { key: "TRIAL", showname: "试用" }, + // { key: "FORMAL", showname: "正式" }, + // { key: "TEMPORARY", showname: "临时" }, + // { key: "DELAY", showname: "试用延期" }, + // { key: "FIRE", showname: "解雇" }, + // { key: "DEPARTURE", showname: "离职" }, + // { key: "RETIRED", showname: "退休" } + // ]; + // const targetTypeList = [ + // { + // key: "EMPLOYEE", + // showname: "人员", + // selected: false + // }, + // { + // key: "SUBCOMPANY", + // showname: "分部", + // selected: false + // }, + // { + // key: "DEPT", + // showname: "部门", + // selected: false + // }, + // { + // key: "POSITION", + // showname: "岗位", + // selected: false + // } + // ]; + // this.setState({ targetTypeList, employeeStatus }); } } + commonEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => { + if (status) { + const targetTypeList = [ + { + key: "EMPLOYEE", + showname: "人员", + selected: false + }, + { + key: "SUBCOMPANY", + showname: "分部", + selected: false + }, + { + key: "DEPT", + showname: "部门", + selected: false + }, + { + key: "POSITION", + showname: "岗位", + selected: false + } + ]; + this.setState({ + targetTypeList, + employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel })) + }); + } + }); + }; getTaxAgentRangeForm = () => { getTaxAgentRangeForm().then(({ status, data }) => { if (status) { @@ -91,7 +125,7 @@ class PersonalScopeModal extends Component { employeeStatus: status.split(","), includeType, targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - [saveKeyVal["key"]]: saveKeyVal["value"], + [saveKeyVal["key"]]: saveKeyVal["value"] }; this.setState({ loading: true }); APISaveFox["save"](payload).then(({ status, errormsg }) => { diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index b7eafd97..fc790558 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -69,6 +69,7 @@ class Index extends Component { onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) }); }; + /* * Author: 黎永顺 * Description: 下一步 diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 0345cad3..9a4c55f0 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -73,7 +73,7 @@ class ReportList extends Component { { _.isEmpty(dataSource) ?
{getLabel(83553, "暂无数据")}
: _.map(dataSource, it => { - const { reportName, dimension, id, dimensionId } = it; + const { reportName, dimension, id, dimensionId, isShare } = it; return this.handleGoReportView(id)}>
@@ -85,14 +85,17 @@ class ReportList extends Component {
- this.handleOptsClick(e, id, dimensionId)}> - {getLabel(501169, "编辑")} - {getLabel(535052, "删除")} - - }> - - + { + !isShare && + this.handleOptsClick(e, id, dimensionId)}> + {getLabel(501169, "编辑")} + {getLabel(535052, "删除")} + + }> + + + }
; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js index e6a6c7e2..7e0c76f4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -11,8 +11,13 @@ import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { cumTaxPeriodCondition } from "../columns"; import { onlineRequest } from "../../../../apis/cumDeduct"; +import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation"; const getLabel = WeaLocaleProvider.getLabel; +const APIFox = { + online: onlineRequest, + advance: onlineActualAddUpAdvanceTax +}; @inject("cumDeductStore") @observer @@ -36,12 +41,12 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { } save = () => { - const { cumDeductStore: { cumTaxPeriodForm } } = this.props; + const { cumDeductStore: { cumTaxPeriodForm }, type } = this.props; cumTaxPeriodForm.validateForm().then(f => { const { declareMonth } = cumTaxPeriodForm.getFormParams(); if (f.isValid) { this.setState({ loading: true }); - onlineRequest({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => { + APIFox[type]({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success(getLabel(111, "获取成功!")); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index b4da4981..0fb0136e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -22,6 +22,7 @@ import { importCumDeductPreview, onlineFeedback } from "../../../apis/cumDeduct"; +import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings"; import DataTables from "../dataTables"; import AddItems from "../addItems"; import ImportFormCom from "./components/importFormCom"; @@ -68,9 +69,10 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, cumTaxPeriodDialog: { - visible: false, title: "" + visible: false, title: "", type: "" }, - feedbackLoading: false + feedbackLoading: false, + incomeTaxStatus: false }; this.tableRef = null; this.addItemRef = null; @@ -79,8 +81,14 @@ class Index extends Component { componentDidMount() { this.getAdvanceCondition(); + this.apiflowBillingConfigStatus(); } + apiflowBillingConfigStatus = () => { + apiflowBillingConfigStatus().then(({ status, data }) => { + this.setState({ incomeTaxStatus: status && data }); + }); + }; /* * Author: 黎永顺 * Description:一键累计 @@ -399,8 +407,8 @@ class Index extends Component { * Date: 2023/2/17 */ getTopBtns = () => { - const { addAllLoading } = this.state; - return [ + const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state; + const commonBtns = [ , , , @@ -417,6 +425,18 @@ class Index extends Component { ]; + const incomeTaxBtns = [ + , + + ]; + return incomeTaxStatus ? [...incomeTaxBtns, ...commonBtns] : commonBtns; }; handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); /* @@ -533,7 +553,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, exportPayloadType, cumTaxPeriodDialog, feedbackLoading + importPayload, exportPayloadType, cumTaxPeriodDialog } = this.state; const tablePayload = { declareMonth: [declareMonth], taxAgentId }; return ( @@ -547,17 +567,6 @@ class Index extends Component { importPayload={importPayload} onImportFile={this.handleImportFile} onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} columns={modalColumns} - tabBtns={[ - , - - ]} > this.tableRef = dom} @@ -571,7 +580,7 @@ class Index extends Component { this.setState({ - cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "" } + cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } })} /> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index ae006af6..7ebb597d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -108,66 +108,68 @@ export const dataCollectCondition = [ precision: 2, viewAttr: 2 }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpChildEducation"], - fieldcol: 14, - label: "累计子女教育", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpContinuingEducation"], - fieldcol: 14, - label: "累计继续教育", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpHousingLoanInterest"], - fieldcol: 14, - label: "累计住房贷款利息", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpHousingRent"], - fieldcol: 14, - label: "累计住房租金", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpSupportElderly"], - fieldcol: 14, - label: "累计赡养老人", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpIllnessMedical"], - fieldcol: 14, - label: "累计大病医疗", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, + + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpChildEducation"], + // fieldcol: 14, + // label: "累计子女教育", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpContinuingEducation"], + // fieldcol: 14, + // label: "累计继续教育", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpHousingLoanInterest"], + // fieldcol: 14, + // label: "累计住房贷款利息", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpHousingRent"], + // fieldcol: 14, + // label: "累计住房租金", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpSupportElderly"], + // fieldcol: 14, + // label: "累计赡养老人", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpIllnessMedical"], + // fieldcol: 14, + // label: "累计大病医疗", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + { conditionType: "INPUTNUMBER", domkey: ["addUpEnterpriseAndOther"], @@ -230,14 +232,47 @@ export const dataCollectCondition = [ }, { conditionType: "INPUTNUMBER", - domkey: ["addUpInfantCare"], + domkey: ["actualAddUpAdvanceTax"], fieldcol: 14, - label: "累计婴幼儿照护", + label: "实际累计已预扣预缴税额", labelcol: 8, value: "", precision: 2, viewAttr: 2 - } + }, + { + conditionType: "INPUTNUMBER", + domkey: ["taxAdjustment"], + fieldcol: 14, + label: "个税调差", + helpfulTitle: "1、【个税调差】=【实际累计已预扣预缴税额】-【累计已预扣预缴税额】。\n" + + "2、直接输入或导入【个税调差】值,则以输入/导入为准,公式失效。再次编辑减数或被减数,会再次按公式自动计算。", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["addUpTaxableIncome"], + fieldcol: 14, + label: "累计应纳税所得额", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, + + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpInfantCare"], + // fieldcol: 14, + // label: "累计婴幼儿照护", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // } ], title: "数据采集", defaultshow: true diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 0efccee6..e4975825 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLoadingGlobal, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { createAddUpSituation, @@ -16,9 +16,9 @@ import { getAddUpSituation, getCumSituationSaCondition, importCumSituationParam, - importCumSituationPreview, - onlineActualAddUpAdvanceTax + importCumSituationPreview } from "../../../apis/cumSituation"; +import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings"; import { removePropertyCondition } from "../../../util/response"; import DataTables from "../dataTables"; import Layout from "../layout"; @@ -30,6 +30,7 @@ import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { situationModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; +import SalaryCumDeductChooseTaxPeriodDialog from "../cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog"; const getLabel = WeaLocaleProvider.getLabel; @@ -64,7 +65,11 @@ class Index extends Component { }, exportPayloadUrl: "", exportPayloadType: false, - advanceCondition: null + advanceCondition: null, + incomeTaxStatus: false, + cumTaxPeriodDialog: { + visible: false, title: "", type: "" + } }; this.tableRef = null; this.addItemRef = null; @@ -73,8 +78,14 @@ class Index extends Component { componentDidMount() { this.getAdvanceCondition(); + this.apiflowBillingConfigStatus(); } + apiflowBillingConfigStatus = () => { + apiflowBillingConfigStatus().then(({ status, data }) => { + this.setState({ incomeTaxStatus: status && data }); + }); + }; /* * Author: 黎永顺 * Description: 高级搜素框-表单项 @@ -322,23 +333,12 @@ class Index extends Component { }); }; onlineActualAddUpAdvanceTax = () => { - const { declareMonth, year } = this.state; - const payload = { - declareMonth: year + "-" + declareMonth + "-01" - }; - WeaLoadingGlobal.start(); - onlineActualAddUpAdvanceTax(payload).then(({ status, errormsg }) => { - WeaLoadingGlobal.end(); - WeaLoadingGlobal.destroy(); - if (status) { - message.success(getLabel(111, "获取成功!")); - this.tableRef.getTableDate(); - } else { - message.error(errormsg); + this.setState({ + cumTaxPeriodDialog: { + ...this.state.cumTaxPeriodDialog, + visible: true, type: "advance", + title: getLabel(542240, "税款所属期") } - }).catch(() => { - WeaLoadingGlobal.end(); - WeaLoadingGlobal.destroy(); }); }; /* @@ -348,8 +348,8 @@ class Index extends Component { * Date: 2023/2/17 */ getTopBtns = () => { - const { addAllLoading } = this.state; - return [ + const { addAllLoading, incomeTaxStatus } = this.state; + const commonBtns = [ , , , @@ -366,6 +366,7 @@ class Index extends Component { ]; + return incomeTaxStatus ? commonBtns : _.filter(commonBtns, (__, index) => index !== 1); }; handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); /* @@ -554,7 +555,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, year, exportPayloadType + importPayload, year, exportPayloadType, cumTaxPeriodDialog } = this.state; const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId }; return ( @@ -570,6 +571,12 @@ class Index extends Component { onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} columns={situationModalColumns} > + this.setState({ + cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } + })} + /> this.tableRef = dom} url="/api/bs/hrmsalary/addUpSituation/list" diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index 3b7ad55d..85293ef8 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -2,11 +2,11 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { DatePicker } from "antd"; import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; -import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; import moment from "moment"; import PayrollModal from "./payrollModal"; import CustomPaginationTable from "../../components/customPaginationTable"; +import Authority from "./authority"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -87,8 +87,8 @@ export default class MySalary extends React.Component { handleTabChange = (selectedKey) => { if (selectedKey === "2") { - const { mySalaryStore: { getRecordList } } = this.props; - getRecordList(); + const { mySalaryStore: { initRecordData } } = this.props; + initRecordData(); } }; @@ -176,21 +176,24 @@ export default class MySalary extends React.Component { } { this.state.selectedKey === "2" && - { - this.historyPageInfo.current = value; - this.handleHistoryPageChange(); - }} - onShowSizeChange={(current, pageSize) => { - this.historyPageInfo = { current, pageSize }; - this.handleHistoryPageChange(); - }} - /> + + { + this.historyPageInfo.current = value; + this.handleHistoryPageChange(); + }} + onShowSizeChange={(current, pageSize) => { + this.historyPageInfo = { current, pageSize }; + this.handleHistoryPageChange(); + }} + /> + } diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js index 94719f8d..b429cfb7 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js @@ -117,6 +117,7 @@ export default class BaseInformForm extends React.Component { { this.state.inited && { salaryItemSet.length > 0 && - salaryItemSet.map((group, index) => { + _.filter(salaryItemSet, it => (!_.isNil(it) && !_.isEmpty(it))).map((group, index) => { return
{group.groupName}
diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js index 01730ef7..67c1ebef 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js @@ -75,7 +75,7 @@ export default class PhoneTemplate extends React.Component {
{ salaryItemSet.length > 0 && - salaryItemSet.map((group, index) => ( + _.filter(salaryItemSet, it => (!_.isNil(it) && !_.isEmpty(it))).map((group, index) => (
{group.groupName}
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js index c9d85ff8..5b2ca302 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js @@ -11,15 +11,16 @@ class AllWithoutPay extends Component { message.warning("未选择条目"); return; } - API.gotoStop(selectedRowKeys).then(({ status, errormsg }) => { + API.gotoStop(selectedRowKeys).then(({ status, data, errormsg }) => { if (status) { - message.success("操作成功!"); + const { msg } = data; + message.info(msg || "操作成功!"); refreshList(); } else { message.error(errormsg || "操作失败!"); } }); - }else{ + } else { const { pageInfo } = this.props; if (pageInfo.total === 0) { message.warning("您没有需要处理的待停薪人员!"); @@ -31,7 +32,7 @@ class AllWithoutPay extends Component { onOk: () => { API.allGotoStop({}).then(({ status, data, errormsg }) => { if (status) { - const { msg }= data; + const { msg } = data; message.info(msg || "操作成功!"); refreshList(); } else { diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index 103793c3..9d141953 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -152,6 +152,195 @@ export const condition = [ defaultshow: true } ]; +export const shareCondition = [ + { + items: [ + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["reportIds"], + fieldcol: 12, + label: "分享报表", + lanId: 111, + labelcol: 6, + options: [], + multiple: true, + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "INPUT", + domkey: ["pushTitle"], + fieldcol: 18, + label: "主题", + lanId: 111, + labelcol: 6, + rules: "required|string", + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17", + viewAttr: 3 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["sharedBy"], + fieldcol: 14, + isQuickSearch: false, + label: "被分享人", + lanId: 111, + labelcol: 6, + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["startTime"], + fieldcol: 12, + label: "报表查看有效开始时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["endTime"], + fieldcol: 12, + label: "报表查看有效结束时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "INPUT", + domkey: ["mark"], + fieldcol: 18, + label: "分享说明", + lanId: 111, + labelcol: 6, + viewAttr: 2 + } + // { + // colSpan: 1, + // conditionType: "SWITCH", + // domkey: ["remind"], + // fieldcol: 12, + // isQuickSearch: false, + // label: "已查看提醒", + // lanId: 111, + // labelcol: 6, + // viewAttr: 2 + // } + ], + title: "", + defaultshow: true + } +]; +export const sharePersonCondition = [ + { + items: [ + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17", + viewAttr: 3 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["sharedBy"], + fieldcol: 14, + isQuickSearch: false, + label: "被分享人", + lanId: 111, + labelcol: 6, + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; +export const shareLogCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["reportName"], + fieldcol: 12, + label: "分享报表", + lanId: 111, + labelcol: 6, + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["effectiveTime"], + fieldcol: 12, + label: "报表查看有效时间", + lanId: 111, + labelcol: 6, + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["remark"], + fieldcol: 12, + label: "分享说明", + lanId: 111, + labelcol: 6, + viewAttr: 1 + } + ], + title: "", + defaultshow: true + } +]; const colorList = ["#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81"]; export const mapBarOptions = (params) => ({ @@ -292,7 +481,7 @@ export const mapBarOptions = (params) => ({ { type: "slider", show: true, - bottom: 20, + bottom: 20 } ] }); diff --git a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js index f87d7912..49f5a462 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js @@ -269,7 +269,7 @@ class CustomStatisticsItemsModal extends Component { render() { const { loading, columns, dataSource, formData } = this.state; const { itemName, itemValue, itemValueSpan } = formData; - const { statisticsItemId } = this.props; + const { statisticsItemId, isShare } = this.props; const cols = _.map(columns, it => { const { text, column } = it; if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") { @@ -278,6 +278,7 @@ class CustomStatisticsItemsModal extends Component { ...it, title: !!child[`${key}Value`])} onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)} /> @@ -286,6 +287,7 @@ class CustomStatisticsItemsModal extends Component { render: (txt, record) => { return this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)} /> @@ -305,6 +307,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["m2mValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -321,6 +324,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["y2yValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -335,8 +339,10 @@ class CustomStatisticsItemsModal extends Component { title={
{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")} - + { + !isShare && + }
} style={{ width: 900, height: 450 }} @@ -348,7 +354,7 @@ class CustomStatisticsItemsModal extends Component { ({ @@ -381,7 +387,7 @@ class CustomStatisticsItemsModal extends Component { - this.setState({ formData: { ...formData, itemName } })}/> @@ -406,11 +412,11 @@ export default CustomStatisticsItemsModal; * Date: 2023/4/23 */ const IntervalSettingsComp = (props) => { - const { LowerLimit, UpperLimit, onChange } = props; + const { LowerLimit, UpperLimit, onChange, isShare } = props; return
- onChange("min", val)}/> + onChange("min", val)} disabled={isShare}/> {`% <${getLabel(111, "增幅")}<`} - onChange("max", val)}/> + onChange("max", val)} disabled={isShare}/> %
; }; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/index.less b/pc4mobx/hrmSalary/pages/reportView/components/index.less index 322df827..d77aab7f 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/components/index.less @@ -63,3 +63,134 @@ height: 100%; } } + +.shareDialogWrapper { + .wea-dialog-body { + background: #f6f6f6; + overflow-y: hidden; + } + + .wea-search-group { + border: 1px solid #e5e5e5; + border-bottom: none; + background: #FFF; + } + + .wea-search-group, .wea-content, .wea-form-cell { + padding: 0; + } + + .wea-form-item { + padding: 8px 16px; + border-bottom: 1px solid #e5e5e5; + } + + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 345px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } + + .shareLogGroupWrapper { + margin-top: 16px; + + .logtitleHeader { + display: flex; + align-items: center; + justify-content: space-between; + + .right { + display: flex; + align-items: center; + } + } + } +} + +.shareRecordWrapper { + z-index: 111; + + .wea-slide-modal-title { + height: auto !important; + line-height: normal !important; + } + + .titleDialog { + display: flex; + padding: 10px 16px 10px 0; + position: relative; + background-color: #FFF; + border-bottom: 1px solid #e5e5e5; + + .titleCol { + flex: 1; + + .titleLeftBox { + display: flex; + height: 100%; + align-items: center; + padding-left: 16px; + + .titleIcon { + color: #fff; + margin: 0; + width: 40px; + height: 40px; + line-height: 40px; + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + background: #F14A2D; + border-radius: 50%; + } + + .title { + font-size: 14px; + color: #333; + padding-left: 6px; + } + } + } + } + + .ant-table-tbody { + & > tr { + & > td { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js index 4af04328..801bb99e 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js @@ -35,8 +35,8 @@ class PovitpivotChartModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { id, dimensionId, dimensionValue } = nextProps; - this.getDataPerspective({ id, dimensionId, dimensionValue }); + const { id, dimensionId, dimensionValue, isShare } = nextProps; + this.getDataPerspective({ id, dimensionId, dimensionValue, isShare }); } else { this.setState({ dataSource: [], @@ -63,13 +63,11 @@ class PovitpivotChartModal extends Component { }); } else if (type === "turn") { if (id === "PAGEINFO") { - const { id, dimensionId, dimensionValue } = this.props; + const { id, dimensionId, dimensionValue, isShare } = this.props; const { pageNum: current, size: pageSize } = params; this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getDataPerspective({ - id, - dimensionId, - dimensionValue + id, dimensionId, dimensionValue, isShare })); } } diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index e87e1eed..70980238 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -26,7 +26,7 @@ class ReportContent extends Component { chartsType: "0", chartsInfo: {}, povitView: { - visible: false, id: "", + visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "" }, rangSet: { @@ -43,7 +43,7 @@ class ReportContent extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.report !== this.props.report && nextProps.report.dimensionId) { - this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId); + this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId, nextProps.report.isShare); this.setState({ viewType: "dataView", chartsInfo: {} }); } } @@ -65,10 +65,10 @@ class ReportContent extends Component { if (id === "PIVOTCHART") { const { record } = params; const { dimension: dimensionValue } = record; - const { id: pivotId, dimensionId } = this.props.report; + const { id: pivotId, dimensionId, isShare } = this.props.report; this.setState({ povitView: { - visible: true, id: pivotId, dimensionId, dimensionValue + visible: true, id: pivotId, dimensionId, dimensionValue, isShare } }); } @@ -81,8 +81,8 @@ class ReportContent extends Component { dataSource, columns, showSum, countResult }), "*"); }; - reportStatisticsReportGetData = (id, dimensionId) => { - const payload = { id, dimensionId }; + reportStatisticsReportGetData = (id, dimensionId, isShare) => { + const payload = { id, dimensionId, isShare }; this.setState({ loading: true }); reportStatisticsReportGetData(payload).then(({ status, data }) => { this.setState({ loading: false }); @@ -191,13 +191,13 @@ class ReportContent extends Component { handleChangeChartOpts = (chartsType, viewType) => { this.setState({ chartsInfo: {} }); if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); - const { report: { id: reportId, dimensionId } } = this.props; + const { report: { id: reportId, dimensionId, isShare } } = this.props; const { rangSet } = this.state; viewType !== "setting" && this.setState({ chartsType, viewType }, () => { const { viewType, chartsType } = this.state; viewType !== "dataView" ? this.queryRangeSetting({ reportId, chartsType }, true) : - this.reportStatisticsReportGetData(reportId, dimensionId); + this.reportStatisticsReportGetData(reportId, dimensionId, isShare); }); viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => { this.queryRangeSetting({ reportId, chartsType }); @@ -213,8 +213,8 @@ class ReportContent extends Component { }; handleGetData = () => { const { report } = this.props; - const { id, dimensionId } = report; - this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId)); + const { id, dimensionId, isShare } = report; + this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare)); }; renderCharts = () => { const { chartsInfo, viewType } = this.state; @@ -229,6 +229,8 @@ class ReportContent extends Component { render() { const { loading, viewType, rangSet, columns, povitView } = this.state; + const { report } = this.props; + const { isShare } = report; return (
@@ -245,7 +247,7 @@ class ReportContent extends Component {
{/*侧边栏*/} - + {/* 图表范围数据设置框 */} this.setState({ povitView: { - visible: false, id: "", dimensionId: "", dimensionValue: "" + visible: false, id: "", dimensionId: "", dimensionValue: "", + isShare: false } })} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/components/rightOptions.js b/pc4mobx/hrmSalary/pages/reportView/components/rightOptions.js index 1cb4a075..ea77424f 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/rightOptions.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/rightOptions.js @@ -19,7 +19,7 @@ class RightOptions extends Component { } render() { - const { onChange } = this.props; + const { onChange, isShare } = this.props; const { show } = this.state; return (
@@ -32,8 +32,11 @@ class RightOptions extends Component { onClick={() => onChange("1", "bar")}/> onChange("2", "line")}/> onChange("0", "pie")}/> - onChange("1", "setting")}/> + { + !isShare && + onChange("1", "setting")}/> + }
{ + const { attendanceStore: { shareForm } } = props; + salaryStatisticsPushGetForm().then(({ status, data }) => { + if (status) { + const { reportOptions } = data; + this.setState({ + conditions: _.map(shareCondition, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "sharedBy") { + return { + ...o, + helpfulTitle: getLabel(111, "被分享人收到您分享的报表后,会默认赋予您的数据权限,但还需要有【薪酬统计分析】的菜单权限才可以查看报表。菜单权限设置路径:后台管理中心-【权限管理中心】-【角色设置】,建议创建一个仅查看报表的角色,这个角色只有薪酬管理模块的【薪酬统计分析】菜单权限。\n" + + "为了避免所选的人同名导致选错人,可在后台管理中心-【组织架构设置】-【浏览框显示字段定义】中人员浏览框的显示字段多勾选几个能区别人员的字段") + }; + } else if (getKey(o) === "startTime__endTime") { + return { + ...o, + helpfulTitle: getLabel(111, "有效时间之外,被分享人无法查看您分享的报表") + }; + } else if (getKey(o) === "remind") { + return { + ...o, + helpfulTitle: getLabel(111, "开启后,被分享人查看报表时,系统自动通过系统消息提醒分享人。") + }; + } else if (getKey(o) === "reportIds") { + return { + ...o, + options: _.map(reportOptions, it => ({ key: it.id, showname: it.reportName })) + }; + } + return { ...o }; + }) + }; + }) + }, () => { + shareForm.initFormFields(this.state.conditions); + shareForm.updateFields({ pushTitle: data["pushTitle"] || "" }); + shareForm.updateFields({ mark: data["mark"] || "" }); + }); + } + }); + }; + salaryStatisticsPushSendMsg = () => { + const { attendanceStore: { shareForm } } = this.props; + shareForm.validateForm().then(f => { + if (f.isValid) { + const { sharedBy, reportIds, ...extraFormparams } = shareForm.getFormParams(); + const payload = { + sharedBy: sharedBy.split(","), + reportIds: reportIds.split(","), + ...extraFormparams + }; + this.setState({ loading: true }); + salaryStatisticsPushSendMsg(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "分享成功")); + this.props.onCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { attendanceStore: { shareForm } } = this.props; + const { conditions, loading } = this.state; + return ( + {getLabel(111, "确认分享")} + ]} + className="shareDialogWrapper" + style={{ + width: 750, + height: 375.6, + minHeight: 200, + minWidth: 380, + maxHeight: "60%", + maxWidth: "60%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getSearchs(shareForm, conditions, 1, false)} +
+
+ ); + } +} + +export default SalaryStatisticsDetailShareDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js new file mode 100644 index 00000000..51fdc5d0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js @@ -0,0 +1,189 @@ +/* + * Author: 黎永顺 + * name: 分享记录-查看分享记录详情 + * Description: + * Date: 2023/9/19 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { + WeaButtonIcon, + WeaDialog, + WeaHelpfulTip, + WeaInputSearch, + WeaLocaleProvider, + WeaSearchGroup, + WeaTable, + WeaTools +} from "ecCom"; +import { message, Modal } from "antd"; +import { shareLogCondition } from "./condition"; +import { getConditionDomkeys, getSearchs } from "../../../util"; +import { salaryStatisticsPushcancel, salaryStatisticsPushGetDetail } from "../../../apis/statistics"; +import SalaryStatisticsDetailSharePersonDialog from "./salaryStatisticsDetailSharePersonDialog"; +import "./index.less"; + +const getKey = WeaTools.getKey; +const { getLabel } = WeaLocaleProvider; + +@inject("attendanceStore") +@observer +class SalaryStatisticsDetailShareLogDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false, dataSource: [], columns: [], + userNameSearch: "", sharePerDialog: { visible: false, id: "" } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { attendanceStore: { initShareLogForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.salaryStatisticsPushGetDetail(nextProps); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + initShareLogForm(); + } + } + + renderShareLogTitle = () => { + return
+
+ {getLabel(111, "被分享人")} + +
+
+ this.setState({ + sharePerDialog: { + ...this.state.sharePerDialog, + visible: true, id: this.props.id + } + })}/> + this.setState({ userNameSearch: v })} + onSearch={() => this.salaryStatisticsPushGetDetail(this.props)} + /> +
+
; + }; + salaryStatisticsPushGetDetail = (props) => { + const { userNameSearch } = this.state; + const { attendanceStore: { shareLogForm }, id } = props; + this.setState({ loading: true }); + salaryStatisticsPushGetDetail({ id, userNameSearch }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { detailForm, detailTable } = data; + const { columns, list: dataSource } = detailTable; + this.setState({ + columns, dataSource, + conditions: _.map(shareLogCondition, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "effectiveTime") { + return { + ...o, + helpfulTitle: getLabel(111, "有效时间之外,被分享人无法查看您分享的报表") + }; + } + return { ...o }; + }) + }; + }) + }, () => { + shareLogForm.initFormFields(this.state.conditions); + getConditionDomkeys(this.state.conditions).map(key => { + shareLogForm.updateFields({ + [key]: detailForm[key] || "" + }); + }); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + salaryStatisticsPushcancel = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要全部撤回吗?"), + onOk: () => { + salaryStatisticsPushcancel({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(505793, "撤回成功!")); + this.salaryStatisticsPushGetDetail(this.props); + this.props.onGetTable(); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { attendanceStore: { shareLogForm } } = this.props; + const { conditions, dataSource, columns, loading, sharePerDialog } = this.state; + return ( + +
+ {getSearchs(shareLogForm, conditions, 1, false)} + + + {getLabel(30585, "操作")} + +

{getLabel(111, "1、分享状态为成功且撤回状态为空时,可操作撤回;")}

+ {/*

{getLabel(111, "2、撤回后不可重新分享;")}

*/} + {/*

{getLabel(111, "3、分享状态为失败,可操作重新分享;")}

*/} + {/*

{getLabel(111, "4、重新分享:以当前分享记录的分享报表、有效时间、渠道和说明重新分享,分享后自动刷新分享时间和分享状态")}

*/} +
+ } + /> + , + render: (__, record) => (_.isEmpty(record.rebackStatus) ? + this.salaryStatisticsPushcancel(record.id)}>{getLabel(32025, "撤回")} : null) + } + ]} + /> + this.setState({ sharePerDialog: { ...sharePerDialog, visible: false, id: "" } })} + onGetTable={() => { + this.salaryStatisticsPushGetDetail(this.props); + this.props.onGetTable(); + }} + /> + +
+ + ); + } +} + +export default SalaryStatisticsDetailShareLogDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js new file mode 100644 index 00000000..b0f8073e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js @@ -0,0 +1,74 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { salaryStatisticsPushAddSharedSendMsg } from "../../../apis/statistics"; +import { sharePersonCondition } from "./condition"; +import { getSearchs } from "../../../util"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("attendanceStore") +@observer +class SalaryStatisticsDetailSharePersonDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { attendanceStore: { initSharePerForm, sharePerForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) { + sharePerForm.initFormFields(sharePersonCondition); + } else { + initSharePerForm(); + } + } + + save = () => { + const { attendanceStore: { sharePerForm }, id } = this.props; + sharePerForm.validateForm().then(f => { + if (f.isValid) { + const { sharedBy } = sharePerForm.getFormParams(); + const payload = { + id, sharedBy: sharedBy.split(",") + }; + salaryStatisticsPushAddSharedSendMsg(payload) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(); + this.props.onGetTable(); + } else { + message.error(errormsg); + } + }) + .catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { attendanceStore: { sharePerForm }, loading } = this.props; + return ( + {getLabel(111, "保存并分享")} + ]} + style={{ width: 600, height: 100 }} + > + {getSearchs(sharePerForm, sharePersonCondition, 1, false)} + + ); + } +} + +export default SalaryStatisticsDetailSharePersonDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js new file mode 100644 index 00000000..3e35f626 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js @@ -0,0 +1,132 @@ +/* + * Author: 黎永顺 + * name: 统计报表-分享记录 + * Description: + * Date: 2023/9/19 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSlideModal, WeaTable } from "ecCom"; +import { message, Modal } from "antd"; +import { salaryStatisticsPushcancelAll, salaryStatisticsPushGetTable } from "../../../apis/statistics"; +import SalaryStatisticsDetailShareLogDialog from "./salaryStatisticsDetailShareLogDialog"; + +const { getLabel } = WeaLocaleProvider; + +class SalaryStatisticsDetailShareRecord extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], columns: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + shareLogDialog: { + visible: false, id: "" + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.salaryStatisticsPushGetTable(); + } + + salaryStatisticsPushGetTable = () => { + this.setState({ loading: true }); + salaryStatisticsPushGetTable({ ...this.state.pageInfo }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, + pageInfo: { ...this.state.pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleWithdrawAll = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要全部撤回吗?"), + onOk: () => { + salaryStatisticsPushcancelAll({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.salaryStatisticsPushGetTable(); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { dataSource, columns, loading, pageInfo, shareLogDialog } = 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.salaryStatisticsPushGetTable(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.salaryStatisticsPushGetTable(); + }); + } + }; + return ( + +
+
+
+
{getLabel(111, "分享记录")}
+
+
+
+
} + content={( + ( + + this.setState({ + shareLogDialog: { visible: true, id: record.id } + })}>{getLabel(111, "查询详情")} + this.handleWithdrawAll(record.id)}>{getLabel(111, "全部撤回")} + this.salaryStatisticsPushGetTable()} + onCancel={() => this.setState({ + shareLogDialog: { visible: false, id: "" } + })} + /> + + ) + } + ]} + /> + )}/> + ); + } +} + +export default SalaryStatisticsDetailShareRecord; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index af333538..32f074d1 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -5,7 +5,6 @@ * Date: 2023/4/21 */ import React, { Component } from "react"; -import { toJS } from "mobx"; import { WeaButtonIcon, WeaDatePicker, @@ -16,12 +15,12 @@ import { WeaSearchGroup, WeaSelect, WeaSlideModal, - WeaTable + WeaTable, + WeaTools } from "ecCom"; import CustomStatisticsItemsModal from "./customStatisticsItemsModal"; import moment from "moment"; import { Button, message, Modal } from "antd"; -import { condition } from "./condition"; import { getSearchs } from "../../../util"; import { deleteRangeSetting, @@ -31,8 +30,11 @@ import { statisticsItemList } from "../../../apis/statistics"; import { commonEnumList } from "../../../apis/ruleconfig"; +import { getTaxAgentSelectList } from "../../../apis/taxAgent"; +import { condition } from "./condition"; import "../index.less"; +const getKey = WeaTools.getKey; const { getLabel } = WeaLocaleProvider; class StatisticalMicroSettingsSlide extends Component { @@ -47,32 +49,14 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth: [], statisticalItemPayload: { visible: false, id: "", dimension: "", - statisticsItemId: "" + statisticsItemId: "", isShare: false } }; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.taxAgentAdminOption !== this.props.taxAgentAdminOption && !_.isEmpty(nextProps.taxAgentAdminOption)) { - const conditions = _.map(condition, item => { - return { - ...item, - items: _.map(item.items, child => { - if (child.domkey[0] === "taxAgent") { - return { - ...child, - options: toJS(nextProps.taxAgentAdminOption) - }; - } - return { ...child }; - }) - }; - }); - this.setState({ conditions }); - nextProps.form.initFormFields(condition); - } + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentSelectList(nextProps); if (nextProps.id !== this.props.id && !_.isEmpty(nextProps.id)) { - this.reportStatisticsGetSearchCondition(nextProps.id); this.statisticsItemList(nextProps.id).then(r => { }); } @@ -82,6 +66,31 @@ class StatisticalMicroSettingsSlide extends Component { } } + getTaxAgentSelectList = (props) => { + getTaxAgentSelectList(props.isShare).then(({ status, data }) => { + if (status) { + const conditions = _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + if (getKey(child) === "taxAgent") { + return { + ...child, viewAttr: props.isShare ? 1 : child.viewAttr, + options: _.map(data, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, viewAttr: props.isShare ? 1 : child.viewAttr }; + }) + }; + }); + this.setState({ conditions }, () => { + props.form.initFormFields(this.state.conditions); + props.id && this.reportStatisticsGetSearchCondition(props.id); + }); + + } + }); + }; reportStatisticsGetSearchCondition = (id) => { const { conditions } = this.state; const { form } = this.props; @@ -189,7 +198,7 @@ class StatisticalMicroSettingsSlide extends Component { }; renderProjectTitle = () => { const { selectedRowKeys } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; return
{getLabel(111, "统计项目")} @@ -198,19 +207,25 @@ class StatisticalMicroSettingsSlide extends Component { />
- - this.setState({ - statisticalItemPayload: { - visible: true, id, dimension, - statisticsItemId: "" - } - })} - /> + { + !isShare && + + } + { + !isShare && + this.setState({ + statisticalItemPayload: { + visible: true, id, dimension, + statisticsItemId: "", isShare + } + })} + /> + }
; }; @@ -220,16 +235,18 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth, conditions, selectedRowKeys, loading, statisticalItemPayload, dataSource, unitTypeList } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; const columns = [ { title: "统计项名称", dataIndex: "itemName", render: (txt, record) => { return ( - this.setState({ - statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } - })}>{txt} + { + this.setState({ + statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id, isShare } + }); + }}>{txt} ); } }, @@ -238,7 +255,7 @@ class StatisticalMicroSettingsSlide extends Component { dataIndex: "unitType", render: (txt, record) => { return this.customStatisticsItemsRef.reportStatisticsItemSave({ id: record.id, unitType })} />; } @@ -248,7 +265,10 @@ class StatisticalMicroSettingsSlide extends Component { selectedRowKeys, onChange: (selectedRowKeys) => { this.setState({ selectedRowKeys }); - } + }, + getCheckboxProps: record => ({ + disabled: isShare + }) }; return ( } + title={} content={ - this.setState({ salaryMonth: v })}/> @@ -294,10 +314,8 @@ class StatisticalMicroSettingsSlide extends Component { {...statisticalItemPayload} onCancel={(isRefresh) => this.setState({ statisticalItemPayload: { - visible: false, - id: "", - dimension: "", - statisticsItemId: "" + visible: false, id: "", dimension: "", + statisticsItemId: "", isShare: false } }, () => isRefresh && this.statisticsItemList(this.props.id))} /> @@ -319,16 +337,19 @@ const TitleDialog = (props) => {
- + { + !props.isShare && + + }
; }; export const MonthRangePicker = (props) => { - const { dateRange, onChange, viewAttr } = props; + const { dateRange, onChange, viewAttr, disabled = false } = props; const [startDate, endDate] = dateRange || []; return
{ return current && endDate && current.getTime() > new Date(endDate).getTime(); }} @@ -338,7 +359,7 @@ export const MonthRangePicker = (props) => { /> { return current && startDate && current.getTime() < new Date(startDate).getTime(); }} diff --git a/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js new file mode 100644 index 00000000..a2a7b0ae --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js @@ -0,0 +1,54 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import SalaryStatisticsDetailShareDialog from "./salaryStatisticsDetailShareDialog"; +import SalaryStatisticsDetailShareRecord from "./salaryStatisticsDetailShareRecord"; + +const { getLabel } = WeaLocaleProvider; + +class TopBtns extends Component { + constructor(props) { + super(props); + this.state = { + shareDialog: { + visible: false + }, + shareRecordDialog: { + visible: false + } + }; + } + + handleShare = () => { + this.setState({ + shareDialog: { visible: true } + }); + }; + handleShareRecord = () => { + this.setState({ + shareRecordDialog: { visible: true } + }); + }; + + render() { + const { shareDialog, shareRecordDialog } = this.state; + return [ + , + , + this.setState({ + shareDialog: { visible: false } + })} + />, + this.setState({ + shareRecordDialog: { visible: false } + })} + /> + ]; + } +} + +export default TopBtns; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index c315ae53..ffe5a3db 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -11,9 +11,11 @@ import { message, Modal } from "antd"; import LeftTab from "./components/leftTab"; import ReportContent from "./components/reportContent"; import StatisticalMicroSettingsSlide from "./components/statisticalMicroSettingsSlide"; +import TopBtns from "./components/topBtns"; import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig"; import "./index.less"; + const { getLabel } = WeaLocaleProvider; @inject("taxAgentStore", "attendanceStore") @@ -31,9 +33,7 @@ class Index extends Component { } componentDidMount() { - const { taxAgentStore: { fetchTaxAgentOption } } = this.props; this.reportGetForm(); - fetchTaxAgentOption(); } reportGetForm = () => { @@ -92,20 +92,19 @@ class Index extends Component { */ exportData = () => { const { report } = this.state; - const { id, dimensionId } = report; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}`, "_self"); + const { id, dimensionId, isShare } = report; + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_blank"); }; render() { const { report, dimensionList, statisticalPayload } = this.state; - const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption } } = this.props; + const { isShare } = report; + const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props; return ( } - iconBgcolor="#F14A2D" - showDropIcon={false} - className="reportViewWrapper" + title={getLabel(111, "报表查看")} icon={} + iconBgcolor="#F14A2D" className="reportViewWrapper" + buttons={(showOperateBtn && !isShare) ? [] : []} >
{getLabel(111, "统计维度")}: - this.handleChangeDimension(key, showname)}/>
@@ -150,10 +149,10 @@ class Index extends Component { {/*统计数据范围及规则设置弹框*/} this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } - }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId))} + }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))} />
diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index 99d4d917..ecf9b997 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -204,6 +204,18 @@ .microSlideWrapper { z-index: 999; + .wea-form-item-wrapper { + display: flex !important; + + .wea-browser { + width: 100%; + } + } + + .wea-form-item .wea-form-item-wrapper .wea-field-readonly { + white-space: pre-wrap !important; + } + .wea-slide-modal-title { height: auto !important; line-height: normal !important; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index c2c63718..a4ffcd0a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -384,7 +384,7 @@ export default class SalaryItem extends React.Component { onCancel={() => this.setState({ syncSalarySetDialog: { ...this.state.syncSalarySetDialog, - visible: false, id: "", title: "" + visible: false, title: "" } })} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js index 5acd68bf..80fe193f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js @@ -1,114 +1,10 @@ -// 社保 -export const socialSecurityColumns = [{ - title: "方案名称", - dataIndex: "title", - key: "title" -}, { - title: "缴纳类型", - dataIndex: "username", - key: "username" -}, { - title: "缴纳范围", - dataIndex: "projectName", - key: "projectName" -}, { - title: "备注", - dataIndex: "customer", - key: "customer" -}, { - title: "操作", - dataIndex: "customer", - key: "customer" -}]; - -// 公积金 -export const accumulationFundColumns = [{ - title: "方案名称", - dataIndex: "title", - key: "title" -}, { - title: "缴纳类型", - dataIndex: "username", - key: "username" -}, { - title: "缴纳范围", - dataIndex: "projectName", - key: "projectName" -}, { - title: "备注", - dataIndex: "customer", - key: "customer" -}, { - title: "操作", - dataIndex: "customer", - key: "customer" -}]; - -// 企业年金及其他福利 -export const otherBenefitsColumns = [ - { - title: "方案名称", - dataIndex: "title", - key: "title" - - }, - { - title: "缴纳类型", - dataIndex: "title", - key: "title" - }, - { - title: "缴纳范围", - dataIndex: "title", - key: "title" - }, - { - title: "备注", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; - -export const CustomBenefitsColumns = [ - { - title: "福利名称", - dataIndex: "title", - key: "title" - }, - { - title: "启用", - dataIndex: "title", - key: "title" - }, - { - title: "类型", - dataIndex: "title", - key: "title" - }, - { - title: "缴纳对象", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; - export const insertUpdateColumns = [ { title: "类型名称", dataIndex: "insuranceName", key: "insuranceName", width: 120, - fixed: 'left' + fixed: "left" }, { title: "是否缴费", @@ -172,8 +68,39 @@ export const insertUpdateColumns = [ } ]; - -export const dataSource = []; +export const conditons = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["schemeName"], + fieldcol: 12, + isQuickSearch: true, + label: "方案名称", + lanId: 33162, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["paymentTypeEnum"], + fieldcol: 12, + isQuickSearch: true, + label: "缴纳类型", + lanId: 543163, + labelcol: 6, + value: "", + options: [], + viewAttr: 2 + } + ], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index fabf6a86..e7c215c2 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -141,6 +141,11 @@ export default class DefaultSlideForm extends React.Component { key: "2", selected: true, showname: "2" + }, + { + key: "3", + selected: false, + showname: "3" } ]; item.render = (text, record) => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 1181f8a0..c3673fae 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -2,9 +2,8 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { Button, Dropdown, Menu, message, Modal } from "antd"; -import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom"; -import { renderNoright } from "../../../util"; -import CustomTab from "../../../components/customTab"; +import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTab, WeaTools, WeaTop } from "ecCom"; +import { getSearchs, renderNoright } from "../../../util"; import SlideModalTitle from "../../../components/slideModalTitle"; import TipLabel from "../../../components/TipLabel"; import DefaultSlideForm from "./defaultSlideForm"; @@ -14,8 +13,10 @@ import CustomPaginationTable from "../../../components/customPaginationTable"; import TwoColContent from "../../../components/twoColContent"; import CopySchemaModal from "./copySchemaModal"; import CustomBenefitsTable from "./customBenefitsTable"; +import { conditons } from "./columns"; import "./index.less"; +const getKey = WeaTools.getKey; const { getLabel } = WeaLocaleProvider; @inject("programmeStore", "taxAgentStore", "salaryFileStore") @observer @@ -30,7 +31,8 @@ export default class Programme extends React.Component { copyModalValue: "", copyId: "", customNewVisible: false, - customEdit: false + customEdit: false, + showSearchAd: false }; this.pageInfo = { current: 1, pageSize: 10 }; @@ -38,12 +40,29 @@ export default class Programme extends React.Component { componentWillMount() { const { programmeStore, salaryFileStore, taxAgentStore } = this.props; - const { doInit } = programmeStore; + const { doInit, planSearchForm } = programmeStore; doInit(); const { commonEnumList } = salaryFileStore; commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }); const { getTaxAgentSelectListAsAdmin } = taxAgentStore; getTaxAgentSelectListAsAdmin(); + planSearchForm.initFormFields(_.map(conditons, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "paymentTypeEnum") { + return { + ...o, + options: [ + { key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") }, + { key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") } + ] + }; + } + return { ...o }; + }) + }; + })); } // 增加编辑功能,重写columns绑定事件 @@ -173,6 +192,7 @@ export default class Programme extends React.Component { } render() { + const { showSearchAd } = this.state; const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props; const { loading, hasRight, form, getTableDatas } = programmeStore; const { @@ -187,7 +207,8 @@ export default class Programme extends React.Component { customNewVisible, tableDataSource, tableColumns, - tablePageInfo + tablePageInfo, + planSearchForm } = programmeStore; if (!hasRight && !loading) return renderNoright(); @@ -317,59 +338,65 @@ export default class Programme extends React.Component { const { programmeStore: { initSlideParms } } = this.props; initSlideParms(); }; - + const customButtons = [ + { + setCustomSelectkey(v); + this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v }); + }} + /> + ]; + const tabButtons = [ + + ]; return (
} // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={false} // 是否显示下拉按钮 + title="社保福利方案" icon={} + iconBgcolor="#F14A2D" showDropIcon={false} > - - {/* 操作按钮权限 */} - {showOperateBtn && - } - - {selectedKey == "custom" && - { - setCustomSelectkey(v); - this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v }); - }} - />} -
- } + this.setState({ showSearchAd: bool })} + advanceHeight={200} searchsAd={getSearchs(planSearchForm, _.map(conditons, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "paymentTypeEnum") { + return { + ...o, + options: [ + { key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") }, + { key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") } + ] + }; + } + return { ...o }; + }) + }; + }), 2, false)} + onAdSearch={() => getTableDatas(selectedKey)} + onAdReset={v => planSearchForm.resetForm()} + onSearch={() => getTableDatas(selectedKey)} onChange={v => { setSelectedKey(v); handleSlideClose(); - if (v == "custom") { - // 自定义福利 - } else { - getTableDatas(v); - } + v !== "custom" && getTableDatas(v); }} + onSearchChange={v => planSearchForm.updateFields({ schemeName: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 + searchsBaseValue={planSearchForm.getFormParams().schemeName} + buttons={!showOperateBtn ? [] : selectedKey !== "custom" ? tabButtons : [...tabButtons, ...customButtons]} />
- {selectedKey == "custom" + {selectedKey === "custom" ? { if (index === idx) { return { - ...item, + ...item, adjustTo: "", companyTotal: data[0].totalNum, adjustToOptions: categoryType ? _.map(categoryType.split(","), tmpV => { return _.find(item.categoryTypeOptions, tmpJ => tmpJ.key === tmpV); @@ -330,7 +330,7 @@ class AdjustTable extends Component { }; handleClick = (record) => { - const { status, id, paymentOrganization, billMonth } = record; + const { status, id, paymentOrganization, billMonth, employeeId, target } = record; const { targetOptions } = this.state; if (status) { Modal.confirm({ @@ -338,7 +338,8 @@ class AdjustTable extends Component { content: "确定撤回吗?撤回后该笔调差将失效!", onOk: () => { const payload = { id, paymentOrganization, billMonth }; - compensationBack(payload).then(({ status, data, errormsg }) => { + compensationBack(payload).then(async ({ status, data, errormsg }) => { + const { data: categoryTypeOptions } = await compensationCategoryType({ id: _.find(targetOptions, child => (child.employeeId == employeeId || child.employeeId == target)).target }); if (status) { message.success(data || "撤回成功"); this.setState({ @@ -347,7 +348,11 @@ class AdjustTable extends Component { return { ...it, status: false, - uuid: new Date().getTime() + idx + uuid: new Date().getTime() + idx, + categoryTypeOptions: _.map(categoryTypeOptions, child => ({ + key: child.id, + showname: child.content + })) }; } return { ...it, uuid: new Date().getTime() + idx }; @@ -404,8 +409,14 @@ class AdjustTable extends Component { if (_.isEmpty(errorMessage)) { this.setState({ dataSource: _.map(this.state.dataSource, it => { - if (record.target === it.target && record.uuid === it.uuid) { - return { ...it, status: true, id: successIds[0] }; + if (record.id === it.id || (!it.id && record.uuid === it.uuid)) { + return { + ...it, status: true, id: successIds[0], + targetOptions: _.map([_.find(targetOptions, o => o.employeeId == target)], v => ({ + key: v.target.toString(), + showname: v.username + })) + }; } return { ...it }; }) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js index 5651926e..47542d39 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js @@ -69,7 +69,7 @@ class AdjustmentDefaultSlide extends Component { dataIndex: "categoryType", title: "统计调差福利类型(单位)", render: (text, record) => { return ( - {_.map(record.categoryTypeOptions, it => it.showname).join(",")} + {_.map(_.filter(record.categoryTypeOptions, o => (record.categoryType.split(",").includes(o.key))), it => it.showname).join(",")} ); } }, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 90fe32b1..2fb3f37c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -73,7 +73,7 @@ class AdjustmentSlide extends Component { const { data: dataMsg, errorMessage = [] } = data; const msg = dataMsg + errorMessage.join(","); !_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功"); - _.isEmpty(errorMessage) && + // _.isEmpty(errorMessage) && this.adjustTableRef.getCompensationList().then(r => { }); } else { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 4a2b5783..2fe404a5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -235,7 +235,7 @@ export default class NormalIndex extends Component { }; getNormalList = async (payload = {}) => { const { getNormalList } = this.props.standingBookStore; - getNormalList({ ...payload }).then(({ list, columns = [], total }) => { + getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { this.setState({ tableData: { list, total, columns } }, () => this.postMessageToChild()); @@ -244,7 +244,7 @@ export default class NormalIndex extends Component { getSupplementaryList = async (payload = {}) => { const { getSupplementaryList } = this.props.standingBookStore; getSupplementaryList({ - ...payload + ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { this.setState({ tableData: { list, columns, total } diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js index e0ee84b5..451cb234 100644 --- a/pc4mobx/hrmSalary/stores/attendanceStore.js +++ b/pc4mobx/hrmSalary/stores/attendanceStore.js @@ -1,4 +1,4 @@ -import { observable } from "mobx"; +import { action, observable } from "mobx"; import { WeaForm } from "comsMobx"; @@ -10,4 +10,15 @@ export class AttendanceStore { @observable reportForm = new WeaForm(); //报表查看 统计数据范围及规则设置form @observable settingForm = new WeaForm(); + //报表查看 分享报表 + @observable shareForm = new WeaForm(); + @observable shareLogForm = new WeaForm(); + @observable sharePerForm = new WeaForm(); + + @action("报表查看-分享报表表单初始化") + initShareForm = () => this.shareForm = new WeaForm(); + @action("报表查看-查看分享记录详情表单初始化") + initShareLogForm = () => this.shareLogForm = new WeaForm(); + @action("报表查看-追加被分享人表单初始化") + initSharePerForm = () => this.sharePerForm = new WeaForm(); } diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 916c3be9..8a38f31e 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -218,6 +218,34 @@ export class MySalaryStore { }); }; + @action initRecordData = async (payload) => { + this.clear(); + //1.check is need second verify + if (window.doCheckSecondaryVerify4ec) { + window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => this.getRecordData({ + ...data, payload + })); + } else { + //4.loaddata + this.getRecordData({ status: "1", token: "", payload }); + } + }; + + @action + getRecordData = async (params = {}) => { + if (_.isEmpty(params)) return; + const { status, payload, token } = params; + if (status == "1") { + // Object.assign(this._reqParams, { token }); + // this.getFormData({ viewAttr: 1 }); + this.hasRight = true; + this.getRecordList(payload); + } else { + this.hasRight = false; + } + this.loading = false; + }; + @action getRecordList = (params = {}) => { API.recordList(params).then(res => { diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js index 3cbc9c91..1459cc09 100644 --- a/pc4mobx/hrmSalary/stores/programme.js +++ b/pc4mobx/hrmSalary/stores/programme.js @@ -8,6 +8,10 @@ import { notNull } from "../util/validate"; const { TableStore } = WeaTableNew; export class ProgrammeStore { + //lys-表单初始化(方案查询表单) + @observable planSearchForm = new WeaForm(); + + @observable tableStore = new TableStore(); // new table @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @@ -94,20 +98,18 @@ export class ProgrammeStore { @action getTableDatas = (selectKey = "SOCIAL_SECURITY", params) => { this.loading = true; - const formParams = this.form.getFormParams() || {}; - params = params || formParams; - params.welfareTypeEnum = selectKey; - API.getTable(params).then(action(res => { - if (res.status) { // 接口请求成功/失败处理 - // this.tableStore.getDatas(res.data.datas); // table 请求数据 - this.tableDataSource = res.data.list ? res.data.list : []; - this.tableColumns = res.data.columns; - this.tablePageInfo = res.data; - } else { - message.error(res.errormsg || "接口调用失败!"); - } - this.loading = false; - })); + API.getTable({ ...params, ...this.planSearchForm.getFormParams(), welfareTypeEnum: selectKey }) + .then(action(res => { + if (res.status) { // 接口请求成功/失败处理 + // this.tableStore.getDatas(res.data.datas); // table 请求数据 + this.tableDataSource = res.data.list ? res.data.list : []; + this.tableColumns = res.data.columns; + this.tablePageInfo = res.data; + } else { + message.error(res.errormsg || "接口调用失败!"); + } + this.loading = false; + })); };