Merge branch 'release/2.16.1.2410.01' into custom/领悦

This commit is contained in:
lys 2024-10-21 10:47:04 +08:00
commit ebd228c496
25 changed files with 387 additions and 300 deletions

View File

@ -235,6 +235,10 @@ export const updateLockStatus = (params) => {
export const updateLockEmpStatus = (params) => { export const updateLockEmpStatus = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lockEmp", params); return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lockEmp", params);
}; };
// 单元格锁定
export const updateLockEmpCellStatus = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lock", params);
};
// 导入薪资核算添加表头字段缓存 // 导入薪资核算添加表头字段缓存
export const cacheImportField = (params) => { export const cacheImportField = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params); return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params);

View File

@ -8,7 +8,12 @@ import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools } from "ecCom"; import { WeaLocaleProvider, WeaTools } from "ecCom";
import { message, Modal, Spin } from "antd"; import { message, Modal, Spin } from "antd";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { acctResultList, updateLockEmpStatus, updateLockStatus } from "../../../../../apis/calculate"; import {
acctResultList,
updateLockEmpCellStatus,
updateLockEmpStatus,
updateLockStatus
} from "../../../../../apis/calculate";
import ProgressModal from "../../../../../components/progressModal"; import ProgressModal from "../../../../../components/progressModal";
import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog"; import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog";
import EditSalaryCalcSlide from "./editSalaryCalcSlide"; import EditSalaryCalcSlide from "./editSalaryCalcSlide";
@ -135,7 +140,7 @@ class EditCalcTable extends Component {
}); });
}; };
updateEmpLockStatus = (payload) => { updateEmpLockStatus = (payload) => {
const { lockStatus } = payload; const { lockStatus, salaryItemId } = payload;
Modal.confirm({ Modal.confirm({
title: getLabel(131329, "信息确认"), title: getLabel(131329, "信息确认"),
content: <div> content: <div>
@ -166,13 +171,16 @@ class EditCalcTable extends Component {
}, 500); }, 500);
}); });
const { routeParams: { salaryAcctRecordId } } = this.props; const { routeParams: { salaryAcctRecordId } } = this.props;
updateLockEmpStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => { const params = salaryItemId ? payload : { ...payload, salaryAcctRecordId };
const APIFunction = salaryItemId ? updateLockEmpCellStatus : updateLockEmpStatus;
APIFunction(params).then(({ status, errormsg }) => {
clearInterval(this.timerLock);
this.setState({
progressVisible: false,
progress: 0
});
if (status) { if (status) {
clearInterval(this.timerLock); this.queryCalcResultList();
this.setState({
progressVisible: false,
progress: 0
}, () => this.queryCalcResultList());
} else { } else {
message.error(errormsg); message.error(errormsg);
} }
@ -224,8 +232,8 @@ class EditCalcTable extends Component {
"点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"), "点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"),
"点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"), "点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"),
"锁定的项目值": getLabel(543647, "锁定的项目值"), "锁定的项目值": getLabel(543647, "锁定的项目值"),
"当前状态锁定,击解锁": getLabel(111, "当前状态锁定,击解锁"), "当前状态锁定,击解锁": getLabel(111, "当前状态锁定,击解锁"),
"当前状态未锁定,击锁定": getLabel(111, "当前状态未锁定,击锁定"), "当前状态未锁定,击锁定": getLabel(111, "当前状态未锁定,击锁定"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),

View File

@ -76,6 +76,8 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
padding: 8px 16px 0 16px;
background: #F6F6F6;
.wea-new-table { .wea-new-table {
background: #fff; background: #fff;
@ -83,7 +85,7 @@
.ant-table-tbody { .ant-table-tbody {
.ant-table-row-indent { .ant-table-row-indent {
display: none!important; display: none !important;
} }
td:not(.ant-table-selection-column) { td:not(.ant-table-selection-column) {

View File

@ -1,7 +1,8 @@
.generateDeclarationDetail { .generateDeclarationDetail {
.tabWrapper{ .tabWrapper {
padding-left: 10px padding-left: 10px
} }
.tableWrapper { .tableWrapper {
height: calc(100vh - 48px); height: calc(100vh - 48px);
overflow: auto; overflow: auto;
@ -34,7 +35,8 @@
.declare-body { .declare-body {
height: 100%; height: 100%;
width: 100%; width: 100%;
padding: 16px; padding: 8px 16px 0 16px;
background: #F6F6F6;
overflow-y: auto; overflow-y: auto;
.wea-new-table { .wea-new-table {

View File

@ -127,7 +127,7 @@ class FieldTable extends Component {
pagination={pagination} pagination={pagination}
loading={loading} loading={loading}
columns={this.getColumns()} columns={this.getColumns()}
scroll={{ y: "calc(100vh - 152px)" }} scroll={{ y: "calc(100vh - 175px)" }}
/> />
); );
} }

View File

@ -99,7 +99,7 @@ class FieldManagement extends Component {
]; ];
return ( return (
<WeaTop <WeaTop
title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" className="fieldManageWrapper"
buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)} buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)}
showDropIcon onDropMenuClick={this.onDropMenuClick} showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={[ dropMenuDatas={[
@ -109,26 +109,23 @@ class FieldManagement extends Component {
} }
]} ]}
> >
<div className="fieldManageWrapper"> <FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField} onDeleteLedger={(record) => this.handleDeleteField([record.id])}
onDeleteLedger={(record) => this.handleDeleteField([record.id])} onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} <FieldSlide
/> {...slideparams}
<FieldSlide onChangeRecord={(record) => this.setState({
{...slideparams} slideparams: {
onChangeRecord={(record) => this.setState({ ...slideparams,
slideparams: { record: { ...slideparams.record, ...record }
...slideparams, }
record: { ...slideparams.record, ...record } })}
} onCancel={this.handleResetField}
})} onRefreshList={() => this.setState({ doSearch: !doSearch })}
onCancel={this.handleResetField} />
onRefreshList={() => this.setState({ doSearch: !doSearch })} {/*操作日志*/}
/> <LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
{/*操作日志*/} onCancel={() => this.setState({ logDialogVisible: false })}/>
<LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</div>
</WeaTop> </WeaTop>
); );
} }

View File

@ -1,3 +1,15 @@
.fieldManageWrapper {
.wea-new-top-content {
background: #F6F6F6;
padding: 8px 16px 0 16px;
}
.wea-new-table {
background: #FFF;
}
}
.slideOuterWrapper { .slideOuterWrapper {
.wea-form-item-group { .wea-form-item-group {
margin: 16px; margin: 16px;

View File

@ -232,11 +232,11 @@ const TitleNormalComp = (props) => {
<i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(uuid)}/> <i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(uuid)}/>
} }
{ {
sortedIndex !== 0 && showOperateBtn && name !== getLabel(111, "未分类") && sortedIndex !== 0 && showOperateBtn &&
<i className="icon-coms-Reverse" title="向上移动" onClick={() => onUpgo(sortedIndex)}/> <i className="icon-coms-Reverse" title="向上移动" onClick={() => onUpgo(sortedIndex)}/>
} }
{ {
sortedIndex !== dataSourceLen - 1 && showOperateBtn && name !== getLabel(111, "未分类") && sortedIndex !== dataSourceLen - 2 && showOperateBtn &&
<i className="icon-coms-positive-sequence" title="向下移动" onClick={() => onDowngo(sortedIndex)}/> <i className="icon-coms-positive-sequence" title="向下移动" onClick={() => onDowngo(sortedIndex)}/>
} }
</div> </div>

View File

@ -15,8 +15,7 @@ import { getTaxAgentSelectList } from "../../../apis/taxAgent";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@inject("ledgerStore") @inject("ledgerStore") @observer
@observer
class LedgerSearchComp extends Component { class LedgerSearchComp extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -36,14 +35,11 @@ class LedgerSearchComp extends Component {
this.setState({ this.setState({
conditions: _.map(searchConditions, o => { conditions: _.map(searchConditions, o => {
return { return {
...o, ...o, items: _.map(o.items, j => {
items: _.map(o.items, j => {
if (getKey(j) === "taxAgentId") { if (getKey(j) === "taxAgentId") {
return { return {
...j, ...j, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({ key: g.id, showname: g.content
key: g.id,
showname: g.content
}))] }))]
}; };
} }
@ -62,19 +58,16 @@ class LedgerSearchComp extends Component {
let items = []; let items = [];
c.items.map(fields => { c.items.map(fields => {
items.push({ items.push({
com: ( com: (<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }} wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom">
tipPosition="bottom" <WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
> onChange={_.debounce(this.props.onSearch, 500)}/>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/> </WeaFormItem>), colSpan: 2
</WeaFormItem>),
colSpan: 2
}); });
}); });
group.push( group.push(<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false} items={items}/>);
items={items}/>);
}); });
return group; return group;
}; };
@ -82,12 +75,7 @@ class LedgerSearchComp extends Component {
render() { render() {
const { conditions } = this.state; const { conditions } = this.state;
const { ledgerStore: { searchForm } } = this.props; const { ledgerStore: { searchForm } } = this.props;
return ( return (<div className="ledgerSearch-Wrapper">{this.formRender(searchForm, conditions)}</div>);
<div className="ledgerSearch-Wrapper">
{this.formRender(searchForm, conditions)}
<Button type="primary" onClick={this.props.onSearch}>{getLabel(388113, "搜索")}</Button>
</div>
);
} }
} }

View File

@ -106,9 +106,9 @@ class LedgerSlide extends Component {
if (!it.salarySobId) delete it.id; if (!it.salarySobId) delete it.id;
return { ...it }; return { ...it };
}), }),
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), item => { itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), (item, index) => {
return { return {
...item, ...item, sortedIndex: index,
items: _.map(item.items, it => { items: _.map(item.items, it => {
delete it.originFormulaContent; delete it.originFormulaContent;
delete it.originSqlContent; delete it.originSqlContent;

View File

@ -71,10 +71,9 @@ class Index extends Component {
const { taxAgentStore } = this.props; const { taxAgentStore } = this.props;
const { showOperateBtn } = taxAgentStore; const { showOperateBtn } = taxAgentStore;
const btns = [ const btns = [
<Button <Button type="primary" onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}>
type="primary" {getLabel(111, "新建")}
onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })} </Button>,
>新建</Button>,
<LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/> <LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/>
]; ];
return ( return (

View File

@ -1,5 +1,11 @@
.ledgerWrapper { .ledgerWrapper {
height: 100%; height: 100%;
padding: 8px 16px 0 16px;
background: #F6F6F6;
.wea-new-table {
background: #FFF;
}
.tdEllipsis { .tdEllipsis {
display: inline-block; display: inline-block;
@ -12,8 +18,6 @@
.ledgerSearch-Wrapper { .ledgerSearch-Wrapper {
min-width: 350px; min-width: 350px;
margin-top: 5px;
margin-right: 70px;
position: relative; position: relative;
& > button { & > button {

View File

@ -1,4 +1,8 @@
.mySalary_wrapper { .mySalary_wrapper {
.wea-new-top-req-content {
padding: 8px 16px;
}
.wea-transfer-list-wrapper { .wea-transfer-list-wrapper {
border: none; border: none;
} }

View File

@ -1,3 +1,4 @@
import React, { Component } from "react";
import { WeaSwitch } from "comsMobx"; import { WeaSwitch } from "comsMobx";
import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";

View File

@ -16,17 +16,13 @@ import moment from "moment";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
@inject("standingBookStore") @inject("standingBookStore") @observer
@observer
class WelfareRecordQuery extends Component { class WelfareRecordQuery extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
conditions: [], conditions: [],
dateRange: [ dateRange: [moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM")]
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM")
]
}; };
} }
@ -36,8 +32,7 @@ class WelfareRecordQuery extends Component {
this.setState({ this.setState({
conditions: _.map(welfareRQConditions, item => { conditions: _.map(welfareRQConditions, item => {
return { return {
...item, ...item, items: _.map(item.items, o => {
items: _.map(item.items, o => {
if (getKey(o) === "taxAgents") { if (getKey(o) === "taxAgents") {
return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) }; return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
} }
@ -63,28 +58,22 @@ class WelfareRecordQuery extends Component {
let items = []; let items = [];
c.items.map(fields => { c.items.map(fields => {
items.push({ items.push({
com: ( com: (<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }} wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom" tipPosition="bottom">
> <WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={this.getWelfareRecordList}/>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} </WeaFormItem>)
onChange={this.getWelfareRecordList}/>
</WeaFormItem>)
}); });
}); });
group.push( group.push(<WeaSearchGroup col={3} needTigger showGroup={c.defaultshow}
<WeaSearchGroup col={3} needTigger showGroup={c.defaultshow} items={[{
items={[ com: (<WeaFormItem label={getLabel(542443, "账单月份")} labelCol={{ span: 4 }}
{ wrapperCol={{ span: 16 }}>
com: (<WeaFormItem label={getLabel(542443, "账单月份")} labelCol={{ span: 4 }} <MonthRangePicker dateRange={dateRange} viewAttr={2}
wrapperCol={{ span: 16 }}> onChange={v => this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/>
<MonthRangePicker dateRange={dateRange} viewAttr={2} </WeaFormItem>)
onChange={v => this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/> }, ...items]}
</WeaFormItem>) />);
},
...items
]}
/>);
}); });
return group; return group;
}; };
@ -101,9 +90,7 @@ class WelfareRecordQuery extends Component {
render() { render() {
const { standingBookStore: { welfareRQForm } } = this.props; const { standingBookStore: { welfareRQForm } } = this.props;
const { conditions } = this.state; const { conditions } = this.state;
return ( return (<div className="salary-welfare-record-query">{this.renderForm(welfareRQForm, conditions)}</div>);
<div className="salary-welfare-record-query">{this.renderForm(welfareRQForm, conditions)}</div>
);
} }
} }

View File

@ -57,24 +57,22 @@
//社保福利台账页面重构 //社保福利台账页面重构
.salary-welfare-record { .salary-welfare-record {
min-width: 1000px;
overflow: auto;
width: 100%;
height: 100%;
background: #f6f6f6;
.salary-welfare-record-content { .salary-welfare-record-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 8px 16px; padding: 8px 16px 0 16px;
background: #F6F6F6;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.salary-welfare-record-query { .salary-welfare-record-query {
width: 100%; width: 100%;
padding: 0 8px;
margin-bottom: 8px;
height: 46px; height: 46px;
display: flex; display: flex;
align-items: center; align-items: center;
background: #FFF;
.wea-search-group { .wea-search-group {
width: 100%; width: 100%;

View File

@ -123,50 +123,45 @@ class StandingBook extends Component {
const rightBtns = [<Button type="primary" onClick={() => this.setState({ const rightBtns = [<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") } accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>]; })}>{getLabel(538780, "核算")}</Button>];
return ( return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
<div className="salary-welfare-record"> iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>} showDropIcon onDropMenuClick={this.onDropMenuClick}
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} dropMenuDatas={[
showDropIcon onDropMenuClick={this.onDropMenuClick} {
dropMenuDatas={[ key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
{ content: getLabel(545781, "操作日志")
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>, }
content: getLabel(545781, "操作日志") ]}>
} <div className="salary-welfare-record-content">
]} <WelfareRecordQuery
> onSearch={(payload) => {
<div className="salary-welfare-record-content"> this.setState({
<WelfareRecordQuery queryForm: { ...queryForm, ...payload }
onSearch={(payload) => { }, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
this.setState({ }}
queryForm: { ...queryForm, ...payload } onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList()); />
}} <WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })} onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
/>
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
</div>
<Accountdialog {...accountDialog}
onCancel={() => this.setState({
accountDialog: { ...accountDialog, visible: false, title: "", loading: false }
})} onOk={this.handleAccount}
/>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="siAccount" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
{/*核算进度条*/}
{
this.state.progressVisible &&
<ProgressModal visible={this.state.progressVisible} progress={this.state.progress}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
}}
/>
}
</WeaTop>
</div> </div>
); <Accountdialog {...accountDialog}
onCancel={() => this.setState({
accountDialog: { ...accountDialog, visible: false, title: "", loading: false }
})} onOk={this.handleAccount}
/>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="siAccount" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
{/*核算进度条*/}
{
this.state.progressVisible &&
<ProgressModal visible={this.state.progressVisible} progress={this.state.progress}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
}}
/>
}
</WeaTop>);
} }
} }

View File

@ -18,8 +18,7 @@ import * as API from "../../../../apis/variableSalary";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@inject("baseTableStore") @inject("baseTableStore") @observer
@observer
class Index extends Component { class Index extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -38,39 +37,40 @@ class Index extends Component {
} }
} }
initForm = (props) => { initForm = async (props) => {
const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props; const { baseTableStore: { VSSalaryFileForm }, detail } = props;
const { data: taxAgentOption } = await API.getAdminTaxAgentList();
API.getCreateForm().then(({ data }) => { API.getCreateForm().then(({ data }) => {
this.setState({ this.setState({
conditions: [ conditions: [..._.map(salaryFileConditions, item => ({
..._.map(salaryFileConditions, item => ({ ...item, items: _.map(item.items, o => {
...item, items: _.map(item.items, o => { if (getKey(o) === "taxAgentIds") {
if (getKey(o) === "taxAgentIds") {
return {
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
options: taxAgentOption, value: detail[getKey(o)] || ""
};
}
return { return {
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), ...o,
value: detail[getKey(o)] || "" viewAttr: !_.isEmpty(detail) ? 1 : 3,
label: getLabel(o.lanId, o.label),
value: detail[getKey(o)] || "",
options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content }))
}; };
}) }
})), return {
{ ...o,
items: _.map(data, o => ({ viewAttr: !_.isEmpty(detail) ? 1 : 3,
conditionType: "INPUT", label: getLabel(o.lanId, o.label),
domkey: [String(o.id)], value: detail[getKey(o)] || ""
fieldcol: 14, };
label: o.name, })
labelcol: 6, })), {
value: detail[`${String(o.id)}_variableItem`] || "", items: _.map(data, o => ({
viewAttr: !_.isEmpty(detail) ? 1 : 2 conditionType: "INPUT",
})), domkey: [String(o.id)],
title: "", col: 2, fieldcol: 14,
defaultshow: true label: o.name,
} labelcol: 6,
] value: detail[`${String(o.id)}_variableItem`] || "",
viewAttr: 2
})), title: "", col: 2, defaultshow: true
}]
}, () => { }, () => {
VSSalaryFileForm.initFormFields(this.state.conditions); VSSalaryFileForm.initFormFields(this.state.conditions);
if (!_.isEmpty(detail)) { if (!_.isEmpty(detail)) {
@ -96,7 +96,7 @@ class Index extends Component {
}, {}); }, {});
}; };
save = () => { save = () => {
const { baseTableStore: { VSSalaryFileForm }, onSearch, id } = this.props; const { baseTableStore: { VSSalaryFileForm }, onSearch, detail: { id } } = this.props;
VSSalaryFileForm.validateForm().then(f => { VSSalaryFileForm.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
const payload = VSSalaryFileForm.getFormParams(); const payload = VSSalaryFileForm.getFormParams();
@ -117,17 +117,14 @@ class Index extends Component {
}); });
}; };
renderTitle = () => { renderTitle = () => {
const { loading } = this.state, { title, detail } = this.props; const { loading } = this.state, { title } = this.props;
return <div className="titleDialog"> return <div className="titleDialog">
<div className="titleCol titleLeftBox"> <div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div> <div className="titleIcon"><i className="icon-coms-fa"/></div>
<div className="title">{title}</div> <div className="title">{title}</div>
</div> </div>
<div className="titleCol titleRightBox"> <div className="titleCol titleRightBox">
{ <Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
_.isEmpty(detail) &&
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
}
</div> </div>
</div>; </div>;
}; };
@ -138,7 +135,7 @@ class Index extends Component {
return (<WeaSlideModal return (<WeaSlideModal
className="variable_salary_file_dialog" {...this.props} direction="right" onClose={() => onClose()} className="variable_salary_file_dialog" {...this.props} direction="right" onClose={() => onClose()}
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()} top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()}
content={<div className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions)}</div>} content={<div className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions, 2, false)}</div>}
/>); />);
} }
} }

View File

@ -30,12 +30,15 @@ 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 }, salaryMonth, taxAgentIds } = nextProps; const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps;
const payload = { const payload = {
salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData
}; };
this.setState({ this.setState({
importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } importDialog: {
...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth,
link: `${importDialog.link}?${convertToUrlString(payload)}`
}
}); });
} else { } else {
this.setState({ this.setState({
@ -48,9 +51,10 @@ class Index extends Component {
} }
handleImport = (payload) => { handleImport = (payload) => {
const { taxAgentIds } = this.props; const { baseTableStore: { VExtraSalryForm } } = this.props;
const { importDialog } = this.state; const { importDialog } = this.state;
const { salaryMonth } = importDialog; const { salaryMonth } = importDialog;
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(",")
@ -64,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 }, taxAgentIds } = 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 = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; const payload = {
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
salaryMonth: val, hasData
};
this.setState({ this.setState({
importDialog: { importDialog: {
...importDialog, salaryMonth: val, ...importDialog, salaryMonth: val,
@ -98,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 }, taxAgentIds } = this.props; const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props;
const { salaryMonth } = importDialog; const { salaryMonth } = importDialog;
const payload = { salaryMonth, taxAgentIds, ...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,26 +9,57 @@
*/ */
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
class Index extends Component { class Index extends Component {
constructor(props) { constructor(props) {
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: [],
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();
@ -56,10 +87,14 @@ class Index extends Component {
pageInfo: { ...this.state.pageInfo, ...params } pageInfo: { ...this.state.pageInfo, ...params }
}, () => this.getVariableSalaryList()); }, () => this.getVariableSalaryList());
break; break;
case "CHECKBOX":
const { selectedRowKeys } = params;
this.setState({ selectedRowKeys });
break;
case "DEL": case "DEL":
this.handleDelete([params.id]); this.handleDelete([params.id]);
break; break;
case "VIEW": case "EDIT":
this.handleView(params.id); this.handleView(params.id);
break; break;
default: default:
@ -68,22 +103,22 @@ class Index extends Component {
} }
}; };
getVariableSalaryList = () => { getVariableSalaryList = () => {
const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props;
const { pageInfo } = this.state; const { pageInfo } = this.state;
const { departmentIds } = VSalryForm.getFormParams(); const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();
this.setState({ loading: true }); this.setState({ loading: true });
getVariableSalaryList({ getVariableSalaryList({
...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
}).then(({ status, data }) => { }).then(({ status, data }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
const { pageInfo: result } = data; const { pageInfo: result } = data;
const { list: dataSource, pageNum: current, pageSize, total } = result; const { list: dataSource, pageNum: current, pageSize, total } = result;
this.setState({ this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
} });
);
} }
}); });
}; };
@ -94,13 +129,11 @@ class Index extends Component {
}; };
handleDelete = (ids) => { handleDelete = (ids) => {
Modal.confirm({ Modal.confirm({
title: getLabel(111, "信息确认"), title: getLabel(111, "信息确认"), content: getLabel(111, "确认删除吗?"), onOk: () => {
content: getLabel(111, "确认删除吗?"),
onOk: () => {
API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => { API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => {
if (status) { if (status) {
message.success(getLabel(111, "删除成功")); message.success(getLabel(111, "删除成功"));
this.getVariableSalaryList(); this.setState({ selectedRowKeys: [] }, () => this.getVariableSalaryList());
} else { } else {
message.error(errormsg); message.error(errormsg);
} }
@ -111,51 +144,68 @@ class Index extends Component {
getColumns = () => { getColumns = () => {
const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props; const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props;
const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({ const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({
dataIndex: it.dataIndex, title: it.title, align: "left", dataIndex: it.dataIndex, title: it.title, align: "left", width: 150, ellipsis: true
width: 150, ellipsis: true
})); }));
if (!_.isEmpty(columns)) { if (!_.isEmpty(columns)) {
this.postMessageToChild({ this.postMessageToChild({
columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 98, columns,
pageInfo: this.state.pageInfo, unitTableType: "variableSalary" showOperateBtn,
dataSource: this.state.dataSource,
scrollHeight: 95,
pageInfo: this.state.pageInfo,
unitTableType: "variableSalary",
selectedRowKeys: this.state.selectedRowKeys
}); });
} }
return columns; return columns;
}; };
postMessageToChild = (payload = {}) => { postMessageToChild = (payload = {}) => {
const i18n = { const i18n = {
"操作": getLabel(30585, "操作"), "查看详情": getLabel(111, "查看详情"), "操作": getLabel(30585, "操作"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "编辑": getLabel(111, "编辑"),
"共": getLabel(18609, "共"),
"条": getLabel(18256, "条"),
"删除": getLabel(111, "删除") "删除": getLabel(111, "删除")
}; };
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">
<div style={{ height: height + "px" }}> {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())}
<Spin spinning={loading}> <AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
<iframe onAdvanceSearch={this.getVariableSalaryList}/>
style={{ border: 0, width: "100%", height: "100%" }} </div>
// src="http://localhost:7607/#/unitTable" <div className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable" <SearchPannel onCancel={() => this.setState({ showSearchAd: false })}
id="unitTable" onAdSearch={() => {
/> this.openAdvanceSearch();
</Spin> this.getVariableSalaryList();
</div> }}/>
<WeaTableComx style={{ display: "none" }} comsWeaTableStore={SFTableStore} needScroll={true} </div>
columns={this.getColumns()}/> <div style={{ height: height + "px" }}>
</React.Fragment> <Spin spinning={loading}>
); <iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/unitTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
id="unitTable"
/>
</Spin>
</div>
<WeaTableComx style={{ display: "none" }} comsWeaTableStore={SFTableStore} needScroll={true}
columns={this.getColumns()}/>
</React.Fragment>);
} }
} }

View File

@ -29,9 +29,7 @@ class VariableSalarySearchPannel extends Component {
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) }))
return { ...child, label: getLabel(child.lanId, child.label) };
})
}; };
}) })
}, () => { }, () => {

View File

@ -1,3 +1,5 @@
import moment from "moment";
export const conditions = [ export const conditions = [
{ {
items: [ items: [
@ -68,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: [
@ -125,7 +157,7 @@ export const salaryFileConditions = [
labelcol: 8, labelcol: 8,
value: "", value: "",
options: [], options: [],
rules: "required|string", rules: "required",
viewAttr: 3 viewAttr: 3
}, },
{ {
@ -157,7 +189,7 @@ export const salaryFileConditions = [
lanId: 111, lanId: 111,
labelcol: 8, labelcol: 8,
value: "", value: "",
rules: "required|string", rules: "required",
viewAttr: 3 viewAttr: 3
} }
], ],

View File

@ -10,18 +10,15 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } 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 moment from "moment"; import { Button, message } from "antd";
import { Button } from "antd";
import cs from "classnames";
import "./index.less"; import "./index.less";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -32,37 +29,22 @@ class Index extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "", selectedKey: "salaryFile", isQuery: false,
salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [], SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框
SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框 SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框
SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框
SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入 SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入
}; };
} }
componentDidMount() {
API.getAdminTaxAgentList().then(({ status, data }) => {
if (status) {
const taxAgentOption = _.map(data, (o, i) => ({ key: o.id, showname: o.content }));
this.setState({
taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","),
SIDialog: { ...this.state.SIDialog, taxAgentOption },
SFDialog: { ...this.state.SFDialog, taxAgentOption }
});
}
});
}
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({
SFDialog: { SFDialog: {
...this.state.SFDialog, visible: true, detail, ...this.state.SFDialog, visible: true, detail,
title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "查看薪资档案") title: _.isEmpty(detail) ? getLabel(111, "新增浮动数据") : getLabel(111, "编辑浮动数据")
} }
}); });
break; break;
@ -71,12 +53,12 @@ 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 { salaryMonth, taxAgentIds } = this.state; 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(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [], departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
salaryMonth, columns columns
}; };
WeaLoadingGlobal.start(); WeaLoadingGlobal.start();
const promise = API.exportVariableSalary(payload); const promise = API.exportVariableSalary(payload);
@ -85,15 +67,21 @@ class Index extends Component {
SFTableStore.setColSetVisible(true); SFTableStore.setColSetVisible(true);
SFTableStore.tableColSet(true); SFTableStore.tableColSet(true);
break; break;
case "batchDel":
const { state: { selectedRowKeys }, handleDelete } = this.salaryListRef.wrappedInstance;
if (_.isEmpty(selectedRowKeys)) {
message.warning(getLabel(111, "请选择数据!"));
return;
}
handleDelete(selectedRowKeys);
break;
default: default:
break; break;
} }
}; };
render() { render() {
const { const { selectedKey, SIDialog, SFDialog, SFImpDialog, isQuery } = this.state;
selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds
} = this.state;
const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props; const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props;
const tabs = [ const tabs = [
{ {
@ -107,21 +95,9 @@ 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>,
<WeaDatePicker format="YYYY-MM" value={salaryMonth} <Button type="primary" onClick={() => this.handleOperate("batchDel")}>{getLabel(111, "批量删除")}</Button>
onChange={val => this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, ] : [],
<WeaSelect options={taxAgentOption} style={{ width: 200, display: "flex" }} multiple value={taxAgentIds} children: <SalaryFileList {...this.props} isQuery={isQuery} ref={dom => this.salaryListRef = dom}
onChange={val => this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>,
<AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
onAdvanceSearch={this.handleAdvanceSearch}/>
] : [
<WeaDatePicker format="YYYY-MM" value={salaryMonth}
onChange={val => this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>,
<WeaSelect options={taxAgentOption} style={{ width: 200, display: "flex" }} multiple value={taxAgentIds}
onChange={val => this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>,
<AdvanceInputBtn searchType="advance" onOpenAdvanceSearch={() => this.openAdvanceSearch()}
onAdvanceSearch={this.handleAdvanceSearch}/>
],
children: <SalaryFileList {...this.props} salaryMonth={salaryMonth} taxAgentIds={taxAgentIds} isQuery={isQuery}
onViewSalaryFile={(data) => this.handleOperate("create", data)}/> onViewSalaryFile={(data) => this.handleOperate("create", data)}/>
}, },
{ {
@ -141,16 +117,13 @@ class Index extends Component {
]; ];
return ( return (
<WeaReqTop <WeaReqTop
title={getLabel(111, "浮动薪酬")} icon={<i className="icon-coms-fa"/>} selectedKey={selectedKey} title={getLabel(111, "浮动数据")} icon={<i className="icon-coms-fa"/>} selectedKey={selectedKey}
iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper" iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper"
buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10} buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10}
onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })} onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })}
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({
@ -161,11 +134,10 @@ class Index extends Component {
SFDialog: { ...SFDialog, visible: false } SFDialog: { ...SFDialog, visible: false }
}, () => callback && callback())}/> }, () => callback && callback())}/>
{/* 薪资档案导入*/} {/* 薪资档案导入*/}
<SalaryFileImportDialog {...this.props} {...SFImpDialog} salaryMonth={salaryMonth} taxAgentIds={taxAgentIds} <SalaryFileImportDialog {...this.props} {...SFImpDialog} onCancel={callback => {
onCancel={callback => { this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } },
this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, () => callback && this.handleAdvanceSearch());
() => callback && this.handleAdvanceSearch()); }}/>
}}/>
</WeaReqTop> </WeaReqTop>
); );
} }

View File

@ -3,7 +3,30 @@
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;
.wea-new-table { .wea-new-table {
background: #FFF; background: #FFF;
@ -56,6 +79,9 @@
} }
} }
.wea-form-item-wrapper {
display: block !important;
}
} }
} }

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