diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 46cd7407..072f856a 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -43,7 +43,8 @@ import TemplatePreview from "./pages/payroll/templatePreview"; import PayrollTemplatePreview from "./pages/payroll/templatePreview/tmpPreview"; //重构的工资单模板预览页面 import MobilePayroll from "./pages/mobilePayroll"; import SysConfig from "./pages/sysConfig"; -import RuleConfig from "./pages/ruleConfig"; +import RuleConfig from "./pages/ruleConfig/ruleConfig"; +import RuleConfigs from "./pages/ruleConfig"; import Appconfig from "./pages/appConfig"; import FieldManagement from "./pages/fieldManagement"; import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics"; @@ -185,7 +186,7 @@ const Routes = ( - + diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index e69de29b..90dbfd6c 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -0,0 +1,167 @@ +import React from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +export const conditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["orderRule"], + fieldcol: 10, + label: getLabel(15512, "排序字段"), + labelcol: 8, + options: [], + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["ascOrDesc"], + fieldcol: 10, + label: getLabel(543351, "正序/倒序"), + labelcol: 8, + options: [], + viewAttr: 2 + } + ], + title: getLabel(543356, "排序规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["rule"], + fieldcol: 10, + label: getLabel(543352, "人员字段"), + labelcol: 8, + options: [], + viewAttr: 2 + } + ], + title: getLabel(543357, "人员校验规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["enctry"], + fieldcol: 10, + label: getLabel(526997, "加密设置"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(543358, "加密规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["operateTaxDeclaration"], + fieldcol: 10, + label: getLabel(111, "系统算税"), + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SWITCH", + domkey: ["withDrawTaxDeclaration"], + fieldcol: 10, + label: getLabel(111, "撤回申报表"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "算税规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["confValue"], + fieldcol: 10, + label: getLabel(111, "允许删除档案"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(538004, "薪资档案"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["welBaseDiffByPerAndCom"], + fieldcol: 10, + label: getLabel(111, "区分个人和公司"), + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SWITCH", + domkey: ["welBaseAutoAdjust"], + fieldcol: 10, + label: getLabel(111, "导入基数自动调整上/下限"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "福利档案基数"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["matchRuleOptions"], + fieldcol: 10, + label: getLabel(111, "匹配规则"), + options: [], + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资核算人员匹配规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "INPUTNUMBER", + domkey: ["salaryAcctFixedColumns"], + fieldcol: 10, + label: getLabel(111, "固定数"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资核算固定列头数"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["extEmpsWitch"], + fieldcol: 10, + label: getLabel(111, "开启非系统人员"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "非系统人员"), + defaultshow: true + } +]; +export const payloadList = [ + { enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" }, + { enumClass: "com.engine.salary.sys.enums.OrderRuleEnum" }, + { enumClass: "com.engine.salary.sys.enums.AscOrDescEnum" }, + { enumClass: "com.engine.salary.sys.enums.MatchEmployeeModeEnum" } +]; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/form.js b/pc4mobx/hrmSalary/pages/ruleConfig/form.js index e69de29b..770ebc7b 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/form.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/form.js @@ -0,0 +1,31 @@ +import React from "react"; +import { WeaFormItem, WeaSearchGroup } from "ecCom"; +import { WeaSwitch } from "comsMobx"; + +export const renderRuleForm = (form, condition, onChange) => { + const { isFormInit } = form; + const formParams = form.getFormParams(); + let group = []; + isFormInit && condition && condition.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + ), + colSpan: 1, + hide: fields.hide + }); + }); + !_.isEmpty(items) && group.push( + ); + }); + return group; +}; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.less b/pc4mobx/hrmSalary/pages/ruleConfig/index.less index 57870c25..a4599477 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.less +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.less @@ -1,9 +1,44 @@ -.ruleWrapper { - height: 100%; +.ruleWrapper-layout { + .wea-new-top-content { + overflow: hidden !important; - .titleWrapper { - display: flex; - justify-content: space-between; - align-items: center; + .ruleWrapper { + padding: 16px; + background: #e5e5e5; + height: 100%; + overflow: hidden auto; + + .wea-search-group { + background: #fff; + margin-bottom: 16px; + + .wea-content { + padding: 8px !important; + + .wea-form-cell:not(:last-child) { + .wea-form-item { + border-bottom: 1px solid #e5e5e5; + } + } + } + } + + .wea-search-group, .wea-form-cell { + padding: 0; + + .wea-form-item { + padding: 5px 16px; + + .wea-form-item-label { + color: #666; + } + } + } + + .wea-form-cell-wrapper { + background: #FFF; + border: 1px solid #e5e5e5; + } + } } } diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index 2f3fb6b1..bbaa3bec 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -5,17 +5,45 @@ * Date: 2024/2/23 */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { renderRuleForm } from "./form"; +import { conditions } from "./conditions"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; +@inject("baseFormStore") +@observer class RuleConfig extends Component { - render() { - return ( -
+ constructor(props) { + super(props); + this.state = { + conditions: [] + }; + } -
+ componentDidMount() { + const { baseFormStore: { form } } = this.props; + form.initFormFields(conditions); + } + + init = async () => { + }; + + handleChange = (value) => { + console.log(value); + }; + + render() { + const { baseFormStore: { form } } = this.props; + return ( + {getLabel(543355, "规则配置")}} icon={} + iconBgcolor="#F14A2D" buttons={[]} className="ruleWrapper-layout" + > +
{renderRuleForm(form, conditions, this.handleChange)}
+
); } } diff --git a/pc4mobx/hrmSalary/stores/baseForm.js b/pc4mobx/hrmSalary/stores/baseForm.js index 38d436b4..3eb3a57e 100644 --- a/pc4mobx/hrmSalary/stores/baseForm.js +++ b/pc4mobx/hrmSalary/stores/baseForm.js @@ -1,15 +1,16 @@ -import { observable, action, toJS } from 'mobx'; -import { message } from 'antd'; -import { WeaForm, WeaLogView } from 'comsMobx'; -import { WeaLocaleProvider } from 'ecCom'; +import { action, observable } from "mobx"; +import { message } from "antd"; +import { WeaForm, WeaLogView } from "comsMobx"; +import { WeaLocaleProvider } from "ecCom"; -import * as API from '../apis'; // 引入API接口文件 +import * as API from "../apis"; // 引入API接口文件 -const {LogStore} = WeaLogView; +const { LogStore } = WeaLogView; const getLabel = WeaLocaleProvider.getLabel; export class BaseFormStore { - @observable form = new WeaForm(); // nrew 一个form + @observable form = new WeaForm(); // 规则渲染form + @observable logStore = new LogStore(); @observable condition = []; // 存储后台得到的form数据 @observable saveLoading = false; // 保存状态处理:保证保存的时候接口只走一次 @@ -18,9 +19,9 @@ export class BaseFormStore { @observable logVisible = false; // 控制日志弹框的显影 @action // 初始化操作: 一般用来初始化获取后台数据 - doInit = () =>{ + doInit = () => { this.getBaseForm(); - } + }; @action // 获得form配置数据 getBaseForm = () => { @@ -32,22 +33,22 @@ export class BaseFormStore { this.form.initFormFields(result.condition); } })); - } + }; @action // 保存 saveForm = () => { - this.form.validateForm().then(action(f=>{ // 表单的校验: 直接使用form的validateForm方法即可 + this.form.validateForm().then(action(f => { // 表单的校验: 直接使用form的validateForm方法即可 if (f.isValid) { // 校验听过: 走保存接口 this.saveLoading = true; const params = this.form.getFormParams(); API.saveForm(params).then(action( result => { - this.saveLoading = false - if(result.api_status){ // 保存成功: 1、给出提示 2、刷新form数据 - message.success(`${getLabel(18758,'保存成功')}`); + this.saveLoading = false; + if (result.api_status) { // 保存成功: 1、给出提示 2、刷新form数据 + message.success(`${getLabel(18758, "保存成功")}`); this.getBaseForm(); - }else { - message.error(`${getLabel(22620,'保存失败')}`); + } else { + message.error(`${getLabel(22620, "保存失败")}`); } } )); @@ -55,9 +56,9 @@ export class BaseFormStore { f.showErrors(); } })); - } + }; @action - setLogVisible = bool => this.logVisible = bool - -} \ No newline at end of file + setLogVisible = bool => this.logVisible = bool; + +}