薪资账套编辑页面修改
This commit is contained in:
parent
8f11093483
commit
d774de6a64
|
|
@ -12,7 +12,7 @@ export const getArchiveList = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ export const saveSalaryItem = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ export const saveTaxAgent = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -135,6 +135,10 @@ export const downloadsalaryArchiveDetail = params => {
|
|||
export const getImportTypes = () => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {});
|
||||
}
|
||||
// 获取档案和人员状态类型
|
||||
export const commonEnumList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params);
|
||||
}
|
||||
|
||||
// 导入预览
|
||||
export const importPreview = (params) => {
|
||||
|
|
@ -143,7 +147,7 @@ export const importPreview = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -155,7 +159,7 @@ export const importSalaryArchive = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -165,7 +169,7 @@ export const exportSalaryArchive = (ids = "") => {
|
|||
fetch('/api/bs/hrmsalary/salaryArchive/exportList?ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`薪资档案.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
|
|
@ -180,7 +184,7 @@ export const adjustRecordTaxAgentList = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -192,7 +196,7 @@ export const adjustRecordSalaryItemList = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -204,7 +208,7 @@ export const singleSalaryItemList = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -216,7 +220,7 @@ export const singleTaxAgentList = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -233,7 +237,7 @@ export const getSalaryItemAdjustBeforeValue = (params) => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
|
@ -241,4 +245,4 @@ export const getSalaryItemAdjustBeforeValue = (params) => {
|
|||
// 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单
|
||||
export const getSalaryItemFormByItemId = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId', 'GET', params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const getTable = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
|
@ -20,7 +20,7 @@ export const createScheme = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
|
@ -31,7 +31,7 @@ export const updateScheme = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
|
@ -41,6 +41,16 @@ export const getCopyForm = params => {
|
|||
export const copyScheme = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/scheme/copyScheme', 'get', params);
|
||||
};
|
||||
export const deleteScheme = params => {
|
||||
return fetch('/api/bs/hrmsalary/scheme/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
||||
|
||||
export const getCustomCategoryForm = params => {
|
||||
|
|
@ -65,7 +75,7 @@ export const updateCustomCategory = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
|
@ -78,7 +88,7 @@ export const updateCustomCategoryStatus = params => {
|
|||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
};
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export default class ModalStep1 extends React.Component {
|
|||
downloadExtra= hasData === '1' ? `&hasData=true` : `&hasData=false`;
|
||||
}
|
||||
const dragger = {
|
||||
accept: ".xlsx",
|
||||
name: 'file',
|
||||
multiple: false,
|
||||
action: "/api/doc/upload/uploadFile", //上传地址
|
||||
|
|
|
|||
|
|
@ -63,15 +63,15 @@ export const slideStep3Columns = [
|
|||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: "规则",
|
||||
title: "核算公式",
|
||||
dataIndex: 'formulaContent',
|
||||
key: 'formulaContent'
|
||||
},
|
||||
// {
|
||||
// title: "个税申请表对应字段",
|
||||
// dataIndex: 'taxDeclarationColumn',
|
||||
// key: 'taxDeclarationColumn',
|
||||
// }
|
||||
{
|
||||
title: "个税申请表对应字段",
|
||||
dataIndex: 'taxDeclarationColumn',
|
||||
key: 'taxDeclarationColumn',
|
||||
}
|
||||
]
|
||||
|
||||
export const slideStep4Columns = [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import React from "react";
|
||||
import { Button, Icon, Table } from "antd";
|
||||
import { WeaInputSearch, WeaHelpfulTip, WeaSelect } from "ecCom";
|
||||
import { slideStep3Columns, dataSource } from "./columns";
|
||||
import { Button, Icon } from "antd";
|
||||
import { WeaHelpfulTip } from "ecCom";
|
||||
import "./index.less";
|
||||
import AddCategoryModal from "./step3/AddCategoryModal";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
|
@ -81,20 +80,33 @@ export default class SalaryItemForm extends React.Component {
|
|||
setItemGroups(newItemGroups);
|
||||
}
|
||||
|
||||
// 修改列表数据顺序
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
// 修改项目组数据顺序
|
||||
handleUpgo = (index) => {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
dataSource.map((data, index) => {
|
||||
data.sortedIndex = index;
|
||||
});
|
||||
let itemResultGroups = itemGroups ? [...itemGroups] : [];
|
||||
itemResultGroups.map(groupItem => {
|
||||
if (groupItem.id == item.id) {
|
||||
groupItem.items = dataSource;
|
||||
}
|
||||
});
|
||||
setItemGroups(itemResultGroups);
|
||||
}
|
||||
let newItemGroups = [...itemGroups];
|
||||
if (index !== 0) {
|
||||
newItemGroups[index] = newItemGroups.splice(index - 1, 1, newItemGroups[index])[0];
|
||||
} else {
|
||||
newItemGroups.push(newItemGroups.shift());
|
||||
}
|
||||
setItemGroups(_.map(newItemGroups, (it, idx) => ({
|
||||
...it,
|
||||
sortedIndex: it.sortedIndex ? idx : undefined
|
||||
})));
|
||||
};
|
||||
handleDowngo = (index) => {
|
||||
const { ledgerStore: { itemGroups, setItemGroups } } = this.props;
|
||||
let newItemGroups = [...itemGroups];
|
||||
if (index !== newItemGroups.length - 1) {
|
||||
newItemGroups[index] = newItemGroups.splice(index + 1, 1, newItemGroups[index])[0];
|
||||
} else {
|
||||
newItemGroups.unshift(newItemGroups.splice(index, 1)[0]);
|
||||
}
|
||||
setItemGroups(_.map(newItemGroups, (it, idx) => ({
|
||||
...it,
|
||||
sortedIndex: it.sortedIndex ? idx : undefined
|
||||
})));
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
|
|
@ -109,7 +121,6 @@ export default class SalaryItemForm extends React.Component {
|
|||
} = this.props;
|
||||
const { canEdit = "true" } = baseInfoRequest;
|
||||
const { previewVisible } = this.state;
|
||||
|
||||
return (
|
||||
<div className="salaryItemForm">
|
||||
<div className="btnBar">
|
||||
|
|
@ -149,23 +160,26 @@ export default class SalaryItemForm extends React.Component {
|
|||
/>
|
||||
</span>
|
||||
<div className="rightBtnsWrapper">
|
||||
<Icon type="down" />
|
||||
<Icon type="down"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UserInfoSelected />
|
||||
<UserInfoSelected/>
|
||||
</div>
|
||||
{itemGroups &&
|
||||
itemGroups.map(item => {
|
||||
itemGroups.map((item, index) => {
|
||||
if (item.items) {
|
||||
return (
|
||||
<CanMoveItem
|
||||
disabled={canEdit !== "true"}
|
||||
dataSource={toJS(item.items)}
|
||||
onUpgo={this.handleUpgo}
|
||||
onDowngo={this.handleDowngo}
|
||||
onDataSourceChange={dataSource => {
|
||||
this.handleItemDataSourceChange(dataSource, item);
|
||||
}}
|
||||
title={item.name}
|
||||
sortedIndex={index}
|
||||
onGroupDelete={() => {
|
||||
this.handleGroupDelete(item);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ export default class AddCategoryModal extends React.Component {
|
|||
}
|
||||
render() {
|
||||
return (
|
||||
<Modal title={this.props.title && this.props.title !== '' ? "修改分类" : "新增分类"} footer={<Button type="primary" onClick={() => {this.props.onSave(this.state.name)}}>保存</Button>} width={600}
|
||||
<Modal title={this.props.title && this.props.title !== '' ? "修改分类" : "新增分类"} footer={<Button type="primary" onClick={() => {this.props.onSave(this.state.name)}}>保存</Button>} width={600}
|
||||
visible={this.props.visible} onCancel={() => {this.props.onCancel()}}
|
||||
>
|
||||
<div style={{padding: "20px"}}>
|
||||
<Row>
|
||||
<Row style={{display:"flex", alignItems:"center"}}>
|
||||
<Col span={6}>分类名称<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.state.name} onChange={(value) => {this.setState({name: value})}}/>
|
||||
|
|
@ -25,6 +25,6 @@ export default class AddCategoryModal extends React.Component {
|
|||
</Row>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
import React, { Fragment } from "react";
|
||||
import { Icon, Table, message, Modal } from "antd";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { Icon, message, Modal } from "antd";
|
||||
import { WeaHelpfulTip, WeaTable } from "ecCom";
|
||||
import { slideStep3Columns } from "../columns";
|
||||
import AddSalaryItemModal from "./AddSalaryItemModal";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import FormalFormModal from "../../salaryItem/formalFormModal";
|
||||
import AddCategoryModal from "../step3/AddCategoryModal";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
const helpContent = () => {
|
||||
return <span>
|
||||
<span>1、新建薪资账套时,核算公式与【薪资项目管理】菜单一致;</span><br/>
|
||||
<span>2、取值方式为公式的薪资项目,核算公式显示为具体公式;点击公式可编辑公式,核算时,按照当前薪资项目的公式进行核算;</span><br/>
|
||||
<span>3、薪资账套内的薪资项目的取值方式的修改或公式的修改,都不影响【薪资项目管理】菜单的薪资项目取值方式或公式,只对当前账套生效;</span><br/>
|
||||
</span>;
|
||||
};
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
|
|
@ -15,7 +23,15 @@ export default class CanMoveItem extends React.Component {
|
|||
super(props);
|
||||
let columns = slideStep3Columns.map(item => {
|
||||
item = { ...item };
|
||||
if (item.key == "formulaContent") {
|
||||
if (item.key === "formulaContent") {
|
||||
item.title = <span>
|
||||
<span style={{ marginRight: 8 }}>{item.title}</span>
|
||||
<WeaHelpfulTip
|
||||
title={helpContent()}
|
||||
placement="bottom"
|
||||
width={200}
|
||||
/>
|
||||
</span>;
|
||||
item.render = (text, record) => {
|
||||
if (record.canEdit) {
|
||||
return (
|
||||
|
|
@ -87,7 +103,8 @@ export default class CanMoveItem extends React.Component {
|
|||
result.filter(item => selectedRowKeys.indexOf(item.key) < 0)
|
||||
);
|
||||
},
|
||||
onCancel: () => {}
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -127,14 +144,16 @@ export default class CanMoveItem extends React.Component {
|
|||
onOk: () => {
|
||||
this.props.onGroupDelete && this.props.onGroupDelete();
|
||||
},
|
||||
onCancel: () => {}
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
disabled,
|
||||
ledgerStore: { setAddItemVisible, addItemVisible }
|
||||
sortedIndex,
|
||||
ledgerStore: { setAddItemVisible, addItemVisible, itemGroups = [] }
|
||||
} = this.props;
|
||||
const {
|
||||
selectedRowKeys,
|
||||
|
|
@ -178,6 +197,30 @@ export default class CanMoveItem extends React.Component {
|
|||
/>
|
||||
</Fragment>}
|
||||
</span>}
|
||||
<span style={{
|
||||
marginLeft: 10,
|
||||
cursor: "pointer"
|
||||
}}>
|
||||
{
|
||||
sortedIndex !== 0 &&
|
||||
<i className="icon-coms-Reverse"
|
||||
onClick={() => this.props.onUpgo(sortedIndex)}
|
||||
style={{
|
||||
marginRight: 10,
|
||||
cursor: "pointer"
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
sortedIndex !== toJS(itemGroups).length - 1 &&
|
||||
<i className="icon-coms-positive-sequence"
|
||||
onClick={()=> this.props.onDowngo(sortedIndex)}
|
||||
style={{
|
||||
cursor: "pointer"
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</span>
|
||||
</span>
|
||||
<span className="rightBtnsWrapper">
|
||||
{!disabled &&
|
||||
|
|
|
|||
|
|
@ -1,52 +1,33 @@
|
|||
import React, { Fragment } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Menu,
|
||||
message,
|
||||
Modal,
|
||||
} from "antd";
|
||||
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaTable,
|
||||
WeaInputSearch,
|
||||
WeaSlideModal,
|
||||
WeaBrowser,
|
||||
WeaCheckbox,
|
||||
WeaFormItem,
|
||||
WeaHelpfulTip,
|
||||
WeaInput,
|
||||
WeaRightMenu,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaSlideModal,
|
||||
WeaTab,
|
||||
WeaTop
|
||||
} from "ecCom";
|
||||
import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import ChangeSalaryModal from "./changeSalaryModal";
|
||||
import EditAgentModal from "./editAgentModal";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import SlideSalaryItem from "./slideSalaryItem";
|
||||
import SlideAgent from "./slideAgent";
|
||||
import ImportModal from "../../components/importModal";
|
||||
import SalaryFileViewSlide from "./saralyFileViewSlide";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import "./index.less";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
import ContentWrapper from "../../components/contentWrapper";
|
||||
|
||||
import { columns, dataSource } from "./columns";
|
||||
|
||||
import ChangeSalaryModal from "./changeSalaryModal"
|
||||
import EditAgentModal from './editAgentModal';
|
||||
import SlideModalTitle from '../../components/slideModalTitle'
|
||||
import SlideSalaryItem from './slideSalaryItem'
|
||||
import SlideAgent from './slideAgent'
|
||||
import ImportModal from '../../components/importModal'
|
||||
import SalaryFileViewSlide from './saralyFileViewSlide'
|
||||
import CustomPaginationTable from "../../components/customPaginationTable"
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import "./index.less";
|
||||
import CustomTable from "../../components/customTable";
|
||||
|
||||
@inject("salaryFileStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class SalaryFile extends React.Component {
|
||||
|
|
@ -67,16 +48,86 @@ export default class SalaryFile extends React.Component {
|
|||
selectedRowKeys: [],
|
||||
showSearchBar: false,
|
||||
importResult: {},
|
||||
searchValue: ""
|
||||
}
|
||||
this.pageInfo = {current: 1, pageSize: 10}
|
||||
searchValue: "",
|
||||
searchItemsValue: {
|
||||
username: "",
|
||||
departmentIds: "",
|
||||
positionIds: "",
|
||||
userstatus: "",
|
||||
archiveStatus: ""
|
||||
}
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
||||
Input = (value, key) => {
|
||||
const { username } = this.state.searchItemsValue;
|
||||
return (
|
||||
<WeaFormItem
|
||||
label={value}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaInput value={username} onChange={(val) => this.setState({
|
||||
searchItemsValue: {
|
||||
...this.state.searchItemsValue,
|
||||
[key]: val
|
||||
}
|
||||
})}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
Browser = (value, key) => {
|
||||
const { positionIds, departmentIds } = this.state.searchItemsValue;
|
||||
return (
|
||||
<WeaFormItem
|
||||
label={value}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaBrowser
|
||||
isSingle={false}
|
||||
value={key === "departmentIds" ? departmentIds : positionIds}
|
||||
tabs={key === "departmentIds" ? [
|
||||
{
|
||||
dataParams: { list: "1" },
|
||||
isSearch: true,
|
||||
key: "1",
|
||||
name: "按列表",
|
||||
selected: false,
|
||||
showOrder: 0
|
||||
}
|
||||
] : null}
|
||||
type={key === "departmentIds" ? 57 : 278}
|
||||
onChange={(val) => {
|
||||
this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } });
|
||||
}}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
Select = (value, key) => {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { userstatus, archiveStatus } = this.state.searchItemsValue;
|
||||
const { archiveStatusList, userStatusList } = salaryFileStore;
|
||||
return (
|
||||
<WeaFormItem
|
||||
label={value}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<WeaSelect
|
||||
value={key === "userstatus" ? userstatus : archiveStatus}
|
||||
options={key === "userstatus" ? userStatusList : archiveStatusList}
|
||||
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
const {
|
||||
salaryFileStore: { doInit },
|
||||
salaryFileStore: { doInit }
|
||||
} = this.props;
|
||||
doInit();
|
||||
doInit({ ...this.state.searchItemsValue });
|
||||
}
|
||||
|
||||
// 设置导入步数
|
||||
|
|
@ -88,7 +139,7 @@ export default class SalaryFile extends React.Component {
|
|||
renderFormComponent() {
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<WeaCheckbox id="importData" content="导出现有数据" />
|
||||
<WeaCheckbox id="importData" content="导出现有数据"/>
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="提示:建议先导出现有最新数据,修改后再导入"
|
||||
|
|
@ -101,7 +152,7 @@ export default class SalaryFile extends React.Component {
|
|||
// 导入预览
|
||||
handlePreviewImport(params) {
|
||||
const {
|
||||
salaryFileStore: { importPreview },
|
||||
salaryFileStore: { importPreview }
|
||||
} = this.props;
|
||||
params.importType = this.state.importType;
|
||||
importPreview(params);
|
||||
|
|
@ -110,13 +161,13 @@ export default class SalaryFile extends React.Component {
|
|||
// 导入档案
|
||||
handleImportFile(params) {
|
||||
const {
|
||||
salaryFileStore: { importSalaryArchive },
|
||||
salaryFileStore: { importSalaryArchive }
|
||||
} = this.props;
|
||||
params.importType = this.state.importType;
|
||||
importSalaryArchive(params).then((data) => {
|
||||
importSalaryArchive(params, this.state.searchItemsValue).then((data) => {
|
||||
data.errorData = data.errorNotice;
|
||||
this.setState({
|
||||
importResult: data,
|
||||
importResult: data
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -129,7 +180,7 @@ export default class SalaryFile extends React.Component {
|
|||
// 导出全部
|
||||
handleExportAll() {
|
||||
const {
|
||||
salaryFileStore: { exportSalaryArchive },
|
||||
salaryFileStore: { exportSalaryArchive }
|
||||
} = this.props;
|
||||
exportSalaryArchive();
|
||||
}
|
||||
|
|
@ -137,7 +188,7 @@ export default class SalaryFile extends React.Component {
|
|||
// 定制列
|
||||
getColumns() {
|
||||
const {
|
||||
salaryFileStore: { tableStore },
|
||||
salaryFileStore: { tableStore }
|
||||
} = this.props;
|
||||
return tableStore.columns
|
||||
.filter((item) => item.display == "true")
|
||||
|
|
@ -159,7 +210,7 @@ export default class SalaryFile extends React.Component {
|
|||
handleEdit(record) {
|
||||
this.setState({ editSlideVisible: true });
|
||||
const {
|
||||
salaryFileStore: { setCurrentId },
|
||||
salaryFileStore: { setCurrentId }
|
||||
} = this.props;
|
||||
setCurrentId(record.id);
|
||||
}
|
||||
|
|
@ -167,7 +218,7 @@ export default class SalaryFile extends React.Component {
|
|||
// 显示调整个税扣缴义务人表单
|
||||
handSildeOptionMenuClick(e) {
|
||||
const {
|
||||
salaryFileStore: { setEditAgentVisible },
|
||||
salaryFileStore: { setEditAgentVisible }
|
||||
} = this.props;
|
||||
setEditAgentVisible(true);
|
||||
}
|
||||
|
|
@ -208,26 +259,26 @@ export default class SalaryFile extends React.Component {
|
|||
// 显示影响搜索面板
|
||||
handleShowSearchBar = () => {
|
||||
this.setState({
|
||||
showSearchBar: !this.state.showSearchBar,
|
||||
showSearchBar: !this.state.showSearchBar
|
||||
});
|
||||
};
|
||||
|
||||
// 页面跳转
|
||||
handlePageChange = (value) => {
|
||||
const { salaryFileStore: {getTableDatas, form}} = this.props;
|
||||
const { salaryFileStore: { getTableDatas, form } } = this.props;
|
||||
this.pageInfo.current = value;
|
||||
getTableDatas(this.pageInfo)
|
||||
}
|
||||
getTableDatas({ ...this.state.searchItemsValue, ...this.pageInfo });
|
||||
};
|
||||
|
||||
handleShowSizeChange(pageInfo) {
|
||||
const { salaryFileStore: {getTableDatas, form}} = this.props;
|
||||
getTableDatas(pageInfo)
|
||||
const { salaryFileStore: { getTableDatas, form } } = this.props;
|
||||
getTableDatas({ ...this.state.searchItemsValue, ...pageInfo });
|
||||
}
|
||||
|
||||
// 搜索
|
||||
handleSearch(value) {
|
||||
const {
|
||||
salaryFileStore: { getTableDatas, form },
|
||||
salaryFileStore: { getTableDatas, form }
|
||||
} = this.props;
|
||||
getTableDatas({ username: value });
|
||||
}
|
||||
|
|
@ -235,21 +286,21 @@ export default class SalaryFile extends React.Component {
|
|||
// 初始化导入参数
|
||||
handleInitModal() {
|
||||
const {
|
||||
salaryFileStore: { setPreviewDataSource },
|
||||
salaryFileStore: { setPreviewDataSource }
|
||||
} = this.props;
|
||||
setPreviewDataSource([]);
|
||||
this.setState({
|
||||
importResult: {},
|
||||
importResult: {}
|
||||
});
|
||||
}
|
||||
|
||||
showColumn = () => {
|
||||
const { salaryFileStore: { tableStore } } = this.props;
|
||||
console.log("showColumn:", tableStore.setColSetVisible(true));
|
||||
// console.log("showColumn:", tableStore.setColSetVisible(true));
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
console.log("showColumn:")
|
||||
}
|
||||
// console.log("showColumn:");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { salaryFileStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
|
|
@ -262,7 +313,7 @@ export default class SalaryFile extends React.Component {
|
|||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
setShowSearchAd
|
||||
} = salaryFileStore;
|
||||
const {
|
||||
importType,
|
||||
|
|
@ -272,7 +323,7 @@ export default class SalaryFile extends React.Component {
|
|||
currentId,
|
||||
editAgentVisible,
|
||||
setEditAgentVisible,
|
||||
pageInfo,
|
||||
pageInfo
|
||||
} = salaryFileStore;
|
||||
|
||||
const { selectedTab, step, selectedRowKeys } = this.state;
|
||||
|
|
@ -285,10 +336,10 @@ export default class SalaryFile extends React.Component {
|
|||
// 右键菜单
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom" />,
|
||||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: "显示列定制",
|
||||
onClick: this.showColumn,
|
||||
},
|
||||
onClick: this.showColumn
|
||||
}
|
||||
];
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
|
|
@ -296,24 +347,33 @@ export default class SalaryFile extends React.Component {
|
|||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1,
|
||||
importantlevel: 1
|
||||
};
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
<Button type="primary" onClick={() => doSearch(this.state.searchItemsValue)}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
searchItemsValue: {
|
||||
username: "",
|
||||
departmentIds: "",
|
||||
positionIds: "",
|
||||
userstatus: "",
|
||||
archiveStatus: ""
|
||||
}
|
||||
})}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
</Button>
|
||||
];
|
||||
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {};
|
||||
const renderSearchOperationItem = () => {
|
||||
};
|
||||
|
||||
const handleMenuClick = (e) => {
|
||||
const { key } = e;
|
||||
|
|
@ -324,7 +384,8 @@ export default class SalaryFile extends React.Component {
|
|||
onOk: () => {
|
||||
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
|
||||
|
|
@ -338,7 +399,7 @@ export default class SalaryFile extends React.Component {
|
|||
return;
|
||||
}
|
||||
const {
|
||||
salaryFileStore: { exportSalaryArchive },
|
||||
salaryFileStore: { exportSalaryArchive }
|
||||
} = this.props;
|
||||
exportSalaryArchive(selectedRowKeys.join(","));
|
||||
};
|
||||
|
|
@ -346,7 +407,7 @@ export default class SalaryFile extends React.Component {
|
|||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
{/*暂时去掉调整个税扣缴义务人导入按钮*/}
|
||||
{_.filter(importType, it => it.id!=="taxAgentAdjust").map((item) => (
|
||||
{_.filter(importType, it => it.id !== "taxAgentAdjust").map((item) => (
|
||||
<Menu.Item key={item.id}>{item.content}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
|
|
@ -362,7 +423,9 @@ export default class SalaryFile extends React.Component {
|
|||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div
|
||||
style={{ display: "inline-block", position: "relative" }}
|
||||
style={{
|
||||
marginTop: 10
|
||||
}}
|
||||
className="salaryFileTabWrapper">
|
||||
{
|
||||
showOperateBtn &&
|
||||
|
|
@ -404,23 +467,36 @@ export default class SalaryFile extends React.Component {
|
|||
{/* }}>*/}
|
||||
{/* 调薪记录*/}
|
||||
{/*</Button>*/}
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={(value) => {
|
||||
this.setState({
|
||||
searchValue: value,
|
||||
});
|
||||
}}
|
||||
onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
|
||||
{/*<WeaInputSearch*/}
|
||||
{/* value={this.state.searchValue}*/}
|
||||
{/* onChange={(value) => {*/}
|
||||
{/* this.setState({*/}
|
||||
{/* searchValue: value*/}
|
||||
{/* });*/}
|
||||
{/* }}*/}
|
||||
{/* onSearch={(value) => {*/}
|
||||
{/* this.handleSearch(value);*/}
|
||||
{/* }}*/}
|
||||
{/*/>*/}
|
||||
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const handleSlideMoreMenuClick = () => {};
|
||||
const renderSearch = () => {
|
||||
const searchItems = [
|
||||
{ com: this.Input("姓名", "username") },
|
||||
{ com: this.Browser("部门", "departmentIds") },
|
||||
{ com: this.Browser("岗位", "positionIds") },
|
||||
{ com: this.Select("人员状态", "userstatus") },
|
||||
{ com: this.Select("档案状态", "archiveStatus") }
|
||||
];
|
||||
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;
|
||||
};
|
||||
|
||||
const handleSlideMoreMenuClick = () => {
|
||||
};
|
||||
|
||||
const slideMoreMenu = (
|
||||
<Menu onClick={handleSlideMoreMenuClick}>
|
||||
|
|
@ -441,7 +517,7 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
onChange: this.onSelectChange
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -452,19 +528,31 @@ export default class SalaryFile extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="薪资档案" // 文字
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
icon={<i className="icon-coms-meeting"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
showSearchAd={showSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => doSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调this.handleSearch()
|
||||
searchsAdQuick={renderRightOperation()}
|
||||
onSearchChange={(v) =>
|
||||
this.setState({
|
||||
searchItemsValue: {
|
||||
...this.state.searchItemsValue,
|
||||
username: v
|
||||
}
|
||||
})} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
|
||||
searchsBaseValue={this.state.searchItemsValue.username} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
|
||||
/>
|
||||
<WeaTableComx
|
||||
style={{display: "none"}}
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
/>
|
||||
|
|
@ -477,13 +565,14 @@ export default class SalaryFile extends React.Component {
|
|||
total={pageInfo.total}
|
||||
current={pageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
scroll={{x: this.getColumns().length ? this.getColumns().length * 150 : 1200}}
|
||||
rowClassName={(record) => record.archiveStatus === "ARCHIVE" ? "archiveRow" : ""}
|
||||
scroll={{ x: this.getColumns().length ? this.getColumns().length * 150 : 1200 }}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value)
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = {current, pageSize}
|
||||
this.handleShowSizeChange(this.pageInfo)
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>
|
||||
</WeaTop>
|
||||
|
|
@ -556,7 +645,7 @@ export default class SalaryFile extends React.Component {
|
|||
<SlideModalTitle
|
||||
subtitle={"操作记录"}
|
||||
tabs={[
|
||||
{ title: "薪资项目", key: 0 },
|
||||
{ title: "薪资项目", key: 0 }
|
||||
// { title: "个税扣缴义务人", key: 1 },
|
||||
]}
|
||||
editable={false}
|
||||
|
|
@ -572,8 +661,8 @@ export default class SalaryFile extends React.Component {
|
|||
}
|
||||
content={
|
||||
<div>
|
||||
{selectedTab == 0 && <SlideSalaryItem />}
|
||||
{selectedTab == 1 && <SlideAgent />}
|
||||
{selectedTab == 0 && <SlideSalaryItem/>}
|
||||
{selectedTab == 1 && <SlideAgent/>}
|
||||
</div>
|
||||
}
|
||||
onClose={() => this.setState({ recordSlideVisible: false })}
|
||||
|
|
@ -599,7 +688,7 @@ export default class SalaryFile extends React.Component {
|
|||
customOperate={this.renderEditSlideOperate()}
|
||||
/>
|
||||
}
|
||||
content={<SalaryFileViewSlide id={currentId} />}
|
||||
content={<SalaryFileViewSlide id={currentId}/>}
|
||||
onClose={() => this.setState({ editSlideVisible: false })}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({ editSlideVisible: false })}
|
||||
|
|
|
|||
|
|
@ -1,51 +1,79 @@
|
|||
.changeSalaryModal {
|
||||
padding: 10px 20px;
|
||||
.itemWrapper {
|
||||
line-height: 47px;
|
||||
padding: 10px 20px;
|
||||
|
||||
.itemWrapper {
|
||||
line-height: 47px;
|
||||
}
|
||||
|
||||
.contentWrapper {
|
||||
margin-top: 10px;
|
||||
|
||||
.contentTitleWrapper {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
.rightIconWrapper {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.contentWrapper {
|
||||
margin-top: 10px;
|
||||
.contentTitleWrapper {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
.rightIconWrapper {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.tableWrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salaryFileSlide {
|
||||
padding: 10px 20px;
|
||||
.searchBar {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
.tableWrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
padding: 10px 20px;
|
||||
|
||||
.searchBar {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.salaryFileViewSlide {
|
||||
.slideItemWrapper {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.slideItemWrapper {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.salaryFileTabWrapper {
|
||||
.searchPanel {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
bottom: -10px;
|
||||
left: 0px;
|
||||
}
|
||||
.searchPanel {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
bottom: -10px;
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.mySalaryBenefitsWrapper {
|
||||
.archiveRow {
|
||||
background: #F1F3F4;
|
||||
}
|
||||
|
||||
.wea-tab-search-ad-quick {
|
||||
.wea-tab-right-search-ad-quick {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.wea-search-container-search-ad-quick {
|
||||
top: 46px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-tab-search-ad-quick-left {
|
||||
text-align: right;
|
||||
padding-right: 291px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,31 @@
|
|||
import React from 'react'
|
||||
import { Modal, Row, Col } from "antd"
|
||||
import { WeaInput } from 'ecCom'
|
||||
import React from "react";
|
||||
import { Col, Modal, Row } from "antd";
|
||||
import { WeaInput } from "ecCom";
|
||||
|
||||
export default class CopySchemaModal extends React.Component {
|
||||
constructor(props){
|
||||
super(props)
|
||||
this.state = {
|
||||
value : ""
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<Modal title="复制社保方案" footer={this.props.footer} onCancel={() => this.props.onCancel()} visible={this.props.visible}>
|
||||
<Row>
|
||||
<Col span={6}>
|
||||
方案名称
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.state.value} onChange={(v) =>{
|
||||
this.setState({value: v})
|
||||
this.props.onChange(v)}} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: ""
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal title={`复制${this.props.title}`} footer={this.props.footer} onCancel={() => this.props.onCancel()}
|
||||
visible={this.props.visible}>
|
||||
<Row style={{ display: "flex", alignItems: "center" }}>
|
||||
<Col span={8} style={{ textAlign: "center" }}>
|
||||
{`${this.props.title}名称`}
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<WeaInput value={this.state.value} onChange={(v) => {
|
||||
this.setState({ value: v });
|
||||
this.props.onChange(v);
|
||||
}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,57 +1,27 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Row,
|
||||
Col,
|
||||
Switch,
|
||||
Modal,
|
||||
Dropdown,
|
||||
Menu,message
|
||||
} from "antd";
|
||||
import { Button, DatePicker, Dropdown, Menu, message, Modal, Switch } from "antd";
|
||||
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaInputSearch,
|
||||
WeaSlideModal,
|
||||
WeaSelect,
|
||||
WeaTable
|
||||
} from "ecCom";
|
||||
import { WeaRightMenu, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
|
||||
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import CustomTable from "../../../components/customTable";
|
||||
import "./index.less";
|
||||
const WeaMobxTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import ContentWrapper from "../../../components/contentWrapper";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import TipLabel from "../../../components/TipLabel";
|
||||
import DefaultSlideForm from "./defaultSlideForm";
|
||||
import CustomNewModal from "./customNewModal";
|
||||
import { welfareTypeEnum, paymentScopeEnum } from "./enum";
|
||||
import { paymentScopeEnum, welfareTypeEnum } from "./enum";
|
||||
import CustomPaginationTable from "../../../components/customPaginationTable";
|
||||
|
||||
import {
|
||||
socialSecurityColumns,
|
||||
accumulationFundColumns,
|
||||
otherBenefitsColumns,
|
||||
CustomBenefitsColumns,
|
||||
dataSource
|
||||
} from "./columns";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import TwoColContent from "../../../components/twoColContent";
|
||||
import CopySchemaModal from "./copySchemaModal";
|
||||
|
||||
const WeaMobxTable = WeaTableNew.WeaTable;
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
@inject("programmeStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class Programme extends React.Component {
|
||||
|
|
@ -105,7 +75,7 @@ export default class Programme extends React.Component {
|
|||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
|
|
@ -142,9 +112,17 @@ export default class Programme extends React.Component {
|
|||
复制
|
||||
</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onDelete(record);
|
||||
}}>
|
||||
删除
|
||||
</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<i className="icon-coms-more" />
|
||||
<i className="icon-coms-more"/>
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
|
|
@ -160,14 +138,15 @@ export default class Programme extends React.Component {
|
|||
onOk: () => {
|
||||
updateCustomCategoryStatus(record.id, value);
|
||||
},
|
||||
onCancel: () => {}
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getCustomColumns = columns => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
let newColumns = [];
|
||||
newColumns = _.filter(columns, it => it.dataIndex !='operate').map(column => {
|
||||
newColumns = _.filter(columns, it => it.dataIndex != "operate").map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
|
|
@ -196,7 +175,7 @@ export default class Programme extends React.Component {
|
|||
/>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
|
|
@ -218,10 +197,25 @@ export default class Programme extends React.Component {
|
|||
onCopy(record) {
|
||||
this.setState({
|
||||
copyId: record.id,
|
||||
copyModalValue: record.schemeName,
|
||||
copyModalVisible: true
|
||||
});
|
||||
}
|
||||
|
||||
onDelete = (record) => {
|
||||
const { programmeStore: { deleteScheme, deleteLoading } } = this.props;
|
||||
Modal.confirm({
|
||||
title: "确认信息",
|
||||
content: "确认删除本条数据吗?",
|
||||
confirmLoading: deleteLoading,
|
||||
onOk: () => {
|
||||
deleteScheme({ ids: [record.id] });
|
||||
},
|
||||
onCancel: () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onCustomOperatesClick(record, index, operate, flag) {
|
||||
switch (operate.text.toString()) {
|
||||
case "编辑": // 编辑
|
||||
|
|
@ -235,7 +229,7 @@ export default class Programme extends React.Component {
|
|||
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest },
|
||||
taxAgentStore: { showOperateBtn }
|
||||
} = this.props;
|
||||
if(!showOperateBtn){
|
||||
if (!showOperateBtn) {
|
||||
message.warning("请设置编辑权限!");
|
||||
return;
|
||||
}
|
||||
|
|
@ -428,7 +422,7 @@ export default class Programme extends React.Component {
|
|||
"2、新增自定义福利默认启用,社保福利方案中的自定义福利项均未开启缴纳,当前页面的自定义福利项才可以停用;停用后再新增方案时没有该福利项",
|
||||
"3、自定义福利若要缴纳,需要在方案里填写缴纳相关数据"
|
||||
];
|
||||
return <TipLabel tipList={tipList} />;
|
||||
return <TipLabel tipList={tipList}/>;
|
||||
};
|
||||
|
||||
const handleCopyModalSave = () => {
|
||||
|
|
@ -452,7 +446,7 @@ export default class Programme extends React.Component {
|
|||
{/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */}
|
||||
<WeaTop
|
||||
title="社保福利方案" // 文字
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
icon={<i className="icon-coms-meeting"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
|
|
@ -501,35 +495,35 @@ export default class Programme extends React.Component {
|
|||
/>
|
||||
{selectedKey == "custom"
|
||||
? <TwoColContent
|
||||
leftContent={
|
||||
<WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getCustomColumns}
|
||||
onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
||||
/>
|
||||
}
|
||||
rightContent={renderCustomRightContent()}
|
||||
/>
|
||||
leftContent={
|
||||
<WeaMobxTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getCustomColumns}
|
||||
onOperatesClick={this.onCustomOperatesClick.bind(this)}
|
||||
/>
|
||||
}
|
||||
rightContent={renderCustomRightContent()}
|
||||
/>
|
||||
: <CustomPaginationTable
|
||||
loading={loading}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
dataSource={tableDataSource}
|
||||
total={toJS(tablePageInfo).total}
|
||||
current={toJS(tablePageInfo).pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={value => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
const {
|
||||
programmeStore: { form, getTableDatas, selectedKey }
|
||||
} = this.props;
|
||||
getTableDatas(selectedKey, this.pageInfo);
|
||||
}}
|
||||
/>}
|
||||
loading={loading}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
dataSource={tableDataSource}
|
||||
total={toJS(tablePageInfo).total}
|
||||
current={toJS(tablePageInfo).pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={value => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
const {
|
||||
programmeStore: { form, getTableDatas, selectedKey }
|
||||
} = this.props;
|
||||
getTableDatas(selectedKey, this.pageInfo);
|
||||
}}
|
||||
/>}
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{this.state.slideVisiable &&
|
||||
|
|
@ -571,6 +565,7 @@ export default class Programme extends React.Component {
|
|||
|
||||
{this.state.copyModalVisible &&
|
||||
<CopySchemaModal
|
||||
title={_.filter(topTab, it => it.viewcondition === selectedKey)[0].title}
|
||||
visible={this.state.copyModalVisible}
|
||||
value={this.state.copyModalValue}
|
||||
onChange={value => this.setState({ copyModalValue: value })}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import React from "react";
|
||||
import { Modal, Button, Row, Col, Radio, Checkbox } from "antd";
|
||||
import { WeaSelect, WeaBrowser } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Checkbox, Col, Modal, Row } from "antd";
|
||||
import { WeaBrowser, WeaSelect } from "ecCom";
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip";
|
||||
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
|
|
@ -12,7 +11,7 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
this.state = {
|
||||
selectedKey: "EMPLOYEE",
|
||||
checkboxValue: [],
|
||||
ids: "",
|
||||
ids: ""
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -28,8 +27,8 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
employeeStatus: checkboxValue,
|
||||
targetParams: _.map(ids.split(","), (it) => ({
|
||||
targetType: selectedKey,
|
||||
targetId: it,
|
||||
})),
|
||||
targetId: it
|
||||
}))
|
||||
};
|
||||
onTaxAgentSave && onTaxAgentSave(payload);
|
||||
};
|
||||
|
|
@ -39,7 +38,7 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
this.setState({
|
||||
selectedKey: "EMPLOYEE",
|
||||
checkboxValue: [],
|
||||
ids: "",
|
||||
ids: ""
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -66,7 +65,7 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
对象类型
|
||||
<RequiredLabelTip />
|
||||
<RequiredLabelTip/>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<div style={{ display: "inline-block", verticalAlign: "top" }}>
|
||||
|
|
@ -76,7 +75,7 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
...it,
|
||||
key: it.id,
|
||||
showname: it.name,
|
||||
selected: false,
|
||||
selected: false
|
||||
}))}
|
||||
value={this.state.selectedKey}
|
||||
onChange={(value) => {
|
||||
|
|
@ -100,6 +99,16 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
<WeaBrowser
|
||||
type={57}
|
||||
title={"部门选择"}
|
||||
tabs={[
|
||||
{
|
||||
dataParams: { list: "1" },
|
||||
isSearch: true,
|
||||
key: "1",
|
||||
name: "按列表",
|
||||
selected: false,
|
||||
showOrder: 0
|
||||
}
|
||||
]}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
|
|
@ -135,13 +144,13 @@ export default class AddTaxAgentModal extends React.Component {
|
|||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
选择员工状态
|
||||
<RequiredLabelTip />
|
||||
<RequiredLabelTip/>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<CheckboxGroup
|
||||
options={_.map(employeeStatus, (it) => ({
|
||||
label: it.name,
|
||||
value: it.id,
|
||||
value: it.id
|
||||
}))}
|
||||
value={this.state.checkboxValue}
|
||||
onChange={(e) => this.onCheckboxChange(e)}
|
||||
|
|
|
|||
|
|
@ -140,8 +140,9 @@ export default class EditModal extends React.Component {
|
|||
</div>
|
||||
</div>
|
||||
}
|
||||
initLoadCss
|
||||
visible={visible}
|
||||
style={{ width: 800, minHeight: 350 }}
|
||||
style={{ width: 800, height: 450 }}
|
||||
hasScroll>
|
||||
{title.indexOf("编辑") >= 0 && (
|
||||
<WeaTab
|
||||
|
|
|
|||
|
|
@ -108,18 +108,18 @@ export default class TaxAgent extends React.Component {
|
|||
name: b.content
|
||||
}))
|
||||
},
|
||||
viewAttr: current == 1 ? 1 : it.viewAttr
|
||||
viewAttr: (current == 1 || !this.state.permission.isChief) ? 1 : it.viewAttr
|
||||
};
|
||||
} else {
|
||||
if (data[key]) {
|
||||
return {
|
||||
...it,
|
||||
value: data[key],
|
||||
viewAttr: current == 1 ? 1 : it.viewAttr
|
||||
viewAttr: (current == 1 || !this.state.permission.isChief) ? 1 : it.viewAttr
|
||||
};
|
||||
}
|
||||
}
|
||||
return { ...it, viewAttr: current == 1 ? 1 : it.viewAttr };
|
||||
return { ...it, viewAttr: (current == 1 || !this.state.permission.isChief) ? 1 : it.viewAttr };
|
||||
});
|
||||
this.setState(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { action, observable } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from '../apis/welfareScheme'; // 引入API接口文件
|
||||
import * as CumAPI from '../apis/cumDeduct'
|
||||
import { notNull } from '../util/validate';
|
||||
import * as API from "../apis/welfareScheme"; // 引入API接口文件
|
||||
import { notNull } from "../util/validate";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -14,6 +13,7 @@ export class ProgrammeStore {
|
|||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
@observable deleteLoading = false; // 删除加载状态
|
||||
@observable selectedKey = "SOCIAL_SECURITY";
|
||||
@observable customSelectkey = ""
|
||||
@observable defaultPersonDataSource = []; // 默认新增列表DataSource
|
||||
|
|
@ -23,7 +23,7 @@ export class ProgrammeStore {
|
|||
remarks: "",
|
||||
paymentArea: "1"
|
||||
}
|
||||
@observable form = new WeaForm();
|
||||
@observable form = new WeaForm();
|
||||
@observable formCondition = []; // 存储后台得到的form数据
|
||||
@observable customNewVisible = false;
|
||||
@observable customRequest = {}
|
||||
|
|
@ -36,7 +36,7 @@ export class ProgrammeStore {
|
|||
|
||||
@action
|
||||
setCustomSelectkey = customSelectkey => this.customSelectkey = customSelectkey
|
||||
|
||||
|
||||
@action
|
||||
setCustomRequest = customRequest => this.customRequest = customRequest
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ export class ProgrammeStore {
|
|||
@action createScheme = (params) => {
|
||||
params.insuranceScheme.paymentArea = params.insuranceScheme.paymentType;
|
||||
if(!this.valideForm(params)) {
|
||||
return
|
||||
return
|
||||
}
|
||||
console.log("params:", params);
|
||||
API.createScheme(params).then(res => {
|
||||
|
|
@ -211,6 +211,19 @@ export class ProgrammeStore {
|
|||
}
|
||||
})
|
||||
}
|
||||
@action("删除社保数据")
|
||||
deleteScheme = (params) => {
|
||||
this.deleteLoading= true;
|
||||
API.deleteScheme(params).then(res => {
|
||||
this.deleteLoading= false;
|
||||
if(res.status) {
|
||||
message.success("刪除成功")
|
||||
this.getTableDatas(this.selectedKey);
|
||||
} else {
|
||||
message.error(res.errormsg || "刪除失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@action getCustomForm = (params) => {
|
||||
API.getCustomCategoryForm(params).then(res => {
|
||||
|
|
@ -260,7 +273,7 @@ export class ProgrammeStore {
|
|||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 自定义福利启用、停用
|
||||
|
|
@ -295,8 +308,8 @@ export class ProgrammeStore {
|
|||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import moment from 'moment'
|
||||
import { action, observable } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
import moment from "moment";
|
||||
|
||||
import * as API from '../apis/archive'; // 引入API接口文件
|
||||
import { notNull } from '../util/validate'
|
||||
import * as API from "../apis/archive"; // 引入API接口文件
|
||||
import { notNull } from "../util/validate";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -16,49 +16,75 @@ export class salaryFileStore {
|
|||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
|
||||
@observable userStatusList = [];
|
||||
@observable archiveStatusList = [];
|
||||
|
||||
@observable importType = [];
|
||||
@observable previewColumns = [];
|
||||
@observable previewDataSource = [];
|
||||
@observable dataSource = [];
|
||||
@observable detailForm= {}
|
||||
@observable detailForm = {};
|
||||
@observable pageInfo = {}; // 分页数据
|
||||
@observable salaryArchiveTaxAgentForm = {}
|
||||
@observable salaryItemChangeForm = {}
|
||||
@observable taxAgentList = []
|
||||
@observable salaryItemList = []
|
||||
@observable singleSalaryItemList = []
|
||||
@observable singleTaxAgentList = []
|
||||
@observable salaryArchiveTaxAgentForm = {};
|
||||
@observable salaryItemChangeForm = {};
|
||||
@observable taxAgentList = [];
|
||||
@observable salaryItemList = [];
|
||||
@observable singleSalaryItemList = [];
|
||||
@observable singleTaxAgentList = [];
|
||||
|
||||
@observable currentId = ""
|
||||
@observable editAgentVisible = false
|
||||
@observable currentId = "";
|
||||
@observable editAgentVisible = false;
|
||||
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setPreviewDataSource = (previewDataSource) => {
|
||||
this.previewDataSource = previewDataSource
|
||||
}
|
||||
this.previewDataSource = previewDataSource;
|
||||
};
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
doInit = (params) => {
|
||||
// this.getCondition();
|
||||
this.getTableDatas();
|
||||
this.getTableDatas(params);
|
||||
this.getImportTypes();
|
||||
}
|
||||
this.commonEnumList("archive", { enumClass: "com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum" });
|
||||
this.commonEnumList("user", { enumClass: "com.engine.salary.enums.UserStatusEnum" });
|
||||
};
|
||||
|
||||
// 获取导入类型
|
||||
@action
|
||||
getImportTypes = () => {
|
||||
API.getImportTypes().then(res => {
|
||||
if(res.status) {
|
||||
this.importType = res.data
|
||||
if (res.status) {
|
||||
this.importType = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@action("获取档案和人员状态类型")
|
||||
commonEnumList = (type, params) => {
|
||||
API.commonEnumList(params).then(res => {
|
||||
if (res.status) {
|
||||
const data = _.map(res.data, it => ({
|
||||
key: String(it.value),
|
||||
showname: it.defaultLabel
|
||||
}));
|
||||
type === "archive" ? this.archiveStatusList = [{
|
||||
key: "",
|
||||
showname: ""
|
||||
}, ...data] : this.userStatusList = [{
|
||||
key: "",
|
||||
showname: ""
|
||||
}, ...data];
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
|
|
@ -68,121 +94,126 @@ export class salaryFileStore {
|
|||
this.condition = res.condition;
|
||||
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
message.error(res.msg || "接口调用失败!");
|
||||
}
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染table数据1
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
this.loading = true;
|
||||
const formParams = this.form.getFormParams() || {};
|
||||
params = {...formParams, ...params}
|
||||
const { departmentIds = "", positionIds = "", ...extraParams } = params || {};
|
||||
params = {
|
||||
...formParams, ...extraParams,
|
||||
departmentIds: departmentIds ? departmentIds.split(",") : "",
|
||||
positionIds: positionIds ? positionIds.split(",") : ""
|
||||
};
|
||||
API.getArchiveList(params).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.data.dataKey.datas); // table 请求数据
|
||||
this.dataSource = res.data.pageInfo.list.map(item => {
|
||||
item.key = item.id
|
||||
item.key = item.id;
|
||||
return item;
|
||||
})
|
||||
this.pageInfo = res.data.pageInfo
|
||||
});
|
||||
this.pageInfo = res.data.pageInfo;
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
@action doSearch = (params) => {
|
||||
this.getTableDatas(params);
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 导入预览
|
||||
@action
|
||||
importPreview = (params) => {
|
||||
API.importPreview(params).then(res => {
|
||||
if(res.status) {
|
||||
let headers = res.data.headers
|
||||
if (res.status) {
|
||||
let headers = res.data.headers;
|
||||
this.previewColumns = headers.map((item, index) => {
|
||||
return {
|
||||
key: index,
|
||||
title: item,
|
||||
dataIndex: index
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
let list = res.data.list;
|
||||
this.previewDataSource = list.map(item => {
|
||||
let result = {}
|
||||
let result = {};
|
||||
item.map((i, index) => {
|
||||
result[index] = i
|
||||
})
|
||||
result[index] = i;
|
||||
});
|
||||
return result;
|
||||
})
|
||||
});
|
||||
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败")
|
||||
message.error(res.errormsg || "获取数据失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 导入档案
|
||||
@action
|
||||
importSalaryArchive = (params) => {
|
||||
importSalaryArchive = (params, tableParams) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.importSalaryArchive(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
// message.success("导入成功")
|
||||
this.getTableDatas();
|
||||
resolve(res.data)
|
||||
this.getTableDatas({...tableParams});
|
||||
resolve(res.data);
|
||||
} else {
|
||||
message.error(res.errormsg || "接口异常")
|
||||
reject()
|
||||
message.error(res.errormsg || "接口异常");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// 导出档案
|
||||
@action
|
||||
exportSalaryArchive = (ids = "") => {
|
||||
API.exportSalaryArchive(ids)
|
||||
}
|
||||
API.exportSalaryArchive(ids);
|
||||
};
|
||||
|
||||
// 获取详情
|
||||
@action
|
||||
getArchiveForm = (salaryArchiveId) => {
|
||||
API.getArchiveForm({salaryArchiveId}).then(res => {
|
||||
if(res.status) {
|
||||
this.detailForm = res.data
|
||||
API.getArchiveForm({ salaryArchiveId }).then(res => {
|
||||
if (res.status) {
|
||||
this.detailForm = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 个税义务人表单
|
||||
valideTaxAgentForm(params) {
|
||||
if(!notNull(params.effectiveTime)) {
|
||||
message.warning("生效日期不能为空")
|
||||
return false
|
||||
if (!notNull(params.effectiveTime)) {
|
||||
message.warning("生效日期不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.adjustReason)) {
|
||||
message.warning("调整原因不能为空")
|
||||
return false
|
||||
if (!notNull(params.adjustReason)) {
|
||||
message.warning("调整原因不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.taxAgentId)) {
|
||||
message.warning("调整后个税义务人不能为空")
|
||||
return false
|
||||
if (!notNull(params.taxAgentId)) {
|
||||
message.warning("调整后个税义务人不能为空");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -190,158 +221,158 @@ export class salaryFileStore {
|
|||
// 薪资档案-保存个税扣缴义务人调整
|
||||
@action
|
||||
saveTaxAgent = (params) => {
|
||||
if(!this.valideTaxAgentForm(params)) {
|
||||
return
|
||||
if (!this.valideTaxAgentForm(params)) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveTaxAgent(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
resolve()
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "保存失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// 调整-义务扣缴人-调整表单
|
||||
@action
|
||||
getTaxAgentForm = (salaryArchiveId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentForm({salaryArchiveId}).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryArchiveTaxAgentForm = res.data.salaryArchiveTaxAgentForm
|
||||
resolve()
|
||||
API.getTaxAgentForm({ salaryArchiveId }).then(res => {
|
||||
if (res.status) {
|
||||
this.salaryArchiveTaxAgentForm = res.data.salaryArchiveTaxAgentForm;
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
convertForm = (resData) => {
|
||||
let salaryItemChangeForm = {}
|
||||
let salaryItemChangeForm = {};
|
||||
salaryItemChangeForm.adjustReasonList = resData.salaryArchiveItemForm.adjustReasonList.map(item => {
|
||||
item = {...item}
|
||||
item = { ...item };
|
||||
item.key = item.id;
|
||||
item.showname = item.content
|
||||
item.selected = false
|
||||
return item
|
||||
})
|
||||
item.showname = item.content;
|
||||
item.selected = false;
|
||||
return item;
|
||||
});
|
||||
|
||||
salaryItemChangeForm.salaryItemList = resData.salaryArchiveItemDetail.salaryItemList.map(item => {
|
||||
item = {...item}
|
||||
item = { ...item };
|
||||
item.key = item.id;
|
||||
item.showname = item.content
|
||||
item.selected = false
|
||||
return item
|
||||
})
|
||||
|
||||
item.showname = item.content;
|
||||
item.selected = false;
|
||||
return item;
|
||||
});
|
||||
|
||||
salaryItemChangeForm.columns = resData.salaryArchiveItemDetail.columns.map(item => {
|
||||
let result = {}
|
||||
result.title = item
|
||||
if(item == "薪资项目") {
|
||||
result.dataIndex = "salaryItem"
|
||||
result.key = "salaryItem"
|
||||
let result = {};
|
||||
result.title = item;
|
||||
if (item == "薪资项目") {
|
||||
result.dataIndex = "salaryItem";
|
||||
result.key = "salaryItem";
|
||||
}
|
||||
if(item == "调整前") {
|
||||
result.dataIndex = "salaryBefore"
|
||||
result.key = "salaryBefore"
|
||||
if (item == "调整前") {
|
||||
result.dataIndex = "salaryBefore";
|
||||
result.key = "salaryBefore";
|
||||
}
|
||||
if(item == "调整后") {
|
||||
result.dataIndex = "adjustAfter"
|
||||
result.key = "adjustAfter"
|
||||
if (item == "调整后") {
|
||||
result.dataIndex = "adjustAfter";
|
||||
result.key = "adjustAfter";
|
||||
}
|
||||
return result
|
||||
})
|
||||
return result;
|
||||
});
|
||||
|
||||
salaryItemChangeForm.dataSource = resData.salaryArchiveItemDetail.list.map((item, index) => {
|
||||
item = {...item}
|
||||
item.key = (index + 1).toString()
|
||||
return item
|
||||
})
|
||||
item = { ...item };
|
||||
item.key = (index + 1).toString();
|
||||
return item;
|
||||
});
|
||||
|
||||
let effectiveTime = resData.salaryArchiveItemForm.effectiveTime
|
||||
if(effectiveTime) {
|
||||
salaryItemChangeForm.effectiveTime = moment(new Date(effectiveTime)).format("YYYY-MM-DD")
|
||||
let effectiveTime = resData.salaryArchiveItemForm.effectiveTime;
|
||||
if (effectiveTime) {
|
||||
salaryItemChangeForm.effectiveTime = moment(new Date(effectiveTime)).format("YYYY-MM-DD");
|
||||
}
|
||||
|
||||
salaryItemChangeForm.description = resData.salaryArchiveItemForm.description
|
||||
salaryItemChangeForm.adjustReason = resData.salaryArchiveItemForm.adjustReason
|
||||
return salaryItemChangeForm
|
||||
}
|
||||
salaryItemChangeForm.description = resData.salaryArchiveItemForm.description;
|
||||
salaryItemChangeForm.adjustReason = resData.salaryArchiveItemForm.adjustReason;
|
||||
return salaryItemChangeForm;
|
||||
};
|
||||
|
||||
// 薪资档案-获取薪资项目调整表单
|
||||
@action
|
||||
getSalaryItemForm = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getSalaryItemForm({salaryArchiveItemId: id}).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryItemChangeForm = this.convertForm(res.data)
|
||||
resolve()
|
||||
API.getSalaryItemForm({ salaryArchiveItemId: id }).then(res => {
|
||||
if (res.status) {
|
||||
this.salaryItemChangeForm = this.convertForm(res.data);
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 调整记录 个税义务人调整列表
|
||||
@action
|
||||
adjustRecordTaxAgentList = (params) => {
|
||||
API.adjustRecordTaxAgentList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.taxAgentList = res.data
|
||||
if (res.status) {
|
||||
this.taxAgentList = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 调整记录 薪资项目调整记录
|
||||
@action
|
||||
adjustRecordSalaryItemList = (params) => {
|
||||
API.adjustRecordSalaryItemList(params).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) {
|
||||
this.salaryItemList = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// slide 薪资项目列表
|
||||
@action
|
||||
fetchSingleSalaryItemList = (params) => {
|
||||
API.singleSalaryItemList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.singleSalaryItemList = res.data
|
||||
if (res.status) {
|
||||
this.singleSalaryItemList = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// slide 个税义务人列表
|
||||
@action
|
||||
fetchSingleTaxAgentList = (params) => {
|
||||
API.singleTaxAgentList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.singleTaxAgentList = res.data
|
||||
if (res.status) {
|
||||
this.singleTaxAgentList = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 设置当前查看的数据id
|
||||
@action
|
||||
setCurrentId = (id) => this.currentId = id
|
||||
setCurrentId = (id) => this.currentId = id;
|
||||
|
||||
// 设置编辑个税义务人修改表modal
|
||||
@action
|
||||
|
|
@ -351,105 +382,105 @@ export class salaryFileStore {
|
|||
@action
|
||||
getTaxAgentFormByTaxAgentId = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentFormBySalaryArchiveTaxAgentId({salaryArchiveTaxAgentId: id}).then(res => {
|
||||
if(res.status) {
|
||||
let form = res.data.salaryArchiveTaxAgentForm
|
||||
form.effectiveTime = moment(new Date(form.effectiveTime)).format("YYYY-MM-DD")
|
||||
this.salaryArchiveTaxAgentForm = form
|
||||
resolve(form)
|
||||
API.getTaxAgentFormBySalaryArchiveTaxAgentId({ salaryArchiveTaxAgentId: id }).then(res => {
|
||||
if (res.status) {
|
||||
let form = res.data.salaryArchiveTaxAgentForm;
|
||||
form.effectiveTime = moment(new Date(form.effectiveTime)).format("YYYY-MM-DD");
|
||||
this.salaryArchiveTaxAgentForm = form;
|
||||
resolve(form);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
validateSaveSalaryForm = (params) => {
|
||||
if(!notNull(params.salaryArchiveId)) {
|
||||
message.error("档案id不能为空")
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.effectiveTime)) {
|
||||
message.error("生效日期不能为空")
|
||||
return false
|
||||
if (!notNull(params.salaryArchiveId)) {
|
||||
message.error("档案id不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.adjustReason)) {
|
||||
message.error("调整原因不能为空")
|
||||
return false
|
||||
if (!notNull(params.effectiveTime)) {
|
||||
message.error("生效日期不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!params.salaryArchiveItems || params.salaryArchiveItems.length == 0 ) {
|
||||
message.error("调整明细不能为空")
|
||||
return false
|
||||
if (!notNull(params.adjustReason)) {
|
||||
message.error("调整原因不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
for(let i = 0; i < params.salaryArchiveItems.length; i++) {
|
||||
if(!notNull(params.salaryArchiveItems[i].salaryItemId)) {
|
||||
message.error("薪资项目不能为空")
|
||||
if (!params.salaryArchiveItems || params.salaryArchiveItems.length == 0) {
|
||||
message.error("调整明细不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < params.salaryArchiveItems.length; i++) {
|
||||
if (!notNull(params.salaryArchiveItems[i].salaryItemId)) {
|
||||
message.error("薪资项目不能为空");
|
||||
return false;
|
||||
}
|
||||
if(!notNull(params.salaryArchiveItems[i].adjustValue)) {
|
||||
message.error("调整后不能为空")
|
||||
if (!notNull(params.salaryArchiveItems[i].adjustValue)) {
|
||||
message.error("调整后不能为空");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// 保存调薪
|
||||
@action
|
||||
saveSalaryItem = (params) => {
|
||||
if(!this.validateSaveSalaryForm(params)) {
|
||||
return
|
||||
if (!this.validateSaveSalaryForm(params)) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveSalaryItem(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功")
|
||||
resolve()
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "保存失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// 调整=薪资项目调整-获取调整前的值
|
||||
@action
|
||||
getSalaryItemAdjustBeforeValue = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getSalaryItemAdjustBeforeValue(params).then(res => {
|
||||
if(res.status) {
|
||||
resolve(res.data)
|
||||
if (res.status) {
|
||||
resolve(res.data);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject(res.errormsg)
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject(res.errormsg);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 调整-薪资项目-编辑获取表单
|
||||
@action
|
||||
getSalaryItemFormByItemId = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getSalaryItemFormByItemId({salaryArchiveItemId: id}).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryItemChangeForm = this.convertForm(res.data)
|
||||
resolve(this.salaryItemChangeForm)
|
||||
API.getSalaryItemFormByItemId({ salaryArchiveItemId: id }).then(res => {
|
||||
if (res.status) {
|
||||
this.salaryItemChangeForm = this.convertForm(res.data);
|
||||
resolve(this.salaryItemChangeForm);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue