release/2.15.2.2409.01

This commit is contained in:
黎永顺 2024-10-14 16:02:12 +08:00
parent 7980acc6c2
commit b954e1696e
7 changed files with 127 additions and 80 deletions

View File

@ -30,11 +30,13 @@ class Index extends Component {
componentWillReceiveProps(nextProps, nextContext) {
const { importDialog } = this.state;
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { baseTableStore: { VSalryForm } } = nextProps;
const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData };
const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps;
const payload = {
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData
};
this.setState({
importDialog: {
...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth,
...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth,
link: `${importDialog.link}?${convertToUrlString(payload)}`
}
});
@ -49,10 +51,10 @@ class Index extends Component {
}
handleImport = (payload) => {
const { baseTableStore: { VSalryForm } } = this.props;
const { baseTableStore: { VExtraSalryForm } } = this.props;
const { importDialog } = this.state;
const { salaryMonth } = importDialog;
const { taxAgentIds } = VSalryForm.getFormParams();
const { taxAgentIds } = VExtraSalryForm.getFormParams();
this.setState({ importDialog: { ...importDialog, nextloading: true } });
API.importVariableSalary({
...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
@ -66,14 +68,17 @@ class Index extends Component {
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
};
renderFormComponent = () => {
const { baseTableStore: { VSalryForm } } = this.props;
const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props;
const { importDialog } = this.state;
const { salaryMonth: month, hasData } = importDialog;
return <div style={{ padding: "8px 16px", border: "1px solid #e5e5e5", margin: "4px 0" }}>
<WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaDatePicker format="YYYY-MM" value={month}
onChange={val => {
const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData };
const payload = {
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
salaryMonth: val, hasData
};
this.setState({
importDialog: {
...importDialog, salaryMonth: val,
@ -100,9 +105,12 @@ class Index extends Component {
content={getLabel(543208, "导出现有数据")}
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
onChange={val => {
const { baseTableStore: { VSalryForm } } = this.props;
const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props;
const { salaryMonth } = importDialog;
const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" };
const payload = {
salaryMonth, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
hasData: val === "1"
};
this.setState({
importDialog: {
...importDialog, hasData: val === "1",

View File

@ -9,14 +9,20 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider } from "ecCom";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import { WeaTableNew } from "comsMobx";
import { message, Modal, Spin } from "antd";
import * as API from "../../../../apis/variableSalary";
import { getSearchs } from "../../../../util";
import { extraConditions } from "../../conditions";
import AdvanceInputBtn from "../advanceInputBtn";
import SearchPannel from "../searchPannel";
import { toJS } from "mobx";
import cs from "classnames";
const WeaTableComx = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("baseTableStore")
@observer
@ -25,11 +31,30 @@ class Index extends Component {
super(props);
this.state = {
pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [],
selectedRowKeys: []
selectedRowKeys: [], condtions: [], showSearchAd: false
};
}
componentDidMount() {
async componentDidMount() {
const { data: taxAgentOption } = await API.getAdminTaxAgentList();
this.setState({
condtions: _.map(extraConditions, item => {
return {
...item, items: _.map(item.items, child => {
if (getKey(child) === "taxAgentIds") {
return {
...child, label: getLabel(child.lanId, child.label),
options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content }))
};
}
return { ...child, label: getLabel(child.lanId, child.label) };
})
};
})
}, () => {
const { baseTableStore: { VExtraSalryForm } } = this.props;
VExtraSalryForm.initFormFields(this.state.condtions);
});
window.addEventListener("message", this.handleReceive, false);
window.addEventListener("resize", this.handleResize, false);
this.getVariableSalaryList();
@ -73,12 +98,12 @@ class Index extends Component {
}
};
getVariableSalaryList = () => {
const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props;
const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props;
const { pageInfo } = this.state;
const { departmentIds, taxAgentIds } = VSalryForm.getFormParams();
const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();
this.setState({ loading: true });
getVariableSalaryList({
...pageInfo, ...VSalryForm.getFormParams(),
...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
}).then(({ status, data }) => {
@ -137,17 +162,26 @@ class Index extends Component {
const childFrameObj = document.getElementById("unitTable");
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
render() {
const { loading, dataSource } = this.state;
const { baseTableStore: { SFTableStore } } = this.props;
const { loading, dataSource, condtions, showSearchAd } = this.state;
const { baseTableStore: { SFTableStore, VExtraSalryForm } } = this.props;
const dom = document.querySelector(".wea-new-top-req-content");
let height = 280;
if (dom && dataSource.length > 0) {
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 16;
height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62;
}
return (
<React.Fragment>
<div className="extraFormQuery form-dialog-layout">
{getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())}
<AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
onAdvanceSearch={() => this.getVariableSalaryList()}/>
</div>
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<SearchPannel onCancel={() => this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/>
</div>
<div style={{ height: height + "px" }}>
<Spin spinning={loading}>
<iframe

View File

@ -6,12 +6,10 @@
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import * as API from "../../../../apis/variableSalary";
import { Button } from "antd";
import { inject, observer } from "mobx-react";
import { getSearchs } from "../../../../util";
import { conditions } from "../../conditions";
import moment from "moment";
const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@ -26,21 +24,12 @@ class VariableSalarySearchPannel extends Component {
};
}
async componentDidMount() {
const { data } = await API.getAdminTaxAgentList();
componentDidMount() {
this.setState({
searchConditions: _.map(conditions, item => {
return {
...item,
items: _.map(item.items, child => {
if (getKey(child) === "taxAgentIds") {
return {
...child, label: getLabel(child.lanId, child.label),
options: _.map(data, o => ({ key: o.id, showname: o.content, selected: true }))
};
}
return { ...child, label: getLabel(child.lanId, child.label) };
})
items: _.map(item.items, child => ({ ...child, label: getLabel(child.lanId, child.label) }))
};
})
}, () => {
@ -63,10 +52,7 @@ class VariableSalarySearchPannel extends Component {
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
</span>
<span style={{ marginLeft: 15 }}>
<Button type="ghost" onClick={() => {
VSalryForm.resetForm();
VSalryForm.updateFields({ salaryMonth: moment(new Date()).format("YYYY-MM") });
}}>{getLabel(2022, "重置")}</Button>
<Button type="ghost" onClick={() => VSalryForm.resetForm()}>{getLabel(2022, "重置")}</Button>
</span>
<span style={{ marginLeft: 15 }}>
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>

View File

@ -24,28 +24,6 @@ export const conditions = [
value: "",
viewAttr: 2
},
{
conditionType: "MONTHPICKER",
domkey: ["salaryMonth"],
fieldcol: 14,
label: "薪资所属月",
lanId: 111,
labelcol: 6,
value: moment(new Date()).format("YYYY-MM"),
viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["taxAgentIds"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 111,
labelcol: 6,
value: "",
options: [],
multiple: true,
viewAttr: 2
},
{
browserConditionParam: {
completeParams: {},
@ -92,6 +70,36 @@ export const conditions = [
defaultshow: true
}
];
export const extraConditions = [
{
items: [
{
conditionType: "MONTHPICKER",
domkey: ["salaryMonth"],
fieldcol: 16,
label: "薪资所属月",
lanId: 111,
labelcol: 8,
value: moment(new Date()).format("YYYY-MM"),
viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["taxAgentIds"],
fieldcol: 16,
label: "个税扣缴义务人",
lanId: 111,
labelcol: 8,
value: "",
options: [],
multiple: true,
viewAttr: 2
}
],
title: "",
defaultshow: true
}
];
export const salaryItemsConditions = [
{
items: [

View File

@ -13,14 +13,12 @@ import { toJS } from "mobx";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop } from "ecCom";
import * as API from "../../apis/variableSalary";
import AdvanceInputBtn from "./components/advanceInputBtn";
import SearchPannel from "./components/searchPannel";
import SalaryItemDialog from "./components/salaryItemDialog";
import SalaryFileDialog from "./components/salaryFileDialog";
import SalaryItemList from "./components/salaryItemList";
import SalaryFileList from "./components/salaryFileList";
import SalaryFileImportDialog from "./components/salaryFileImportDialog";
import { Button, message } from "antd";
import cs from "classnames";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@ -31,7 +29,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "salaryFile", isQuery: false, showSearchAd: false,
selectedKey: "salaryFile", isQuery: false,
SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框
SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框
SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入
@ -39,9 +37,8 @@ class Index extends Component {
}
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
handleOperate = (type, detail = {}) => {
const { baseTableStore: { SFTableStore, VSalryForm } } = this.props;
const { baseTableStore: { SFTableStore, VSalryForm, VExtraSalryForm } } = this.props;
switch (type) {
case "create":
this.setState({
@ -56,9 +53,9 @@ class Index extends Component {
break;
case "export":
const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex);
const { taxAgentIds, departmentIds } = VSalryForm.getFormParams();
const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();
const payload = {
...VSalryForm.getFormParams(),
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [],
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
columns
@ -84,8 +81,8 @@ class Index extends Component {
};
render() {
const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state;
const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props;
const { selectedKey, SIDialog, SFDialog, SFImpDialog, isQuery } = this.state;
const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props;
const tabs = [
{
title: getLabel(111, "浮动数据"), key: "salaryFile", showDropIcon: true,
@ -98,16 +95,10 @@ class Index extends Component {
buttons: showOperateBtn ? [
<Button type="primary" onClick={() => this.handleOperate("create")}>{getLabel(111, "新建")}</Button>,
<Button type="ghost" onClick={() => this.handleOperate("import")}>{getLabel(111, "导入")}</Button>,
<Button type="primary" onClick={() => this.handleOperate("batchDel")}>{getLabel(111, "批量删除")}</Button>,
<AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
onAdvanceSearch={this.handleAdvanceSearch}/>
] : [
<AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
onAdvanceSearch={this.handleAdvanceSearch}/>
],
children: !_.isEmpty(VSalryForm.getFormParams()) ?
<SalaryFileList {...this.props} isQuery={isQuery} ref={dom => this.salaryListRef = dom}
onViewSalaryFile={(data) => this.handleOperate("create", data)}/> : null
<Button type="primary" onClick={() => this.handleOperate("batchDel")}>{getLabel(111, "批量删除")}</Button>
] : [],
children: <SalaryFileList {...this.props} isQuery={isQuery} ref={dom => this.salaryListRef = dom}
onViewSalaryFile={(data) => this.handleOperate("create", data)}/>
},
{
title: getLabel(111, "字段管理"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [],
@ -133,9 +124,6 @@ class Index extends Component {
showDropIcon={_.find(tabs, o => selectedKey === o.key).showDropIcon} onDropMenuClick={this.handleOperate}
dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas}
>
<div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
<SearchPannel onCancel={() => this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/>
</div>
{_.find(tabs, o => selectedKey === o.key).children}
{/*薪资项目*/}
<SalaryItemDialog {...SIDialog} onSearch={this.handleAdvanceSearch} onCancel={callback => this.setState({

View File

@ -3,6 +3,28 @@
right: 16px !important;
}
.extraFormQuery {
display: flex;
align-items: center;
justify-content: space-between;
background: #FFF;
margin-bottom: 8px;
padding-right: 8px;
.wea-search-group {
padding: 0;
flex: 1;
.wea-content {
max-width: 50%;
.wea-form-cell-wrapper, .wea-form-cell {
border: none;
}
}
}
}
.wea-new-top-req-content {
padding: 8px 16px 0 16px;
@ -31,7 +53,7 @@
}
.wea-advanced-searchsAd {
height: 155px;
height: 108px;
overflow: hidden auto;
.formItem-delete {

View File

@ -16,6 +16,7 @@ export class BaseTableStore {
@observable loading = true; // 数据加载状态
// 浮动薪酬相关
@observable VExtraSalryForm = new WeaForm(); // 浮动薪酬extra查询form
@observable VSalryForm = new WeaForm(); // 浮动薪酬查询form
@observable VSSalaryItemForm = new WeaForm(); // 新增编辑浮动薪酬项目form
@action initVSSalaryItemForm = () => this.VSSalaryItemForm = new WeaForm();