custom/陕西万众-薪资账套薪资核算配置

This commit is contained in:
黎永顺 2023-12-29 16:45:37 +08:00
parent 68e9fd5ad1
commit 5340dba06d
4 changed files with 94 additions and 2 deletions

View File

@ -171,6 +171,11 @@
.wea-search-group {
padding-left: 0;
padding-right: 0;
margin-bottom: 16px;
.wea-form-cell {
padding: 0;
}
}
.titleNormalWrapper {

View File

@ -5,19 +5,73 @@
* Date: 2023/07/19
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaSlideModal } from "ecCom";
import { inject, observer } from "mobx-react";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom";
import { Button } from "antd";
import { WeaSwitch } from "comsMobx";
import SlideModalTitle from "../../../components/slideModalTitle";
import SalaryItemForm from "../../salaryItem/salaryItemForm";
import { sxwzApprovalConditions } from "../config";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("ledgerStore")
@observer
class LedgerSalaryItemEditSlide extends Component {
constructor(props) {
super(props);
this.state = {};
this.state = {
conditions: []
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { ledgerStore: { sxwzForm } } = nextProps;
this.setState({
conditions: _.map(sxwzApprovalConditions, item => {
return {
...item, title: getLabel(111, "审批配置"),
items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
};
})
}, () => sxwzForm.initFormFields(this.state.conditions));
}
}
/*
* Author: 黎永顺
* Description: 陕西万众-审批配置渲染表单
* Params:
* Date: 2023/12/29
*/
renderSxwzForm = (form, condition) => {
const { isFormInit } = form, formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan: 1,
hide: fields.hide
});
});
group.push(
<WeaSearchGroup col={1} needTigger={true} title={c.title}
showGroup={c.defaultshow} items={items} center={false}
customComponent={<Button type="primary">{getLabel(111, "同步审批信息至账套")}</Button>}
/>);
});
return group;
};
handleChange = (params) => {
const request = { ...this.props.request, ...params };
const key = Object.keys(params)[0];
@ -26,6 +80,8 @@ class LedgerSalaryItemEditSlide extends Component {
handleShowFormal = (salaryItemName) => this.props.onEditFormnul(salaryItemName);
render() {
const { conditions } = this.state;
const { ledgerStore: { sxwzForm } } = this.props;
return (
<WeaSlideModal
{...this.props}
@ -47,6 +103,8 @@ class LedgerSalaryItemEditSlide extends Component {
onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}
/>
}
{/*陕西万众-流程审批配置*/}
{this.renderSxwzForm(sxwzForm, conditions)}
</div>
}
/>

View File

@ -803,3 +803,31 @@ export const keepDecimalPlaces = [
showname: "5"
}
];
//陕西万众-薪资账套中薪资项目的审批配置项
export const sxwzApprovalConditions = [
{
items: [
{
conditionType: "SWITCH",
domkey: ["showInWorkflow"],
fieldcol: 14,
label: "审批时展示",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["sumInWorkflow"],
fieldcol: 14,
label: "审批时求和",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
}
],
defaultshow: true
}
];

View File

@ -13,6 +13,7 @@ export class LedgerStore {
@observable copyForm = new WeaForm(); // 复制form
@observable categoryForm = new WeaForm(); // 新增分类form
@observable searchForm = new WeaForm(); // 查询form
@observable sxwzForm = new WeaForm(); // 陕西万众-审批配置form
/*******************************************************/