修复bug

This commit is contained in:
MustangDeng 2022-05-10 15:31:13 +08:00
parent ca2f9d6319
commit b2d5b1a90c
25 changed files with 229 additions and 76 deletions

View File

@ -154,3 +154,18 @@ export const detailFormual = params => {
// *** 公式 end ***
// 列出可以删除的薪资项目
export const listCanDelete = params => {
return fetch('/api/bs/hrmsalary/salaryitem/listCanDelete', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}

View File

@ -1,6 +1,6 @@
import React from "react"
import successImg from "./success.svg"
import { Button, Table } from "antd"
import { Button, Table, Spin } from "antd"
import { WeaTable } from 'ecCom'
export default class ModalStep3 extends React.Component {
@ -20,11 +20,18 @@ export default class ModalStep3 extends React.Component {
return (
<div style={{textAlign: "center", marginTop: "10px", overflow: "hidden", height: "550px", display:"flex", flexFlow: "column" }}>
<div style={{flex: "1",display: "flex", flexFlow: "column"}}>
<div style={{marginTop: "20px"}}>
<img src={successImg} style={{marginBottom: "10px"}} />
<div style={{fontSize: "20px", marginBottom: "10px"}}>数据导入完成</div>
<div>已导入 <span style={{color: "red"}}> {importResult.successCount} </span> <span style={{color: "green"}}> {importResult.errorCount} </span></div>
</div>
{
importResult.successCount === undefined ?
<div style={{textAlign: "center", marginTop: "20px"}}>
<Spin />
正在导入请稍后...
</div>
: <div style={{marginTop: "20px"}}>
<img src={successImg} style={{marginBottom: "10px"}} />
<div style={{fontSize: "20px", marginBottom: "10px"}}>数据导入完成</div>
<div>已导入 <span style={{color: "red"}}> {importResult.successCount} </span> <span style={{color: "green"}}> {importResult.errorCount} </span></div>
</div>
}
<div style={{marginTop: "20px", maxHeight: "300px", overflowY: "scroll"}} >
{
<WeaTable columns={this.columns} dataSource={importResult.errorData} pagination={false}/>

View File

@ -64,11 +64,17 @@ export default class PlaceOnFileDetail extends React.Component {
onDetail() {
this.setState({slideVisiable: true})
}
// 分页
handleDataPageChange(value) {
const { calculateStore: {acctResultList}} = this.props;
acctResultList(this.id, this.props.employeeName, value)
}
render() {
const { calculateStore } = this.props;
const { baseSalarySobCycle, acctResultListDateSource, acctResultListColumns } = calculateStore
const { baseSalarySobCycle, acctResultListDateSource, acctResultListColumns, acctResultListPageInfo } = calculateStore
const menu = (
<Menu>
@ -111,7 +117,15 @@ export default class PlaceOnFileDetail extends React.Component {
/>
</div>
<div className="tableWrapper">
<WeaTable columns={this.getColumns()} dataSource={acctResultListDateSource} />
<WeaTable columns={this.getColumns()}
scroll={{x: this.getColumns().length * 100}}
dataSource={acctResultListDateSource}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
total: acctResultListPageInfo.total,
current: acctResultListPageInfo.pageNum
}}
/>
</div>
{

View File

@ -138,6 +138,7 @@ export default class SalaryDetail extends React.Component {
<CustomTable
loading={loading}
dataSource={acctResultListDateSource} columns={this.getColumns()}
scroll={{x: this.getColumns().length * 100}}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
total: acctResultListPageInfo.total,

View File

@ -128,6 +128,7 @@ export default class EditSlideContent extends React.Component {
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>

View File

@ -128,6 +128,7 @@ export default class EditSlideContent extends React.Component {
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>

View File

@ -125,7 +125,10 @@ export default class CumSituation extends React.Component {
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
let newColumns = [];
if(!columns) {
return []
}
newColumns = columns.map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => { //前端元素转义
@ -142,9 +145,11 @@ export default class CumSituation extends React.Component {
}
return newColumn;
});
console.log("newColumns: ", newColumns);
return newColumns;
}
handleCancel() {
const { cumSituationStore } = this.props;
const { modalVisiable, setModalVisiable, setStep } = cumSituationStore
@ -300,6 +305,7 @@ export default class CumSituation extends React.Component {
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
scroll={{x: this.getColumns(tableStore.columns).length * 100}}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
</WeaTop>

View File

@ -128,6 +128,7 @@ export default class EditSlideContent extends React.Component {
comsWeaTableStore={slideTableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
scroll={{x: slideTableStore.columns.length * 100}}
/>
</div>
</div>

View File

@ -96,10 +96,13 @@ export default class SalaryItemForm extends React.Component {
</div>
{
itemGroups && itemGroups.map(item => {
item.items.map(i => {i.key = i.id})
return (
<CanMoveItem dataSource={item.items} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}}title={item.name} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
)
if(item.items) {
item.items.map(i => {i.key = i.id})
return (
<CanMoveItem dataSource={item.items} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}}title={item.name} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
)
}
return ""
}
)
}

View File

@ -80,10 +80,18 @@ export default class MySalary extends React.Component {
mySalaryBillList(range.map(item => moment(item).format("YYYY-MM")))
}
handleTabChange(selectedKey) {
if(selectedKey == "2") {
const { mySalaryStore: {getRecordList}} = this.props;
getRecordList()
}
}
render() {
const { mySalaryStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = mySalaryStore;
const { tabIndex, myBillTableStore, myBillDataSource } = mySalaryStore
const { tabIndex, myBillTableStore, myBillDataSource, recordListColumns, recordListDataSource, recordListPageInfo } = mySalaryStore
const { salaryBillVisible } = this.state;
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
@ -115,10 +123,10 @@ export default class MySalary extends React.Component {
title: "工资单",
viewcondition: "0"
},
{
title: "社保福利",
viewcondition: "1"
},
// {
// title: "社保福利",
// viewcondition: "1"
// },
{
title: "薪酬记录",
viewcondition: "2"
@ -152,6 +160,8 @@ export default class MySalary extends React.Component {
}
return (
<div className="mySalaryBenefitsWrapper">
<WeaRightMenu
@ -171,6 +181,7 @@ export default class MySalary extends React.Component {
renderSearchOperationItem()
}
onChange={(v) => {
this.handleTabChange(v)
this.setState({selectedKey: v})
}}
/>
@ -179,11 +190,11 @@ export default class MySalary extends React.Component {
this.state.selectedKey == '0' &&
<CustomTable loading={loading} columns={this.getColumns()} dataSource={myBillDataSource ? myBillDataSource : []}/>
}
{
{/* {
this.state.selectedKey == '1' && <WeaTable columns={socialSecurityBenefitsColumns} dataSource={dataSource} scroll={{ x: 1000}}/>
}
} */}
{
this.state.selectedKey == '2' && <WeaTable columns={salaryRecordColumns} dataSource={dataSource}/>
this.state.selectedKey == '2' && <WeaTable columns={recordListColumns} dataSource={recordListDataSource}/>
}
</WeaTop>

View File

@ -75,14 +75,16 @@ export default class PayrollModal extends React.Component {
borderRight: "1px solid #f2f2f2",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
whiteSpace: "nowrap",
height: "35px"
}}>{item.name}</Col>
<Col span={ 4 } className="contentItem"
style={{
borderRight: (index + 1) % 3 == 0 ? "none": "1px solid #f2f2f2",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
whiteSpace: "nowrap",
height: "35px"
}}
>{item.salaryItemValue}</Col>
</Col>
@ -126,7 +128,8 @@ export default class PayrollModal extends React.Component {
borderBottom: (index + 1) > 3 ? "1px solid #f2f2f2" : "none",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
whiteSpace: "nowrap",
height: "35px"
}}>{item.name}</Col>
<Col span={ 4 } className="contentItem"
style={{
@ -134,7 +137,8 @@ export default class PayrollModal extends React.Component {
borderBottom: (index + 1) > 3 ? "1px solid #f2f2f2" : "none",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
whiteSpace: "nowrap",
height: "35px"
}}
>{item.salaryItemValue}</Col>
</Col>

View File

@ -1,6 +1,6 @@
import React from 'react'
import { inject, observer } from 'mobx-react';
import { Table, Menu, Dropdown } from 'antd'
import { Table, Menu, Dropdown, message } from 'antd'
import { WeaTable } from 'ecCom'
import moment from 'moment'
@ -33,8 +33,13 @@ export default class SalarySendList extends React.Component {
// 更新模板
handleUpdateTemplate(record) {
window.open("")
let templateRecord = {}
templateRecord.id = record.templateId;
if(!record.templateId) {
message.warning("请设置默认模板")
return
}
this.props.onEditTemplate && this.props.onEditTemplate(templateRecord)
}
// 页面跳转

View File

@ -217,12 +217,12 @@ export default class Payroll extends React.Component {
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
},
// {
// key: 'BTN_COLUMN',
// icon: <i className='icon-coms-Custom' />,
// content: '显示列定制',
// onClick: this.showColumn
// },
];
const collectParams = { // 收藏功能配置
favname: '工资单发放',
@ -332,7 +332,11 @@ export default class Payroll extends React.Component {
/>
{
this.state.selectedKey == 0 &&
<SalarySendList />
<SalarySendList
onEditTemplate={(record) => {
this.handleTemplateListEdit(record)
}}
/>
// <WeaTable columns={columns} dataSource={dataSource}/>
}
@ -345,6 +349,7 @@ export default class Payroll extends React.Component {
onCopy={(record) => {
this.handleTemplateListCopy(record)
}}
onDelete={(record)=> this.handleTemplateListDelete(record)}
/>
}

View File

@ -137,7 +137,7 @@ export default class PayrollGrant extends React.Component {
<Menu.Item key="2">批量撤回</Menu.Item>
<Menu.Item key="3">全部导出</Menu.Item>
<Menu.Item key="3">导出选中</Menu.Item>
<Menu.Item key="3">自定义列</Menu.Item>
{/* <Menu.Item key="3">自定义列</Menu.Item> */}
</Menu>
);
return (

View File

@ -31,9 +31,11 @@ export default class ComputerTemplate extends React.Component {
<div className="titleWrapper">
{this.salaryTemplateShowSet.theme.replace("${companyName}", "上海泛微").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))}
</div>
<div className="background-wrapper">
<img className="background-img" src={this.salaryTemplateShowSet.background} />
</div>
{
this.salaryTemplateShowSet.background && <div className="background-wrapper">
<img className="background-img" src={this.salaryTemplateShowSet.background} />
</div>
}
<div className="sobItemDiv" style={{margin: "20px auto"}}>
{

View File

@ -34,10 +34,12 @@ export default class PhoneTemplate extends React.Component {
<div className="titleWrapper">
{this.salaryTemplateShowSet.theme.replace("${companyName}", "上海泛微").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))}
</div>
<div className="background-wrapper">
<img className="background-img" src={this.salaryTemplateShowSet.background} />
</div>
{
this.salaryTemplateShowSet.background && <div className="background-wrapper">
<img className="background-img" src={this.salaryTemplateShowSet.background} />
</div>
}
<div className="sobItemDiv" style={{margin: "20px auto"}}>
{

View File

@ -1,6 +1,6 @@
import React from 'react'
import { inject, observer } from 'mobx-react';
import { Radio } from 'antd'
import { Radio, Spin } from 'antd'
import { WeaTableNew } from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
@ -46,8 +46,10 @@ export default class TemplateSettingList extends React.Component {
// 默认使用配置
recordItemChange(record) {
const { payrollStore } = this.props;
const { changePayrollDefaultUse } = payrollStore;
changePayrollDefaultUse(record.id)
const { changePayrollDefaultUse, getPayrollTemplateList } = payrollStore;
changePayrollDefaultUse(record.id).then(() => {
getPayrollTemplateList()
})
}
// 增加编辑功能重写columns绑定事件
@ -71,9 +73,14 @@ export default class TemplateSettingList extends React.Component {
render() {
const { payrollStore } = this.props;
const { templateStore } = payrollStore;
const { templateStore, loading } = payrollStore;
return (
<div>
{ loading ?
<div style={{width: '100%', textAlign: "center"}}>
<Spin />
</div>
:
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={templateStore} // table store
hasOrder={true} // 是否启用排序
@ -81,6 +88,8 @@ export default class TemplateSettingList extends React.Component {
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
}
</div>
)
}

View File

@ -44,7 +44,8 @@ export default class SalaryFile extends React.Component {
recordSlideVisible: false,
selectedRowKeys: [],
showSearchBar: false,
importResult: {}
importResult: {},
searchValue: ""
}
}
@ -163,6 +164,13 @@ export default class SalaryFile extends React.Component {
form.updateFields({ current: value })
getTableDatas()
}
// 搜索
handleSearch(value) {
const { salaryFileStore: {getTableDatas, form}} = this.props;
form.updateFields({username: value})
getTableDatas()
}
render() {
const { salaryFileStore } = this.props;
@ -251,8 +259,10 @@ export default class SalaryFile extends React.Component {
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu}>导入</Dropdown.Button>
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu2} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.setState({recordSlideVisible: true})}}>调薪记录</Button>
<WeaInputSearch />
<Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({
searchValue: value
})}} onSearch={(value) => {this.handleSearch(value)}}/>
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
</div>
)
}

View File

@ -106,7 +106,8 @@ export default class CustomSalaryItemSlide extends React.Component {
<Col span={4}>取值方式<RequiredLabelTip /></Col>
<Col span={20}>
<Radio.Group disabled={isAdd ? false : true} value={valueType} onChange={(e) => {
this.handleChange({valueType: e.target.value})
this.handleChange({valueType: e.target.value, formulaId: null, formulaContent: ""})
}}>
<Radio key={1} value={"1"}>输入</Radio>
<Radio key={2} value={"2"}>公式</Radio>
@ -116,7 +117,7 @@ export default class CustomSalaryItemSlide extends React.Component {
</Row>
{
( valueType == 2 || valueType == 3 ) && <Row className="formItem">
<Col span={4}>公式</Col>
<Col span={4}>公式<RequiredLabelTip /></Col>
<Col span={20}>
<div style={{width: "100%", lineHeight: '30px', minHeight: "30px", border: "1px solid rgb(217, 217, 217)"}}
onClick={() => this.handleShowFormal()}

View File

@ -220,7 +220,7 @@ export default class FormalFormModal extends React.Component {
searchGroup && searchGroup.map(item => {
return <div style={{height: "25px", lineHeight: '25px', cursor: "pointer", overflow: "hidden"}} key={item.key} onClick={() => {this.handleItemClick(item)}}>
{item.value}
<Icon type="right" style={{float: "right", marginLeft: "10px", color: "#eee"}}/>
<Icon type="right" style={{float: "right", marginLeft: "10px", color: "#eee", marginTop: "9px"}}/>
<span style={{color: "#999", float: 'right'}}>{item.value} 的字段</span>
</div>
})

View File

@ -56,8 +56,10 @@ export default class SalaryItem extends React.Component {
componentWillMount() { // 初始化渲染页面
const { salaryItemStore: { doInit }} = this.props;
const { salaryItemStore: { doInit, listCanDelete }} = this.props;
doInit();
listCanDelete();
}
onEditItem(record, isedit) {
@ -117,7 +119,8 @@ export default class SalaryItem extends React.Component {
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
return (
if(record.canDelete) {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
<a onClick={() => {
@ -127,8 +130,10 @@ export default class SalaryItem extends React.Component {
</Menu>}>
<i className="icon-coms-more"></i>
</Dropdown>
);
);
} else {
return ""
}
}
})

View File

@ -451,11 +451,16 @@ export class LedgerStore {
this.loading = true
API.listSalaryItem({name:searchValue, excludeIds, current}).then(res => {
if(res.status) {
this.addSalaryItemDataSource = res.data.list.map(item => {
item = {...item}
item.key = item.id
return item;
});
if(res.data.list) {
this.addSalaryItemDataSource = res.data.list.map(item => {
item = {...item}
item.key = item.id
return item;
});
} else {
this.addSalaryItemDataSource = []
}
this.addSalaryItemColumns = res.data.columns;
this.addSalaryItemPageInfo = res.data
// this.salaryItemTableStore.getDatas(res.data.datas);
@ -482,15 +487,17 @@ export class LedgerStore {
let itemGroups = [...this.itemGroups]
itemGroups = itemGroups.map(item => {
let result = {...item}
result.items = result.items.map((i,index) => (
{
salaryItemId: i.salaryItemId,
sortedIndex: index + 1,
formulaId: i.formulaId
}
))
return result;
})
if(result.items) {
result.items = result.items.map((i,index) => (
{
salaryItemId: i.salaryItemId,
sortedIndex: index + 1,
formulaId: i.formulaId
}
))
return result;
}
}).filter(item => item)
let params = {
salarySobId: this.salarySobId,

View File

@ -27,6 +27,11 @@ export class MySalaryStore {
// 工资单详情
@observable mySalaryBill = {};
// 调薪记录
@observable recordListColumns = [];
@observable recordListDataSource = [];
@observable recordListPageInfo = {}
@action
initParams = () => {
let month = moment().format("YYYY-MM")
@ -119,5 +124,16 @@ export class MySalaryStore {
}
})
}
@action
getRecordList = (params = {}) => {
API.recordList(params).then(res => {
if(res.status) {
this.recordListColumns = res.data.columns
this.recordListDataSource = res.data.list ? res.data.list : []
this.recordListPageInfo = res.data
}
})
}
}

View File

@ -113,12 +113,14 @@ export class payrollStore {
// 工资单模板-工资单模板列表
@action
getPayrollTemplateList = (params = {}) => {
this.loading = true
API.getPayrollTemplateList(params).then(res => {
if(res.status) {
this.templateStore.getDatas(res.data.datas);
} else {
message.error(res.errormsg || "获取失败");
}
this.loading = false;
})
}
@ -296,12 +298,16 @@ export class payrollStore {
let params = {
id
}
API.changePayrollDefaultUse(params).then(res => {
if(res.status) {
message.success("设置成功");
} else {
message.success(res.errormsg || "设置失败")
}
return new Promise((resolve, reject) => {
API.changePayrollDefaultUse(params).then(res => {
if(res.status) {
message.success("设置成功");
resolve()
} else {
message.success(res.errormsg || "设置失败")
reject()
}
})
})
}

View File

@ -34,6 +34,9 @@ export class SalaryItemStore {
@observable tableDataSource = []; // 主列表
@observable tableColumns = []; // 主列表列
@observable pageInfo = {}; // 分页数据
// 可以删除的项目
@observable canDeleteList = []
// ** 公式 **
// 类型列表
@ -229,6 +232,11 @@ export class SalaryItemStore {
message.warning("取值方式不能为空")
return false;
}
if((params.valueType == 2 || params.valueType == 3) && !notNull(params.formulaId)) {
message.warning("公式不能为空")
return false;
}
return true
}
@ -310,4 +318,17 @@ export class SalaryItemStore {
})
}
//
@action
listCanDelete = (params = {}) => {
API.listCanDelete(params).then(res => {
if(res.status) {
this.canDeleteList = res.data
console.log("this.canDeleteList: ", this.canDeleteList);
} else {
message.error(res.errormsg || "获取失败")
}
})
}
}