custom/金华交投

This commit is contained in:
黎永顺 2024-06-12 10:58:24 +08:00
parent f0d1a82e83
commit 3c48eee308
7 changed files with 149 additions and 4 deletions

View File

@ -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);
};

View File

@ -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(<Button type="ghost" onClick={() => {
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
this.setState({ JHDialog: { visible: true, approvalWorkflowUrl, salaryAcctRecordId } });
}}>{getLabel(111, "发起审批")}</Button>);
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
title={getLabel(111, "存在异常信息,点击下载!")}
@ -213,7 +215,7 @@ class Index extends Component {
{ key: "calc", title: getLabel(538011, "薪资核算") }
];
const { calculateStore: { setOtherConditions } } = this.props;
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog, JHDialog } = this.state;
return (
<Layout {...this.props} init={this.init}>
<div className="salary-calculate-do-calc">
@ -246,6 +248,12 @@ class Index extends Component {
salaryImpDialog: { ...salaryImpDialog, visible: false }
}, () => isFresh && this.calc.onAdSearch(false));
}}/>
{/* 金华交投流程审批薪资核算二开*/}
<ApprovalSelectionDialog {...JHDialog} onCancel={() => {
this.setState({
JHDialog: { ...JHDialog, visible: false, salaryAcctRecordId: "" }
});
}}/>
</WeaReqTop>
</div>
</Layout>

View File

@ -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 (
<WeaDialog
{...this.props} title={getLabel(111, "薪资核算记录")} style={{ width: 480, height: 80 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确定")}</Button>
]}
>
<div className="calculate-dialog-layout multipleSelect-layout">{getSearchs(form, conditions, 1, false)}</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -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: ""
}
];

View File

@ -1,2 +1,5 @@
import { JHStore } from "./jinhuajiaotou";
module.exports = {
jhStore: new JHStore()
};

View File

@ -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();
}

View File

@ -72,6 +72,12 @@
}
}
.multipleSelect-layout {
.wea-form-item .wea-form-item-wrapper {
display: inline-block !important;
}
}
//公式编辑框样式
.excel-codeBox {
.cm-variable {