diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 0abda464..e4431c8a 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -266,4 +266,8 @@ export const deleteExportTemplate = (params) => { export const getExportTemplateForm = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); }; +//薪资审批-薪资核算页面获取审批信息 +export const getApprovalInfoByRecordId = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index d8a8d78e..d7e6dd26 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -9,7 +9,12 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; -import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate"; +import { + acctresultAccounting, + getApprovalInfoByRecordId, + getCalculateProgress, + getExportField +} from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryEditCalc from "./components/salaryEditCalc"; @@ -30,6 +35,7 @@ class Index extends Component { selectedKey: "person", progressVisible: false, progress: 0, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, + approvalInfo: {},//审批信息, accountExceptInfo: "" //核算报错信息, }; @@ -37,6 +43,14 @@ class Index extends Component { this.timer = null; } + init = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + }; handleMenuClick = ({ key }) => { switch (key) { case "calc_selected": @@ -196,7 +210,7 @@ class Index extends Component { const { calculateStore: { setOtherConditions } } = this.props; const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state; return ( - +
{ const { saveSalarySobId, editId } = this.props; - API.getSalaryApprovalForm({ salarySobId: saveSalarySobId || editId }).then(({ status, data }) => { + API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => { if (status) { this.setState({ approvalId: data.id, @@ -88,8 +88,8 @@ class LedgerAccountApprRule extends Component { wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom" > - this.setState({ + this.setState({ approvalItemGroup: _.map(approvalItemGroup, o => ({ ...o, approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({ @@ -99,9 +99,11 @@ class LedgerAccountApprRule extends Component { })) }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} onEdit={(groupName, groupId) => this.setState({ - approvalItemGroup: _.map(approvalItemGroup, o => ({ + approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({ ...o, groupName: groupId === o.id ? groupName : o.groupName - })) + })) : [{ + approvalItems: [], groupName, id: String(approvalItemGroup.length) + }, ...approvalItemGroup] }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} onDelete={(group, item) => this.setState({ approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) : diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js index 482f3ea5..9958b727 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js @@ -28,7 +28,7 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { } init = (props) => { - const { ledgerStore: { AARClassifyForm }, groupName } = props; + const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props; this.setState({ conditions: _.map(classifyConditions, item => ({ ...item, @@ -36,7 +36,7 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { })) }, () => { AARClassifyForm.initFormFields(this.state.conditions); - AARClassifyForm.updateFields({ groupName }); + groupId && AARClassifyForm.updateFields({ groupName }); }); }; save = () => { @@ -57,7 +57,6 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { return ( {getLabel(537558, "保存")} ]} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js index 7152c7ba..1f53c37b 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js @@ -5,7 +5,7 @@ * Date: 2024/4/24 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom"; +import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom"; import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog"; import * as API from "../../../apis/ledger"; import { Icon, Modal } from "antd"; @@ -18,7 +18,7 @@ class LedgerAccountSalaryItemsSet extends Component { constructor(props) { super(props); this.state = { - editDialog: { visible: false, groupName: "", groupId: "" }, + editDialog: { visible: false, groupName: "", groupId: "", title: "" }, salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" } }; } @@ -32,9 +32,11 @@ class LedgerAccountSalaryItemsSet extends Component { }; handleAddSalaryItems = (group) => { const { salaryItemDialog } = this.state; - const { salarySobId } = this.props; + const { salarySobId, datas } = this.props; const payload = { - salarySobId, excludeIds: _.map(group.approvalItems, o => o.salaryItemId) + salarySobId, excludeIds: _.reduce(datas, (pre, cur) => { + return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId)); + }, []) }; API.getListSalaryItem(payload).then(({ status, data }) => { if (status) this.setState({ @@ -48,84 +50,95 @@ class LedgerAccountSalaryItemsSet extends Component { const { salaryItemDialog } = this.state; this.setState({ salaryItemDialog: { ...salaryItemDialog, visible: false } - }, () => this.props.onAdd(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem))); + }, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem))); }; render() { const { editDialog, salaryItemDialog } = this.state; const { datas } = this.props; return ( -
- this.props.onChange(list)} - renderNodeItem={(item) => { - return
-
+
+
+ this.setState({ + editDialog: { visible: true, title: getLabel(111, "添加分类") } + })}/> + +
+
+ this.props.onChange(list)} + renderNodeItem={(item) => { + return
+
{item.groupName} this.setState({ - editDialog: { visible: true, groupName: item.groupName, groupId: item.id } + editDialog: { + visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑") + } })}/> this.handleDeleteClick(item)}/> - this.handleAddSalaryItems(item)}/> -
-
- { - !_.isEmpty(item.approvalItems) ? - this.props.onChange( - _.map(datas, child => { - if (child.id === item.id) { - return { ...child, approvalItems: items }; - } - return { ...child }; - }) - )} - renderNodeItem={(filed) => { - return
-
-
{filed.salaryItemName}
- this.handleDeleteClick(item, filed)}/> -
-
; - }} - className="wea-sortable-salary-item" - /> : -
暂无数据
- } -
-
; - }} - className="wea-sortable-salary-item" - /> - this.setState({ - editDialog: { ...editDialog, visible: false } - })}/> - this.setState({ - salaryItemDialog: { ...salaryItemDialog, visible: false } - })} onConfirm={this.handleConfirm}> -
- g.checkedSalaryItem), o => o.id)} - onChange={v => { - this.setState({ - salaryItemDialog: { - ...salaryItemDialog, - options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) })) + this.handleAddSalaryItems(item)}/> +
+
+ { + !_.isEmpty(item.approvalItems) ? + this.props.onChange( + _.map(datas, child => { + if (child.id === item.id) { + return { ...child, approvalItems: items }; + } + return { ...child }; + }) + )} + renderNodeItem={(filed) => { + return
+
+
{filed.salaryItemName}
+ this.handleDeleteClick(item, filed)}/> +
+
; + }} + className="wea-sortable-salary-item" + /> : +
暂无数据
} - }); - }} - /> -
-
+
+
; + }} + className="wea-sortable-salary-item" + /> + this.setState({ + editDialog: { ...editDialog, visible: false } + })}/> + this.setState({ + salaryItemDialog: { ...salaryItemDialog, visible: false } + })} onConfirm={this.handleConfirm}> +
+ g.checkedSalaryItem), o => o.id)} + onChange={v => { + this.setState({ + salaryItemDialog: { + ...salaryItemDialog, + options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) })) + } + }); + }} + /> +
+
+
); }