Merge branch 'fenquan' into release-zhongjiang
This commit is contained in:
commit
0ce5d93199
|
|
@ -68,7 +68,7 @@ export default class ImportModal extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { step, slideDataSource } = this.props;
|
||||
const { step, slideDataSource, isInit } = this.props;
|
||||
return (
|
||||
<Modal title="数据导入" visible={this.props.visiable}
|
||||
onCancel={this.props.onCancel}
|
||||
|
|
@ -84,6 +84,7 @@ export default class ImportModal extends React.Component {
|
|||
</div>
|
||||
{
|
||||
this.props.step == 0 && (<ModalStep1
|
||||
isInit={ isInit }
|
||||
templateLink={this.props.templateLink}
|
||||
headerSetCompoent={this.props.headerSetCompoent}
|
||||
formComponent={this.props.renderFormComponent && this.props.renderFormComponent()}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ export default class ModalStep1 extends React.Component {
|
|||
|
||||
render() {
|
||||
const { datetime, taxAgentId, hasData } = this.state
|
||||
const { taxAgentStore: {taxAgentOption} } = this.props;
|
||||
const { taxAgentStore: {taxAgentOption}, isInit } = this.props;
|
||||
let downloadExtra= '';
|
||||
if(isInit){
|
||||
downloadExtra= hasData === '1' ? `&hasData=true` : `&hasData=false`;
|
||||
}
|
||||
const dragger = {
|
||||
name: 'file',
|
||||
multiple: false,
|
||||
|
|
@ -84,19 +88,22 @@ export default class ModalStep1 extends React.Component {
|
|||
<p>1. 第一步,请选择导出的Excel文件或
|
||||
{
|
||||
(typeof this.props.templateLink) == "string" ?
|
||||
<a href={`${this.props.templateLink}&hasData=${hasData === '1' ? true : false}`}>点击这里下载模板</a>
|
||||
<a href={`${this.props.templateLink}${downloadExtra}`}>点击这里下载模板</a>
|
||||
:
|
||||
<a onClick={() => {this.props.templateLink()}}>点击这里下载模板</a>
|
||||
}
|
||||
|
||||
{this.props.headerSetCompoent && this.props.headerSetCompoent };
|
||||
<WeaCheckbox
|
||||
value={hasData}
|
||||
content="导出现有数据"
|
||||
helpfulTip="提示:建议先导出现有最新数据,修改后再导入"
|
||||
style={{ marginLeft: 10 }}
|
||||
onChange={(hasData)=> this.setState({hasData})}
|
||||
/>
|
||||
{
|
||||
this.props.isInit &&
|
||||
<WeaCheckbox
|
||||
value={hasData}
|
||||
content="导出现有数据"
|
||||
helpfulTip="提示:建议先导出现有最新数据,修改后再导入"
|
||||
style={{ marginLeft: 10 }}
|
||||
onChange={(hasData)=> this.setState({hasData})}
|
||||
/>
|
||||
}
|
||||
</p>
|
||||
<p>2. 第二步,请一定要确定Excel文档中的格式是模板中的格式,没有被修改掉;</p>
|
||||
<p>3. 第三步,选择填写好的Excel文档,点击“下一步”按钮进行数据预览;</p>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default class EditSlideContent extends React.Component {
|
|||
<div className="titleWrapper">
|
||||
{
|
||||
this.props.salaryYearMonth != "" &&
|
||||
<div className="slideLeftTitle">考勤周期: {moment(this.props.salaryYearMonth + "-01").startOf("month").format("YYYY-MM-DD")} 至 {moment(this.props.salaryYearMonth + "-01").endOf("month").format("YYYY-MM-DD")}</div>
|
||||
<div className="slideLeftTitle">考勤周期: {this.props.salaryYearMonth}</div>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ export default class Attendance extends React.Component {
|
|||
handleViewAttendance(record) {
|
||||
const { attendanceStore: {setSlideVisiable}} = this.props;
|
||||
this.recordId = record.id
|
||||
this.salaryYearMonth = record.salaryYearMonth
|
||||
this.salaryYearMonth = record.attendCycle
|
||||
setSlideVisiable(true)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,27 @@ export default class SalaryItemForm extends React.Component {
|
|||
setItemGroups(newItemGroups)
|
||||
}
|
||||
|
||||
// 修改列表数据顺序
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
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)
|
||||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible, baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
const { previewVisible } = this.state;
|
||||
|
||||
|
||||
return (
|
||||
<div className="salaryItemForm">
|
||||
<div className="btnBar">
|
||||
|
|
@ -119,10 +136,11 @@ export default class SalaryItemForm extends React.Component {
|
|||
{
|
||||
itemGroups && itemGroups.map(item => {
|
||||
if(item.items) {
|
||||
item.items && item.items.map(i => {i.key = i.id})
|
||||
return (
|
||||
<CanMoveItem disabled={canEdit !== "true"} dataSource={toJS(item.items)} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
<CanMoveItem disabled={canEdit !== "true"} dataSource={toJS(item.items)}
|
||||
onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}}
|
||||
title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,9 +56,11 @@ export default class AddSalaryItemModal extends React.Component {
|
|||
let selectItems = []
|
||||
|
||||
addSalaryItemDataSource.map(item => {
|
||||
item = {...item}
|
||||
selectedRowKeys.map(key => {
|
||||
if(item.id == key) {
|
||||
item.salaryItemId = item.id
|
||||
item.key = item.id
|
||||
selectItems.push(item)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -127,11 +127,6 @@ export default class CanMoveItem extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
handleTableDrop = (datas) => {
|
||||
// TODO
|
||||
console.log("datas:", datas);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {disabled, ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
|
||||
const { selectedRowKeys, formalModalVisible, addCategoryVisible } = this.state;
|
||||
|
|
@ -181,8 +176,10 @@ export default class CanMoveItem extends React.Component {
|
|||
moveRow: record,
|
||||
})}
|
||||
pagination={false}
|
||||
onDrop={(datas) => this.handleTableDrop(datas)}
|
||||
draggable={true}/>
|
||||
onDrop={(datas) => this.props.onDataSourceChange(datas)}
|
||||
draggable={true}
|
||||
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.addItemVisible && <AddSalaryItemModal
|
||||
|
|
|
|||
|
|
@ -32,6 +32,42 @@ export default class ShowSettingForm extends React.Component {
|
|||
setSalaryTemplateShowSet(request);
|
||||
}
|
||||
|
||||
handleDownClick(index) {
|
||||
const {payrollStore: {salaryItemSet, setSalaryItemSet}} = this.props
|
||||
let downItem = salaryItemSet[index + 1];
|
||||
let thisItem = salaryItemSet[index]
|
||||
let resultSet = [...salaryItemSet]
|
||||
resultSet[index] = downItem;
|
||||
resultSet[index + 1] = thisItem;
|
||||
setSalaryItemSet(resultSet)
|
||||
}
|
||||
|
||||
handleUpClick(index) {
|
||||
const {payrollStore: {salaryItemSet, setSalaryItemSet}} = this.props
|
||||
let upItem = salaryItemSet[index - 1]
|
||||
let thisItem = salaryItemSet[index]
|
||||
let resultSet = [...salaryItemSet]
|
||||
resultSet[index] = upItem
|
||||
resultSet[index - 1] = thisItem;
|
||||
setSalaryItemSet(resultSet)
|
||||
}
|
||||
|
||||
handleDeleteItem(group, item) {
|
||||
const { payrollStore : {salaryItemSet, setSalaryItemSet}} = this.props;
|
||||
console.log("item:", item);
|
||||
let resultSalaryItemSet = [...salaryItemSet]
|
||||
resultSalaryItemSet.map(sourceGroup => {
|
||||
if(sourceGroup.id == group.id) {
|
||||
sourceGroup.items.map((sourceItem, index) => {
|
||||
if(sourceItem.id == item.id) {
|
||||
sourceGroup.items.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
setSalaryItemSet(resultSalaryItemSet)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { payrollStore } = this.props;
|
||||
const { salaryTemplateShowSet } = payrollStore;
|
||||
|
|
@ -132,12 +168,24 @@ export default class ShowSettingForm extends React.Component {
|
|||
<div className="itemTitle">薪资项目设置</div>
|
||||
<div className="itemContent">
|
||||
{
|
||||
salaryItemSet.map(group => (
|
||||
salaryItemSet.map((group, index) => (
|
||||
<div className="configItemWrapper">
|
||||
<div className="configTitle">{group.groupName}</div>
|
||||
<div className="configTitle">{group.groupName}
|
||||
{
|
||||
index < salaryItemSet.length - 1 &&
|
||||
<Icon type="caret-down" style={{marginLeft: "10px" , cursor: "pointer"}}
|
||||
onClick={() => {this.handleDownClick(index)}}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
index > 0 && <Icon type="caret-up" style={{marginLeft: "10px", cursor: 'pointer'}}
|
||||
onClick={() => {this.handleUpClick(index)}}/>
|
||||
}
|
||||
</div>
|
||||
<div className="configContent">
|
||||
{group.items.map(item => (
|
||||
<span className="editItem">{item.name}</span>
|
||||
<span className="editItem">{item.name} <Icon type="cross" style={{cursor: "pointer"}} onClick={() => {this.handleDeleteItem(group, item)}}/></span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
|
||||
import {
|
||||
Button,
|
||||
|
|
@ -24,6 +25,8 @@ import {
|
|||
WeaHelpfulTip,
|
||||
} from "ecCom";
|
||||
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
import ContentWrapper from "../../components/contentWrapper";
|
||||
|
|
@ -57,6 +60,7 @@ export default class SalaryFile extends React.Component {
|
|||
selectedTab: 0,
|
||||
editSlideVisible: false,
|
||||
importType: "",
|
||||
isInit: false, //是否是初始化导入
|
||||
modalVisiable: false,
|
||||
step: 0,
|
||||
recordSlideVisible: false,
|
||||
|
|
@ -231,6 +235,14 @@ export default class SalaryFile extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
showColumn = () => {
|
||||
const { salaryFileStore: { tableStore } } = this.props;
|
||||
console.log("showColumn:", tableStore.setColSetVisible(true));
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
console.log("showColumn:")
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const {
|
||||
|
|
@ -302,12 +314,12 @@ export default class SalaryFile extends React.Component {
|
|||
title: "信息确认",
|
||||
content: `若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入,点击确定继续导入`,
|
||||
onOk: () => {
|
||||
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
|
||||
this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 });
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
} else {
|
||||
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
|
||||
this.setState({ importType: e.key, isInit: false, modalVisiable: true, step: 0 });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -432,10 +444,15 @@ export default class SalaryFile extends React.Component {
|
|||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
<WeaTableComx
|
||||
style={{display: "none"}}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
/>
|
||||
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
|
|
@ -445,7 +462,7 @@ export default class SalaryFile extends React.Component {
|
|||
total={pageInfo.total}
|
||||
current={pageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
scroll={{x: 2300}}
|
||||
scroll={{x: this.getColumns().length ? this.getColumns().length * 150 : 1200}}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value)
|
||||
}}
|
||||
|
|
@ -462,6 +479,7 @@ export default class SalaryFile extends React.Component {
|
|||
init={() => {
|
||||
this.handleInitModal();
|
||||
}}
|
||||
isInit={this.state.isInit}
|
||||
params={{}}
|
||||
columns={previewColumns}
|
||||
step={step}
|
||||
|
|
|
|||
|
|
@ -425,8 +425,9 @@ export default class Programme extends React.Component {
|
|||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={this.state.customEdit ? "修改社保方案": "新增社保方案"}
|
||||
subtitle={this.state.customEdit ? "修改": "新增"}
|
||||
subTabs={[{title: "基础设置"}]}
|
||||
editable={true}
|
||||
onSave={() => {
|
||||
handleOnSave();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,15 @@ export class LedgerStore {
|
|||
};
|
||||
|
||||
@action
|
||||
setItemGroups = (itemGroups) => (this.itemGroups = itemGroups);
|
||||
setItemGroups = (itemGroups) => {
|
||||
itemGroups = itemGroups ? [...itemGroups] : []
|
||||
itemGroups && itemGroups.map(item => {
|
||||
if(item.items) {
|
||||
item.items && item.items.map(i => {i.key = i.id})
|
||||
}
|
||||
})
|
||||
this.itemGroups = itemGroups
|
||||
};
|
||||
|
||||
@action
|
||||
addItemGroup = (name) => {
|
||||
|
|
@ -687,13 +695,14 @@ export class LedgerStore {
|
|||
API.getLedgerItemForm({ salarySobId: this.salarySobId }).then((res) => {
|
||||
if (res.status) {
|
||||
this.empFields = res.data.empFields;
|
||||
this.itemGroups = res.data.itemGroups;
|
||||
let itemGroups = res.data.itemGroups;
|
||||
let defaultItems = {
|
||||
id: "default",
|
||||
name: "未分类",
|
||||
items: res.data.items,
|
||||
};
|
||||
this.itemGroups.unshift(defaultItems);
|
||||
itemGroups.unshift(defaultItems);
|
||||
this.setItemGroups(itemGroups)
|
||||
API.empFieldList().then((ires) => {
|
||||
if (res.status) {
|
||||
this.empBrowserList = ires.data.map((item) => {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ export class payrollStore {
|
|||
@action
|
||||
setSalaryTemplateShowSet = (salaryTemplateShowSet) => this.salaryTemplateShowSet = salaryTemplateShowSet
|
||||
|
||||
@action
|
||||
setSalaryItemSet = (salaryItemSet) => this.salaryItemSet = salaryItemSet
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue