Merge branch 'release/2.16.1.2410.01' into custom/领悦
This commit is contained in:
commit
ebd228c496
|
|
@ -235,6 +235,10 @@ export const updateLockStatus = (params) => {
|
|||
export const updateLockEmpStatus = (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) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
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 BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog";
|
||||
import EditSalaryCalcSlide from "./editSalaryCalcSlide";
|
||||
|
|
@ -135,7 +140,7 @@ class EditCalcTable extends Component {
|
|||
});
|
||||
};
|
||||
updateEmpLockStatus = (payload) => {
|
||||
const { lockStatus } = payload;
|
||||
const { lockStatus, salaryItemId } = payload;
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: <div>
|
||||
|
|
@ -166,13 +171,16 @@ class EditCalcTable extends Component {
|
|||
}, 500);
|
||||
});
|
||||
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) {
|
||||
clearInterval(this.timerLock);
|
||||
this.setState({
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
}, () => this.queryCalcResultList());
|
||||
this.queryCalcResultList();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -224,8 +232,8 @@ class EditCalcTable extends Component {
|
|||
"点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"),
|
||||
"点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"),
|
||||
"锁定的项目值": getLabel(543647, "锁定的项目值"),
|
||||
"当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"),
|
||||
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
|
||||
"当前状态锁定,右击解锁": getLabel(111, "当前状态锁定,右击解锁"),
|
||||
"当前状态未锁定,右击锁定": getLabel(111, "当前状态未锁定,右击锁定"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
|
||||
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@
|
|||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #fff;
|
||||
|
|
@ -83,7 +85,7 @@
|
|||
|
||||
.ant-table-tbody {
|
||||
.ant-table-row-indent {
|
||||
display: none!important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
td:not(.ant-table-selection-column) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
.generateDeclarationDetail {
|
||||
.tabWrapper{
|
||||
.tabWrapper {
|
||||
padding-left: 10px
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
height: calc(100vh - 48px);
|
||||
overflow: auto;
|
||||
|
|
@ -34,7 +35,8 @@
|
|||
.declare-body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
overflow-y: auto;
|
||||
|
||||
.wea-new-table {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class FieldTable extends Component {
|
|||
pagination={pagination}
|
||||
loading={loading}
|
||||
columns={this.getColumns()}
|
||||
scroll={{ y: "calc(100vh - 152px)" }}
|
||||
scroll={{ y: "calc(100vh - 175px)" }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class FieldManagement extends Component {
|
|||
];
|
||||
return (
|
||||
<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)}
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
|
|
@ -109,26 +109,23 @@ class FieldManagement extends Component {
|
|||
}
|
||||
]}
|
||||
>
|
||||
<div className="fieldManageWrapper">
|
||||
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
|
||||
onDeleteLedger={(record) => this.handleDeleteField([record.id])}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
/>
|
||||
<FieldSlide
|
||||
{...slideparams}
|
||||
onChangeRecord={(record) => this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
record: { ...slideparams.record, ...record }
|
||||
}
|
||||
})}
|
||||
onCancel={this.handleResetField}
|
||||
onRefreshList={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</div>
|
||||
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
|
||||
onDeleteLedger={(record) => this.handleDeleteField([record.id])}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
|
||||
<FieldSlide
|
||||
{...slideparams}
|
||||
onChangeRecord={(record) => this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
record: { ...slideparams.record, ...record }
|
||||
}
|
||||
})}
|
||||
onCancel={this.handleResetField}
|
||||
onRefreshList={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salarcfield" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
|
||||
.fieldManageWrapper {
|
||||
.wea-new-top-content {
|
||||
background: #F6F6F6;
|
||||
padding: 8px 16px 0 16px;
|
||||
}
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.slideOuterWrapper {
|
||||
.wea-form-item-group {
|
||||
margin: 16px;
|
||||
|
|
|
|||
|
|
@ -232,11 +232,11 @@ const TitleNormalComp = (props) => {
|
|||
<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)}/>
|
||||
}
|
||||
{
|
||||
sortedIndex !== dataSourceLen - 1 && showOperateBtn &&
|
||||
name !== getLabel(111, "未分类") && sortedIndex !== dataSourceLen - 2 && showOperateBtn &&
|
||||
<i className="icon-coms-positive-sequence" title="向下移动" onClick={() => onDowngo(sortedIndex)}/>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
|||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
@inject("ledgerStore") @observer
|
||||
class LedgerSearchComp extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -36,14 +35,11 @@ class LedgerSearchComp extends Component {
|
|||
this.setState({
|
||||
conditions: _.map(searchConditions, o => {
|
||||
return {
|
||||
...o,
|
||||
items: _.map(o.items, j => {
|
||||
...o, items: _.map(o.items, j => {
|
||||
if (getKey(j) === "taxAgentId") {
|
||||
return {
|
||||
...j,
|
||||
options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
||||
key: g.id,
|
||||
showname: g.content
|
||||
...j, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
||||
key: g.id, showname: g.content
|
||||
}))]
|
||||
};
|
||||
}
|
||||
|
|
@ -62,19 +58,16 @@ class LedgerSearchComp extends Component {
|
|||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
||||
</WeaFormItem>),
|
||||
colSpan: 2
|
||||
com: (<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom">
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={_.debounce(this.props.onSearch, 500)}/>
|
||||
</WeaFormItem>), colSpan: 2
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
|
||||
items={items}/>);
|
||||
group.push(<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
|
||||
items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
|
@ -82,12 +75,7 @@ class LedgerSearchComp extends Component {
|
|||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { searchForm } } = this.props;
|
||||
return (
|
||||
<div className="ledgerSearch-Wrapper">
|
||||
{this.formRender(searchForm, conditions)}
|
||||
<Button type="primary" onClick={this.props.onSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
return (<div className="ledgerSearch-Wrapper">{this.formRender(searchForm, conditions)}</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ class LedgerSlide extends Component {
|
|||
if (!it.salarySobId) delete it.id;
|
||||
return { ...it };
|
||||
}),
|
||||
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), item => {
|
||||
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), (item, index) => {
|
||||
return {
|
||||
...item,
|
||||
...item, sortedIndex: index,
|
||||
items: _.map(item.items, it => {
|
||||
delete it.originFormulaContent;
|
||||
delete it.originSqlContent;
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ class Index extends Component {
|
|||
const { taxAgentStore } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const btns = [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}
|
||||
>新建</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}>
|
||||
{getLabel(111, "新建")}
|
||||
</Button>,
|
||||
<LedgerSearchComp onSearch={() => this.setState({ doSearch: !doSearch })}/>
|
||||
];
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
.ledgerWrapper {
|
||||
height: 100%;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.tdEllipsis {
|
||||
display: inline-block;
|
||||
|
|
@ -12,8 +18,6 @@
|
|||
|
||||
.ledgerSearch-Wrapper {
|
||||
min-width: 350px;
|
||||
margin-top: 5px;
|
||||
margin-right: 70px;
|
||||
position: relative;
|
||||
|
||||
& > button {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
.mySalary_wrapper {
|
||||
.wea-new-top-req-content {
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.wea-transfer-list-wrapper {
|
||||
border: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
|
||||
|
|
|
|||
|
|
@ -16,17 +16,13 @@ import moment from "moment";
|
|||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("standingBookStore")
|
||||
@observer
|
||||
@inject("standingBookStore") @observer
|
||||
class WelfareRecordQuery extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [],
|
||||
dateRange: [
|
||||
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).endOf("year").format("YYYY-MM")
|
||||
]
|
||||
dateRange: [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({
|
||||
conditions: _.map(welfareRQConditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, o => {
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgents") {
|
||||
return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
|
||||
}
|
||||
|
|
@ -63,28 +58,22 @@ class WelfareRecordQuery extends Component {
|
|||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={this.getWelfareRecordList}/>
|
||||
</WeaFormItem>)
|
||||
com: (<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom">
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={this.getWelfareRecordList}/>
|
||||
</WeaFormItem>)
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup col={3} needTigger showGroup={c.defaultshow}
|
||||
items={[
|
||||
{
|
||||
com: (<WeaFormItem label={getLabel(542443, "账单月份")} labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/>
|
||||
</WeaFormItem>)
|
||||
},
|
||||
...items
|
||||
]}
|
||||
/>);
|
||||
group.push(<WeaSearchGroup col={3} needTigger showGroup={c.defaultshow}
|
||||
items={[{
|
||||
com: (<WeaFormItem label={getLabel(542443, "账单月份")} labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/>
|
||||
</WeaFormItem>)
|
||||
}, ...items]}
|
||||
/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
|
@ -101,9 +90,7 @@ class WelfareRecordQuery extends Component {
|
|||
render() {
|
||||
const { standingBookStore: { welfareRQForm } } = this.props;
|
||||
const { conditions } = this.state;
|
||||
return (
|
||||
<div className="salary-welfare-record-query">{this.renderForm(welfareRQForm, conditions)}</div>
|
||||
);
|
||||
return (<div className="salary-welfare-record-query">{this.renderForm(welfareRQForm, conditions)}</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,24 +57,22 @@
|
|||
|
||||
//社保福利台账页面重构
|
||||
.salary-welfare-record {
|
||||
min-width: 1000px;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.salary-welfare-record-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 8px 16px;
|
||||
padding: 8px 16px 0 16px;
|
||||
background: #F6F6F6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.salary-welfare-record-query {
|
||||
width: 100%;
|
||||
padding: 0 8px;
|
||||
margin-bottom: 8px;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #FFF;
|
||||
|
||||
.wea-search-group {
|
||||
width: 100%;
|
||||
|
|
|
|||
|
|
@ -123,50 +123,45 @@ class StandingBook extends Component {
|
|||
const rightBtns = [<Button type="primary" onClick={() => this.setState({
|
||||
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
|
||||
})}>{getLabel(538780, "核算")}</Button>];
|
||||
return (
|
||||
<div className="salary-welfare-record">
|
||||
<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []}
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]}
|
||||
>
|
||||
<div className="salary-welfare-record-content">
|
||||
<WelfareRecordQuery
|
||||
onSearch={(payload) => {
|
||||
this.setState({
|
||||
queryForm: { ...queryForm, ...payload }
|
||||
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
|
||||
}}
|
||||
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
|
||||
/>
|
||||
<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>
|
||||
return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]}>
|
||||
<div className="salary-welfare-record-content">
|
||||
<WelfareRecordQuery
|
||||
onSearch={(payload) => {
|
||||
this.setState({
|
||||
queryForm: { ...queryForm, ...payload }
|
||||
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
|
||||
}}
|
||||
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
|
||||
/>
|
||||
<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>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ import * as API from "../../../../apis/variableSalary";
|
|||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("baseTableStore")
|
||||
@observer
|
||||
@inject("baseTableStore") @observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -38,39 +37,40 @@ class Index extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
initForm = (props) => {
|
||||
const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props;
|
||||
initForm = async (props) => {
|
||||
const { baseTableStore: { VSSalaryFileForm }, detail } = props;
|
||||
const { data: taxAgentOption } = await API.getAdminTaxAgentList();
|
||||
API.getCreateForm().then(({ data }) => {
|
||||
this.setState({
|
||||
conditions: [
|
||||
..._.map(salaryFileConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return {
|
||||
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
|
||||
options: taxAgentOption, value: detail[getKey(o)] || ""
|
||||
};
|
||||
}
|
||||
conditions: [..._.map(salaryFileConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return {
|
||||
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
|
||||
value: detail[getKey(o)] || ""
|
||||
...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 }))
|
||||
};
|
||||
})
|
||||
})),
|
||||
{
|
||||
items: _.map(data, o => ({
|
||||
conditionType: "INPUT",
|
||||
domkey: [String(o.id)],
|
||||
fieldcol: 14,
|
||||
label: o.name,
|
||||
labelcol: 6,
|
||||
value: detail[`${String(o.id)}_variableItem`] || "",
|
||||
viewAttr: !_.isEmpty(detail) ? 1 : 2
|
||||
})),
|
||||
title: "", col: 2,
|
||||
defaultshow: true
|
||||
}
|
||||
]
|
||||
}
|
||||
return {
|
||||
...o,
|
||||
viewAttr: !_.isEmpty(detail) ? 1 : 3,
|
||||
label: getLabel(o.lanId, o.label),
|
||||
value: detail[getKey(o)] || ""
|
||||
};
|
||||
})
|
||||
})), {
|
||||
items: _.map(data, o => ({
|
||||
conditionType: "INPUT",
|
||||
domkey: [String(o.id)],
|
||||
fieldcol: 14,
|
||||
label: o.name,
|
||||
labelcol: 6,
|
||||
value: detail[`${String(o.id)}_variableItem`] || "",
|
||||
viewAttr: 2
|
||||
})), title: "", col: 2, defaultshow: true
|
||||
}]
|
||||
}, () => {
|
||||
VSSalaryFileForm.initFormFields(this.state.conditions);
|
||||
if (!_.isEmpty(detail)) {
|
||||
|
|
@ -96,7 +96,7 @@ class Index extends Component {
|
|||
}, {});
|
||||
};
|
||||
save = () => {
|
||||
const { baseTableStore: { VSSalaryFileForm }, onSearch, id } = this.props;
|
||||
const { baseTableStore: { VSSalaryFileForm }, onSearch, detail: { id } } = this.props;
|
||||
VSSalaryFileForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const payload = VSSalaryFileForm.getFormParams();
|
||||
|
|
@ -117,17 +117,14 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { loading } = this.state, { title, detail } = this.props;
|
||||
const { loading } = this.state, { title } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{
|
||||
_.isEmpty(detail) &&
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
|
@ -138,7 +135,7 @@ class Index extends Component {
|
|||
return (<WeaSlideModal
|
||||
className="variable_salary_file_dialog" {...this.props} direction="right" onClose={() => onClose()}
|
||||
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>}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,15 @@ class Index extends Component {
|
|||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
const { importDialog } = this.state;
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps;
|
||||
const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps;
|
||||
const payload = {
|
||||
salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData
|
||||
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData
|
||||
};
|
||||
this.setState({
|
||||
importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` }
|
||||
importDialog: {
|
||||
...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth,
|
||||
link: `${importDialog.link}?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
|
|
@ -48,9 +51,10 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
handleImport = (payload) => {
|
||||
const { taxAgentIds } = this.props;
|
||||
const { baseTableStore: { VExtraSalryForm } } = this.props;
|
||||
const { importDialog } = this.state;
|
||||
const { salaryMonth } = importDialog;
|
||||
const { taxAgentIds } = VExtraSalryForm.getFormParams();
|
||||
this.setState({ importDialog: { ...importDialog, nextloading: true } });
|
||||
API.importVariableSalary({
|
||||
...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
|
||||
|
|
@ -64,14 +68,17 @@ class Index extends Component {
|
|||
}).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
|
||||
};
|
||||
renderFormComponent = () => {
|
||||
const { baseTableStore: { VSalryForm }, taxAgentIds } = 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 = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() };
|
||||
const payload = {
|
||||
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
|
||||
salaryMonth: val, hasData
|
||||
};
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog, salaryMonth: val,
|
||||
|
|
@ -98,9 +105,12 @@ class Index extends Component {
|
|||
content={getLabel(543208, "导出现有数据")}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => {
|
||||
const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props;
|
||||
const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props;
|
||||
const { salaryMonth } = importDialog;
|
||||
const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" };
|
||||
const payload = {
|
||||
salaryMonth, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
|
||||
hasData: val === "1"
|
||||
};
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog, hasData: val === "1",
|
||||
|
|
|
|||
|
|
@ -9,26 +9,57 @@
|
|||
*/
|
||||
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
|
||||
@inject("baseTableStore") @observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
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("resize", this.handleResize, false);
|
||||
this.getVariableSalaryList();
|
||||
|
|
@ -56,10 +87,14 @@ class Index extends Component {
|
|||
pageInfo: { ...this.state.pageInfo, ...params }
|
||||
}, () => this.getVariableSalaryList());
|
||||
break;
|
||||
case "CHECKBOX":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "DEL":
|
||||
this.handleDelete([params.id]);
|
||||
break;
|
||||
case "VIEW":
|
||||
case "EDIT":
|
||||
this.handleView(params.id);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -68,22 +103,22 @@ class Index extends Component {
|
|||
}
|
||||
};
|
||||
getVariableSalaryList = () => {
|
||||
const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props;
|
||||
const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props;
|
||||
const { pageInfo } = this.state;
|
||||
const { departmentIds } = VSalryForm.getFormParams();
|
||||
const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
getVariableSalaryList({
|
||||
...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","),
|
||||
...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : []
|
||||
...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
|
||||
}).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageInfo: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
|
||||
}
|
||||
);
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -94,13 +129,11 @@ class Index extends Component {
|
|||
};
|
||||
handleDelete = (ids) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(111, "信息确认"),
|
||||
content: getLabel(111, "确认删除吗?"),
|
||||
onOk: () => {
|
||||
title: getLabel(111, "信息确认"), content: getLabel(111, "确认删除吗?"), onOk: () => {
|
||||
API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "删除成功"));
|
||||
this.getVariableSalaryList();
|
||||
this.setState({ selectedRowKeys: [] }, () => this.getVariableSalaryList());
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -111,51 +144,68 @@ class Index extends Component {
|
|||
getColumns = () => {
|
||||
const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props;
|
||||
const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({
|
||||
dataIndex: it.dataIndex, title: it.title, align: "left",
|
||||
width: 150, ellipsis: true
|
||||
dataIndex: it.dataIndex, title: it.title, align: "left", width: 150, ellipsis: true
|
||||
}));
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 98,
|
||||
pageInfo: this.state.pageInfo, unitTableType: "variableSalary"
|
||||
columns,
|
||||
showOperateBtn,
|
||||
dataSource: this.state.dataSource,
|
||||
scrollHeight: 95,
|
||||
pageInfo: this.state.pageInfo,
|
||||
unitTableType: "variableSalary",
|
||||
selectedRowKeys: this.state.selectedRowKeys
|
||||
});
|
||||
}
|
||||
return columns;
|
||||
};
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "查看详情": getLabel(111, "查看详情"),
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"操作": getLabel(30585, "操作"),
|
||||
"编辑": getLabel(111, "编辑"),
|
||||
"共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条"),
|
||||
"删除": getLabel(111, "删除")
|
||||
};
|
||||
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 style={{ height: height + "px" }}>
|
||||
<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>
|
||||
);
|
||||
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.openAdvanceSearch();
|
||||
this.getVariableSalaryList();
|
||||
}}/>
|
||||
</div>
|
||||
<div style={{ height: height + "px" }}>
|
||||
<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>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,7 @@ class VariableSalarySearchPannel extends Component {
|
|||
searchConditions: _.map(conditions, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.map(item.items, child => {
|
||||
return { ...child, label: getLabel(child.lanId, child.label) };
|
||||
})
|
||||
items: _.map(item.items, child => ({ ...child, label: getLabel(child.lanId, child.label) }))
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import moment from "moment";
|
||||
|
||||
export const conditions = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -68,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: [
|
||||
|
|
@ -125,7 +157,7 @@ export const salaryFileConditions = [
|
|||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
|
|
@ -157,7 +189,7 @@ export const salaryFileConditions = [
|
|||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -10,18 +10,15 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
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 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 moment from "moment";
|
||||
import { Button } from "antd";
|
||||
import cs from "classnames";
|
||||
import { Button, message } from "antd";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -32,37 +29,22 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "",
|
||||
salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [],
|
||||
SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框
|
||||
SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框
|
||||
selectedKey: "salaryFile", isQuery: false,
|
||||
SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框
|
||||
SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框
|
||||
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 });
|
||||
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({
|
||||
SFDialog: {
|
||||
...this.state.SFDialog, visible: true, detail,
|
||||
title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "查看薪资档案")
|
||||
title: _.isEmpty(detail) ? getLabel(111, "新增浮动数据") : getLabel(111, "编辑浮动数据")
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
@ -71,12 +53,12 @@ class Index extends Component {
|
|||
break;
|
||||
case "export":
|
||||
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 = {
|
||||
...VSalryForm.getFormParams(),
|
||||
...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(),
|
||||
taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [],
|
||||
departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [],
|
||||
salaryMonth, columns
|
||||
departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [],
|
||||
columns
|
||||
};
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.exportVariableSalary(payload);
|
||||
|
|
@ -85,15 +67,21 @@ class Index extends Component {
|
|||
SFTableStore.setColSetVisible(true);
|
||||
SFTableStore.tableColSet(true);
|
||||
break;
|
||||
case "batchDel":
|
||||
const { state: { selectedRowKeys }, handleDelete } = this.salaryListRef.wrappedInstance;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.warning(getLabel(111, "请选择数据!"));
|
||||
return;
|
||||
}
|
||||
handleDelete(selectedRowKeys);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds
|
||||
} = this.state;
|
||||
const { selectedKey, SIDialog, SFDialog, SFImpDialog, isQuery } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props;
|
||||
const tabs = [
|
||||
{
|
||||
|
|
@ -107,21 +95,9 @@ 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>,
|
||||
<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}/>
|
||||
] : [
|
||||
<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}
|
||||
<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)}/>
|
||||
},
|
||||
{
|
||||
|
|
@ -141,16 +117,13 @@ class Index extends Component {
|
|||
];
|
||||
return (
|
||||
<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"
|
||||
buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10}
|
||||
onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })}
|
||||
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({
|
||||
|
|
@ -161,11 +134,10 @@ class Index extends Component {
|
|||
SFDialog: { ...SFDialog, visible: false }
|
||||
}, () => callback && callback())}/>
|
||||
{/* 薪资档案导入*/}
|
||||
<SalaryFileImportDialog {...this.props} {...SFImpDialog} salaryMonth={salaryMonth} taxAgentIds={taxAgentIds}
|
||||
onCancel={callback => {
|
||||
this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } },
|
||||
() => callback && this.handleAdvanceSearch());
|
||||
}}/>
|
||||
<SalaryFileImportDialog {...this.props} {...SFImpDialog} onCancel={callback => {
|
||||
this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } },
|
||||
() => callback && this.handleAdvanceSearch());
|
||||
}}/>
|
||||
</WeaReqTop>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,30 @@
|
|||
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;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
|
|
@ -56,6 +79,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue