diff --git a/pc4mobx/hrmSalary/apis/custom-apis/jinhuajiaotou/index.js b/pc4mobx/hrmSalary/apis/custom-apis/jinhuajiaotou/index.js new file mode 100644 index 00000000..e13a5e1c --- /dev/null +++ b/pc4mobx/hrmSalary/apis/custom-apis/jinhuajiaotou/index.js @@ -0,0 +1,15 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../../../util/request"; + +//大成二开 薪资核算/月结、取消月结 +export const balanceAPI = (api, params) => { + return postFetch(api, params); +}; +//金华交投二开 审批记录下拉框 +export const jhjtSelectList = params => { + return postFetch("/api/bs/hrmsalary/salaryacct/jhjtSelectList", params); +}; +//大成二开 获取下级分部 +export const getChildSubCompanyList = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/getChildSubCompanyList", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index c67e096b..9c84142f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -23,6 +23,8 @@ import CustomCalcExportDialog from "./components/customCalcExportDialog"; import SalaryEditCalcImport from "./components/salaryEditCalcImport"; import { convertToUrlString } from "../../../util/url"; import "./index.less"; +//二开 +import ApprovalSelectionDialog from "../../custom-pages/jinhuajiaotou/approvalSelectionDialog"; const getLabel = WeaLocaleProvider.getLabel; @@ -36,8 +38,8 @@ class Index extends Component { customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, approvalInfo: {},//审批信息, - accountExceptInfo: "" //核算报错信息, - + accountExceptInfo: "", //核算报错信息, + JHDialog: { visible: false, approvalWorkflowUrl: "", salaryAcctRecordId: "" } }; this.calc = null; this.timer = null; @@ -171,7 +173,7 @@ class Index extends Component { ]; !canEdit && reqBtns.splice(0, 1); isOpenApproval && reqBtns.unshift(); accountExceptInfo && reqBtns.unshift(
@@ -246,6 +248,12 @@ class Index extends Component { salaryImpDialog: { ...salaryImpDialog, visible: false } }, () => isFresh && this.calc.onAdSearch(false)); }}/> + {/* 金华交投流程审批薪资核算二开*/} + { + this.setState({ + JHDialog: { ...JHDialog, visible: false, salaryAcctRecordId: "" } + }); + }}/>
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/approvalSelectionDialog.js b/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/approvalSelectionDialog.js new file mode 100644 index 00000000..3271580a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/approvalSelectionDialog.js @@ -0,0 +1,86 @@ +/* + * + * 金华交投-发起流程审批薪资核算记录选择弹框 + * @Author: 黎永顺 + * @Date: 2024/6/11 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { getSearchs } from "../../../util"; +import { convertToUrlString } from "../../../util/url"; +import { jhjtSelectList } from "../../../apis/custom-apis/jinhuajiaotou"; +import { accountConditions } from "./condition"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("jhStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.jhjtSelectList(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.jhStore.initForm(); + } + + jhjtSelectList = (props) => { + const { jhStore: { form }, salaryAcctRecordId } = props; + jhjtSelectList({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(accountConditions, item => ({ + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "salaryAcctRecordId") { + return { + ...o, label: getLabel(o.lanId, o.label), value: salaryAcctRecordId, + options: _.map(data, g => ({ key: g.id.toString(), showname: g.salarySobName })) + }; + } + return { ...o }; + }) + })) + }, () => form.initFormFields(this.state.conditions)); + } + }); + }; + save = () => { + const { jhStore: { form }, approvalWorkflowUrl } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const payload = form.getFormParams(); + window.open(`${approvalWorkflowUrl}&${convertToUrlString(payload)}`, "_blank"); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { conditions, loading } = this.state; + const { jhStore: { form } } = this.props; + return ( + {getLabel(111, "确定")} + ]} + > +
{getSearchs(form, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/condition.js b/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/condition.js new file mode 100644 index 00000000..ebeab299 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/jinhuajiaotou/condition.js @@ -0,0 +1,20 @@ +export const accountConditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["salaryAcctRecordId"], + fieldcol: 14, + label: "薪资核算记录", + lanId: 111, + labelcol: 6, + multiple: true, + options: [], + rules: "required|string", + viewAttr: 3 + }, + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/stores/custom-stores/index.js b/pc4mobx/hrmSalary/stores/custom-stores/index.js index 7be35b6b..29152241 100644 --- a/pc4mobx/hrmSalary/stores/custom-stores/index.js +++ b/pc4mobx/hrmSalary/stores/custom-stores/index.js @@ -1,2 +1,5 @@ +import { JHStore } from "./jinhuajiaotou"; + module.exports = { + jhStore: new JHStore() }; diff --git a/pc4mobx/hrmSalary/stores/custom-stores/jinhuajiaotou/index.js b/pc4mobx/hrmSalary/stores/custom-stores/jinhuajiaotou/index.js new file mode 100644 index 00000000..ec8f1df7 --- /dev/null +++ b/pc4mobx/hrmSalary/stores/custom-stores/jinhuajiaotou/index.js @@ -0,0 +1,7 @@ +import { action, observable } from "mobx"; +import { WeaForm } from "comsMobx"; + +export class JHStore { + @observable form = new WeaForm(); + @action initForm = () => this.form = new WeaForm(); +} diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 4ce6ef7a..c543e762 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -72,6 +72,12 @@ } } +.multipleSelect-layout { + .wea-form-item .wea-form-item-wrapper { + display: inline-block !important; + } +} + //公式编辑框样式 .excel-codeBox { .cm-variable {