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

View File

@ -9,14 +9,20 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaLocaleProvider } from "ecCom"; import { WeaLocaleProvider, WeaTools } from "ecCom";
import { WeaTableNew } from "comsMobx"; import { WeaTableNew } from "comsMobx";
import { message, Modal, Spin } from "antd"; import { message, Modal, Spin } from "antd";
import * as API from "../../../../apis/variableSalary"; 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 { toJS } from "mobx";
import cs from "classnames";
const WeaTableComx = WeaTableNew.WeaTable; const WeaTableComx = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey;
@inject("baseTableStore") @inject("baseTableStore")
@observer @observer
@ -25,11 +31,30 @@ class Index extends Component {
super(props); super(props);
this.state = { this.state = {
pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], 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("message", this.handleReceive, false);
window.addEventListener("resize", this.handleResize, false); window.addEventListener("resize", this.handleResize, false);
this.getVariableSalaryList(); this.getVariableSalaryList();
@ -73,12 +98,12 @@ class Index extends Component {
} }
}; };
getVariableSalaryList = () => { getVariableSalaryList = () => {
const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props;
const { pageInfo } = this.state; const { pageInfo } = this.state;
const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();
this.setState({ loading: true }); this.setState({ loading: true });
getVariableSalaryList({ getVariableSalaryList({
...pageInfo, ...VSalryForm.getFormParams(), ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
}).then(({ status, data }) => { }).then(({ status, data }) => {
@ -137,17 +162,26 @@ class Index extends Component {
const childFrameObj = document.getElementById("unitTable"); const childFrameObj = document.getElementById("unitTable");
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
}; };
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
render() { render() {
const { loading, dataSource } = this.state; const { loading, dataSource, condtions, showSearchAd } = this.state;
const { baseTableStore: { SFTableStore } } = this.props; const { baseTableStore: { SFTableStore, VExtraSalryForm } } = this.props;
const dom = document.querySelector(".wea-new-top-req-content"); const dom = document.querySelector(".wea-new-top-req-content");
let height = 280; let height = 280;
if (dom && dataSource.length > 0) { 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 ( return (
<React.Fragment> <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" }}> <div style={{ height: height + "px" }}>
<Spin spinning={loading}> <Spin spinning={loading}>
<iframe <iframe

View File

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

View File

@ -24,28 +24,6 @@ export const conditions = [
value: "", value: "",
viewAttr: 2 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: { browserConditionParam: {
completeParams: {}, completeParams: {},
@ -92,6 +70,36 @@ export const conditions = [
defaultshow: true 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 = [ export const salaryItemsConditions = [
{ {
items: [ items: [

View File

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

View File

@ -3,6 +3,28 @@
right: 16px !important; 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 { .wea-new-top-req-content {
padding: 8px 16px 0 16px; padding: 8px 16px 0 16px;
@ -31,7 +53,7 @@
} }
.wea-advanced-searchsAd { .wea-advanced-searchsAd {
height: 155px; height: 108px;
overflow: hidden auto; overflow: hidden auto;
.formItem-delete { .formItem-delete {

View File

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