Merge branch 'release' into release-zhongjiang

This commit is contained in:
liyongshun 2022-06-23 16:35:33 +08:00
commit 7e1ed1b848
33 changed files with 1425 additions and 1084 deletions

View File

@ -1,20 +1,32 @@
import React from 'react'
import { WeaTable } from 'ecCom'
import { Spin } from 'antd'
/*
* Author: 黎永顺
* Description:
* Date: 2022-06-21 14:27:29
* LastEditTime: 2022-06-21 15:05:12
*/
import React from "react";
import { WeaTable } from "ecCom";
import { Spin, Table } from "antd";
import "./index.less";
export default class CustomTable extends React.Component {
render() {
return (
<div>
{
this.props.loading ?
<div style={{textAlign: 'center'}}>
<Spin />
</div>
:
<WeaTable {...this.props}/>
}
render() {
const { loading, isWeaTable = true } = this.props;
return (
<div>
{loading
? <div style={{ textAlign: "center" }}>
<Spin />
</div>
)
}
}
: isWeaTable
? <WeaTable {...this.props} />
: <Table
{...this.props}
size="middle"
className="wea-new-table antd-wrap"
bordered
/>}
</div>
);
}
}

View File

@ -0,0 +1,11 @@
.antd-wrap {
.ant-table-tbody {
tr {
td {
white-space: nowrap;
height: 41px !important;
border-bottom: 1px solid #e2e2e2 !important;
}
}
}
}

View File

@ -38,7 +38,7 @@ export default class SlideModalTitle extends React.Component {
<div className="btnWrapper">
{this.props.btns}
{
this.state.editable && <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
this.props.showOperateBtn && this.state.editable && <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
}
{this.props.customOperate}
</div>

View File

@ -26,7 +26,7 @@ import CustomPaginationTable from "../../components/customPaginationTable";
const { RangePicker } = DatePicker;
@inject("calculateStore")
@inject("calculateStore", "taxAgentStore")
@observer
export default class Calculate extends React.Component {
constructor(props) {
@ -111,7 +111,7 @@ export default class Calculate extends React.Component {
handleDeleteItem(record) {
Modal.confirm({
title: "信息确认",
content: "确认删除",
content: "确认删除本条数据吗?",
onOk: () => {
const { calculateStore: { deleteSalaryacct } } = this.props;
deleteSalaryacct([record.id]).then(() => {
@ -148,10 +148,10 @@ export default class Calculate extends React.Component {
// 获取列表
getColumns() {
const { calculateStore: { salaryListColumns } } = this.props;
const { calculateStore: { salaryListColumns }, taxAgentStore: { showOperateBtn } } = this.props;
let columns = [...salaryListColumns];
columns.map(item => {
if (item.title == "操作") {
if (item.title == "操作" && showOperateBtn ) {
item.render = (text, record) => {
const accountBtn = _.filter(record.operate, it => it.text == "核算");
const notAccountBtn = _.filter(record.operate, it => it.text != "核算");
@ -205,7 +205,7 @@ export default class Calculate extends React.Component {
)}
</Menu>
}>
<i className="icon-coms-more" />
<i className="icon-coms-more" style={{ color: "#4d7ad8", cursor: "pointer" }}/>
</Dropdown>
);
}
@ -242,7 +242,7 @@ export default class Calculate extends React.Component {
}
render() {
const { calculateStore } = this.props;
const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
salaryListDataSource,
salaryListColumns,
@ -303,15 +303,18 @@ export default class Calculate extends React.Component {
const { startDate, endDate } = this.state;
return (
<div style={{ display: "inline-block" }}>
<Button
type="primary"
style={{ marginRight: "10px" }}
// onClick={() => window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail")}
onClick={() => {
this.setState({ baseFormVisible: true });
}}>
核算
</Button>
{
showOperateBtn &&
<Button
type="primary"
style={{ marginRight: "10px" }}
// onClick={() => window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail")}
onClick={() => {
this.setState({ baseFormVisible: true });
}}>
核算
</Button>
}
<div
style={{ display: "inline-block", position: "relative", top: 2 }}>
<RangePicker

View File

@ -13,7 +13,7 @@ import { inject, observer } from 'mobx-react';
import CustomTable from '../../components/customTable'
import CustomPaginationTable from '../../components/customPaginationTable'
@inject('calculateStore')
@inject('calculateStore', 'taxAgentStore')
@observer
export default class SalaryDetail extends React.Component {
constructor(props) {
@ -128,7 +128,7 @@ export default class SalaryDetail extends React.Component {
render() {
const { slideVisiable } = this.state;
const { calculateStore } = this.props;
const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props;
const { acctResultListDateSource, acctResultListColumns, baseSalarySobCycle, acctResultListPageInfo, loading } = calculateStore
return (
<div className="salaryDetail">
@ -162,6 +162,7 @@ export default class SalaryDetail extends React.Component {
this.pageInfo.current = value
this.handleDataPageChange(value)
}}
isWeaTable={false}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = {current, pageSize}
this.handleShowSizeChange(this.pageInfo)
@ -180,6 +181,7 @@ export default class SalaryDetail extends React.Component {
<SlideModalTitle
subtitle={"编辑薪资"}
editable={true}
showOperateBtn={showOperateBtn}
onSave={() => this.handleEditSlideSave()}
/>
}

View File

@ -449,6 +449,7 @@ export default class UserSure extends React.Component {
this.pageInfo.current = value;
this.handleUserListPageChange(value);
}}
isWeaTable={false}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = { current, pageSize };
this.handleShowSizeChange(this.pageInfo);
@ -456,6 +457,7 @@ export default class UserSure extends React.Component {
/>}
{this.state.selectedKey == 1 &&
<CustomPaginationTable
isWeaTable={false}
dataSource={reducedemployeeListDataSource}
columns={reducedemployeeListColumns}
total={reducedemployeeListPageInfo.total}

View File

@ -1,72 +1,115 @@
import React from 'react';
import { Row, Col, Table, DatePicker } from "antd"
import { inject, observer } from 'mobx-react';
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect, WeaCheckbox, WeaTable } from "ecCom";
import { slideColumns, slideDataSource, columns } from './columns';
import "./editSlideContent.less"
import React from "react";
import { Row, Col, Table, DatePicker } from "antd";
import { inject, observer } from "mobx-react";
import {
WeaInput,
WeaTextarea,
WeaSearchGroup,
WeaSelect,
WeaCheckbox,
WeaTable
} from "ecCom";
import { slideColumns, slideDataSource, columns } from "./columns";
import "./editSlideContent.less";
// import { WeaTableNew } from "comsMobx"
// const WeaTable = WeaTableNew.WeaTable;
import moment from 'moment'
import moment from "moment";
const { MonthPicker } = DatePicker;
let emptyItem = {
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00"
}
incomeLowerLimit: "0.00",
incomeUpperLimit: "0.00",
dutyFreeValue: "0.00",
dutyFreeRate: "0.00",
taxableIncomeLl: "0.00",
taxableIncomeUl: "0.00",
taxRate: "0.00",
taxDeduction: "0.00"
};
@inject('attendanceStore')
@inject("attendanceStore")
@observer
export default class EditSlideContent extends React.Component {
constructor(props) {
super(props);
}
constructor(props) {
super(props);
}
componentWillMount() {
// 初始化渲染页面
const { attendanceStore: { viewAttendQuote } } = this.props;
viewAttendQuote({ attendQuoteId: this.props.id });
}
componentWillMount() { // 初始化渲染页面
const {attendanceStore: {viewAttendQuote}} = this.props;
viewAttendQuote({attendQuoteId: this.props.id})
}
getColumns(columns) {
let result = [...columns];
return result.filter(item => item.hide == "false");
}
getColumns(columns) {
let result = [...columns]
return result.filter(item => item.hide == "false")
}
getScrollWidth() {
const { attendanceStore } = this.props;
const { attendQuoteDetailTableStore } = attendanceStore;
return (
this.getColumns(
attendQuoteDetailTableStore.columns
? attendQuoteDetailTableStore.columns
: []
).length * 150
);
}
getScrollWidth() {
const { attendanceStore } = this.props;
const { attendQuoteDetailTableStore} = attendanceStore;
return this.getColumns(attendQuoteDetailTableStore.columns ? attendQuoteDetailTableStore.columns : []).length * 150
}
render() {
const {
attendanceStore,
attendanceStore: { viewAttendQuote }
} = this.props;
const {
attendQuoteDetailPageInfo,
attendQuoteDetailTableStore
} = attendanceStore;
render() {
const { attendanceStore } = this.props;
const { attendQuoteDetailPageInfo, attendQuoteDetailTableStore} = attendanceStore;
return (
<div className="attendSlide">
<div className="titleWrapper">
{
this.props.salaryYearMonth != "" &&
<div className="slideLeftTitle">考勤周期 {this.props.salaryYearMonth}</div>
}
</div>
<div>
<WeaTable
columns={this.getColumns(attendQuoteDetailTableStore.columns ? attendQuoteDetailTableStore.columns : [])}
dataSource={attendQuoteDetailPageInfo.list ? attendQuoteDetailPageInfo.list : []}
scroll={{x: this.getScrollWidth()}}
/>
</div>
</div>
)
}
}
const pagination = {
total: attendQuoteDetailPageInfo.total,
showTotal: total => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
viewAttendQuote({ attendQuoteId: this.props.id, current, pageSize });
},
onChange: current => {
viewAttendQuote({
attendQuoteId: this.props.id,
current,
pageSize: attendQuoteDetailPageInfo.pageSize
});
}
};
return (
<div className="attendSlide">
<div className="titleWrapper">
{this.props.salaryYearMonth != "" &&
<div className="slideLeftTitle">
考勤周期 {this.props.salaryYearMonth}
</div>}
</div>
<div>
<WeaTable
columns={this.getColumns(
attendQuoteDetailTableStore.columns
? attendQuoteDetailTableStore.columns
: []
)}
dataSource={
attendQuoteDetailPageInfo.list
? attendQuoteDetailPageInfo.list
: []
}
pagination={pagination}
scroll={{ x: this.getScrollWidth() }}
/>
</div>
</div>
);
}
}

View File

@ -30,7 +30,7 @@ const { RangePicker } = DatePicker;
const { Option } = Select
@inject('attendanceStore')
@inject('attendanceStore', 'taxAgentStore')
@observer
export default class Attendance extends React.Component {
constructor(props) {
@ -223,8 +223,13 @@ export default class Attendance extends React.Component {
viewAttendQuote(request)
}
handleExportAttendQuote= ()=>{
const url= `${window.location.origin}/api/bs/hrmsalary/attendQuote/export?attendQuoteId=${this.recordId}`
window.open(url, '_self');
}
render() {
const { attendanceStore } = this.props;
const { attendanceStore, taxAgentStore: {showOperateBtn} } = this.props;
const { modalParam } = this.state;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = attendanceStore;
const { step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, attendTableStore, fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList } = attendanceStore;
@ -274,10 +279,11 @@ export default class Attendance extends React.Component {
}];
const renderSearchOperationItem = () => {
return <div>
const { taxAgentStore: { showOperateBtn } } = this.props;
return showOperateBtn ? <div>
<Button type="primary" style={{ marginRight: '10px' }} onClick={() => { this.setState({ refereAttendFormVisible: true }) }}>引用</Button>
<Button type="default" onClick={() => { this.setState({ modalVisiable: true}); setStep(0) }}>导入</Button>
</div>
</div> : null
}
@ -351,8 +357,13 @@ export default class Attendance extends React.Component {
const renderCustomOperate = () => {
return (
<div style={{display: "inline-block"}}>
<Dropdown.Button overlay={menu} type="primary">导出</Dropdown.Button>
{
showOperateBtn &&
<Button type="primary" onClick={this.handleExportAttendQuote}>导出全部</Button>
// <Dropdown.Button onClick={this.handleExportAttendQuote} overlay={menu} type="primary" visible={ false }>导出全部</Dropdown.Button>
}
<WeaInputSearch
style={{ marginLeft: 10 }}
placeholder="请输入姓名/部门/工号/手机号"
onChange={(v) => {this.setState({searchValue: v})}}
onSearch={(v) => {this.handleSearch({keyword: v})}}
@ -376,7 +387,10 @@ export default class Attendance extends React.Component {
const renderRightOperation = () => {
return (
<div style={{display: "inline-block"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => handleNewClick()}>新建</Button>
{
showOperateBtn &&
<Button type="primary" style={{marginRight: "10px"}} onClick={() => handleNewClick()}>新建</Button>
}
<WeaInputSearch value={this.state.fieldName} onChange={(value) => {this.setState({fieldName: value})}} onSearch={(value) => {
this.setState({fieldSettingSearchValue: value})
handleItemSearch(value)
@ -387,7 +401,7 @@ export default class Attendance extends React.Component {
const menu = (
<Menu>
<Menu.Item key="1">导出全部</Menu.Item>
<Menu.Item key="1">导出选中</Menu.Item>
</Menu>
);
@ -431,7 +445,7 @@ export default class Attendance extends React.Component {
return <a onClick={() => {this.onItemEdit(record)}}
dangerouslySetInnerHTML={{ __html: valueSpan }} />
case "enableStatus":
return <Switch checked={text == '1'} onChange={(value) => {handleSwitchItemChange(record, value)}}/>
return <Switch checked={text == '1'} disabled={!showOperateBtn} onChange={(value) => {handleSwitchItemChange(record, value)}}/>
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
}
@ -663,6 +677,7 @@ export default class Attendance extends React.Component {
<SlideModalTitle
subtitle={"考勤数据"}
editable={false}
showOperateBtn={showOperateBtn}
customOperate={
renderCustomOperate()
}

View File

@ -31,7 +31,7 @@ export default class ItemMangeFormModal extends React.Component {
this.setState({request: result})
}
convertFieldType(fileTypeStr) {
convertFieldType=(fileTypeStr)=> {
if(fileTypeStr == "数值") {
return "1"
} else if(fileTypeStr == "文本"){
@ -57,7 +57,7 @@ export default class ItemMangeFormModal extends React.Component {
]
const { request } = this.state;
const {fieldName, fieldType, enableStatus, description} = request
let fileTypeKey = convertFieldType(fieldType)
let fileTypeKey = this.convertFieldType(fieldType)
const { attendanceStore : {currentItemOperate}} = this.props;
return (
<Modal width={600} visible={this.props.visible} onCancel={this.props.onCancel}

View File

@ -295,7 +295,7 @@ export default class CumDeduct extends React.Component {
previewImport,
importFile,
} = cumDeductStore;
const { taxAgentOption } = taxAgentStore;
const { taxAgentOption, showOperateBtn } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
@ -429,13 +429,14 @@ export default class CumDeduct extends React.Component {
const pagination = {
total: pageObj.total,
showTotal: (total) => `${total}`,
pageSizeOptions: ["10", "20", "50", "100"],
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
taxAgentId: taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -444,7 +445,7 @@ export default class CumDeduct extends React.Component {
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
taxAgentId: taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -487,7 +488,7 @@ export default class CumDeduct extends React.Component {
),
};
} else {
return { ...item };
return { ...item, width: 150 };
}
});
@ -502,7 +503,7 @@ export default class CumDeduct extends React.Component {
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
buttons={btns}>
buttons={showOperateBtn ? btns : []}>
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
@ -575,7 +576,8 @@ export default class CumDeduct extends React.Component {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
showOperateBtn={showOperateBtn}
btns={showOperateBtn ? renderBtns() : null}
/>
}
content={

View File

@ -43,5 +43,15 @@
text-decoration: none;
}
}
}
}
.wea-new-table {
.ant-table-tbody {
tr {
td {
height: 41px !important;
border-bottom: 1px solid #e2e2e2 !important;
}
}
}
}

View File

@ -293,7 +293,7 @@ export default class CumSituation extends React.Component {
previewImport,
importFile,
} = cumSituationStore;
const { taxAgentOption } = taxAgentStore;
const { taxAgentOption, showOperateBtn } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
@ -436,12 +436,13 @@ export default class CumSituation extends React.Component {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -450,7 +451,7 @@ export default class CumSituation extends React.Component {
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -509,7 +510,7 @@ export default class CumSituation extends React.Component {
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={btns}>
buttons={showOperateBtn ? btns : []}>
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
@ -580,7 +581,8 @@ export default class CumSituation extends React.Component {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
showOperateBtn={showOperateBtn}
btns={showOperateBtn ? renderBtns() : null}
/>
}
content={

View File

@ -284,7 +284,7 @@ export default class OtherDeduct extends React.Component {
previewImport,
importFile,
} = otherDeductStore;
const { taxAgentOption } = taxAgentStore;
const { taxAgentOption, showOperateBtn } = taxAgentStore;
const {
slideVisiable,
setSlideVisiable,
@ -432,12 +432,13 @@ export default class OtherDeduct extends React.Component {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
taxAgentIdL:taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -446,7 +447,7 @@ export default class OtherDeduct extends React.Component {
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
taxAgentId:taxAgentId==='All' ? '' : taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
@ -502,7 +503,7 @@ export default class OtherDeduct extends React.Component {
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={btns}>
buttons={showOperateBtn ? btns : []}>
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
@ -573,7 +574,8 @@ export default class OtherDeduct extends React.Component {
this.state.currentOperate == "add" ? doSave() : doUpdate();
}}
editable={false}
btns={renderBtns()}
showOperateBtn={showOperateBtn}
btns={showOperateBtn ? renderBtns() : null}
/>
}
content={

View File

@ -160,7 +160,7 @@ export default class Declare extends React.Component {
}
render() {
const { declareStore } = this.props;
const { declareStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
loading,
hasRight,
@ -222,15 +222,17 @@ export default class Declare extends React.Component {
defaultValue={[this.state.startDate, this.state.endDate]}
onChange={(value) => this.handleRangePickerChange(value)}
/>
<Button
type="primary"
style={{ marginLeft: "10px" }}
onClick={() => {
this.setState({ declarationModalVisible: true });
}}>
生成申报单
</Button>
{
showOperateBtn &&
<Button
type="primary"
style={{ marginLeft: "10px", position: "relative", top: '-2px' }}
onClick={() => {
this.setState({ declarationModalVisible: true });
}}>
生成申报单
</Button>
}
</div>
);
};

View File

@ -1,6 +1,12 @@
/*
* Author: 黎永顺
* Description:
* Date: 2022-06-20 13:53:14
* LastEditTime: 2022-06-21 13:30:00
*/
import React from "react";
import { Modal, Button, Row, Col } from "antd";
import { WeaInput, WeaSelect } from "ecCom";
import { WeaInput, WeaSelect, WeaError } from "ecCom";
export default class CopyFormModal extends React.Component {
constructor(props) {
@ -23,6 +29,14 @@ export default class CopyFormModal extends React.Component {
<Button
type="primary"
onClick={() => {
if (!this.state.name) {
this.refs.weaNameError.showError();
return;
}
if (!this.state.taxAgentId) {
this.refs.weaTaxAgentError.showError();
return;
}
this.props.onSave({
name: this.state.name,
taxAgentId: this.state.taxAgentId
@ -34,27 +48,36 @@ export default class CopyFormModal extends React.Component {
<Row style={{ display: "flex", alignItems: "center" }}>
<Col span={6}>账套名称</Col>
<Col span={18}>
<WeaInput
style={{ width: "200px" }}
value={this.state.name}
onChange={value => {
this.setState({ name: value });
}}
/>
<WeaError tipPosition="bottom" ref="weaNameError" error="账套名称不能为空">
<WeaInput
style={{ width: "200px" }}
value={this.state.name}
onChange={value => {
this.setState({ name: value });
!value && this.refs.weaNameError.showError();
}}
/>
</WeaError>
</Col>
</Row>
<Row style={{ display: "flex", alignItems: "center" }}>
<Col span={6}>个税扣缴义务人</Col>
<Col span={18}>
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200, marginTop: 10 }}
options={taxAgentOption}
value={this.state.taxAgentId}
onChange={value => {
this.setState({ taxAgentId: value });
}}
/>
<WeaError
tipPosition="bottom"
ref="weaTaxAgentError"
error="请选择个税扣缴义务人">
<WeaSelect
showSearch // 设置select可搜索
style={{ width: 200, marginTop: 10 }}
options={taxAgentOption}
value={this.state.taxAgentId}
onChange={value => {
this.setState({ taxAgentId: value });
!value && this.refs.weaTaxAgentError.showError();
}}
/>
</WeaError>
</Col>
</Row>
</Modal>

View File

@ -231,6 +231,7 @@ export default class Ledger extends React.Component {
setShowSearchAd,
baseInfoRequest,
} = ledgerStore;
const { showOperateBtn }= taxAgentStore;
const { canEdit } = baseInfoRequest;
const { currentStep, selectedTab } = this.state;
if (!hasRight && !loading) {
@ -273,12 +274,15 @@ export default class Ledger extends React.Component {
const renderRightOperation = () => {
return (
<div style={{ display: "inline-block" }}>
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleNew()}>
新建
</Button>
{
showOperateBtn &&
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleNew()}>
新建
</Button>
}
<WeaInputSearch
value={this.state.searchValue}
onChange={(value) => {
@ -359,6 +363,7 @@ export default class Ledger extends React.Component {
total: pageObj.total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({ current, pageSize, name: this.state.searchValue });
@ -394,13 +399,14 @@ export default class Ledger extends React.Component {
render: (text, record) => (
<Switch
checked={text == 0}
disabled={!showOperateBtn}
onChange={(value) => {
this.handleItemStatusChange(value, record);
}}
/>
),
};
} else if (item.dataIndex === "operate") {
} else if (item.dataIndex === "operate" && showOperateBtn) {
return {
...item,
render: (text, record) => (
@ -577,6 +583,7 @@ export default class Ledger extends React.Component {
{ title: "薪资项目", key: 2 },
{ title: "调薪计薪规则", key: 3 },
]}
showOperateBtn={showOperateBtn}
editable={canEdit === "true"}
selectedTab={selectedTab}
onSave={() => this.handleEditSlideSave()}

View File

@ -81,8 +81,13 @@ export default class MySalary extends React.Component {
// 区间改变事件
handleSalaryRangePickerChange(range) {
const { mySalaryStore : {mySalaryBillList}} = this.props;
this.range = range.map(item => moment(item).format("YYYY-MM"))
mySalaryBillList(this.range, this.pageInfo)
const isNull= _.every(range, it=> !!it)
if(!_.isEmpty(range) && isNull){
this.range = range.map(item => moment(item).format("YYYY-MM"))
mySalaryBillList(this.range, this.pageInfo)
}else{
mySalaryBillList([], this.pageInfo)
}
}

View File

@ -1,131 +1,180 @@
import React from 'react'
import { inject, observer } from 'mobx-react';
import { Table, Menu, Dropdown, message } from 'antd'
import { WeaTable } from 'ecCom'
import moment from 'moment'
import React from "react";
import { inject, observer } from "mobx-react";
import { Table, Menu, Dropdown, message } from "antd";
import { WeaTable } from "ecCom";
import moment from "moment";
import CustomTable from "../../components/customTable";
import CustomPaginationTable from "../../components/customPaginationTable";
import CustomTable from '../../components/customTable';
import CustomPaginationTable from '../../components/customPaginationTable'
@inject('payrollStore')
@inject("payrollStore", "taxAgentStore")
@observer
export default class SalarySendList extends React.Component {
constructor(props) {
super(props)
this.searchParams = {salaryYearMonth: this.props.salaryYearMonth}
this.pageInfo = {current: 1, pageSize: 10}
constructor(props) {
super(props);
this.searchParams = { salaryYearMonth: this.props.salaryYearMonth };
this.pageInfo = { current: 1, pageSize: 10 };
}
componentWillMount() {
const { payrollStore: { getPayrollList } } = this.props;
getPayrollList();
}
// 发放回调
handleGrant(record) {
window.open(
"/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=" +
record.id
);
}
// 查看详情
handleShowDetail(record) {
window.open(
"/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollDetail?id=" +
record.id
);
}
// 更新模板
handleUpdateTemplate(record) {
let templateRecord = {};
templateRecord.id = record.templateId;
if (!record.templateId) {
message.warning("请设置默认模板");
return;
}
this.props.onEditTemplate && this.props.onEditTemplate(templateRecord);
}
// 获取表头数据
getColumns() {
const {
payrollStore: { salarySendTableStore },
taxAgentStore: { showOperateBtn }
} = this.props;
const { columns } = salarySendTableStore;
if (!columns) {
return [];
}
componentWillMount() {
const { payrollStore: {getPayrollList} } = this.props;
getPayrollList()
}
// 发放回调
handleGrant(record) {
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=" + record.id)
}
// 查看详情
handleShowDetail(record) {
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollDetail?id=" + record.id)
}
// 更新模板
handleUpdateTemplate(record) {
let templateRecord = {}
templateRecord.id = record.templateId;
if(!record.templateId) {
message.warning("请设置默认模板")
return
}
this.props.onEditTemplate && this.props.onEditTemplate(templateRecord)
}
// 获取表头数据
getColumns() {
const {payrollStore : {salarySendTableStore}} = this.props;
const{ columns } = salarySendTableStore
if(!columns) {
return [];
}
let result = columns.filter(item => item.hide == "false")
result.map(item => {
if(item.dataIndex == "salaryYearMonth") {
item.render = (text, record) => {
return <span>{moment(parseInt(text)).format("YYYY-MM")}</span>
}
} else if(item.dataIndex == "lastSendTime") {
item.render = (text, record) => {
return <span>{moment(parseInt(text)).format("YYYY-MM-DD HH:mm:ss")}</span>
}
let result = columns.filter(item => item.hide == "false");
result.map(item => {
if (item.dataIndex == "salaryYearMonth") {
item.render = (text, record) => {
return (
<span>
{moment(parseInt(text)).format("YYYY-MM")}
</span>
);
};
} else if (item.dataIndex == "lastSendTime") {
item.render = (text, record) => {
return (
<span>
{moment(parseInt(text)).format("YYYY-MM-DD HH:mm:ss")}
</span>
);
};
}
});
showOperateBtn
? (result = result.concat([
{
title: "操作",
key: "operate",
render: (text, record) => {
return (
<a
onClick={() => {
this.handleGrant(record);
}}>
发放
</a>
);
}
})
return result
.concat([
{
title: "操作",
key: "operate",
render: (text, record) => {
return (
<a onClick={() => {this.handleGrant(record)}}>发放</a>
)
}
},
{
title : '',
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
<a onClick={() => {
this.handleShowDetail(record)
}}>查看详情</a>
</Menu.Item>
<Menu.Item>
<a onClick={() => {
this.handleUpdateTemplate(record)
}}>更新模板</a>
</Menu.Item>
</Menu>}>
<i className="icon-coms-more"></i>
</Dropdown>
);
}
}
])
}
},
{
title: "",
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
return (
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a
onClick={() => {
this.handleShowDetail(record);
}}>
查看详情
</a>
</Menu.Item>
render() {
const { payrollStore } = this.props;
const { salarySendTableStore, salarySendDataSource, pageInfo, loading } = payrollStore;
return (
<div>
<CustomPaginationTable
loading={loading}
columns={this.getColumns()}
dataSource={salarySendDataSource}
total={pageInfo.total}
current={pageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
onPageChange={(value) => {
this.pageInfo.current = value
this.props.handleListDataPageChange(value, this.pageInfo)
}}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = {current, pageSize}
this.props.handleListShowSizeChange(this.pageInfo)
}}
/>
</div>
)
}
}
<Menu.Item>
<a
onClick={() => {
this.handleUpdateTemplate(record);
}}>
更新模板
</a>
</Menu.Item>
</Menu>
}>
<i className="icon-coms-more" />
</Dropdown>
);
}
}
]))
: (result = result.concat([
{
title: "操作",
key: "operate",
render: (text, record) => {
return (
<a
onClick={() => {
this.handleShowDetail(record);
}}>
查看详情
</a>
);
}
}
]));
return result;
}
render() {
const { payrollStore } = this.props;
const {
salarySendTableStore,
salarySendDataSource,
pageInfo,
loading
} = payrollStore;
return (
<div>
<CustomPaginationTable
loading={loading}
columns={this.getColumns()}
dataSource={salarySendDataSource}
total={pageInfo.total}
current={pageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
onPageChange={value => {
this.pageInfo.current = value;
this.props.handleListDataPageChange(value, this.pageInfo);
}}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = { current, pageSize };
this.props.handleListShowSizeChange(this.pageInfo);
}}
/>
</div>
);
}
}

View File

@ -23,7 +23,7 @@ import SalarySendList from './SalarySendList'
const { RangePicker } = DatePicker;
@inject('payrollStore')
@inject('payrollStore', 'taxAgentStore')
@observer
export default class Payroll extends React.Component {
constructor(props) {
@ -225,7 +225,7 @@ export default class Payroll extends React.Component {
}
render() {
const { payrollStore } = this.props;
const { payrollStore, taxAgentStore: { showOperateBtn } } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = payrollStore;
const { currentStep, selectedTab, templateSearchValue, templateSelect } = this.state
if (!hasRight && !loading) { // 无权限处理
@ -279,7 +279,10 @@ export default class Payroll extends React.Component {
} else if(this.state.selectedKey == "1") {
return (
<div style={{display: "inline-block"}}>
<Button type="primary" onClick={() => {this.setState({stepSlideVisible: true})}}>新建</Button>
{
showOperateBtn &&
<Button type="primary" onClick={() => {this.setState({stepSlideVisible: true})}}>新建</Button>
}
{
this.state.initSelected && <WeaSelect options={this.state.ledgerOptions} style={{width: "200px", marginLeft: "10px", marginRight: "10px"}} value={templateSelect} onChange={(value) => {this.handleTemplateSelectChange(value)}}/>
}
@ -372,7 +375,7 @@ export default class Payroll extends React.Component {
onCopy={(record) => {
this.handleTemplateListCopy(record)
}}
showOperateBtn={showOperateBtn}
onDelete={(record)=> this.handleTemplateListDelete(record)}
/>
}
@ -428,6 +431,7 @@ export default class Payroll extends React.Component {
tabs={[{title: '基础设置', key: 0}, {title: "显示设置", key: 1}]}
editable={false}
selectedTab={selectedTab}
showOperateBtn={showOperateBtn}
customOperate={<span>
{
selectedTab == 0 && <Button type="primary" onClick={() => {this.handleUpdateSave()}}>保存</Button>

View File

@ -92,10 +92,12 @@ export default class PayrollDetail extends React.Component {
}
// 导出全部
handleExportAll() {
const { payrollStore } = this.props;
const { exportDetailList } = payrollStore
exportDetailList({salarySendId: this.state.currentId})
handleExportAll=()=> {
// const { payrollStore } = this.props;
// const { exportDetailList } = payrollStore
// exportDetailList({salarySendId: this.state.currentId})
const url= `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${this.state.currentId}`
window.open(url, '_self');
}
getSearchsAdQuick() {
@ -112,7 +114,8 @@ export default class PayrollDetail extends React.Component {
</Menu>
);
return (
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
// <Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
<Button type="primary" onClick={this.handleExportAll}>导出全部</Button>
)
// return (<div></div>)
}

View File

@ -113,17 +113,13 @@ export default class PayrollGrant extends React.Component {
getColumns() {
const { payrollStore } = this.props;
const { salaryGrantTableStore } = payrollStore
const { columns } = salaryGrantTableStore;
if(!columns) {
return []
}
const { salaryGrantTableStore: columns } = payrollStore
let result = columns.filter(item => item.hide == "false").map(item => {
let result = [...columns, {title: "操作",key: "operation",dataIndex: "operation"}].map(item => {
item = {...item}
if(item.dataIndex == "operation") {
item.render = (text,record) => {
if(text == 'ALREADYSEND') {
if(record.sendStatus == '已发放') {
return (
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
)
@ -162,13 +158,9 @@ export default class PayrollGrant extends React.Component {
);
return (
<div style={{display: "inline-block"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleGrantAll()}} disabled={!this.state.btnStatus.can_send}>全部发放</Button>
{
this.state.btnStatus.show_workflow_status && <Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleGrantProxy()}}>发起流程</Button>
}
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Button>
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>更多</Dropdown.Button>
<Button type="primary" style={{marginRight: "1rem"}} onClick={() => {this.handleGrantAll()}}>全部发放</Button>
<Button type="default" style={{marginRight: "1rem"}} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Button>
<Dropdown.Button style={{marginRight: "1rem"}} overlay={menu}>更多</Dropdown.Button>
</div>
)
}
@ -236,7 +228,7 @@ export default class PayrollGrant extends React.Component {
<div className="titleBarLeft">
<span>薪资所属月{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
<WeaHelpfulTip
style={{marginLeft: '10px', marginRight: "10px"}}
style={{marginLeft: '1rem', marginRight: "1rem"}}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate} ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n

View File

@ -1,181 +1,246 @@
import React from 'react'
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom"
import { payrollGrantColumns, dataSource } from "../columns"
import { Menu, Button,Table, Modal, Dropdown,message } from "antd"
import { inject, observer } from 'mobx-react';
import React from "react";
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom";
import { payrollGrantColumns, dataSource } from "../columns";
import { Menu, Button, Table, Modal, Dropdown, message } from "antd";
import { inject, observer } from "mobx-react";
@inject('payrollStore')
@inject("payrollStore")
@observer
export default class payrollGrantModal extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
current: 1,
searchValue: ""
}
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, batchSendInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchSendInfoList({salarySendId: this.props.sendId})
})
}
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
current: 1,
searchValue: ""
};
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, batchSendInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchSendInfoList({ salarySendId: this.props.sendId });
});
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll, batchSendInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchSendInfoList({salarySendId: this.props.sendId})
})
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll, batchSendInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchSendInfoList({ salarySendId: this.props.sendId });
});
}
componentWillMount() {
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({salarySendId: this.props.sendId})
}
componentWillMount() {
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({ salarySendId: this.props.sendId });
}
getColumns() {
const { payrollStore } = this.props;
const { canGrantColumns } = payrollStore
if(!canGrantColumns) {
return []
}
return canGrantColumns.map(item => {
let result = {}
result.title = item.text;
result.dataIndex = item.column;
result.key = item.column;
result.width = item.width;
if(result.key == "operation") {
result.render = (text,record) => {
if(text == 'ALREADYSEND') {
return (
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
)
} else {
return (
<a onClick={() => {this.handleGrant(record)}}>发送</a>
)
}
}
} else {
result.dataIndex = item.column;
}
return result;
})
}
onSelectChange = (value) => {
this.setState({
selectedRowKeys: value
})
}
// 发放
fetchGrantPayRoll(payload) {
const { payrollStore: { grantPayroll }} = this.props;
grantPayroll(payload).then(() => {
const { payrollStore: {getInfoList}} = this.props;
getInfoList({
salarySendId:this.props.sendId
})
this.props.onCancel && this.props.onCancel()
})
}
handleMenuClick(e) {
const { selectedRowKeys } = this.state;
const { payrollStore: { grantPayroll }} = this.props;
if(selectedRowKeys.length == 0) {
message.warning("未选择条目");
return
}
this.fetchGrantPayRoll({ids: selectedRowKeys, salarySendId: this.props.sendId})
}
handleGrantAll() {
this.fetchGrantPayRoll({salarySendId: this.props.sendId})
}
handleSearch(value) {
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({salarySendId: this.props.sendId, keyword: value, current: this.state.current})
}
// 分页
handleDataPageChange(value) {
this.setState({current: value})
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({salarySendId: this.props.sendId, current: value})
}
render() {
const menu = (
<Menu onClick={(e) => this.handleMenuClick(e)}>
<Menu.Item key="1">发放所选</Menu.Item>
</Menu>
);
const {payrollStore} = this.props;
const { salarySendDetailBaseInfo, canGrantDataSource, canGrantPageInfo } = payrollStore;
const { selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange.bind(this),
getColumns() {
const { payrollStore } = this.props;
const { canGrantColumns } = payrollStore;
return [
...canGrantColumns,
{ title: "操作", key: "operation", dataIndex: "operation" }
].map(item => {
if (item.key == "operation") {
item.render = (text, record) => {
if (record.sendStatus == "已发放") {
return (
<a
onClick={() => {
this.handleWithdraw(record);
}}>
撤回
</a>
);
} else {
return (
<a
onClick={() => {
this.handleGrant(record);
}}>
发送
</a>
);
}
};
return (
<Modal width={800} visible={this.props.visible} onCancel={() => {this.props.onCancel()}}>
<div style={{padding: "0px 10px", height: "47px", lineHeight: "47px"}}>
<span style={{fontSize: "14px", color: '#666'}}>批量发放</span>
<div style={{float: "right", marginRight: "40px"}}>
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleGrantAll()}}>全部发放</Dropdown.Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>
</div>
<div style={{height: "40px", lineHeight: "40px"}}>
<div className="titleBarLeft">
<span>薪资所属月{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
<WeaHelpfulTip
style={{marginLeft: '10px', marginRight: "10px"}}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate} ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
税款所属期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
考勤取值周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
福利台账月份\n
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>工资单模板{salarySendDetailBaseInfo.template}</span>
</div>
</div>
<div style={{marginTop: "10px", height: "500px", overflowY: "scroll"}}>
<WeaTable rowSelection={rowSelection} dataSource={canGrantDataSource} columns={this.getColumns()}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
total: canGrantPageInfo.total,
current: canGrantPageInfo.pageNum,
showTotal: (total) => `${total}`,
}}
/>
</div>
</Modal>
)
}
return item;
});
}
onSelectChange = value => {
this.setState({
selectedRowKeys: value
});
};
// 发放
fetchGrantPayRoll(payload) {
const { payrollStore: { grantPayroll } } = this.props;
grantPayroll(payload).then(() => {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId: this.props.sendId
});
this.props.onCancel && this.props.onCancel();
});
}
handleMenuClick(e) {
const { selectedRowKeys } = this.state;
const { payrollStore: { grantPayroll } } = this.props;
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
}
this.fetchGrantPayRoll({
ids: selectedRowKeys,
salarySendId: this.props.sendId
});
}
handleGrantAll() {
this.fetchGrantPayRoll({ salarySendId: this.props.sendId });
}
handleSearch(value) {
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({
salarySendId: this.props.sendId,
keyword: value,
current: this.state.current
});
}
// 分页
handleDataPageChange(value) {
this.setState({ current: value });
const { payrollStore: { batchSendInfoList } } = this.props;
batchSendInfoList({ salarySendId: this.props.sendId, current: value });
}
render() {
const menu = (
<Menu onClick={e => this.handleMenuClick(e)}>
<Menu.Item key="1">发放所选</Menu.Item>
</Menu>
);
const { payrollStore } = this.props;
const {
salarySendDetailBaseInfo,
canGrantDataSource,
canGrantPageInfo
} = payrollStore;
const { selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange.bind(this)
};
return (
<Modal
width={800}
visible={this.props.visible}
onCancel={() => {
this.props.onCancel();
}}>
<div
style={{ padding: "0px 10px", height: "47px", lineHeight: "47px" }}>
<span style={{ fontSize: "14px", color: "#666" }}>批量发放</span>
<div style={{ float: "right", marginRight: "40px" }}>
<Dropdown.Button
type="primary"
style={{ marginRight: "10px" }}
overlay={menu}
onClick={() => {
this.handleGrantAll();
}}>
全部发放
</Dropdown.Button>
<WeaInputSearch
value={this.state.searchValue}
onChange={value => {
this.setState({ searchValue: value });
}}
onSearch={value => {
this.handleSearch(value);
}}
/>
</div>
</div>
<div style={{ height: "40px", lineHeight: "40px" }}>
<div className="titleBarLeft">
<span>
薪资所属月{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth
.year}-{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth.monthValue}
</span>
<WeaHelpfulTip
style={{ marginLeft: "10px", marginRight: "10px" }}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle
.fromDate} ${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
税款所属期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.taxCycle}\n
考勤取值周期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle
.fromDate}至${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
福利台账月份\n
引用${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>
工资单模板{salarySendDetailBaseInfo.template}
</span>
</div>
</div>
<div
style={{ marginTop: "10px", height: "500px", overflowY: "scroll" }}>
<WeaTable
rowSelection={rowSelection}
dataSource={canGrantDataSource}
columns={this.getColumns()}
pagination={{
onChange: value => {
this.handleDataPageChange(value);
},
total: canGrantPageInfo.total,
current: canGrantPageInfo.pageNum,
showTotal: total => `${total}`
}}
/>
</div>
</Modal>
);
}
}

View File

@ -1,188 +1,245 @@
import React from 'react'
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom"
import { payrollGrantColumns, dataSource } from "../columns"
import { Menu, Button,Table, Modal, Dropdown } from "antd"
import { inject, observer } from 'mobx-react';
import React from "react";
import { WeaInputSearch, WeaHelpfulTip, WeaTable } from "ecCom";
import { payrollGrantColumns, dataSource } from "../columns";
import { Menu, Button, Table, Modal, Dropdown } from "antd";
import { inject, observer } from "mobx-react";
@inject('payrollStore')
@inject("payrollStore")
@observer
export default class PayrollWithdrawModal extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
current: 1,
}
}
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
current: 1
};
}
componentWillMount() {
const { payrollStore } = this.props
const { batchWithdrawInfoList } = payrollStore
batchWithdrawInfoList({salarySendId:this.props.sendId})
}
componentWillMount() {
const { payrollStore } = this.props;
const { batchWithdrawInfoList } = payrollStore;
batchWithdrawInfoList({ salarySendId: this.props.sendId });
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, batchWithdrawInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchWithdrawInfoList({salarySendId:this.props.sendId})
})
}
// 撤回
handleWithdraw(record) {
const { payrollStore } = this.props;
const { withdrawPayroll, batchWithdrawInfoList } = payrollStore;
withdrawPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchWithdrawInfoList({ salarySendId: this.props.sendId });
});
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll,batchWithdrawInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchWithdrawInfoList({salarySendId:this.props.sendId})
})
}
// 发送
handleGrant(record) {
const { payrollStore } = this.props;
const { grantPayroll, batchWithdrawInfoList } = payrollStore;
grantPayroll({
ids: [record.id],
salarySendId: this.props.sendId
}).then(() => {
batchWithdrawInfoList({ salarySendId: this.props.sendId });
});
}
getColumns() {
const { payrollStore } = this.props;
const { canWidthdrawColumns } = payrollStore
if(!canWidthdrawColumns) {
return []
}
return canWidthdrawColumns.map(item => {
let result = {}
result.title = item.text;
result.key = item.column;
result.dataIndex = item.column;
result.width = item.width;
if(result.key == "operation") {
result.render = (text,record) => {
if(text == 'ALREADYSEND') {
return (
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
)
} else {
return (
<a onClick={() => {this.handleGrant(record)}}>发送</a>
)
}
}
} else {
result.dataIndex = item.column;
}
return result;
})
}
onSelectChange = (value) => {
this.setState({
selectedRowKeys: value
})
}
// 撤回
fetchWithdrawPayroll(payload) {
const { payrollStore: { grantPayroll, withdrawPayroll }} = this.props;
withdrawPayroll(payload).then(() => {
const { payrollStore: {getInfoList}} = this.props;
getInfoList({
salarySendId:this.props.sendId
})
this.props.onCancel && this.props.onCancel()
})
}
handleMenuClick(e) {
const { selectedRowKeys } = this.state;
const { payrollStore: { grantPayroll }} = this.props;
if(selectedRowKeys.length == 0) {
message.warning("未选择条目");
return
}
this.fetchWithdrawPayroll({ids: selectedRowKeys, salarySendId: this.props.sendId})
}
handleWithdrawAll() {
this.fetchWithdrawPayroll({salarySendId: this.props.sendId})
}
// 分页
handleDataPageChange(value) {
this.setState({current: value})
const { payrollStore } = this.props
const { batchWithdrawInfoList } = payrollStore
batchWithdrawInfoList({salarySendId:this.props.sendId, current: value})
}
handleSearch(value) {
const { payrollStore: { batchWithdrawInfoList } } = this.props;
batchWithdrawInfoList({salarySendId: this.props.sendId, keyword: value, current: this.state.current})
}
render() {
const menu = (
<Menu onClick={(e) => this.handleMenuClick(e)}>
<Menu.Item key="1">撤回所选</Menu.Item>
</Menu>
);
const {payrollStore} = this.props;
const { salarySendDetailBaseInfo, canWidthdrawColumns, canWithdrawDataSource, canWithdrawPageInfo } = payrollStore;
const { selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange.bind(this),
getColumns() {
const { payrollStore } = this.props;
const { canWidthdrawColumns } = payrollStore;
return [
...canWidthdrawColumns,
{ title: "操作", key: "operation", dataIndex: "operation" }
].map(item => {
if (item.key == "operation") {
item.render = (text, record) => {
if (record.sendStatus == "已发放") {
return (
<a
onClick={() => {
this.handleWithdraw(record);
}}>
撤回
</a>
);
} else {
return (
<a
onClick={() => {
this.handleGrant(record);
}}>
发送
</a>
);
}
};
}
return item;
});
}
onSelectChange = value => {
this.setState({
selectedRowKeys: value
});
};
return (
<Modal width={800} visible={this.props.visible} onCancel={() => {this.props.onCancel()}}>
<div style={{padding: "0px 10px", height: "47px", lineHeight: "47px"}}>
<span style={{fontSize: "14px", color: '#666'}}>批量撤回</span>
<div style={{float: "right", marginRight: "40px"}}>
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleWithdrawAll()}}>全部撤回</Dropdown.Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>
</div>
<div style={{height: "40px", lineHeight: "40px"}}>
<div className="titleBarLeft">
<span>薪资所属月{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue}</span>
<WeaHelpfulTip
style={{marginLeft: '10px', marginRight: "10px"}}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate} ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
税款所属期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
考勤取值周期\n
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
福利台账月份\n
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>工资单模板{salarySendDetailBaseInfo.template}</span>
</div>
</div>
<div style={{marginTop: "10px", height: "500px", scrollY: "scroll"}}>
<WeaTable
rowSelection={rowSelection}
dataSource={canWithdrawDataSource}
columns={this.getColumns()}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
total: canWithdrawPageInfo.total,
current: canWithdrawPageInfo.pageNum,
showTotal: (total) => `${total}`,
}}
/>
</div>
</Modal>
)
// 撤回
fetchWithdrawPayroll(payload) {
const { payrollStore: { grantPayroll, withdrawPayroll } } = this.props;
withdrawPayroll(payload).then(() => {
const { payrollStore: { getInfoList } } = this.props;
getInfoList({
salarySendId: this.props.sendId
});
this.props.onCancel && this.props.onCancel();
});
}
handleMenuClick(e) {
const { selectedRowKeys } = this.state;
const { payrollStore: { grantPayroll } } = this.props;
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
}
this.fetchWithdrawPayroll({
ids: selectedRowKeys,
salarySendId: this.props.sendId
});
}
handleWithdrawAll() {
this.fetchWithdrawPayroll({ salarySendId: this.props.sendId });
}
// 分页
handleDataPageChange(value) {
this.setState({ current: value });
const { payrollStore } = this.props;
const { batchWithdrawInfoList } = payrollStore;
batchWithdrawInfoList({ salarySendId: this.props.sendId, current: value });
}
handleSearch(value) {
const { payrollStore: { batchWithdrawInfoList } } = this.props;
batchWithdrawInfoList({
salarySendId: this.props.sendId,
keyword: value,
current: this.state.current
});
}
render() {
const menu = (
<Menu onClick={e => this.handleMenuClick(e)}>
<Menu.Item key="1">撤回所选</Menu.Item>
</Menu>
);
const { payrollStore } = this.props;
const {
salarySendDetailBaseInfo,
canWidthdrawColumns,
canWithdrawDataSource,
canWithdrawPageInfo
} = payrollStore;
const { selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange.bind(this)
};
return (
<Modal
width={800}
visible={this.props.visible}
onCancel={() => {
this.props.onCancel();
}}>
<div
style={{ padding: "0px 10px", height: "47px", lineHeight: "47px" }}>
<span style={{ fontSize: "14px", color: "#666" }}>批量撤回</span>
<div style={{ float: "right", marginRight: "40px" }}>
<Dropdown.Button
style={{ marginRight: "10px" }}
overlay={menu}
onClick={() => {
this.handleWithdrawAll();
}}>
全部撤回
</Dropdown.Button>
<WeaInputSearch
value={this.state.searchValue}
onChange={value => {
this.setState({ searchValue: value });
}}
onSearch={value => {
this.handleSearch(value);
}}
/>
</div>
</div>
<div style={{ height: "40px", lineHeight: "40px" }}>
<div className="titleBarLeft">
<span>
薪资所属月{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth
.year}-{salarySendDetailBaseInfo.salaryMonth &&
salarySendDetailBaseInfo.salaryMonth.monthValue}
</span>
<WeaHelpfulTip
style={{ marginLeft: "10px", marginRight: "10px" }}
width={200}
title={`薪资周期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle
.salaryCycle
.fromDate} ${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle &&
salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
税款所属期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.taxCycle}\n
考勤取值周期\n
${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle
.attendCycle
.fromDate}至${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle &&
salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
福利台账月份\n
引用${salarySendDetailBaseInfo.salarySobCycle &&
salarySendDetailBaseInfo.salarySobCycle
.socialSecurityCycle}的福利台账数据`}
placement="topLeft"
/>
<span>
工资单模板{salarySendDetailBaseInfo.template}
</span>
</div>
</div>
<div style={{ marginTop: "10px", height: "500px", scrollY: "scroll" }}>
<WeaTable
rowSelection={rowSelection}
dataSource={canWithdrawDataSource}
columns={this.getColumns()}
pagination={{
onChange: value => {
this.handleDataPageChange(value);
},
total: canWithdrawPageInfo.total,
current: canWithdrawPageInfo.pageNum,
showTotal: total => `${total}`
}}
/>
</div>
</Modal>
);
}
}

View File

@ -1,96 +1,106 @@
import React from 'react'
import { inject, observer } from 'mobx-react';
import { Radio, Spin } from 'antd'
import { WeaTableNew } from 'comsMobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { Radio, Spin } from "antd";
import { WeaTableNew } from "comsMobx";
const WeaTable = WeaTableNew.WeaTable;
@inject('payrollStore')
@inject("payrollStore")
@observer
export default class TemplateSettingList extends React.Component {
componentWillMount() {
const { payrollStore } = this.props;
const { getPayrollTemplateList } = payrollStore;
getPayrollTemplateList();
}
componentWillMount() {
const { payrollStore } = this.props;
const { getPayrollTemplateList } = payrollStore;
getPayrollTemplateList();
}
// 编辑操作按钮
onEdit(record) {
this.props.onEdit && this.props.onEdit(record)
}
// 编辑操作按钮
onEdit(record) {
this.props.onEdit && this.props.onEdit(record);
}
// 复制操作按钮
onCopy(record) {
this.props.onCopy && this.props.onCopy(record)
}
// 复制操作按钮
onCopy(record) {
this.props.onCopy && this.props.onCopy(record);
}
// 删除操作按钮
onDelete(record) {
this.props.onDelete && this.props.onDelete(record)
}
// 删除操作按钮
onDelete(record) {
this.props.onDelete && this.props.onDelete(record);
}
// 操作按钮
onOperatesClick = (record, index, operate, flag) => {
switch(operate.index.toString()){
case '0': // 编辑
this.onEdit(record);
break;
case "1": // 复制
this.onCopy(record);
break;
case "2": // 删除
this.onDelete(record);
break;
// 操作按钮
onOperatesClick = (record, index, operate, flag) => {
switch (operate.index.toString()) {
case "0": // 编辑
this.onEdit(record);
break;
case "1": // 复制
this.onCopy(record);
break;
case "2": // 删除
this.onDelete(record);
break;
}
};
// 默认使用配置
recordItemChange(record) {
const { payrollStore } = this.props;
const { changePayrollDefaultUse, getPayrollTemplateList } = payrollStore;
changePayrollDefaultUse(record.id).then(() => {
getPayrollTemplateList();
});
}
// 增加编辑功能重写columns绑定事件
getColumns = columns => {
const { showOperateBtn } = this.props;
let newColumns = "";
newColumns = columns.map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => {
//前端元素转义
let valueSpan =
record[newColumn.dataIndex + "span"] !== undefined
? record[newColumn.dataIndex + "span"]
: record[newColumn.dataIndex];
switch (newColumn.dataIndex) {
case "useType":
return (
<Radio
disabled={!showOperateBtn}
checked={record.useType == "1"}
onChange={value => {
this.recordItemChange(record);
}}
/>
);
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
}
};
};
return newColumn;
});
return newColumns;
};
// 默认使用配置
recordItemChange(record) {
const { payrollStore } = this.props;
const { changePayrollDefaultUse, getPayrollTemplateList } = payrollStore;
changePayrollDefaultUse(record.id).then(() => {
getPayrollTemplateList()
})
}
// 增加编辑功能重写columns绑定事件
getColumns = (columns) => {
let newColumns = '';
newColumns = columns.map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => { //前端元素转义
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
switch(newColumn.dataIndex) {
case "useType":
return <Radio checked={record.useType == "1"} onChange={(value) => {this.recordItemChange(record)}}/>
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
}
}
return newColumn;
});
return newColumns;
}
render() {
const { payrollStore } = this.props;
const { templateStore, loading } = payrollStore;
return (
<div>
{ loading ?
<div style={{width: '100%', textAlign: "center"}}>
<Spin />
</div>
:
<WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={templateStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
}
render() {
const { payrollStore } = this.props;
const { templateStore, loading } = payrollStore;
return (
<div>
{loading
? <div style={{ width: "100%", textAlign: "center" }}>
<Spin />
</div>
)
}
}
: <WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={templateStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
getColumns={this.getColumns}
onOperatesClick={this.onOperatesClick.bind(this)}
/>}
</div>
);
}
}

View File

@ -1,4 +1,4 @@
import React from "react";
import React, { Fragment } from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { WeaTableNew } from "comsMobx";
@ -47,7 +47,7 @@ const { MonthPicker } = DatePicker;
import "./index.less";
import CustomTable from "../../components/customTable";
@inject("salaryFileStore")
@inject("salaryFileStore", "taxAgentStore")
@observer
export default class SalaryFile extends React.Component {
constructor(props) {
@ -174,20 +174,24 @@ export default class SalaryFile extends React.Component {
// 查看 Slide 头部操作按钮
renderEditSlideOperate() {
const { taxAgentStore: { showOperateBtn } } = this.props;
return (
<div style={{ display: "inline-block" }}>
<Dropdown.Button
type="primary"
overlay={
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
</Menu>
}
onClick={() => {
this.setState({ changeSalaryVisible: true });
}}>
调薪
</Dropdown.Button>
{
showOperateBtn &&
<Dropdown.Button
type="primary"
overlay={
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
</Menu>
}
onClick={() => {
this.setState({ changeSalaryVisible: true });
}}>
调薪
</Dropdown.Button>
}
</div>
);
}
@ -244,7 +248,7 @@ export default class SalaryFile extends React.Component {
}
render() {
const { salaryFileStore } = this.props;
const { salaryFileStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
loading,
hasRight,
@ -355,32 +359,37 @@ export default class SalaryFile extends React.Component {
<div
style={{ display: "inline-block", position: "relative" }}
className="salaryFileTabWrapper">
<WeaHelpfulTip
style={{ marginRight: "10px" }}
width={300}
title="导入按钮使用场景说明<br/>
1.档案初始化<br/>
a.初次使用薪酬模块全量导入员工的薪资档案数据<br/>
b.员工入职导入新入职的员工的薪资档案数据若导入表格中的人员已存在在薪资档案中初始化导入会将档案中该人员的数据清除再导入<br/>
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴<br/>
2.调薪档案中已存在的人员批量调整薪资项目值包括返聘人员的情况<br/>
3.调整个税扣缴义务人档案中已存在的人员批量调整个税扣缴义务人包括返聘人员的情况<br/>"
placement="topLeft"
/>
<Dropdown.Button
type="primary"
style={{ marginRight: "10px" }}
overlay={menu}>
导入
</Dropdown.Button>
<Dropdown.Button
style={{ marginRight: "10px" }}
overlay={menu2}
onClick={() => {
this.handleExportAll();
}}>
导出全部
</Dropdown.Button>
{
showOperateBtn &&
<Fragment>
<WeaHelpfulTip
style={{ marginRight: "10px" }}
width={300}
title="导入按钮使用场景说明<br/>
1.档案初始化<br/>
a.初次使用薪酬模块全量导入员工的薪资档案数据<br/>
b.员工入职导入新入职的员工的薪资档案数据若导入表格中的人员已存在在薪资档案中初始化导入会将档案中该人员的数据清除再导入<br/>
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴<br/>
2.调薪档案中已存在的人员批量调整薪资项目值包括返聘人员的情况<br/>
3.调整个税扣缴义务人档案中已存在的人员批量调整个税扣缴义务人包括返聘人员的情况<br/>"
placement="topLeft"
/>
<Dropdown.Button
type="primary"
style={{ marginRight: "10px" }}
overlay={menu}>
导入
</Dropdown.Button>
<Dropdown.Button
style={{ marginRight: "10px" }}
overlay={menu2}
onClick={() => {
this.handleExportAll();
}}>
导出全部
</Dropdown.Button>
</Fragment>
}
<Button
type="default"
style={{ marginRight: "10px" }}
@ -545,6 +554,7 @@ export default class SalaryFile extends React.Component {
{ title: "个税扣缴义务人", key: 1 },
]}
editable={false}
showOperateBtn={showOperateBtn}
selectedTab={selectedTab}
customOperate={() => {
renderCustomOperate();

View File

@ -20,7 +20,7 @@ import CustomPaginationTable from '../../components/customPaginationTable';
const { MonthPicker } = DatePicker;
@inject('salaryItemStore')
@inject('salaryItemStore', 'taxAgentStore')
@observer
export default class SalaryItem extends React.Component {
constructor(props) {
@ -85,7 +85,7 @@ export default class SalaryItem extends React.Component {
// 增加编辑功能重写columns绑定事件
getColumns = () => {
const { salaryItemStore } = this.props;
const { salaryItemStore, taxAgentStore: { showOperateBtn } } = this.props;
const { tableColumns} = salaryItemStore
let columns = tableColumns.map(column => {
let newColumn = column;
@ -109,7 +109,7 @@ export default class SalaryItem extends React.Component {
title: "操作",
render: (text, record) => {
return (
<a onClick={() => {this.onEditItem(record, true)}}>编辑</a>
<a onClick={() => {this.onEditItem(record, true)}}>{ showOperateBtn ? '编辑' : '查看' }</a>
)
}
})
@ -175,7 +175,7 @@ export default class SalaryItem extends React.Component {
}
render() {
const { salaryItemStore } = this.props;
const { salaryItemStore, taxAgentStore: { showOperateBtn } } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryItemStore;
const { tableDataSource, tableColumns, systemItemVisible, setSystemItemVisible, deleteItemVisible, setDeleteItemVisible, deleteItemList, editSlideVisible, setEditSlideVisible, request, pageInfo } = salaryItemStore
const { formalModalVisible} = this.state;
@ -238,8 +238,12 @@ export default class SalaryItem extends React.Component {
);
const renderRightOperation = () => {
const { taxAgentStore: { showOperateBtn } }= this.props;
return (<div style={{display: "inline-block"}}>
<Dropdown.Button overlay={menu} type="primary" style={{marginRight: "10px"}}>新增</Dropdown.Button>
{
showOperateBtn &&
<Dropdown.Button overlay={menu} type="primary" style={{marginRight: "10px"}}>新增</Dropdown.Button>
}
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
</div>)
@ -348,7 +352,8 @@ export default class SalaryItem extends React.Component {
<SlideModalTitle
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
editable={false}
customOperate={renderCustomOperate()}
showOperateBtn={showOperateBtn}
customOperate={showOperateBtn ? renderCustomOperate() : null}
subItemChange={
(item) => {this.setState({selectedTab: item.key})}
}

View File

@ -22,7 +22,7 @@ import ImportModal from '../../../components/importModal';
const { MonthPicker } = DatePicker;
@inject('archivesStore')
@inject('archivesStore','taxAgentStore')
@observer
export default class Archives extends React.Component {
constructor(props) {
@ -58,7 +58,7 @@ export default class Archives extends React.Component {
}
getColumns() {
const { archivesStore: {tableStore}} = this.props;
const { archivesStore: {tableStore}, taxAgentStore: { showOperateBtn }} = this.props;
let columns = [...tableStore.columns]
columns = columns.filter(item => item.hide == "false")
columns.map(item => {
@ -71,7 +71,7 @@ export default class Archives extends React.Component {
width: "100px",
height: "auto",
render: (text, record) => {
return (<a onClick={() => {this.handleEdit(record)}}>编辑</a>)
return (<a onClick={() => {this.handleEdit(record)}}>{showOperateBtn ? '编辑' : '查看'}</a>)
}
})
return columns;
@ -158,7 +158,7 @@ export default class Archives extends React.Component {
}
render() {
const { archivesStore } = this.props;
const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props;
const { selectedTab, selectedRowKeys } = this.state;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd,
previewCurDataColumns, previewCurDataDataSource, importResult, initImportParams
@ -201,7 +201,6 @@ export default class Archives extends React.Component {
// 导出选中
const handleMenuClick = () => {
const { selectedRowKeys } = this.state;
console.log("selectedRowKeys", selectedRowKeys);
if(selectedRowKeys.length == 0) {
message.warning("未选择任何条目", 1);
return
@ -245,7 +244,7 @@ export default class Archives extends React.Component {
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
buttons={btns}
buttons={showOperateBtn ? btns : []}
>
<WeaTab
@ -301,10 +300,11 @@ export default class Archives extends React.Component {
tabs={[{title: '基础设置', key: 0}, {title: "社保", key: 1}, {title: "公积金", key: 2}, {title: '企业年金及其他福利', key: 3}]}
editable={false}
selectedTab={selectedTab}
showOperateBtn={showOperateBtn}
customOperate={
<div>
{
selectedTab != 0 && <Button type="primary" onClick={() => {this.handleEditSlideSave()}}>保存</Button>
showOperateBtn && selectedTab != 0 && <Button type="primary" onClick={() => {this.handleEditSlideSave()}}>保存</Button>
}
</div>
}

View File

@ -11,7 +11,7 @@ import {
Switch,
Modal,
Dropdown,
Menu
Menu,message
} from "antd";
import {
@ -53,7 +53,7 @@ const { MonthPicker } = DatePicker;
import TwoColContent from "../../../components/twoColContent";
import CopySchemaModal from "./copySchemaModal";
@inject("programmeStore")
@inject("programmeStore", "taxAgentStore")
@observer
export default class Programme extends React.Component {
constructor(props) {
@ -166,8 +166,9 @@ export default class Programme extends React.Component {
}
getCustomColumns = columns => {
let newColumns = "";
newColumns = columns.map(column => {
const { taxAgentStore: { showOperateBtn } } = this.props;
let newColumns = [];
newColumns = _.filter(columns, it => it.dataIndex !='operate').map(column => {
let newColumn = column;
newColumn.render = (text, record, index) => {
//前端元素转义
@ -188,6 +189,7 @@ export default class Programme extends React.Component {
case "is_use":
return (
<Switch
disabled={!showOperateBtn}
checked={text == 1}
onChange={value => {
this.handleCategoryStatusChange(record, value);
@ -231,8 +233,13 @@ export default class Programme extends React.Component {
onCustomEdit(record) {
const {
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest }
programmeStore: { getCustomForm, setCustomNewVisible, setCustomRequest },
taxAgentStore: { showOperateBtn }
} = this.props;
if(!showOperateBtn){
message.warning("请设置编辑权限!");
return;
}
getCustomForm();
setCustomNewVisible(true);
this.setState({
@ -257,7 +264,7 @@ export default class Programme extends React.Component {
}
render() {
const { programmeStore } = this.props;
const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
loading,
hasRight,
@ -456,18 +463,20 @@ export default class Programme extends React.Component {
topTab={topTab}
searchOperationItem={
<div>
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => {
if (selectedKey == "custom") {
handleCustomNewClick();
} else {
handleNewClick();
}
}}>
新建
</Button>
{/* 操作按钮权限 */}
{showOperateBtn &&
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => {
if (selectedKey == "custom") {
handleCustomNewClick();
} else {
handleNewClick();
}
}}>
新建
</Button>}
{selectedKey == "custom" &&
<WeaSelect
@ -477,7 +486,6 @@ export default class Programme extends React.Component {
onChange={v => {
setCustomSelectkey(v);
getCustomCategoryList(v);
console.log("v:", v);
}}
/>}
</div>
@ -537,6 +545,7 @@ export default class Programme extends React.Component {
subtitle={this.state.customEdit ? "修改" : "新增"}
subTabs={[{ title: "基础设置" }]}
editable={true}
showOperateBtn={showOperateBtn}
onSave={() => {
handleOnSave();
}}

View File

@ -62,7 +62,6 @@ export default class StandingBook extends React.Component {
const { taxAgentStore: {getPermission}, standingBookStore: {getAdminTaxAgentList}} = this.props
getPermission().then(({status, data}) => {
if(status) {
console.log("data:", data);
this.setState({adminData : data})
if(data.isAdminEnable) {
getAdminTaxAgentList().then((data) => {
@ -328,7 +327,7 @@ export default class StandingBook extends React.Component {
}
render() {
const { standingBookStore } = this.props;
const { standingBookStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
inspectLoading,
loading,
@ -353,7 +352,7 @@ export default class StandingBook extends React.Component {
return renderNoright();
}
const rightBtns = (!this.state.adminData.isDefaultOpen || this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable) ? [
const rightBtns = [
// 右键菜单
<Button
type="primary"
@ -368,7 +367,7 @@ export default class StandingBook extends React.Component {
}}>
核算
</Button>
] : [];
];
const rightMenu = [
// 右键菜单
{
@ -428,7 +427,7 @@ export default class StandingBook extends React.Component {
title="社保福利台账" // 文字
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
buttons={rightBtns}
buttons={showOperateBtn ? rightBtns : []}
// showDropIcon={true} // 是否显示下拉按钮
// dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
// dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能

View File

@ -305,6 +305,7 @@ export default class TaxAgent extends React.Component {
total: pageObj.total,
showTotal: total => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange(current, pageSize) {
doInit({ current, pageSize });
},
@ -374,7 +375,6 @@ export default class TaxAgent extends React.Component {
icon={<i className="icon-coms-meeting" />} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true}>
{" "}// 是否显示下拉按钮
<Row
gutter={16}
style={{ overflow: "hidden", width: "100%", marginTop: 8 }}>

View File

@ -29,7 +29,8 @@ const Home = props => props.children;
class Root extends React.Component {
componentWillMount() {
top.$(".ant-message").remove()
top.$(".ant-message").remove();
allStore.taxAgentStore.getPermission();
}
render() {
return (

View File

@ -1,10 +1,10 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from '../apis/payroll'; // 引入API接口文件
import { notNull } from '../util/validate';
import { removePropertyCondition } from '../util/response';
import * as API from "../apis/payroll"; // 引入API接口文件
import { notNull } from "../util/validate";
import { removePropertyCondition } from "../util/response";
const { TableStore } = WeaTableNew;
@ -16,20 +16,19 @@ export class payrollStore {
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
// **** 模板页面 ****
// **** 模板页面 ****
@observable templateStore = new TableStore(); // 模板设置列表
// 基础设置表单
@observable templateBaseData = {} // 基础信息表单数据
@observable salarySobOptions = [] // 账套列表
@observable templateBaseData = {}; // 基础信息表单数据
@observable salarySobOptions = []; // 账套列表
// 显示设置表单
@observable salaryTemplateShowSet = {} // 显示设置基础表单
@observable salaryItemSet = [] // 显示设置薪资项
@observable salaryTemplateShowSet = {}; // 显示设置基础表单
@observable salaryItemSet = []; // 显示设置薪资项
// **** 工资单页面 ****
@observable salarySendTableStore = new TableStore(); // 工资单列表
@observable salarySendDataSource = [];
@observable pageInfo = {}
@observable pageInfo = {};
// **** 工资单详情页 ****
@observable salarySendDetailBaseInfo = {}; // 工资单详情基础信息
@ -38,513 +37,503 @@ export class payrollStore {
@observable detailListConditionForm = new WeaForm(); // 详情页搜索条件
@observable detailListShowSearchAd = false; // 详情页是否展开搜索面板
@observable detailListCondition = []; // 详情页搜索条件
@observable salarySendDetailPageInfo ={}
@observable salarySendDetailPageInfo = {};
// **** 工资单发放页 ****
@observable salaryGrantDataSource = [];
@observable salaryGrantPageInfo ={};
@observable salaryGrantTableStore = new TableStore();
@observable salaryGrantPageInfo = {};
@observable salaryGrantTableStore = [];
@observable grantListConditionForm = new WeaForm(); // 详情页搜索条件
@observable grantListShowSearchAd = false; // 详情页是否展开搜索面板
@observable grantListCondition = []; // 详情页搜索条件
@observable canGrantDataSource = []; // 可以发送的列表
@observable canGrantColumns = []; // 可以发送的列名
@observable canGrantColumns = []; // 可以发送的列名
@observable canGrantPageInfo = {}; // 可以发送列表分页对象
@observable canWithdrawDataSource = []; // 可以撤回的列表
@observable canWidthdrawColumns = []; // 可以撤回的列表列名
@observable canWithdrawPageInfo = {}; // 可以撤回列表分页对象
@action
setGrantListShowSearchAd = (grantListShowSearchAd) => this.grantListShowSearchAd = grantListShowSearchAd
setGrantListShowSearchAd = grantListShowSearchAd =>
(this.grantListShowSearchAd = grantListShowSearchAd);
// 详情页是否展开搜索面板
@action
setDetailListShowSearchAd = (detailListShowSearchAd) => this.detailListShowSearchAd = detailListShowSearchAd
setDetailListShowSearchAd = detailListShowSearchAd =>
(this.detailListShowSearchAd = detailListShowSearchAd);
// 基础信息表单数据
@action
setTemplateBaseData = (templateBaseData) => this.templateBaseData = templateBaseData
setTemplateBaseData = templateBaseData =>
(this.templateBaseData = templateBaseData);
// 显示设置基础表单
@action
setSalaryTemplateShowSet = (salaryTemplateShowSet) => this.salaryTemplateShowSet = salaryTemplateShowSet
setSalaryTemplateShowSet = salaryTemplateShowSet =>
(this.salaryTemplateShowSet = salaryTemplateShowSet);
@action
setSalaryItemSet = (salaryItemSet) => this.salaryItemSet = salaryItemSet
setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet);
// 初始化操作
@action
doInit = () => {
// this.getCondition();
// this.getTableDatas();
}
};
// 获得高级搜索表单数据
@action
getCondition = () => {
API.getCondition().then(action(res => {
if (res.api_status) { // 接口请求成功/失败处理
let condition = removePropertyCondition(res.condition);
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.msg || '接口调用失败!')
}
}));
}
API.getCondition().then(
action(res => {
if (res.api_status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.condition);
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.msg || "接口调用失败!");
}
})
);
};
// 渲染table数据
@action
getTableDatas = (params) => {
getTableDatas = params => {
this.loading = true;
const formParams = this.form.getFormParams() || {};
params = params || formParams;
API.getTableDatas(params).then(action(res => {
if (res.api_status) { // 接口请求成功/失败处理
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.msg || '接口调用失败!')
}
this.loading = false;
}));
}
API.getTableDatas(params).then(
action(res => {
if (res.api_status) {
// 接口请求成功/失败处理
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.msg || "接口调用失败!");
}
this.loading = false;
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
@action setShowSearchAd = bool => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = () => {
@action
doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 工资单模板-工资单模板列表
@action
getPayrollTemplateList = (params = {}) => {
this.loading = true
this.loading = true;
API.getPayrollTemplateList(params).then(res => {
if(res.status) {
if (res.status) {
this.templateStore.getDatas(res.data.datas);
} else {
message.error(res.errormsg || "获取失败");
}
this.loading = false;
})
}
});
};
// 工资单模板-获取工资单模板基础设置表单
@action
getPayrollBaseForm = (id = "") => {
let params = {
id
}
};
return new Promise((resolve, reject) => {
API.getPayrollBaseForm(params).then(res => {
if(res.status) {
let response = res.data.salaryTemplateBaseSet
let templateBaseData = response.data
templateBaseData.salarySob = templateBaseData.salarySob != undefined ? templateBaseData.salarySob + "": null;
this.templateBaseData = templateBaseData // 基础信息表单数据
this.salarySobOptions = response.salarySobOptions ?
response.salarySobOptions.map(item => {
let result = {}
result.showname = item.name;
result.key = item.id + "";
result.selected = false;
return result;
}) : []
if (res.status) {
let response = res.data.salaryTemplateBaseSet;
let templateBaseData = response.data;
templateBaseData.salarySob =
templateBaseData.salarySob != undefined
? templateBaseData.salarySob + ""
: null;
this.templateBaseData = templateBaseData; // 基础信息表单数据
this.salarySobOptions = response.salarySobOptions
? response.salarySobOptions.map(item => {
let result = {};
result.showname = item.name;
result.key = item.id + "";
result.selected = false;
return result;
})
: [];
resolve({
templateBaseData: this.templateBaseData,
salarySobOptions: this.salarySobOptions
});
} else {
message.errro(res.errormsg || "获取失败");
reject()
reject();
}
})
})
}
});
});
};
// 工资单模板-获取工资单模板显示设置表单
@action
getPayrollShowForm = (id = "") => {
let params = {
id
}
};
API.getPayrollShowForm(params).then(res => {
if(res.status) {
if(id !== "") {
this.salaryItemSet = res.data.salaryTemplateSalaryItemSet
if (res.status) {
if (id !== "") {
this.salaryItemSet = res.data.salaryTemplateSalaryItemSet;
}
this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data
this.salaryTemplateShowSet = res.data.salaryTemplateShowSet.data;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 工资单模板-获取薪资项目设置
@action
getPayrollItemList = (salarySobId = "") => {
let params = {
salarySobId
}
};
API.getPayrollItemList(params).then(res => {
if(res.status) {
this.salaryItemSet = res.data
if (res.status) {
this.salaryItemSet = res.data;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 初始化显示设置表单
@action
initShowSettingForm = (id = "") => {
this.getPayrollShowForm(id);
if(id == "") {
this.getPayrollItemList(this.templateBaseData.salarySob)
if (id == "") {
this.getPayrollItemList(this.templateBaseData.salarySob);
}
}
};
// 校验显示设置表单
validateSalaryTemplateShowSet = () => {
if(!notNull(this.salaryTemplateShowSet.theme)) {
if (!notNull(this.salaryTemplateShowSet.theme)) {
message.warning("工资单主题不能为空");
return false;
}
return true;
}
};
// 拼装保存参数
convertParams = () => {
let params = {...this.templateBaseData, ...this.salaryTemplateShowSet}
params.salarySobId = params.salarySob
let params = { ...this.templateBaseData, ...this.salaryTemplateShowSet };
params.salarySobId = params.salarySob;
params.emailStatus = params.emailStatus ? params.emailStatus : false;
params.msgStatus = params.msgStatus ? params.msgStatus : false
params.salaryItemNullStatus = params.salaryItemNullStatus ? params.salaryItemNullStatus : false;
params.salaryItemZeroStatus = params.salaryItemZeroStatus ? params.salaryItemZeroStatus : false;
params.salaryItemSetting = this.salaryItemSet
return params
}
params.msgStatus = params.msgStatus ? params.msgStatus : false;
params.salaryItemNullStatus = params.salaryItemNullStatus
? params.salaryItemNullStatus
: false;
params.salaryItemZeroStatus = params.salaryItemZeroStatus
? params.salaryItemZeroStatus
: false;
params.salaryItemSetting = this.salaryItemSet;
return params;
};
// 工资单模板-新建工资单模板
@action
fetchSavePayroll = () => {
if(!(this.validateSalaryTemplateShowSet())) {
return false
if (!this.validateSalaryTemplateShowSet()) {
return false;
}
let params = this.convertParams()
let params = this.convertParams();
return new Promise((resolve, reject) => {
API.savePayroll(params).then(res => {
if(res.status) {
if (res.status) {
message.success("保存成功");
this.getPayrollTemplateList();
resolve();
} else {
message.error(res.errormsg || "保存失败")
reject()
} else {
message.error(res.errormsg || "保存失败");
reject();
}
})
})
}
});
});
};
// 工资单模板-更新工资单模板
@action
fetchUpdatePayroll = (id) => {
if(!(this.validateSalaryTemplateShowSet())) {
return false
fetchUpdatePayroll = id => {
if (!this.validateSalaryTemplateShowSet()) {
return false;
}
let params = this.convertParams()
params.id = id
let params = this.convertParams();
params.id = id;
return new Promise((resolve, reject) => {
API.updatePayroll(params).then(res => {
if(res.status) {
if (res.status) {
message.success("保存成功");
this.getPayrollTemplateList();
resolve();
} else {
message.error(res.errormsg || "保存失败")
reject()
} else {
message.error(res.errormsg || "保存失败");
reject();
}
})
})
}
});
});
};
//工资单-获取薪资账套下拉列表
@action
getPayrollTemplateLedgerList = () => {
return new Promise((resolve, reject) => {
API.getPayrollTemplateLedgerList().then(res => {
if(res.status) {
if (res.status) {
this.payrollTemplateLedgerList = res.data.map(item => {
let result = {}
let result = {};
result.showname = item.content;
result.selected = false;
result.key = item.id
result.key = item.id;
return result;
})
resolve(this.payrollTemplateLedgerList)
});
resolve(this.payrollTemplateLedgerList);
} else {
message.error(res.errormsg || "获取失败");
reject()
reject();
}
})
})
}
});
});
};
// 工资单模板-工资单模板默认使用
@action
changePayrollDefaultUse(id = "") {
if(id == "") {
if (id == "") {
message.warning("id必填");
return
return;
}
let params = {
id
}
};
return new Promise((resolve, reject) => {
API.changePayrollDefaultUse(params).then(res => {
if(res.status) {
if (res.status) {
message.success("设置成功");
resolve()
resolve();
} else {
message.success(res.errormsg || "设置失败")
reject()
message.success(res.errormsg || "设置失败");
reject();
}
})
})
});
});
}
// 工资单模板-复制工资单模板
@action
duplicatePayroll = (id, name) => {
let params = {
id, name
}
id,
name
};
return new Promise((resolve, reject) => {
API.duplicatePayroll(params).then(res => {
if(res.status) {
message.success("复制成功")
this.getPayrollTemplateList()
resolve()
if (res.status) {
message.success("复制成功");
this.getPayrollTemplateList();
resolve();
} else {
message.error(res.errormsg || "复制失败")
message.error(res.errormsg || "复制失败");
reject();
}
})
})
}
});
});
};
// 工资单模板-删除工资单模板
@action
deletePayroll = (ids) => {
deletePayroll = ids => {
API.deletePayroll(ids).then(res => {
if(res.status) {
if (res.status) {
message.success("删除成功");
this.getPayrollTemplateList()
this.getPayrollTemplateList();
} else {
message.error(res.errormsg || "删除失败");
}
})
}
});
};
// 工资单-工资单发放列表
@action
getPayrollList = (parmas = {salaryYearMonth: []}) => {
this.loading = true
getPayrollList = (parmas = { salaryYearMonth: [] }) => {
this.loading = true;
API.getPayrollList(parmas).then(res => {
if(res.status) {
this.salarySendDataSource = res.data.datas
this.salarySendTableStore.getDatas(res.data.dataKey.datas)
this.pageInfo = res.data.pageInfo
if (res.status) {
this.salarySendDataSource = res.data.datas;
this.salarySendTableStore.getDatas(res.data.dataKey.datas);
this.pageInfo = res.data.pageInfo;
} else {
message.error(res.errormsg || "获取失败");
}
this.loading = false
})
}
this.loading = false;
});
};
// 工资单发放-工资单发放基本信息
@action
getPayrollInfo = (id) => {
API.getPayrollInfo({id}).then(res => {
if(res.status) {
this.salarySendDetailBaseInfo = res.data
getPayrollInfo = id => {
API.getPayrollInfo({ id }).then(res => {
if (res.status) {
this.salarySendDetailBaseInfo = res.data;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 工资单发放-工资单发放信息列表
@action
getInfoList = (params = {}) => {
let form = this.grantListConditionForm.getFormParams();
params = {...form, ...params}
params = { ...form, ...params };
API.getInfoList(params).then(res => {
if(res.status) {
this.salaryGrantTableStore.getDatas(res.data.dataKey.datas)
this.salaryGrantDataSource = res.data.datas
this.salaryGrantPageInfo = res.data.pageInfo
if (res.status) {
this.salaryGrantTableStore = res.data.columns;
this.salaryGrantDataSource = res.data.list;
this.salaryGrantPageInfo = {
total: res.data.total,
pageNum: res.data.pageNum
};
this.getPayrollInfo(params.salarySendId);
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 工资单-工资单发放详情列表
@action
getPayrollDetailList = (params) => {
let form = this.detailListConditionForm.getFormParams() || {}
params = {...form, ...params}
getPayrollDetailList = params => {
let form = this.detailListConditionForm.getFormParams() || {};
params = { ...form, ...params };
API.getPayrollDetailList(params).then(res => {
if(res.status) {
this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas)
this.salarySendDetailDataSource = res.data.datas
this.salarySendDetailPageInfo = res.data.pageInfo
if (res.status) {
this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas);
this.salarySendDetailDataSource = res.data.datas;
this.salarySendDetailPageInfo = res.data.pageInfo;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 工资单详情页 - 获得高级搜索表单数据
@action
getPayrollDetailSa = (params = {}) => {
API.getPayrollDetailSa(params).then(res => {
if (res.status) { // 接口请求成功/失败处理
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition);
this.detailListCondition = condition
this.detailListCondition = condition;
this.detailListConditionForm.initFormFields(condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || '接口调用失败!')
message.error(res.errormsg || "接口调用失败!");
}
});
}
};
// 工资单发放-导出-工资单发放详情列表
@action
exportDetailList = (params = {}) => {
API.exportDetailList(params)
}
API.exportDetailList(params);
};
// 工资单-获取工资单发放高级搜索
@action
getPaySa = (params = {}) => {
API.getPaySa(params).then(res => {
if(res.status) {
let condition = removePropertyCondition(res.data.condition)
if (res.status) {
let condition = removePropertyCondition(res.data.condition);
this.grantListCondition = condition;
this.grantListConditionForm.initFormFields(condition);
this.grantListConditionForm.initFormFields(condition);
} else {
message.error(res.errormsg || "接口调用失败")
message.error(res.errormsg || "接口调用失败");
}
})
}
});
};
// 工资单发放-工资单批量发放信息列表
@action
batchSendInfoList = (params = {}) => {
API.batchSendInfoList(params).then(res => {
if(res.status) {
let datas = res.data.datas || [];
datas.map(item => {
item.key = item.id
})
this.canGrantDataSource = datas
if (res.status) {
this.canGrantDataSource = res.data.list;
this.canGrantColumns = res.data.columns;
this.canGrantPageInfo = res.data.pageInfo
// alert("this.canGrantColumns:" + JSON.stringify(this.canGrantColumns))
this.canGrantPageInfo = {
total: res.data.total,
pageNum: res.data.pageNum
};
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 工资单发放-工资单批量撤回信息列表
@action
batchWithdrawInfoList = (params = {}) => {
API.batchWithdrawInfoList(params).then(res => {
if(res.status) {
let datas = res.data.datas || [];
if (res.status) {
let datas = res.data.list || [];
datas.map(item => {
item.key = item.id
})
this.canWithdrawDataSource = datas
this.canWidthdrawColumns = res.data.columns
this.canWithdrawPageInfo = res.data.pageInfo
item.key = item.id;
});
this.canWithdrawDataSource = datas;
this.canWidthdrawColumns = res.data.columns;
this.canWithdrawPageInfo = {
total: res.data.total,
pageNum: res.data.pageNum
};
} else {
message.error(res.errormsg || "获取失败");
}
})
}
});
};
//工资单-工资单发放
@action
grantPayroll = (params = {}) => {
return new Promise((resolve, reject) => {
API.grantPayroll(params).then(res => {
if(res.status) {
if (res.status) {
message.success("发送成功");
resolve();
} else {
message.error(res.errormsg || "发送失败")
message.error(res.errormsg || "发送失败");
reject();
}
})
})
}
});
});
};
// 工资单-工资单撤回
@action
withdrawPayroll = (params = {}) => {
return new Promise((resolve, reject) => {
API.withdrawPayroll(params).then(res => {
if(res.status) {
if (res.status) {
message.success("撤回成功");
resolve()
resolve();
} else {
message.error(res.errormsg || "撤回失败")
message.error(res.errormsg || "撤回失败");
reject();
}
})
})
}
// 工资单-按钮状态
@action
getSendBtnStatus = (params = {}) => {
return new Promise((resolve, reject) => {
API.getSendBtnStatus(params).then(res => {
if(res.status) {
resolve(res.data)
} else {
reject()
}
})
})
}
// 工资单-扩展按钮点击
@action
grantProxy = (params = {}) => {
return new Promise((resolve, reject) => {
API.grantProxy(params).then(res => {
if(res.status) {
message.success("发起流程")
resolve(res.data)
} else {
message.error(res.errormsg || "发起失败")
reject()
}
})
})
}
}
});
});
};
}

View File

@ -16,6 +16,7 @@ export class TaxAgentStore {
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable showOperateBtn = false; // 页面操作按钮显示权限
@observable loading = false; // 数据加载状态
@observable modalVisiable = false; // EditModal 模态框
@observable columns = [];
@ -31,6 +32,8 @@ export class TaxAgentStore {
@action setDataSource = dataSource => (this.dataSource = dataSource);
@action setShowOperateBtn = bool => (this.showOperateBtn = bool);
// 初始化操作
@action
doInit = params => {
@ -118,6 +121,10 @@ export class TaxAgentStore {
return new Promise((resolve, reject) => {
API.getPermission(params).then(({ status, data }) => {
if (status) {
const { isAdminEnable, isOpenDevolution } = data;
this.setShowOperateBtn(
!isOpenDevolution ? true : isAdminEnable ? true : false
);
resolve({ status, data });
} else {
reject();