薪资核算详情页面添加高级搜索的功能以及添加列表头公式查看的接口

This commit is contained in:
liyongshun 2022-08-02 18:16:49 +08:00
parent cac473595e
commit 2097d2faf7
63 changed files with 1623 additions and 917 deletions

View File

@ -54,7 +54,9 @@ export default class EditableTable extends React.Component {
item.render = (text, record) => (
<Tooltip title={
<div className="popoverBtnWrapper">
<i className="icon-coms-Delete popBtnItem" onClick={() => {this.onItemDelete(record)}} />
<i className="icon-coms-Delete popBtnItem" onClick={() => {
this.onItemDelete(record)
}} />
</div>
}>
<div>{text}</div>
@ -95,7 +97,9 @@ export default class EditableTable extends React.Component {
onItemDelete = (record) => {
let dataSource = [...this.props.dataSource];
dataSource = dataSource.filter(item => item.indexNum != record.indexNum)
dataSource.map((item, index) => {item.indexNum = index + 1})
dataSource.map((item, index) => {
item.indexNum = index + 1
})
this.props.onDataSourceChange(dataSource)
}
render() {
@ -105,7 +109,9 @@ export default class EditableTable extends React.Component {
<div>
{
editable && <div className="operateWrapper">
<i className="icon-coms-tianjia operateItem" onClick={() => { this.props.addItem() }} />
<i className="icon-coms-tianjia operateItem" onClick={() => {
this.props.addItem()
}} />
</div>
}
<Table columns={this.columns} dataSource={this.props.dataSource} {...this.props} />

View File

@ -27,7 +27,9 @@ export default class CustomForm extends React.Component {
<Col span={18}>
{
item.conditionType == "INPUT" &&
<WeaInput value={request[item.domkey[0]]} disabled={disabledValue} onChange={(value) => {this.handleChange({[item.domkey[0]]: value})}}/>
<WeaInput value={request[item.domkey[0]]} disabled={disabledValue} onChange={(value) => {
this.handleChange({[item.domkey[0]]: value})
}}/>
}
{

View File

@ -1,13 +1,24 @@
.antd-wrap {
.ant-table-scroll{
.ant-table-thead > tr > th {
border-right: 1px solid #e2e2e2 !important;
}
}
.ant-table-thead > tr > th {
border-width: 1px !important;
border-right: 1px solid #e2e2e2 !important;
padding: 0 5px !important;
}
.ant-table-bordered .ant-table-fixed-right {
top: 1px !important;
right: 0 !important;
border-radius: 0!important;
.ant-table-thead > tr > th {
border-right: 1px solid #e2e2e2 !important;
}
.ant-table-tbody>tr>td:last-child{
border-right: 1px solid #e2e2e2 !important;
}
thead {
tr > th {
border-top: 1px solid #e2e2e2 !important;
@ -18,6 +29,7 @@
.ant-table-bordered .ant-table-fixed-left {
top: 1px !important;
left: 0 !important;
border-radius: 0!important;
thead {
tr > th {

View File

@ -16,7 +16,9 @@ export default class GroupCard extends React.Component {
<div className="titleWrapper">
<span className="groupTitle">{this.props.title}</span>
<div className="tipWrapper">{this.props.tips}</div>
<div className="operateIconWrapper" onClick={() => {this.setState({showContent: !this.state.showContent})}}>
<div className="operateIconWrapper" onClick={() => {
this.setState({showContent: !this.state.showContent})
}}>
{
this.state.showContent ? <Icon type="down" /> : <Icon type="left" />
}

View File

@ -107,7 +107,9 @@ export default class ImportModal extends React.Component {
templateLink={this.props.templateLink}
headerSetCompoent={this.props.headerSetCompoent}
formComponent={this.props.renderFormComponent && this.props.renderFormComponent()}
onFileIdChange={(fileId) => {this.setState({fileId})}}
onFileIdChange={(fileId) => {
this.setState({fileId})
}}
onStep1Next={() => {
this.handleStep1Next();
}}/>)
@ -120,13 +122,17 @@ export default class ImportModal extends React.Component {
onStep2Next={() => {
this.nextStep();
this.hanleImportData()
}} onStep2Pre={() => {this.preStep()}}/>)
}} onStep2Pre={() => {
this.preStep()
}}/>)
}
{
this.props.step == 2 && (<ModalStep3
// onImportData={() => this.hanleImportData()}
importResult={toJS(this.props.importResult)}
onFinish={() => {this.props.onFinish()}}/>)
onFinish={() => {
this.props.onFinish()
}}/>)
}
</Modal>

View File

@ -113,7 +113,9 @@ export default class ModalStep1 extends React.Component {
(typeof this.props.templateLink) == "string" ?
<a href={`${this.props.templateLink}${downloadExtra}`}>点击这里下载模板</a>
:
<a onClick={() => {this.props.templateLink(hasData === '1' ? `true` : `false`)}}>点击这里下载模板</a>
<a onClick={() => {
this.props.templateLink(hasData === '1' ? `true` : `false`)
}}>点击这里下载模板</a>
}
{this.props.headerSetCompoent && this.props.headerSetCompoent };

View File

@ -74,10 +74,14 @@ export default class SelectItemModal extends React.Component {
<div style={{marginTop: "40px", overflow:"hidden", height: "50px", lineHeight: "50px"}}>
<div style={{float: "left"}}>
<WeaCheckbox content="只显示已选中字段" onChange={(value) => {this.handleShowChecked(value)}}/>
<WeaCheckbox content="只显示已选中字段" onChange={(value) => {
this.handleShowChecked(value)
}}/>
</div>
<div style={{float: "right"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.props.onSave()}}>保存</Button>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {
this.props.onSave()
}}>保存</Button>
<Dropdown.Button overlay={menu}>更多</Dropdown.Button>
</div>
</div>

View File

@ -14,7 +14,9 @@ export default class SelectItemsWrapper extends React.Component {
handleAllChecked(value) {
value = value == 1 ? true : false
let items = [...this.props.items]
items.map(item => { item.checked = value })
items.map(item => {
item.checked = value
})
this.setState({
checkStatus: value
})
@ -36,7 +38,9 @@ export default class SelectItemsWrapper extends React.Component {
return (
<div style={{ margin: "10px 20px" }}>
<div style={{marginBottom: "10px", cursor: "pointer"}} >
<div style={{display: "inline-block"}}><WeaCheckbox content={<span style={{fontWeight: "600"}}>{this.props.title}</span>} onChange={(value) => {this.handleAllChecked(value)}} value={this.state.checkStatus}/></div>
<div style={{display: "inline-block"}}><WeaCheckbox content={<span style={{fontWeight: "600"}}>{this.props.title}</span>} onChange={(value) => {
this.handleAllChecked(value)
}} value={this.state.checkStatus}/></div>
<div style={{float: 'right', fontWeight: "600"}} onClick={() => this.setState({
showContent: !this.state.showContent
})}>已选中{this.props.items ? this.props.items.filter(item => item.checked).length : 0}个字段
@ -57,7 +61,9 @@ export default class SelectItemsWrapper extends React.Component {
<Row>
{
this.props.items && this.props.items.map(item => (
<Col span={6}><WeaCheckbox content={item.name} value={item.checked} onChange={(value) => {this.handleItemChange(value, item)}}/></Col>
<Col span={6}><WeaCheckbox content={item.name} value={item.checked} onChange={(value) => {
this.handleItemChange(value, item)
}}/></Col>
))
}
</Row>

View File

@ -20,7 +20,9 @@ export default class SelectedTab extends React.Component {
<div className="selectedTabWrapper">
{
this.props.items.map(item => (
<div className={item.key == this.state.selectedKey ? "selectedTab selectedItem" : "selectedTab"} onClick={() => {this.handleChange(item)}}>
<div className={item.key == this.state.selectedKey ? "selectedTab selectedItem" : "selectedTab"} onClick={() => {
this.handleChange(item)
}}>
{item.name}
</div>
))

View File

@ -15,7 +15,9 @@ export default class SmallTab extends React.Component {
<div className="smallTab">
{
this.props.items.map(item => (
<span className={selectedItem.title == item.title ? "tabItem tabItemSelected": "tabItem"} onClick={() => {this.setState({selectedItem: item}); this.props.onChange(item)}}>{item.title}</span>
<span className={selectedItem.title == item.title ? "tabItem tabItemSelected": "tabItem"} onClick={() => {
this.setState({selectedItem: item}); this.props.onChange(item)
}}>{item.title}</span>
))
}
</div>

View File

@ -72,7 +72,9 @@ export default class baseFormModal extends React.Component {
render() {
const { salaryMonthStr, salarySobId, description } = this.state;
return (
<Modal title="核算" visible={this.props.visible} width={600} onCancel={() => {this.props.onCancel()}}
<Modal title="核算" visible={this.props.visible} width={600} onCancel={() => {
this.props.onCancel()
}}
footer={<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>}
@ -84,9 +86,11 @@ export default class baseFormModal extends React.Component {
style={{width: "100%"}}
format="yyyy-MM"
value={this.state.salaryMonthStr}
onChange={value => {this.setState({
onChange={value => {
this.setState({
salaryMonthStr: value
})}}
})
}}
/>
</Col>
</Row>

View File

@ -331,6 +331,7 @@ export default class Calculate extends React.Component {
<WeaInputSearch
style={{ marginLeft: "10px" }}
value={this.state.searchValue}
placeholder={"请输入薪资账套名称"}
onChange={value => {
this.setState({ searchValue: value });
}}

View File

@ -127,12 +127,20 @@ export default class AcctResultImportModal extends React.Component {
onFinish={() => {
this.handleFinish()
}}
previewImport={(params) => {fetchPreviewAcctResult(params)}}
importFile={(params) => {fetchImportAcctResult(params)}}
templateLink={ () => { this.handleAccResultTemplateLink()}}
previewImport={(params) => {
fetchPreviewAcctResult(params)
}}
importFile={(params) => {
fetchImportAcctResult(params)
}}
templateLink={ () => {
this.handleAccResultTemplateLink()
}}
renderFormComponent={() => this.renderFormComponent()}
visiable={visiable}
onCancel={() => { this.props.onCancel() }}
onCancel={() => {
this.props.onCancel()
}}
/>
}
{

View File

@ -109,16 +109,22 @@ export default class SelectFieldModal extends React.Component {
render() {
const { fieldData } = this.state;
return (
<Modal visible={this.props.visible} width={800} onCancel={() =>{this.props.onCancel()}}
<Modal visible={this.props.visible} width={800} onCancel={() =>{
this.props.onCancel()
}}
footer={null}
>
<div style={{height: "50px", lineHeight: "50px"}}>
<span style={{fontSize: "14px", fontWeight: "600"}}>添加表头字段</span>
<Button type="primary" style={{float: "right", marginRight: "50px"}} onClick={() => {this.handleAddClick()}}>添加</Button>
<Button type="primary" style={{float: "right", marginRight: "50px"}} onClick={() => {
this.handleAddClick()
}}>添加</Button>
</div>
<div style={{marginTop: "20px"}}>
<div style={{height: "40px", lineHeight: "40px"}}>
<WeaCheckbox content="公式项" onChange={(value) => {this.handleTitleCheckboxChange(value, "formula")}}/>
<WeaCheckbox content="公式项" onChange={(value) => {
this.handleTitleCheckboxChange(value, "formula")
}}/>
</div>
<div style={{height: "100px", border: "1px solid #f2f2f2", margin: "10px", padding: "10px", overflowY: 'scroll'}}>
<Row>
@ -133,7 +139,9 @@ export default class SelectFieldModal extends React.Component {
<div style={{marginTop: "20px"}}>
<div style={{height: "50px", lineHeight: "50px"}}>
<WeaCheckbox content="输入项" onChange={(value) => {this.handleTitleCheckboxChange(value, "input")}}/>
<WeaCheckbox content="输入项" onChange={(value) => {
this.handleTitleCheckboxChange(value, "input")
}}/>
</div>
<div style={{height: "100px", border: "1px solid #f2f2f2", margin: "10px", padding: "10px", overflowY: "scroll"}}>
<Row>
@ -147,7 +155,9 @@ export default class SelectFieldModal extends React.Component {
</div>
<div style={{marginTop: "20px"}}>
<WeaCheckbox content="只显示已选中" onChange={(value) => {this.showSelectedChange(value)}}/>
<WeaCheckbox content="只显示已选中" onChange={(value) => {
this.showSelectedChange(value)
}}/>
</div>
</Modal>
)

View File

@ -175,9 +175,13 @@ export default class CompareDetail extends React.Component {
<div style={{display: "inline-block"}}>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => this.handleImportClick()} >导入</Button>
<Button type="default" style={{marginRight: "10px"}} onClick={() => this.handleExportClick()}>导出</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {this.setState({
<WeaInputSearch value={searchValue} onChange={(value) => {
this.setState({
searchValue: value
})}} onSearch={(value) => {this.handleSearch(value)}}/>
})
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
)
}

View File

@ -64,11 +64,19 @@ export default class CompareDetailImportModal extends React.Component {
this.props.onCancel();
this.props.onFinish();
}}
previewImport={(params) => {previewComparisonResult(params)}}
importFile={(params) => {importComparisonExcelAcctResult(params)}}
templateLink={ () => { this.handleTemplateLink()}}
previewImport={(params) => {
previewComparisonResult(params)
}}
importFile={(params) => {
importComparisonExcelAcctResult(params)
}}
templateLink={ () => {
this.handleTemplateLink()
}}
visiable={visiable}
onCancel={() => { this.props.onCancel() }}
onCancel={() => {
this.props.onCancel()
}}
/>
}
</div>

View File

@ -1,20 +1,27 @@
import React from "react";
import UserSure from "./userSure";
import { inject, observer } from "mobx-react";
import CustomTab from "../../components/customTab";
import SalaryDetail from "./salaryDetail";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import { WeaInputSearch } from "ecCom";
import { WeaBrowser, WeaCheckbox, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom";
import { getQueryString } from "../../util/url";
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
import ProgressModal from "../../components/progressModal";
@inject("calculateStore")
@inject("calculateStore", "salaryFileStore")
@observer
export default class CalculateDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
showSearchAd: false,
searchItemsValue: {
employeeName: "",
departmentIds: "",
positionIds: "",
status: "",
consolidatedTaxation: "0"
},
selectedKey: "0",
fieldData: {},
acctResultImportVisiable: false,
@ -28,12 +35,94 @@ export default class CalculateDetail extends React.Component {
componentWillMount() {
let id = getQueryString("id");
this.id = id;
const { calculateStore: { checkTaxAgent } } = this.props;
const { calculateStore: { checkTaxAgent }, salaryFileStore } = this.props;
const { commonEnumList } = salaryFileStore;
checkTaxAgent(this.id);
let modalParam = { ...this.state.modalParam, salaryAcctRecordId: id };
this.setState({ modalParam });
commonEnumList("user", { enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" });
}
Input = (value, key) => {
const { employeeName } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaInput value={employeeName} onChange={(val) => this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
[key]: val
}
})}/>
</WeaFormItem>
);
};
Browser = (value, key) => {
const { positionIds, departmentIds } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaBrowser
isSingle={false}
value={key === "departmentIds" ? departmentIds : positionIds}
tabs={key === "departmentIds" ? [
{
dataParams: { list: "1" },
isSearch: true,
key: "1",
name: "按列表",
selected: false,
showOrder: 0
}
] : null}
type={key === "departmentIds" ? 57 : 278}
onChange={(val) => {
this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } });
}}/>
</WeaFormItem>
);
};
Select = (value, key) => {
const { salaryFileStore } = this.props;
const { status } = this.state.searchItemsValue;
const { userStatusList } = salaryFileStore;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaSelect
value={status}
options={userStatusList}
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
</WeaFormItem>
);
};
Checkbox = (value, key) => {
const { consolidatedTaxation } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaCheckbox value={consolidatedTaxation} content="是" onChange={(val) => this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
[key]: val
}
})}/>
</WeaFormItem>
);
};
// 核算点击事件
handleAccount() {
const { calculateStore } = this.props;
@ -64,7 +153,7 @@ export default class CalculateDetail extends React.Component {
progressVisible: false
});
message.success("核算完成");
acctResultList(this.id);
acctResultList({ salaryAcctRecordId: this.id });
} else if (!data.status) {
clearInterval(this.timer);
this.timer = null;
@ -109,9 +198,9 @@ export default class CalculateDetail extends React.Component {
}
// 核算结果搜索
handleSearch(value) {
handleSearch(params) {
const { calculateStore: { acctResultList } } = this.props;
acctResultList(this.id, value);
acctResultList({ salaryAcctRecordId: this.id, ...params });
}
componentWillUnmount() {
@ -122,7 +211,7 @@ export default class CalculateDetail extends React.Component {
}
render() {
const { selectedKey, modalParam, acctResultImportVisiable } = this.state;
const { selectedKey, modalParam, acctResultImportVisiable, showSearchAd } = this.state;
const { calculateStore } = this.props;
const { calculateProgress } = calculateStore;
@ -135,31 +224,17 @@ export default class CalculateDetail extends React.Component {
);
const renderRightOperation = () => {
if (selectedKey == "1") {
return (
<div style={{ display: "inline-block" }}>
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleAccount()}>
核算
</Button>
{/* <Button type="default" style={{marginRight: "10px"}} onClick={() => this.setState({stepSlideVisible: true})}>校验</Button> */}
<Dropdown.Button style={{ marginRight: "10px" }} overlay={menu}>
更多
</Dropdown.Button>
<WeaInputSearch
value={this.state.searchValue}
onChange={value => {
this.setState({ searchValue: value });
}}
onSearch={value => {
this.handleSearch(value);
}}
/>
</div>
);
}
return [
<Button
type="primary"
style={{ marginRight: "10px" }}
onClick={() => this.handleAccount()}>
核算
</Button>,
<Dropdown.Button style={{ marginRight: "10px" }} overlay={menu}>
更多
</Dropdown.Button>
];
};
const topTab = [
@ -173,14 +248,66 @@ export default class CalculateDetail extends React.Component {
}
];
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={() => {
this.setState({ showSearchAd: false }, () => {
this.handleSearch(this.state.searchItemsValue);
});
}}>
搜索
</Button>,
<Button type="ghost" onClick={() => this.setState({
searchItemsValue: {
employeeName: "",
departmentIds: "",
positionIds: "",
status: "",
consolidatedTaxation: "0"
}
})}>
重置
</Button>,
<Button type="ghost" onClick={() => this.setState({ showSearchAd: false })}>
取消
</Button>
];
const renderSearch = () => {
const searchItems = [
{ com: this.Input("姓名", "employeeName") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("状态", "status") },
{ com: this.Checkbox("合并计税", "consolidatedTaxation") }
];
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;
};
return (
<div style={{ overflowY: "hidden", height: "100%" }}>
<CustomTab
topTab={topTab}
searchOperationItem={renderRightOperation()}
onChange={v => {
this.setState({ selectedKey: v });
}}
<WeaTab
datas={topTab}
selectedKey={selectedKey}
keyParam="viewcondition"
onChange={v => this.setState({ selectedKey: v })}
searchType={selectedKey == 1 ? ["base", "advanced"] : []} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调
buttons={selectedKey == 1 ? renderRightOperation() : []}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
employeeName: v
}
})
} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
/>
{selectedKey == 0 && <UserSure/>}
{selectedKey == 1 &&

View File

@ -12,9 +12,10 @@
}
.operateBarWrapper {
border-bottom: 1px solid #eee;
line-height: 47px;
height: 47px;
display: flex;
align-items: center;
justify-content: space-between;
.crumbsWrapper {
display: inline-block;
@ -30,17 +31,18 @@
}
.crumbsOperateWrapper {
float: right;
display: inline-block;
.headerIcon {
display: inline-block;
.iconItem {
margin-right: 15px;
flex: 1;
.wea-advanced-search{
right: 0!important;
}
.wea-advanced-searchsAd{
height: inherit!important;
}
.wea-search-tab{
padding-right: 0;
.iconItem{
color: #2db7f5;
cursor: pointer;
font-size: 16px;
}
}
}
@ -57,7 +59,6 @@
line-height: 47px;
padding-left: 10px;
padding-right: 10px;
border-bottom: 1px solid #eee;
.warningspan {
float: right;

View File

@ -17,7 +17,9 @@ export default class PlaceOnFileDetail extends React.Component {
placeOnFileColumns.map(item => {
if(item.dataIndex == "username") {
item.render = (text, record) => (
<a onClick={() => {this.onDetail()}}>{text}</a>
<a onClick={() => {
this.onDetail()
}}>{text}</a>
)
}
})
@ -71,7 +73,9 @@ export default class PlaceOnFileDetail extends React.Component {
title: '操作',
key: "cz",
render: (text, record) => {
return <a onClick={() => {this.handleEdit(record)}}>编辑</a>
return <a onClick={() => {
this.handleEdit(record)
}}>编辑</a>
}
})
return columns;
@ -138,8 +142,14 @@ export default class PlaceOnFileDetail extends React.Component {
const renderRightOperation = () => {
return (
<div style={{display: "inline-block"}}>
<Dropdown.Button type="primary" style={{marginRight: "10px"}} onClick={() => {this.handleExportAll()}} overlay={menu}>导出全部</Dropdown.Button>
<WeaInputSearch onChange={(value) => {this.setState({searchValue: value})}} value={this.state.searchValue} onSearch={(value) => {this.handleSearch(value)}}/>
<Dropdown.Button type="primary" style={{marginRight: "10px"}} onClick={() => {
this.handleExportAll()
}} overlay={menu}>导出全部</Dropdown.Button>
<WeaInputSearch onChange={(value) => {
this.setState({searchValue: value})
}} value={this.state.searchValue} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
)
}

View File

@ -7,6 +7,7 @@ import EditSalaryDetail from "./editSalaryDetail";
import SlideModalTitle from "../../components/slideModalTitle";
import { getQueryString } from "../../util/url";
import { inject, observer } from "mobx-react";
import { toJS } from 'mobx';
import CustomPaginationTable from "../../components/customPaginationTable";
@inject("calculateStore", "taxAgentStore")
@ -15,6 +16,7 @@ export default class SalaryDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
columnIndex:"",
visible: false,
slideVisiable: false,
columns: salaryDetailColumns.map(item => {
@ -38,7 +40,7 @@ export default class SalaryDetail extends React.Component {
let id = getQueryString("id");
this.id = id;
const { calculateStore: { acctResultList, getSalarySobCycle } } = this.props;
acctResultList(id);
acctResultList({ salaryAcctRecordId: id });
getSalarySobCycle(id);
}
@ -62,14 +64,14 @@ export default class SalaryDetail extends React.Component {
let columns = acctResultListColumns ? [...acctResultListColumns] : [];
columns = columns.filter(item => item.hide == "FALSE").map(item => {
let result = { ...item };
result.title = item.text;
result.title = <span onClick={()=>this.setState({columnIndex: item.column})}>{item.text}</span>;;
result.dataIndex = item.column;
result.oldWidth = result.width;
result.width = "150px";
if (result.children) {
result.width = (result.children.length * 150) + "px";
result.children.map(child => {
child.title = child.text;
child.title = <span onClick={()=>this.setState({columnIndex: child.column})}>{child.text}</span>;
child.dataIndex = child.column;
child.width = "150px";
});
@ -114,31 +116,33 @@ export default class SalaryDetail extends React.Component {
slideVisiable: false
});
saveAcctResult(this.recordId).then(() => {
acctResultList(this.id);
acctResultList({ salaryAcctRecordId: this.id });
});
}
// 分页
handleDataPageChange(value) {
handleDataPageChange(current) {
const { calculateStore: { acctResultList } } = this.props;
acctResultList(this.id, this.props.employeeName, value, this.pageInfo);
acctResultList({ salaryAcctRecordId: this.id, employeeName: this.props.employeeName, ...this.pageInfo, current });
}
handleShowSizeChange(pageInfo) {
const { calculateStore: { acctResultList } } = this.props;
acctResultList(this.id, this.props.employeeName, pageInfo.current, pageInfo);
acctResultList({ salaryAcctRecordId: this.id, employeeName: this.props.employeeName, ...pageInfo });
}
render() {
const { slideVisiable } = this.state;
const { slideVisiable, columnIndex } = this.state;
const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props;
const {
acctResultListDateSource,
acctResultListColumns,
baseSalarySobCycle,
acctResultListPageInfo,
loading
loading,
columnDescList
} = calculateStore;
return (
<div className="salaryDetail">
<div className="salaryBarWrapper">
@ -160,6 +164,10 @@ export default class SalaryDetail extends React.Component {
this.setState({ visible: true });
}}>校验异常0</span>
</div>
<div className="salaryBarWrapper" style={{ borderBottom: "1px solid #eee" }}>
<span>公式=</span>
<span>{toJS(columnDescList)[columnIndex] && toJS(columnDescList)[columnIndex].formulaContent}</span>
</div>
<div className="tableWrapper">
<CustomPaginationTable
loading={loading}

View File

@ -1,17 +1,24 @@
import React from "react";
import { Col, Icon, message, Modal, Row } from "antd";
import { WeaBrowser, WeaHelpfulTip, WeaInputSearch } from "ecCom";
import { Button, Col, Icon, message, Modal, Row } from "antd";
import { WeaBrowser, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom";
import { inject, observer } from "mobx-react";
import "./index.less";
import { getQueryString } from "../../util/url";
import CustomPaginationTable from "../../components/customPaginationTable";
@inject("calculateStore")
@inject("calculateStore", "salaryFileStore")
@observer
export default class UserSure extends React.Component {
constructor(props) {
super(props);
this.state = {
showSearchAd: false,
searchItemsValue: {
employeeName: "",
departmentIds: "",
positionIds: "",
status: "",
},
selectedKey: "0",
selectedRowKeys: [], // table 选中项
userListSearchValue: ""
@ -47,6 +54,69 @@ export default class UserSure extends React.Component {
getSalarySobCycle(id);
}
Input = (value, key) => {
const { employeeName } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaInput value={employeeName} onChange={(val) => this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
[key]: val
}
})}/>
</WeaFormItem>
);
};
Browser = (value, key) => {
const { positionIds, departmentIds } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaBrowser
isSingle={false}
value={key === "departmentIds" ? departmentIds : positionIds}
tabs={key === "departmentIds" ? [
{
dataParams: { list: "1" },
isSearch: true,
key: "1",
name: "按列表",
selected: false,
showOrder: 0
}
] : null}
type={key === "departmentIds" ? 57 : 278}
onChange={(val) => {
this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } });
}}/>
</WeaFormItem>
);
};
Select = (value, key) => {
const { salaryFileStore } = this.props;
const { status } = this.state.searchItemsValue;
const { userStatusList } = salaryFileStore;
return (
<WeaFormItem
label={value}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<WeaSelect
value={status}
options={userStatusList}
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
</WeaFormItem>
);
};
// 添加人员回调
handleUserBrowserChange(ids) {
if (ids && ids.length > 0) {
@ -251,7 +321,7 @@ export default class UserSure extends React.Component {
}
// 搜索
handleUserListSearch(value) {
handleUserListSearch=(value)=> {
const {
calculateStore: { acctemployeeList, reducedemployeeList }
} = this.props;
@ -259,14 +329,14 @@ export default class UserSure extends React.Component {
if (this.state.selectedKey == 0) {
acctemployeeList({
salaryAcctRecordId: this.id,
employeeName: value,
...value,
...this.pageInfo
});
this.current = 1;
} else {
reducedemployeeList({
salaryAcctRecordId: this.id,
employeeName: value,
...value,
...this.pageInfo
});
this.current = 1;
@ -274,7 +344,7 @@ export default class UserSure extends React.Component {
}
render() {
const { selectedRowKeys } = this.state;
const { selectedRowKeys, showSearchAd, selectedKey } = this.state;
const { calculateStore } = this.props;
const {
calculateBaseForm,
@ -293,6 +363,40 @@ export default class UserSure extends React.Component {
onChange: this.onSelectChange
};
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={() => {
this.setState({ showSearchAd: false }, () => {
this.handleUserListSearch(this.state.searchItemsValue);
});
}}>
搜索
</Button>,
<Button type="ghost" onClick={() => this.setState({
searchItemsValue: {
employeeName: "",
departmentIds: "",
positionIds: "",
status: "",
}
})}>
重置
</Button>,
<Button type="ghost" onClick={() => this.setState({ showSearchAd: false })}>
取消
</Button>
];
const renderSearch = () => {
const searchItems = [
{ com: this.Input("姓名", "employeeName") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("状态", "status") }
];
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;
};
return (
<div className="userSure">
<div className="baseInfo">基本信息</div>
@ -350,91 +454,150 @@ export default class UserSure extends React.Component {
</Row>
</div>
<div className="operateBarWrapper">
<div>
<div className="crumbsWrapper">
<span
className={
this.state.selectedKey == "0"
? "crumbItem crumbItemSelected"
: "crumbItem"
}
onClick={() => {
this.setState({ selectedKey: "0" });
}}>
核算人员范围
</span>
<WeaHelpfulTip
width={200}
title="核算完若薪资档案中个税扣缴义务人发生调整,需先刷新【核算人员范围】再到【薪资核算】中重新核算"
placement="topLeft"
/>
{" "}|{" "}
<span
className={
this.state.selectedKey == "1"
? "crumbItem crumbItemSelected"
: "crumbItem"
}
onClick={() => {
this.setState({ selectedKey: "1" });
}}>
环比上月减少人员
</span>
<WeaHelpfulTip
width={200}
title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下减少的人员"
placement="topLeft"
/>
</div>
<div className="crumbsOperateWrapper">
{this.state.selectedKey == "0" &&
<div className="headerIcon">
<Icon
className="iconItem"
type="minus-square"
onClick={() => {
this.handleBatchDelete();
}}
title="批量删除"
/>
<WeaBrowser
type={17}
title="添加人员"
isSingle={false}
customized
onChange={(ids, names, datas) =>
this.handleUserBrowserChange(ids)}>
<Icon className="iconItem" type="plus-square" title="新增"/>
</WeaBrowser>
<i
className="icon-coms-fawen iconItem"
onClick={() => {
this.handleExport();
}}
style={{ fontSize: 20, position: "relative", top: "2px" }}
title="导出"
/>
<i
className="icon-coms-Synchro iconItem"
onClick={() => {
this.handleRefresh();
}}
style={{ fontSize: 20, position: "relative", top: "2px" }}
title="刷新"
/>
</div>}
<WeaInputSearch
className="searchInput"
value={this.state.userListSearchValue}
onChange={value => {
this.setState({ userListSearchValue: value });
}}
onSearch={value => {
this.handleUserListSearch(value);
}}
/>
</div>
<div className="crumbsWrapper">
<span
className={
this.state.selectedKey == "0"
? "crumbItem crumbItemSelected"
: "crumbItem"
}
onClick={() => {
this.setState({ selectedKey: "0" });
}}>
核算人员范围
</span>
<WeaHelpfulTip
width={200}
title="核算完若薪资档案中个税扣缴义务人发生调整,需先刷新【核算人员范围】再到【薪资核算】中重新核算"
placement="topLeft"
/>
<span style={{ margin: "0 8px" }}>|</span>
<span
className={
this.state.selectedKey == "1"
? "crumbItem crumbItemSelected"
: "crumbItem"
}
onClick={() => {
this.setState({ selectedKey: "1" });
}}>
环比上月减少人员
</span>
<WeaHelpfulTip
width={200}
title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下减少的人员"
placement="topLeft"
/>
</div>
<div className="crumbsOperateWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleUserListSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调
buttons={selectedKey == 0 ? [
<Icon
className="iconItem"
style={{ fontSize: 16 }}
type="minus-square"
onClick={() => {
this.handleBatchDelete();
}}
title="批量删除"
/>,
<WeaBrowser
type={17}
title="添加人员"
isSingle={false}
customized
onChange={(ids, names, datas) =>
this.handleUserBrowserChange(ids)}>
<Icon type="plus-square" title="新增"
className="iconItem"
style={{ fontSize: 16 }}/>
</WeaBrowser>,
<i
className="icon-coms-fawen iconItem"
onClick={() => {
this.handleExport();
}}
style={{ fontSize: 20, position: "relative", top: 2 }}
title="导出"
/>,
<i
className="icon-coms-Synchro iconItem"
onClick={() => {
this.handleRefresh();
}}
style={{ fontSize: 20, position: "relative", top: 2 }}
title="刷新"
/>
] : []}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
employeeName: v
}
})
} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
/>
</div>
{/*<div className="crumbsOperateWrapper">*/}
{/*{this.state.selectedKey == "0" &&*/}
{/* <div className="headerIcon">*/}
{/* <Icon*/}
{/* className="iconItem"*/}
{/* type="minus-square"*/}
{/* onClick={() => {*/}
{/* this.handleBatchDelete();*/}
{/* }}*/}
{/* title="批量删除"*/}
{/* />*/}
{/* <WeaBrowser*/}
{/* type={17}*/}
{/* title="添加人员"*/}
{/* isSingle={false}*/}
{/* customized*/}
{/* onChange={(ids, names, datas) =>*/}
{/* this.handleUserBrowserChange(ids)}>*/}
{/* <Icon className="iconItem" type="plus-square" title="新增"/>*/}
{/* </WeaBrowser>*/}
{/* <i*/}
{/* className="icon-coms-fawen iconItem"*/}
{/* onClick={() => {*/}
{/* this.handleExport();*/}
{/* }}*/}
{/* style={{ fontSize: 20, position: "relative" }}*/}
{/* title="导出"*/}
{/* />*/}
{/* <i*/}
{/* className="icon-coms-Synchro iconItem"*/}
{/* onClick={() => {*/}
{/* this.handleRefresh();*/}
{/* }}*/}
{/* style={{ fontSize: 20, position: "relative" }}*/}
{/* title="刷新"*/}
{/* />*/}
{/* </div>}*/}
{/*<WeaInputSearch*/}
{/* className="searchInput"*/}
{/* value={this.state.userListSearchValue}*/}
{/* onChange={value => {*/}
{/* this.setState({ userListSearchValue: value });*/}
{/* }}*/}
{/* onSearch={value => {*/}
{/* this.handleUserListSearch(value);*/}
{/* }}*/}
{/*/>*/}
{/*</div>*/}
</div>
<div className="tableWrapper">
{this.state.selectedKey == 0 &&

View File

@ -63,8 +63,7 @@ export default class ItemMangeFormModal extends React.Component {
<Modal width={600} visible={this.props.visible} onCancel={this.props.onCancel}
title={"新建自定义字段"}
footer={
<Button type="primary" onClick={() =>
{
<Button type="primary" onClick={() => {
currentItemOperate == "add" ? this.props.onSave(this.state.request) :
this.props.onUpdate(this.state.request)
}
@ -77,7 +76,9 @@ export default class ItemMangeFormModal extends React.Component {
字段名称
</Col>
<Col span={16}>
<WeaInput style={{width: "200px"}} value={fieldName} onChange={(v) => {this.handleChange({fieldName: v})}}/>
<WeaInput style={{width: "200px"}} value={fieldName} onChange={(v) => {
this.handleChange({fieldName: v})
}}/>
</Col>
</Row>
<Row gutter={[10, 10]} style={{marginBottom: "10px"}}>

View File

@ -90,8 +90,12 @@ export default class RefereAttendFormModal extends React.Component {
return (
<Modal width={600} title="引用考勤数据" footer={
<div style={{display: "inline-block"}}>
<Button type="primary" onClick={() => {this.handleSync()}}>同步</Button>
<Button type="default" onClick={() => {this.handleHeaderSet()}}>表头设置</Button>
<Button type="primary" onClick={() => {
this.handleSync()
}}>同步</Button>
<Button type="default" onClick={() => {
this.handleHeaderSet()
}}>表头设置</Button>
</div>
} visible={this.props.visible} onCancel={this.props.onCancel}>
<Row style={{marginBottom: "10px"}}>
@ -150,13 +154,25 @@ export default class RefereAttendFormModal extends React.Component {
<SelectItemModal
onShowChecked={(value) => {this.props.onShowChecked(value)}}
onRestoreDefault={() => {this.props.onRestoreDefault()}}
onSetDefault={() => {this.props.onSetDefault()}}
onSearch={(value) => {this.props.onSearch(value)}}
onSave={(value) => {this.props.onSave(value)}}
onShowChecked={(value) => {
this.props.onShowChecked(value)
}}
onRestoreDefault={() => {
this.props.onRestoreDefault()
}}
onSetDefault={() => {
this.props.onSetDefault()
}}
onSearch={(value) => {
this.props.onSearch(value)
}}
onSave={(value) => {
this.props.onSave(value)
}}
visible={this.state.headerSetVisible} onCancel={() => this.setState({headerSetVisible: false})}>
<SelectItemsWrapper items={this.props.items} title={"考勤模块"} onChange={(value) => {this.props.onChange(value)}}/>
<SelectItemsWrapper items={this.props.items} title={"考勤模块"} onChange={(value) => {
this.props.onChange(value)
}}/>
</SelectItemModal>
</Modal>

View File

@ -511,6 +511,7 @@ export default class CumDeduct extends React.Component {
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
searchsBasePlaceHolder={"请输入姓名"}
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据

View File

@ -517,6 +517,7 @@ export default class CumSituation extends React.Component {
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
searchsBasePlaceHolder={"请输入姓名"}
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据

View File

@ -510,6 +510,7 @@ export default class OtherDeduct extends React.Component {
<div className="weaTabWrapper">
<WeaTab
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
searchsBasePlaceHolder={"请输入姓名"}
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据

View File

@ -18,7 +18,9 @@ export default class CalRulesForm extends React.Component {
if(item.key == "cz") {
item.render = (text, record) => {
return (
<a onClick={() => {this.handleDeleteItem(record)}}>删除</a>
<a onClick={() => {
this.handleDeleteItem(record)
}}>删除</a>
)
}
}
@ -85,7 +87,9 @@ export default class CalRulesForm extends React.Component {
<div className="headerIcon">
{
canEdit ==='true'&&
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
<Icon className="iconItem" type="plus-square" onClick={() => {
this.setState({modalVisible: true})
}}/>
}
</div>
<div className="tableWrapper">
@ -96,7 +100,9 @@ export default class CalRulesForm extends React.Component {
this.state.modalVisible && <RuleEditModal
visible={this.state.modalVisible}
onCancel={() => this.setState({modalVisible: false})}
onSave={(params) => {this.handleSave(params)}}
onSave={(params) => {
this.handleSave(params)
}}
/>
}
</div>

View File

@ -263,6 +263,7 @@ export default class Ledger extends React.Component {
onChange={value => {
this.setState({ searchValue: value });
}}
placeholder={"请输入薪资账套名称"}
onSearch={value => {
this.handleSearch(value);
}}

View File

@ -191,7 +191,12 @@ export default class SlideBaseForm extends React.Component {
key: "1",
selected: true,
showname: "正常工资薪金所得"
}
},
{
key: "4",
selected: false,
showname: "劳务报酬所得"
},
]}
style={{width: "190px"}}
value={taxableItems}

View File

@ -13,14 +13,20 @@ export default class AddCategoryModal extends React.Component {
}
render() {
return (
<Modal title={this.props.title && this.props.title !== '' ? "修改分类" : "新增分类"} footer={<Button type="primary" onClick={() => {this.props.onSave(this.state.name)}}>保存</Button>} width={600}
visible={this.props.visible} onCancel={() => {this.props.onCancel()}}
<Modal title={this.props.title && this.props.title !== '' ? "修改分类" : "新增分类"} footer={<Button type="primary" onClick={() => {
this.props.onSave(this.state.name)
}}>保存</Button>} width={600}
visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}}
>
<div style={{padding: "20px"}}>
<Row style={{display:"flex", alignItems:"center"}}>
<Col span={6}>分类名称<RequiredLabelTip /></Col>
<Col span={18}>
<WeaInput value={this.state.name} onChange={(value) => {this.setState({name: value})}}/>
<WeaInput value={this.state.name} onChange={(value) => {
this.setState({name: value})
}}/>
</Col>
</Row>
</div>

View File

@ -98,15 +98,23 @@ export default class AddSalaryItemModal extends React.Component {
return (
<Modal
visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={900} height={600}
visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} width={900} height={600}
style={{top: 20}}
footer={null}
>
<div style={{height: "47px", lineHeight: '47px'}}>
<span style={{marginLeft: "10px", fontSize: '14px'}}>添加薪资项目</span>
<div style={{float: "right", marginRight: "40px"}}>
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {this.handleAdd()}}>添加</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {
this.handleAdd()
}}>添加</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {
this.setState({searchValue: value})
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
</div>
@ -125,7 +133,9 @@ export default class AddSalaryItemModal extends React.Component {
columns={this.getColumns(addSalaryItemColumns)}
rowSelection={rowSelection}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
onChange: (value) => {
this.handleDataPageChange(value)
},
total: addSalaryItemPageInfo.total,
showTotal: (total) => `${total}`,
current: addSalaryItemPageInfo.pageNum

View File

@ -72,7 +72,9 @@ export default class UserInfoSelected extends React.Component {
}}/>
))
}
<Icon type="plus" style={{marginLeft: "10px", marginRight: "10px", cursor: "pointer"}} onClick={() => {this.setState({showSelect: true})}}/>
<Icon type="plus" style={{marginLeft: "10px", marginRight: "10px", cursor: "pointer"}} onClick={() => {
this.setState({showSelect: true})
}}/>
{
this.state.showSelect && empBrowserList.length > 0 && <WeaSelect showSearch options={empBrowserList} onChange={(value) => {
this.handleSelectChange(value)

View File

@ -58,7 +58,9 @@ export default class PreviewSalaryModal extends React.Component {
visible={this.props.visible}
title="预览"
width={800}
onCancel={() => {this.props.onCancel()}}
onCancel={() => {
this.props.onCancel()
}}
footer={null}
>
<WeaTable columns={this.getColumns().columns} dataSource={[]} scroll={{x: this.getColumns().length * 150}}/>

View File

@ -91,8 +91,12 @@ export default class RuleEditModal extends React.Component {
const { ruleOptionList } = ledgerStore;
const { beforeAdjustmentType, afterAdjustmentType, initedSelect } = this.state
return (
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={800}
footer={<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>}
<Modal visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} width={800}
footer={<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>}
title="调薪计薪规则项"
>
<div style={{padding: '20px'}}>
@ -101,7 +105,9 @@ export default class RuleEditModal extends React.Component {
<Col span={16}>
{
initedSelect &&
<WeaSelect style={{width: "200px"}} options={ruleOptionList} value={this.state.itemValue} onChange={(value) => {this.setState({itemValue: value})} } />
<WeaSelect style={{width: "200px"}} options={ruleOptionList} value={this.state.itemValue} onChange={(value) => {
this.setState({itemValue: value})
} } />
}
</Col>
</Row>
@ -116,7 +122,9 @@ export default class RuleEditModal extends React.Component {
placement="topLeft"
/>
如果调薪生效日期在
<WeaSelect style={{width: '100px'}} options={daysOptions} value={this.state.effectiveDate} onChange={(value) => {this.setState({effectiveDate: value})}}/>
<WeaSelect style={{width: '100px'}} options={daysOptions} value={this.state.effectiveDate} onChange={(value) => {
this.setState({effectiveDate: value})
}}/>
之前
@ -124,7 +132,9 @@ export default class RuleEditModal extends React.Component {
<div>
计薪规则为
<Radio.Group onChange={(value) => {this.beforeAdjustmentTypeChange(value)}} value={beforeAdjustmentType}>
<Radio.Group onChange={(value) => {
this.beforeAdjustmentTypeChange(value)
}} value={beforeAdjustmentType}>
<Radio value={1}>取调整后薪资</Radio>
<Radio value={2}>分段计薪<WeaHelpfulTip
style={{marginLeft: "10px"}}
@ -146,7 +156,9 @@ export default class RuleEditModal extends React.Component {
</div>
<div>
计薪规则为
<Radio.Group onChange={(value) => {this.afterAdjustmentTypeChange(value)}} value={afterAdjustmentType}>
<Radio.Group onChange={(value) => {
this.afterAdjustmentTypeChange(value)
}} value={afterAdjustmentType}>
<Radio value={1}>取调整前薪资</Radio>
<Radio value={2}>分段计薪<WeaHelpfulTip
style={{marginLeft: "10px"}}

View File

@ -13,7 +13,9 @@ export default class PayrollModal extends React.Component {
render() {
const { mySalaryStore: { mySalaryBill }} = this.props;
return (
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}}
<Modal visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}}
width={900}
footer={null}>
<div className="computerTemplate" style={{

View File

@ -60,12 +60,20 @@ function beforeUpload(file) {
<div className="uploadPictureWrapper">
{
(imageUrl || imageUrl == "") ?
<div className="previewWrapper" onMouseEnter={() => {this.setState({showOperate: true})}} onMouseLeave={() => {this.setState({showOperate: false})}}>
<div className="previewWrapper" onMouseEnter={() => {
this.setState({showOperate: true})
}} onMouseLeave={() => {
this.setState({showOperate: false})
}}>
<img src={imageUrl} alt="" className="previewImg"/>
{
this.state.showOperate && <div className="operateWrapper">
<i className="icon-coms-Supervise operateIcon" onClick={() => {this.handlePreview()}}/>
<i className="icon-coms-Delete operateIcon" onClick={() => {this.handleDelete()}}/>
<i className="icon-coms-Supervise operateIcon" onClick={() => {
this.handlePreview()
}}/>
<i className="icon-coms-Delete operateIcon" onClick={() => {
this.handleDelete()
}}/>
</div>
}
</div>
@ -74,7 +82,9 @@ function beforeUpload(file) {
<Icon type="plus" className="avatar-uploader-trigger" />
</Upload>
}
<Modal visible={this.state.visible} width={600} footer={null} onCancel={() => {this.setState({visible: false})}} >
<Modal visible={this.state.visible} width={600} footer={null} onCancel={() => {
this.setState({visible: false})
}} >
<div style={{width: "100%", textAlign: "center"}}>
<img src={imageUrl}/>
</div>

View File

@ -22,14 +22,20 @@ export default class CopyModal extends React.Component {
render(){
const { name } = this.state;
return (
<Modal width={600} title="复制工资单" visible={this.props.visible} onCancel={() => {this.props.onCancel()}} footer={
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
<Modal width={600} title="复制工资单" visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} footer={
<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>
}>
<Row>
<Col span={6}>工资单名称<RequiredLabelTip /></Col>
<Col span={18}>
<WeaInput value={name}
onChange={(value) => {this.handleChange(value)}}/>
onChange={(value) => {
this.handleChange(value)
}}/>
</Col>
</Row>
</Modal>

View File

@ -72,11 +72,15 @@ export default class PayrollDetail extends React.Component {
item.render = (text,record) => {
if(text == 'ALREADYSEND') {
return (
<a onClick={() => {this.handleWithdraw(record)}}>撤回</a>
<a onClick={() => {
this.handleWithdraw(record)
}}>撤回</a>
)
} else {
return (
<a onClick={() => {this.handleGrant(record)}}>发送</a>
<a onClick={() => {
this.handleGrant(record)
}}>发送</a>
)
}
}
@ -155,7 +159,9 @@ export default class PayrollDetail extends React.Component {
setShowSearchAd={bool => setDetailListShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(detailListConditionForm, toJS(detailListCondition), 2)} // 高级搜索内部数据
// buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => {this.handleSearch()}} // 点搜索按钮时的回调
onSearch={() => {
this.handleSearch()
}} // 点搜索按钮时的回调
// searchsAdQuick={this.getSearchsAdQuick()}
onSearchChange={v => detailListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={detailListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步

View File

@ -127,22 +127,30 @@ export default class ShowSettingForm extends React.Component {
<Row>
<Col span={8}>工资单主题<RequiredLabelTip /></Col>
<Col span={16}>
<WeaInput style={{width: "200px"}} value={theme} onChange={(value) => {this.handleChange({theme:value})}}/>
<WeaInput style={{width: "200px"}} value={theme} onChange={(value) => {
this.handleChange({theme:value})
}}/>
</Col>
</Row>
</Col>
<Col span={12}>
<span style={{float: "right"}}>
插入变量
<a onClick={() => {this.handleThemeNameCllck("${companyName}")}} className="themeFormalStr">公司名称</a>
<a onClick={() => {this.handleThemeNameCllck("${salaryMonth}")}} className="themeFormalStr">薪资所属月</a>
<a onClick={() => {
this.handleThemeNameCllck("${companyName}")
}} className="themeFormalStr">公司名称</a>
<a onClick={() => {
this.handleThemeNameCllck("${salaryMonth}")
}} className="themeFormalStr">薪资所属月</a>
</span>
</Col>
</Row>
<Row className="formItem">
<Col span={4}>工资单背景</Col>
<Col span={20}>
<BackgroundUpload imageUrl={background} onChange={(value) => {this.handleChange({background: value})}}/>
<BackgroundUpload imageUrl={background} onChange={(value) => {
this.handleChange({background: value})
}}/>
{/* <Dragger {...dropProps} style={{width: "100px"}}>
<div style={{ padding: '55px 0' }}>
<Icon type="plus" />
@ -154,14 +162,18 @@ export default class ShowSettingForm extends React.Component {
<Row className="formItem">
<Col span={4}>文本内容</Col>
<Col span={20}>
<WeaInput value={textContent} onChange={(value) => {this.handleChange({textContent: value})}}/>
<WeaInput value={textContent} onChange={(value) => {
this.handleChange({textContent: value})
}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={4}>文本内容位置</Col>
<Col span={20}>
<Radio.Group value={textContentPosition} onChange={(e) => {this.handleChange({textContentPosition: e.target.value})}}>
<Radio.Group value={textContentPosition} onChange={(e) => {
this.handleChange({textContentPosition: e.target.value})
}}>
<Radio value={"1"}>薪资项目前</Radio>
<Radio value={"2"}>薪资项目后</Radio>
</Radio.Group>
@ -171,14 +183,18 @@ export default class ShowSettingForm extends React.Component {
<Row className="formItem">
<Col span={6}>薪资项为空时不显示</Col>
<Col span={18}>
<Switch checked={salaryItemNullStatus} onChange={(value) => {this.handleChange({salaryItemNullStatus: value})}}/>
<Switch checked={salaryItemNullStatus} onChange={(value) => {
this.handleChange({salaryItemNullStatus: value})
}}/>
</Col>
</Row>
<Row className="formItem">
<Col span={6}>薪资项为0时不显示</Col>
<Col span={18}>
<Switch checked={salaryItemZeroStatus} onChange={(value) => {this.handleChange({salaryItemZeroStatus: value})}}/>
<Switch checked={salaryItemZeroStatus} onChange={(value) => {
this.handleChange({salaryItemZeroStatus: value})
}}/>
</Col>
</Row>
</div>
@ -194,13 +210,17 @@ export default class ShowSettingForm extends React.Component {
{
index < salaryItemSet.length - 1 &&
<Icon type="caret-down" style={{marginLeft: "10px" , cursor: "pointer", color: "#666"}}
onClick={() => {this.handleDownClick(index)}}
onClick={() => {
this.handleDownClick(index)
}}
/>
}
{
index > 0 && <Icon type="caret-up" style={{marginLeft: "10px", cursor: 'pointer', color: "#666"}}
onClick={() => {this.handleUpClick(index)}}/>
onClick={() => {
this.handleUpClick(index)
}}/>
}
<i className="icon-coms-Delete" style={{cursor: "pointer", color: '#666', marginLeft: "10px"}} onClick={() => {
@ -209,7 +229,9 @@ export default class ShowSettingForm extends React.Component {
</div>
<div className="configContent">
{group.items.map(item => (
<span className="editItem">{item.name} <Icon type="cross" style={{cursor: "pointer"}} onClick={() => {this.handleDeleteItem(group, item)}}/></span>
<span className="editItem">{item.name} <Icon type="cross" style={{cursor: "pointer"}} onClick={() => {
this.handleDeleteItem(group, item)
}}/></span>
))}
</div>
</div>

View File

@ -26,10 +26,14 @@ export default class TemplatePreview extends React.Component {
<div className="templatePreview">
<div className="headerWrapper">
<div className="iconsWrapper">
<div onClick={() => {this.handleSelectClick("0")}} className={selectKey == "0" ? "iconWrapper activeIconWrapper" : "iconWrapper" }>
<div onClick={() => {
this.handleSelectClick("0")
}} className={selectKey == "0" ? "iconWrapper activeIconWrapper" : "iconWrapper" }>
<img src={computer} />
</div>
<div onClick={() => {this.handleSelectClick("1")}} className={selectKey == "1" ? "iconWrapper activeIconWrapper" : "iconWrapper"}>
<div onClick={() => {
this.handleSelectClick("1")
}} className={selectKey == "1" ? "iconWrapper activeIconWrapper" : "iconWrapper"}>
<img src={phone}/>
</div>
</div>

View File

@ -144,9 +144,11 @@ export default class ChangeSalaryModal extends React.Component {
})
})
} else {
getSalaryItemForm(currentId).then(() => {this.setState({
getSalaryItemForm(currentId).then(() => {
this.setState({
inited: true
})})
})
})
}
}
@ -200,7 +202,9 @@ export default class ChangeSalaryModal extends React.Component {
};
return (
<Modal title="调薪" width={800} visible={this.props.visible} onClose={() => {this.props.onCancel()}}
<Modal title="调薪" width={800} visible={this.props.visible} onClose={() => {
this.props.onCancel()
}}
footer={<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>}
@ -215,7 +219,9 @@ export default class ChangeSalaryModal extends React.Component {
format="yyyy-MM-dd"
style={{width: "200px"}}
value={effectiveTime}
onChange={(value) => {this.handleChange({ effectiveTime: value })}}
onChange={(value) => {
this.handleChange({ effectiveTime: value })
}}
/>
</Col>
</Row>
@ -251,7 +257,9 @@ export default class ChangeSalaryModal extends React.Component {
<WeaInput
style={{width: "200px"}}
value={description}
onChange={value => {this.handleChange({description: value})}}
onChange={value => {
this.handleChange({description: value})
}}
/>
</Col>
</Row>
@ -261,8 +269,12 @@ export default class ChangeSalaryModal extends React.Component {
<div className="contentTitleWrapper" style={{height: "40px",lineHeight: "40px"}}>
<span className="contentTitle" style={{fontSize: "14px", color: "#666"}}>调薪明细</span>
<div className="rightIconWrapper" style={{display: "inline-block", float: "right"}}>
<Icon type="minus-square" style={{color: "#2db7f5", cursor: "pointer", marginRight: "15px"}} onClick={() => {this.handleRemoveClick()}}/>
<Icon type="plus-square" style={{color: "#2db7f5", cursor: "pointer"}} onClick={() => {this.handleAddItemClick()}}/>
<Icon type="minus-square" style={{color: "#2db7f5", cursor: "pointer", marginRight: "15px"}} onClick={() => {
this.handleRemoveClick()
}}/>
<Icon type="plus-square" style={{color: "#2db7f5", cursor: "pointer"}} onClick={() => {
this.handleAddItemClick()
}}/>
</div>
</div>

View File

@ -103,14 +103,18 @@ export default class EditAgentModal extends React.Component {
return (
<Modal title="个税扣缴义务人调整" width={800} visible={this.props.visible} onClose={this.props.onCancel}
footer={
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>
}
>
<div className="editAgentModal" style={{padding: "20px"}}>
<Row style={{lineHeight: '47px'}}>
<Col span={8}>生效日期<RequiredLabelTip /></Col>
<Col span={16}>
<WeaDatePicker value={effectiveTime} onChange={(value) => {this.handleChange({effectiveTime: value})}}/>
<WeaDatePicker value={effectiveTime} onChange={(value) => {
this.handleChange({effectiveTime: value})
}}/>
</Col>
</Row>
<Row style={{lineHeight: '47px'}}>

View File

@ -542,6 +542,7 @@ export default class SalaryFile extends React.Component {
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => doSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调this.handleSearch()
searchsAdQuick={renderRightOperation()}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
searchItemsValue: {

View File

@ -56,7 +56,9 @@ export default class SalaryItemChangeList extends React.Component {
<div>
<WeaTable dataSource={singleSalaryItemList.list ? singleSalaryItemList.list: []} columns={this.getColumns()}
pagination={{
onChange: (value) => {this.handlePageChange(value)},
onChange: (value) => {
this.handlePageChange(value)
},
total: singleSalaryItemList.total,
showTotal: (total) => `${total}`,
current: singleSalaryItemList.pageNum
@ -67,7 +69,9 @@ export default class SalaryItemChangeList extends React.Component {
currentId={this.props.id}
recordId={this.state.recordId}
visible={this.state.changeSalaryVisible}
onCancel={() => {this.setState({changeSalaryVisible: false})}}
onCancel={() => {
this.setState({changeSalaryVisible: false})
}}
/>
}
</div>

View File

@ -48,7 +48,9 @@ export default class SalaryFileViewSlide extends React.Component {
const { baseInfo, adjustSalaryItems } = detailForm;
return (
<div className="salaryFileViewSlide">
<WeaSearchGroup title={"基本信息"} items={[]} onVisibleChange={(value) => {this.setState({baseInfoVisible: value})}}/>
<WeaSearchGroup title={"基本信息"} items={[]} onVisibleChange={(value) => {
this.setState({baseInfoVisible: value})
}}/>
{
this.state.baseInfoVisible && <div className="slideItemWrapper">
<Row className="formRow">
@ -99,7 +101,9 @@ export default class SalaryFileViewSlide extends React.Component {
width={200}
title="提示:显示已生效的最新数据"
placement="topLeft"
/></span>} items={[]} onVisibleChange={(value) => {this.setState({salaryItemVisible: value})}}/>
/></span>} items={[]} onVisibleChange={(value) => {
this.setState({salaryItemVisible: value})
}}/>
{
this.state.salaryItemVisible && <div style={{lineHeight: '40px'}} className="slideItemWrapper">
{
@ -113,7 +117,11 @@ export default class SalaryFileViewSlide extends React.Component {
</div>
}
<WeaSearchGroup title={<SelectedTab items={selectedTabItems} onChange={(item) => {this.handleTabChange(item)}}/>} items={[]} onVisibleChange={(value) => {this.setState({salaryItemVisible: value})}}/>
<WeaSearchGroup title={<SelectedTab items={selectedTabItems} onChange={(item) => {
this.handleTabChange(item)
}}/>} items={[]} onVisibleChange={(value) => {
this.setState({salaryItemVisible: value})
}}/>
{
this.state.selectedTab == "0" ? <SalaryItemChangeList id={this.props.id}/> : <TaxAgentChangeList id={this.props.id}/>
}

View File

@ -53,7 +53,9 @@ export default class SlideAgent extends React.Component {
this.setState({
searchValue: value
})
}} onSearch={(value) => { this.handleSearch(value)}}/>
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
<div className="tableWrapper">
<WeaTable
@ -61,7 +63,9 @@ export default class SlideAgent extends React.Component {
columns={this.getColumns(taxAgentList.columns ? taxAgentList.columns : [])}
scroll={{x: this.getColumns(taxAgentList.columns ? taxAgentList.columns : []).length * 120}}
pagination={{
onChange: (value) => {this.handlePageChange(value)},
onChange: (value) => {
this.handlePageChange(value)
},
total: taxAgentList.total,
showTotal: (total) => `${total}`,
current: taxAgentList.pageNum

View File

@ -55,14 +55,18 @@ export default class SlideSalaryItem extends React.Component {
this.setState({
searchValue: value
})
}} onSearch={(value) => { this.handleSearch(value)}}/>
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
<div className="tableWrapper">
<WeaTable dataSource={salaryItemList.list}
columns={this.getColumns(salaryItemList.columns ? salaryItemList.columns : [])}
scroll={{x: this.getColumns(salaryItemList.columns ? salaryItemList.columns : []).length * 120}}
pagination={{
onChange: (value) => {this.handlePageChange(value)},
onChange: (value) => {
this.handlePageChange(value)
},
total: salaryItemList.total,
showTotal: (total) => `${total}`,
current: salaryItemList.pageNum

View File

@ -57,7 +57,9 @@ export default class TaxAgentChangeList extends React.Component {
dataSource={singleTaxAgentList.list ? singleTaxAgentList.list: []}
columns={this.getColumns()}
pagination={{
onChange: (value) => {this.handlePageChange(value)},
onChange: (value) => {
this.handlePageChange(value)
},
total: singleTaxAgentList.total,
showTotal: (total) => `${total}`,
current: singleTaxAgentList.pageNum
@ -68,7 +70,9 @@ export default class TaxAgentChangeList extends React.Component {
currentId={this.props.id}
recordId={this.state.recordId}
visible={this.state.editAgentVisible}
onCancel={() => {this.setState({editAgentVisible: false})}}
onCancel={() => {
this.setState({editAgentVisible: false})
}}
/>
}
</div>

View File

@ -69,12 +69,20 @@ export default class DeleteSalaryItemModal extends React.Component {
}
return (
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} footer={null} width={800}>
<Modal visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} footer={null} width={800}>
<div style={{height: "47px", lineHeight: '47px'}}>
<span style={{marginLeft: "10px", fontSize: '14px'}}>批量删除</span>
<div style={{float: "right", marginRight: "40px"}}>
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {handleDelete()}}>批量删除</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {this.handleSearchChange(value)}} onSearch={(value) => {this.handleSearch(value)}}/>
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {
handleDelete()
}}>批量删除</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {
this.handleSearchChange(value)
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>
</div>
<div style={{margin: "10px", height: "500px", overflowY: "scroll"}}>
@ -83,7 +91,9 @@ export default class DeleteSalaryItemModal extends React.Component {
columns={this.getColumns()}
dataSource={canDeleteList.list ? canDeleteList.list : []}
pagination={{
onChange: (value) => {this.handleDataPageChange(value)},
onChange: (value) => {
this.handleDataPageChange(value)
},
total: canDeleteList.total,
showTotal: (total) => `${total}`,
current: canDeleteList.pageNum

View File

@ -193,12 +193,18 @@ export default class FormalFormModal extends React.Component {
maskClosable={false}
width={800}
footer={
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>
}
onCancel={() => {this.props.onCancel()}}>
onCancel={() => {
this.props.onCancel()
}}>
{
(this.props.valueType == "3" || this.referenceType == 'sql') && <div style={{marginBottom: '10px', lineHeight: "30px"}}>
返回字段<WeaInput style={{width: '150px'}} value={this.state.returnValue} onChange={(value) => {this.setState({returnValue: value})}} />
返回字段<WeaInput style={{width: '150px'}} value={this.state.returnValue} onChange={(value) => {
this.setState({returnValue: value})
}} />
</div>
}
<div>
@ -218,7 +224,9 @@ export default class FormalFormModal extends React.Component {
<div>
{
searchGroup && searchGroup.map(item => {
return <div style={{height: "25px", lineHeight: '25px', cursor: "pointer", overflow: "hidden"}} key={item.key} onClick={() => {this.handleItemClick(item)}}>
return <div style={{height: "25px", lineHeight: '25px', cursor: "pointer", overflow: "hidden"}} key={item.key} onClick={() => {
this.handleItemClick(item)
}}>
{item.value}
<Icon type="right" style={{float: "right", marginLeft: "10px", color: "#eee", marginTop: "9px"}}/>
<span style={{color: "#999", float: 'right'}}>{item.value} 的字段</span>
@ -232,7 +240,9 @@ export default class FormalFormModal extends React.Component {
{
searchFields && searchFields.map(item => {
return (
<div style={{height: "25px", lineHeight: "25px", cursor: "pointer"}} key={item.fieldId} onClick={() => {this.handleFieldClick(item)}}>
<div style={{height: "25px", lineHeight: "25px", cursor: "pointer"}} key={item.fieldId} onClick={() => {
this.handleFieldClick(item)
}}>
{item.name}
</div>
)

View File

@ -1,26 +1,23 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { Button, Table, DatePicker, Switch, Menu, Dropdown, Modal } from 'antd';
import { Button, DatePicker, Dropdown, Menu, Modal, Switch } from "antd";
// import { WeaTableNew } from "comsMobx"
import { WeaInputSearch, WeaRightMenu, WeaSlideModal, WeaTop } from "ecCom";
import { WeaTable, WeaSlideModal, WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch } from 'ecCom';
import { renderNoright } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
import SystemSalaryItemModal from "./systemSalaryItemModal";
import { columns } from "./columns";
import SlideModalTitle from "../../components/slideModalTitle";
import CustomSalaryItemSlide from "./customSalaryItemSlide";
import DeleteSalaryItemModal from "./deleteSalaryItemModal";
import CustomPaginationTable from "../../components/customPaginationTable";
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../components/customTab';
import ContentWrapper from '../../components/contentWrapper';
import SystemSalaryItemModal from './systemSalaryItemModal'
import { columns, dataSource } from './columns';
import SlideModalTitle from "../../components/slideModalTitle"
import CustomSalaryItemSlide from './customSalaryItemSlide'
import DeleteSalaryItemModal from './deleteSalaryItemModal';
import FormalFormModal from './formalFormModal';
import CustomPaginationTable from '../../components/customPaginationTable';
const { MonthPicker } = DatePicker;
@inject('salaryItemStore', 'taxAgentStore')
@inject("salaryItemStore", "taxAgentStore")
@observer
export default class SalaryItem extends React.Component {
constructor(props) {
@ -32,76 +29,78 @@ export default class SalaryItem extends React.Component {
isAdd: false,
searchValue: "",
formalModalVisible: false
}
this.searchParams = {current: 1, pageSize: 10}
};
this.searchParams = { current: 1, pageSize: 10 };
columns.map(item => {
if(item.dataIndex == "refere") {
if (item.dataIndex == "refere") {
item.render = () => {
return (
<Switch />
)
}
} else if(item.dataIndex == 'cz') {
<Switch/>
);
};
} else if (item.dataIndex == "cz") {
item.render = () => {
return (<div>
<a style={{marginRight: "10px"}}>编辑</a>
<a style={{marginRight: "10px"}}>删除</a>
{/* <a>操作日志</a> */}
</div>)
}
return (<div>
<a style={{ marginRight: "10px" }}>编辑</a>
<a style={{ marginRight: "10px" }}>删除</a>
{/* <a>操作日志</a> */}
</div>);
};
}
})
this.record = {}
});
this.record = {};
}
componentWillMount() { // 初始化渲染页面
const { salaryItemStore: { doInit }} = this.props;
const { salaryItemStore: { doInit } } = this.props;
doInit();
}
onEditItem(record, isedit) {
this.record = record
const { salaryItemStore: {getItemForm, setEditSlideVisible}} = this.props;
this.setState({editable: isedit, isAdd: false})
getItemForm(record.id)
setEditSlideVisible(true)
this.record = record;
const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props;
this.setState({ editable: isedit, isAdd: false });
getItemForm(record.id);
setEditSlideVisible(true);
}
// 删除列表项
handleDeleteItem(record) {
const { salaryItemStore: {deleteItemRequest}} = this.props;
const { salaryItemStore: { deleteItemRequest } } = this.props;
Modal.confirm({
title: '信息确认',
content: '确认删除',
onOk:() => {
deleteItemRequest([record.id])
title: "信息确认",
content: "确认删除",
onOk: () => {
deleteItemRequest([record.id]);
},
onCancel: () => {
},
}
});
}
// 增加编辑功能重写columns绑定事件
getColumns = () => {
const { salaryItemStore, taxAgentStore: { showOperateBtn } } = this.props;
const { tableColumns} = salaryItemStore
const { tableColumns } = salaryItemStore;
let columns = tableColumns.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) {
switch (newColumn.dataIndex) {
case "name":
return <a onClick={() => {this.onEditItem(record, false)}}>{text}</a>
return <a onClick={() => {
this.onEditItem(record, false);
}}>{text}</a>;
case "useInEmployeeSalary":
return <Switch checked={text == 1} disabled/>
return <Switch checked={text == 1} disabled/>;
case "useDefault":
return <Switch checked={text == 1} disabled/>
return <Switch checked={text == 1} disabled/>;
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
}
}
};
return newColumn;
});
columns.push({
@ -109,36 +108,38 @@ export default class SalaryItem extends React.Component {
title: "操作",
render: (text, record) => {
return (
<a onClick={() => {this.onEditItem(record, true)}}>{ showOperateBtn ? '编辑' : '查看' }</a>
)
<a onClick={() => {
this.onEditItem(record, true);
}}>{showOperateBtn ? "编辑" : "查看"}</a>
);
}
})
});
columns.push({
title : '',
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
if(record.canDelete) {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
<a onClick={() => {
this.handleDeleteItem(record)
}}>删除</a>
</Menu.Item>
</Menu>}>
<i className="icon-coms-more"></i>
</Dropdown>
);
} else {
return ""
}
title: "",
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
if (record.canDelete) {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
<a onClick={() => {
this.handleDeleteItem(record);
}}>删除</a>
</Menu.Item>
</Menu>}>
<i className="icon-coms-more"></i>
</Dropdown>
);
} else {
return "";
}
})
}
});
return columns
}
return columns;
};
// onOperatesClick = (record, index, operate, flag) => {
@ -154,81 +155,100 @@ export default class SalaryItem extends React.Component {
// };
handleSearch(value) {
const { salaryItemStore: {getTableDatas}} = this.props;
this.searchParams = {name: value, current: 1}
getTableDatas(this.searchParams)
const { salaryItemStore: { getTableDatas } } = this.props;
this.searchParams = { name: value, current: 1 };
getTableDatas(this.searchParams);
}
handlePageChnage(value) {
this.searchParams.current = value;
const { salaryItemStore: {getTableDatas}} = this.props;
getTableDatas(this.searchParams)
const { salaryItemStore: { getTableDatas } } = this.props;
getTableDatas(this.searchParams);
}
handleShowSizeChange(searchParams) {
const { salaryItemStore: {getTableDatas}} = this.props;
getTableDatas(searchParams)
const { salaryItemStore: { getTableDatas } } = this.props;
getTableDatas(searchParams);
}
render() {
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;
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;
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
const batchDelete = () => {
// deleteItemList({})
setDeleteItemVisible(true)
}
setDeleteItemVisible(true);
};
const rightMenu = [// 右键菜单
// {
// key: "BTN_COLUMN",
// icon: <i className="icon-coms-Custom"/>,
// content: "显示列定制",
// onClick: this.showColumn
// },
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
},
{
key: 'BTN_DEL',
icon: <i className='icon-coms-delete'/>,
content : '批量删除',
onClick : batchDelete,
key: "BTN_DEL",
icon: <i className="icon-coms-delete"/>,
content: "批量删除",
onClick: batchDelete
}
];
const collectParams = { // 收藏功能配置
favname: '薪资项目管理',
favname: "薪资项目管理",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
importantlevel: 1,
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>
];
const topTab = [
];
const topTab = [];
const handleMenuClick = (e) => {
const { salaryItemStore: {getSysItemList, setEditSlideVisible, initRequest}} = this.props;
if(e.key == "1") {
getSysItemList({})
setSystemItemVisible(true)
} else if(e.key == "2") {
this.setState({editable: true, isAdd: true})
initRequest()
setEditSlideVisible(true)
const { salaryItemStore: { getSysItemList, setEditSlideVisible, initRequest } } = this.props;
if (e.key == "1") {
getSysItemList({});
setSystemItemVisible(true);
} else if (e.key == "2") {
this.setState({ editable: true, isAdd: true });
initRequest();
setEditSlideVisible(true);
}
}
};
const menu = (
<Menu onClick={handleMenuClick}>
@ -238,26 +258,30 @@ export default class SalaryItem extends React.Component {
);
const renderRightOperation = () => {
const { taxAgentStore: { showOperateBtn } }= this.props;
return (<div style={{display: "inline-block"}}>
const { taxAgentStore: { showOperateBtn } } = this.props;
return (<div style={{ display: "inline-block" }}>
{
showOperateBtn &&
<Dropdown.Button overlay={menu} type="primary" style={{marginRight: "10px"}}>新增</Dropdown.Button>
<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>)
<WeaInputSearch value={this.state.searchValue} placeholder={"请输入名称"} onChange={(value) => {
this.setState({ searchValue: value });
}} onSearch={(value) => {
this.handleSearch(value);
}}/>
</div>);
}
};
// 新建和修改保存的回调
const handleSlideSave = (continueFlag) => {
const { salaryItemStore: {saveItem, request}} = this.props;
if(this.state.editable) { // 修改
const { salaryItemStore: { saveItem, request } } = this.props;
if (this.state.editable) { // 修改
saveItem(request, continueFlag, this.searchParams);
} else { // 新建
saveItem(request, continueFlag)
saveItem(request, continueFlag);
}
}
};
const renderCustomOperate = () => {
return (
@ -265,23 +289,29 @@ export default class SalaryItem extends React.Component {
<div>
{
this.state.isAdd ? <div>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {handleSlideSave(false)}}>保存</Button>
<Button type="default" onClick={() => {handleSlideSave(true)}}>保存并继续创建</Button>
</div> :
this.state.editable ? <div>
<Button type="primary" style={{marginRight: "10px"}} onClick={() => {handleSlideSave(false)}}>保存</Button>
</div> :
""
<Button type="primary" style={{ marginRight: "10px" }} onClick={() => {
handleSlideSave(false);
}}>保存</Button>
<Button type="default" onClick={() => {
handleSlideSave(true);
}}>保存并继续创建</Button>
</div> :
this.state.editable ? <div>
<Button type="primary" style={{ marginRight: "10px" }} onClick={() => {
handleSlideSave(false);
}}>保存</Button>
</div> :
""
}
</div>
)
}
);
};
const handleSaveSlideChange = (value) => {
const { salaryItemStore:{setRequest}} = this.props;
setRequest(value)
}
const { salaryItemStore: { setRequest } } = this.props;
setRequest(value);
};
return (
<div className="mySalaryBenefitsWrapper">
@ -291,19 +321,19 @@ export default class SalaryItem extends React.Component {
>
<WeaTop
title="薪资项目管理" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting"/>} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
>
<CustomTab
searchOperationItem={
renderRightOperation()
}
/>
searchOperationItem={
renderRightOperation()
}
/>
{/* <WeaTable // table内部做了loading加载处理页面就不需要再加了
{/* <WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
needScroll={true} // 是否启用table内部列表滚动将自适应到父级高度
@ -319,12 +349,12 @@ export default class SalaryItem extends React.Component {
current={pageInfo.pageNum}
pageSize={this.searchParams.pageSize}
onPageChange={(value) => {
this.handlePageChnage(value)
this.handlePageChnage(value);
}}
onShowSizeChange={(current, pageSize) => {
this.searchParams.current = current;
this.searchParams.pageSize = pageSize;
this.handleShowSizeChange(this.searchParams)
this.handleShowSizeChange(this.searchParams);
}}
/>
@ -332,41 +362,51 @@ export default class SalaryItem extends React.Component {
</WeaRightMenu>
{
systemItemVisible && <SystemSalaryItemModal visible={systemItemVisible} onCancel={() => {setSystemItemVisible(false)}}/>
systemItemVisible && <SystemSalaryItemModal visible={systemItemVisible} onCancel={() => {
setSystemItemVisible(false);
}}/>
}
{
deleteItemVisible && <DeleteSalaryItemModal visible={deleteItemVisible} onCancel={() => {setDeleteItemVisible(false)}}/>
deleteItemVisible && <DeleteSalaryItemModal visible={deleteItemVisible} onCancel={() => {
setDeleteItemVisible(false);
}}/>
}
{
editSlideVisible &&
<WeaSlideModal visible={editSlideVisible}
top={0}
width={40}
height={100}
direction={'right'}
measure={'%'}
editSlideVisible &&
<WeaSlideModal visible={editSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
editable={false}
showOperateBtn={showOperateBtn}
customOperate={showOperateBtn ? renderCustomOperate() : null}
subItemChange={
(item) => {this.setState({selectedTab: item.key})}
}
/>
}
content={<CustomSalaryItemSlide record={this.record} editable={this.state.editable} isAdd={this.state.isAdd} request={request} onChange={(value) => {handleSaveSlideChange(value)}}/>}
onClose={() => setEditSlideVisible(false)}
showMask={true}
closeMaskOnClick={() => setEditSlideVisible(false)} />
title={
<SlideModalTitle
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
editable={false}
showOperateBtn={showOperateBtn}
customOperate={showOperateBtn ? renderCustomOperate() : null}
subItemChange={
(item) => {
this.setState({ selectedTab: item.key });
}
}
/>
}
content={<CustomSalaryItemSlide record={this.record} editable={this.state.editable}
isAdd={this.state.isAdd} request={request}
onChange={(value) => {
handleSaveSlideChange(value);
}}/>}
onClose={() => setEditSlideVisible(false)}
showMask={true}
closeMaskOnClick={() => setEditSlideVisible(false)}/>
}
}
</div>
)
);
}
}

View File

@ -39,12 +39,18 @@ export default class SystemSalaryItemModal extends React.Component {
}
return (
<Modal footer={null} visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={800}>
<Modal footer={null} visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} width={800}>
<div style={{height: "47px", lineHeight: '47px'}}>
<span style={{marginLeft: "10px", fontSize: '14px'}}>添加系统薪资项目</span>
<div style={{float: "right", marginRight: "40px"}}>
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {handleAdd()}}>添加</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {this.handleSearchChange(value)}} onSearch={(value) => {
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {
handleAdd()
}}>添加</Button>
<WeaInputSearch value={searchValue} onChange={(value) => {
this.handleSearchChange(value)
}} onSearch={(value) => {
this.handleSearch(value)
}}/>
</div>

View File

@ -1,28 +1,24 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { toJS } from 'mobx';
import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Table, DatePicker, Dropdown, Menu, message } from 'antd';
import { Button, DatePicker, Dropdown, Menu, message } from "antd";
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaSlideModal } from 'ecCom';
import { WeaRightMenu, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
// import { WeaTableNew } from "comsMobx"
// const WeaTable = WeaTableNew.WeaTable;
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../../components/customTab';
import ContentWrapper from '../../../components/contentWrapper';
import BaseForm from './baseForm'
import SlideModalTitle from '../../../components/slideModalTitle'
import SocialSecurityForm from './socialSecurityForm';
import AccumulationFundForm from './accumulationFundForm';
import OtherForm from './otherForm';
import { tempateColumns } from '../../payroll/columns';
import CustomPaginationTable from '../../../components/customPaginationTable';
import ImportModal from '../../../components/importModal';
import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import BaseForm from "./baseForm";
import SlideModalTitle from "../../../components/slideModalTitle";
import SocialSecurityForm from "./socialSecurityForm";
import AccumulationFundForm from "./accumulationFundForm";
import OtherForm from "./otherForm";
import CustomPaginationTable from "../../../components/customPaginationTable";
import ImportModal from "../../../components/importModal";
const { MonthPicker } = DatePicker;
@inject('archivesStore','taxAgentStore')
@inject("archivesStore", "taxAgentStore")
@observer
export default class Archives extends React.Component {
constructor(props) {
@ -37,33 +33,33 @@ export default class Archives extends React.Component {
modalParam: {},
step: 0,
selectedRowKeys: []
}
};
this.record = {}
this.pageInfo = {current: 1, pageSize: 10}
this.record = {};
this.pageInfo = { current: 1, pageSize: 10 };
}
componentWillMount() {
const { archivesStore: {doInit}} = this.props;
doInit()
const { archivesStore: { doInit } } = this.props;
doInit();
}
handleEdit(record) {
this.record = record
this.setState({employeeId: record.employeeId, editSlideVisible: true})
this.record = record;
this.setState({ employeeId: record.employeeId, editSlideVisible: true });
}
setStep(step) {
this.setState({step})
this.setState({ step });
}
getColumns() {
const { archivesStore: {tableStore}, taxAgentStore: { showOperateBtn }} = this.props;
let columns = [...tableStore.columns]
columns = columns.filter(item => item.hide == "false")
const { archivesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
let columns = [...tableStore.columns];
columns = columns.filter(item => item.hide == "false");
columns.map(item => {
item.width = "150px"
})
item.width = "150px";
});
columns.push({
title: "操作",
dataIndex: "operate",
@ -71,99 +67,102 @@ export default class Archives extends React.Component {
width: "100px",
height: "auto",
render: (text, record) => {
return (<a onClick={() => {this.handleEdit(record)}}>{showOperateBtn ? '编辑' : '查看'}</a>)
return (<a onClick={() => {
this.handleEdit(record);
}}>{showOperateBtn ? "编辑" : "查看"}</a>);
}
})
});
return columns;
}
// 保存
handleEditSlideSave() {
const { selectedTab } = this.state;
const { archivesStore: {save}} = this.props;
if(selectedTab == 1) {
save("SOCIAL_SECURITY")
} else if(selectedTab == 2) {
save("ACCUMULATION_FUND")
} else if(selectedTab == 3) {
save("OTHER")
const { archivesStore: { save } } = this.props;
if (selectedTab == 1) {
save("SOCIAL_SECURITY");
} else if (selectedTab == 2) {
save("ACCUMULATION_FUND");
} else if (selectedTab == 3) {
save("OTHER");
}
}
handlePageChnage(value) {
const { archivesStore: {form, getTableDatas}} = this.props;
this.pageInfo.current = value
getTableDatas(this.pageInfo)
const { archivesStore: { form, getTableDatas } } = this.props;
this.pageInfo.current = value;
getTableDatas(this.pageInfo);
}
// 导入
handleBtnImport() {
this.setState({importVisible: true})
this.setState({ importVisible: true });
}
// 模板点击
handleTemplateLinkClick(exportData) {
const { archivesStore: {exportTempateDownload} } = this.props;
exportTempateDownload({exportData})
const { archivesStore: { exportTempateDownload } } = this.props;
exportTempateDownload({ exportData });
}
// 导入预览
handlePreviewImport(params) {
const { archivesStore: {previewCurData}} = this.props;
previewCurData(params)
const { archivesStore: { previewCurData } } = this.props;
previewCurData(params);
}
// 导入
handleImport(params) {
const { archivesStore: {importBatch, initImportParams}} = this.props;
importBatch(params)
const { archivesStore: { importBatch, initImportParams } } = this.props;
importBatch(params);
}
// 导入完成
handleFinish() {
const { archivesStore: {getTableDatas, initImportParams}} = this.props;
initImportParams()
this.setState({importVisible: false, step: 0})
getTableDatas()
const { archivesStore: { getTableDatas, initImportParams } } = this.props;
initImportParams();
this.setState({ importVisible: false, step: 0 });
getTableDatas();
}
// 初始化导入参数
handleInitModal() {
const { archivesStore: { setPreviewCurDataColumns, setPreviewCurDataDataSource, setImportResult }} = this.props;
setPreviewCurDataColumns([])
setPreviewCurDataDataSource([])
setImportResult({})
const { archivesStore: { setPreviewCurDataColumns, setPreviewCurDataDataSource, setImportResult } } = this.props;
setPreviewCurDataColumns([]);
setPreviewCurDataDataSource([]);
setImportResult({});
}
// 选项设置
onSelectChange = selectedRowKeys => {
this.setState({ selectedRowKeys });
}
};
// 关闭导入框
handleImportCancel() {
const { archivesStore: {initImportParams, getTableDatas }} = this.props;
const { archivesStore: { initImportParams, getTableDatas } } = this.props;
initImportParams()
if(this.state.step == 2) {
getTableDatas()
initImportParams();
if (this.state.step == 2) {
getTableDatas();
}
this.setState({importVisible: false, step: 0});
this.setState({ importVisible: false, step: 0 });
}
handleSearch() {
const { archivesStore: {getTableDatas}} = this.props;
getTableDatas({...this.pageInfo, current: 1})
const { archivesStore: { getTableDatas } } = this.props;
getTableDatas({ ...this.pageInfo, current: 1 });
}
render() {
const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props;
const { selectedTab, selectedRowKeys } = this.state;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd,
const {
loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd,
previewCurDataColumns, previewCurDataDataSource, importResult, initImportParams
} = archivesStore;
const { dataSource, pageInfo } = archivesStore
} = archivesStore;
const { dataSource, pageInfo } = archivesStore;
if (!hasRight && !loading) { // 无权限处理
return renderNoright();
}
@ -177,41 +176,42 @@ export default class Archives extends React.Component {
// },
];
const collectParams = { // 收藏功能配置
favname: '社保福利档案',
favname: "社保福利档案",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
importantlevel: 1,
link: "wui/index.html#/ns_demo03/index",
importantlevel: 1
};
const adBtn = [ // 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>搜索</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>
];
const topTab = [
];
const topTab = [];
// 导出全部
const handleButtonClick = () => {
const { archivesStore:{exportArchives}} = this.props;
exportArchives()
}
const { archivesStore: { exportArchives } } = this.props;
exportArchives();
};
// 导出选中
const handleMenuClick = () => {
const { selectedRowKeys } = this.state;
if(selectedRowKeys.length == 0) {
if (selectedRowKeys.length == 0) {
message.warning("未选择任何条目", 1);
return
return;
}
let ids = selectedRowKeys.join(",")
const { archivesStore:{exportArchives}} = this.props;
exportArchives(ids)
}
let ids = selectedRowKeys.join(",");
const { archivesStore: { exportArchives } } = this.props;
exportArchives(ids);
};
const btns = [
<Button type="primary" onClick={() => { this.handleBtnImport() }}>导入</Button>,
<Button type="primary" onClick={() => {
this.handleBtnImport();
}}>导入</Button>,
<Dropdown.Button onClick={handleButtonClick} overlay={
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">导出选中</Menu.Item>
@ -219,16 +219,16 @@ export default class Archives extends React.Component {
} type="ghost">
导出全部
</Dropdown.Button>
]
];
const renderSearchOperationItem = () => {
return <div></div>
}
return <div></div>;
};
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange,
onChange: this.onSelectChange
};
return (
@ -239,8 +239,8 @@ export default class Archives extends React.Component {
>
<WeaTop
title="社保福利档案" // 文字
icon={<i className='icon-coms-meeting' />} // 左侧图标
iconBgcolor='#F14A2D' // 左侧图标背景色
icon={<i className="icon-coms-meeting"/>} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={true} // 是否显示下拉按钮
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
@ -248,15 +248,18 @@ export default class Archives extends React.Component {
>
<WeaTab
searchType={['base', 'advanced']} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => {this.handleSearch()}} // 点搜索按钮时的回调
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
searchType={["base", "advanced"]} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
buttonsAd={adBtn} // 高级搜索内部按钮
searchsBasePlaceHolder={"请输入姓名"}
onSearch={() => {
this.handleSearch();
}} // 点搜索按钮时的回调
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
/>
{/* <WeaTable // table内部做了loading加载处理页面就不需要再加了
comsWeaTableStore={tableStore} // table store
hasOrder={true} // 是否启用排序
@ -273,89 +276,106 @@ export default class Archives extends React.Component {
total={pageInfo.total}
current={pageInfo.pageNum}
pageSize={this.pageInfo.pageSize}
scroll={{ x: this.getColumns().length > 0 ? this.getColumns().length * 150: 1000 }}
scroll={{ x: this.getColumns().length > 0 ? this.getColumns().length * 150 : 1000 }}
onPageChange={(value) => {
this.handlePageChnage(value)
this.handlePageChnage(value);
}}
onShowSizeChange={(current, pageSize) => {
this.pageInfo = {current, pageSize}
getTableDatas(this.pageInfo)
this.pageInfo = { current, pageSize };
getTableDatas(this.pageInfo);
}}
/>
/>
</WeaTop>
</WeaRightMenu>
{
this.state.editSlideVisible &&
<WeaSlideModal visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"员工福利档案"}
tabs={[{title: '基础设置', key: 0}, {title: "社保", key: 1}, {title: "公积金", key: 2}, {title: '企业年金及其他福利', key: 3}]}
editable={false}
selectedTab={selectedTab}
showOperateBtn={showOperateBtn}
customOperate={
<div>
{
showOperateBtn && selectedTab != 0 && <Button type="primary" onClick={() => {this.handleEditSlideSave()}}>保存</Button>
}
</div>
}
subItemChange={
(item) => {this.setState({selectedTab: item.key})}
}
/>
}
content={<div>
{
selectedTab == 0 && <BaseForm employeeId={this.state.employeeId}/>
}
{
selectedTab == 1 && <SocialSecurityForm employeeId={this.state.employeeId} record={this.record}/>
}
{
selectedTab == 2 && <AccumulationFundForm employeeId={this.state.employeeId} record={this.record}/>
}
{
selectedTab == 3 && <OtherForm employeeId={this.state.employeeId} record={this.record}/>
}
this.state.editSlideVisible &&
<WeaSlideModal visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"员工福利档案"}
tabs={[{ title: "基础设置", key: 0 }, { title: "社保", key: 1 }, {
title: "公积金",
key: 2
}, { title: "企业年金及其他福利", key: 3 }]}
editable={false}
selectedTab={selectedTab}
showOperateBtn={showOperateBtn}
customOperate={
<div>
{
showOperateBtn && selectedTab != 0 && <Button type="primary" onClick={() => {
this.handleEditSlideSave();
}}>保存</Button>
}
</div>
}
subItemChange={
(item) => {
this.setState({ selectedTab: item.key });
}
}
/>
}
content={<div>
{
selectedTab == 0 && <BaseForm employeeId={this.state.employeeId}/>
}
{
selectedTab == 1 &&
<SocialSecurityForm employeeId={this.state.employeeId} record={this.record}/>
}
{
selectedTab == 2 &&
<AccumulationFundForm employeeId={this.state.employeeId} record={this.record}/>
}
{
selectedTab == 3 && <OtherForm employeeId={this.state.employeeId} record={this.record}/>
}
</div>}
onClose={() => this.setState({editSlideVisible: false})}
showMask={true}
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
}
{
this.state.importVisible && <ImportModal
init={() => {
this.handleInitModal()
}}
params={this.state.modalParam}
columns={previewCurDataColumns}
step={this.state.step}
setStep={this.setStep.bind(this)}
// isInit 暂时去掉导入带数据的
slideDataSource={previewCurDataDataSource}
importResult={importResult}
onFinish={() => {this.handleFinish()}}
previewImport={(params) => {this.handlePreviewImport(params)}}
importFile={(params) => {this.handleImport(params);}}
templateLink={(exportData) => {this.handleTemplateLinkClick(exportData)}}
visiable={this.state.importVisible}
onCancel={() => {
this.handleImportCancel()
</div>}
onClose={() => this.setState({ editSlideVisible: false })}
showMask={true}
closeMaskOnClick={() => this.setState({ editSlideVisible: false })}/>
}
{
this.state.importVisible && <ImportModal
init={() => {
this.handleInitModal();
}}
params={this.state.modalParam}
columns={previewCurDataColumns}
step={this.state.step}
setStep={this.setStep.bind(this)}
isInit
slideDataSource={previewCurDataDataSource}
importResult={importResult}
onFinish={() => {
this.handleFinish();
}}
previewImport={(params) => {
this.handlePreviewImport(params);
}}
importFile={(params) => {
this.handleImport(params);
}}
templateLink={(exportData) => {
this.handleTemplateLinkClick(exportData);
}}
visiable={this.state.importVisible}
onCancel={() => {
this.handleImportCancel();
}}
/>
}
}}
/>
}
</div>
)
);
}
}

View File

@ -28,9 +28,15 @@ export default class CustomNewModal extends React.Component {
render() {
const { programmeStore: {customRequest, setCustomRequest}} = this.props;
return (
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} title="新建自定义福利" onOk={() => {this.handleOK()}}>
<Modal visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} title="新建自定义福利" onOk={() => {
this.handleOK()
}}>
{/* {getCustomSearchs(this.props.form, toJS(this.props.condition), 1)} */}
<CustomForm condition={this.props.condition} disable={this.props.edit ? ['paymentScope', 'welfareType'] : null} request={customRequest} onChange={(value) => {setCustomRequest(value)}}/>
<CustomForm condition={this.props.condition} disable={this.props.edit ? ['paymentScope', 'welfareType'] : null} request={customRequest} onChange={(value) => {
setCustomRequest(value)
}}/>
</Modal>
)
}

View File

@ -113,14 +113,14 @@ export default class Programme extends React.Component {
</a>
</Menu.Item>
{/*暂时隐藏*/}
{/*<Menu.Item>*/}
{/* <a*/}
{/* onClick={() => {*/}
{/* this.onDelete(record);*/}
{/* }}>*/}
{/* 删除*/}
{/* </a>*/}
{/*</Menu.Item>*/}
<Menu.Item>
<a
onClick={() => {
this.onDelete(record);
}}>
删除
</a>
</Menu.Item>
</Menu>
}>
<i className="icon-coms-more"/>

View File

@ -61,7 +61,9 @@ export default class AbnormalDrawer extends Component {
dataSource={this.props.dataSource}
loading={loading}
pagination={{
onChange: (value) => {this.props.onPageChange(value)},
onChange: (value) => {
this.props.onPageChange(value)
},
total: this.props.total,
showTotal: (total) => `${total}`,
}}

View File

@ -5,9 +5,9 @@
* LastEditTime: 2022-05-09 15:07:19
*/
import React, { Component } from "react";
import { Icon, Tooltip, Button, Spin } from "antd";
import { Button, Icon, Spin, Tooltip } from "antd";
import { inject, observer } from "mobx-react";
import { WeaBrowser, WeaTable, WeaInputSearch } from "ecCom";
import { WeaInputSearch, WeaTable } from "ecCom";
import "./index.less";
@inject("standingBookStore")
@ -22,8 +22,8 @@ export default class AbnormalListIndex extends Component {
tableData: {
list: [],
columns: [],
total: 0,
},
total: 0
}
};
}
@ -39,8 +39,8 @@ export default class AbnormalListIndex extends Component {
this.setState({
tableData: {
list,
total,
},
total
}
});
});
};
@ -50,6 +50,7 @@ export default class AbnormalListIndex extends Component {
const { current } = this.state;
this.getChangeList({ billMonth, current, userName: value });
}
render() {
const { remarks, billMonth, selectedKey } = this.props;
const { selectedRowKeys } = this.state;
@ -66,7 +67,7 @@ export default class AbnormalListIndex extends Component {
onChange: (current) => {
this.setState({ current });
this.getChangeList({ billMonth, current });
},
}
};
return (
<div className="normalWapper">
@ -77,7 +78,7 @@ export default class AbnormalListIndex extends Component {
<Tooltip
placement="topLeft"
title="提示:列表显示未维护缴纳起始月的账单月入职人员(不在系统缴纳范围内,可添加到缴纳范围)和有缴纳起始月未维护缴纳最后月的账单月离职人员(在系统缴纳范围内,可从缴纳范围移除)。">
<Icon type="question-circle" />
<Icon type="question-circle"/>
</Tooltip>
</span>
<span>{billMonth}</span>
@ -85,7 +86,15 @@ export default class AbnormalListIndex extends Component {
</div>
<div className="tabOption">
<Button>导出全部</Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
<WeaInputSearch value={this.state.searchValue}
placeholder={"请输入姓名"}
onChange={(value) => {
this.setState({ searchValue: value });
}}
onSearch={(value) => {
this.handleSearch(value);
}}
/>
</div>
{/* table */}
<div style={{ padding: "0 16px" }}>

View File

@ -487,6 +487,7 @@ export default class NormalIndex extends Component {
onChange={value => {
this.setState({ searchValue: value });
}}
placeholder={"请输入姓名"}
onSearch={value => {
this.handleSearch(value);
}}

View File

@ -82,7 +82,9 @@ export default class EditSlideContent extends React.Component {
dataSource={dataSource}
bordered
type="number"
addItem={() => {this.addItem()}}
addItem={() => {
this.addItem()
}}
onDataSourceChange={setDataSource}
editable={this.state.editable}
/>

View File

@ -46,7 +46,9 @@ export default class TaxRate extends React.Component {
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
switch(newColumn.dataIndex) {
case "name":
return <a onClick={() => {this.onEdit(record, false)}}
return <a onClick={() => {
this.onEdit(record, false)
}}
dangerouslySetInnerHTML={{ __html: valueSpan }} />
default:
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
@ -137,7 +139,9 @@ export default class TaxRate extends React.Component {
{' '}
<WeaInputSearch
placeholder={'请输入个税税率表名称'}
onSearch={(name) => {doSearch({name})}}
onSearch={(name) => {
doSearch({name})
}}
/>
</div>
@ -190,7 +194,9 @@ export default class TaxRate extends React.Component {
<SlideModalTitle
subtitle={!this.state.editable ? "查看个税税率表" : this.state.currentOperate == "add" ? "新建个税税率表" : "编辑个税税率表" }
subTabs={[{title: "基础设置"}]}
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
onSave={() => {
this.state.currentOperate == "add" ? doSave() : doUpdate()
}}
editable={this.state.editable}
/>
}

View File

@ -1,9 +1,8 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { action, observable } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from '../apis/calculate'; // 引入API接口文件
import { empFieldList } from '../apis/ledger';
import * as API from "../apis/calculate";
const { TableStore } = WeaTableNew;
@ -18,8 +17,8 @@ export class calculateStore {
// ** 薪资核算列表 **
@observable salaryListDataSource = [];
@observable salaryListColumns = [];
@observable calculateBaseForm = {}
@observable salaryListPageInfo = {}
@observable calculateBaseForm = {};
@observable salaryListPageInfo = {};
// ** 核算信息页 ***
// 核算人员
@ -31,14 +30,14 @@ export class calculateStore {
@observable reducedemployeeListColumns = []; // 列
@observable reducedemployeeListPageInfo = {}; // 分页信息
// 薪资周期、考勤周期
@observable baseSalarySobCycle = {}
@observable baseSalarySobCycle = {};
// *** 薪资核算 ***
// 核算结果--列表
@observable acctResultListDateSource = []; // dataSource
@observable acctResultListColumns = []; // 列
@observable acctresultDetailForm = {}; // 编辑薪资表单数据
@observable acctResultListTableStore = new TableStore()
@observable acctResultListTableStore = new TableStore();
@observable acctResultListPageInfo = {}; // 分页信息
// 导入
@observable importFieldData = {}; // 表头选择列表
@ -59,48 +58,53 @@ export class calculateStore {
// ** 核算进度 **
@observable calculateProgress = 0;
// ** 列表说明数据 **
@observable columnDescList = {};
// ** 设置导入参数 **
@action
setPreviewAcctResultColumns = (previewAcctResultColumns) => {
this.previewAcctResultColumns = previewAcctResultColumns
}
this.previewAcctResultColumns = previewAcctResultColumns;
};
@action
setPreviewAcctResultDataSource = previewAcctResultDataSource => {
this.previewAcctResultDataSource = previewAcctResultDataSource;
}
};
@action
setImportAcctResult = importAcctResult => {
this.importAcctResult = importAcctResult;
}
};
@action
setComparisonPreviewColumns = comparisonPreviewColumns => {
this.comparisonPreviewColumns = comparisonPreviewColumns;
}
};
@action
setComparisonPreviewDataSource = comparisonPreviewDataSource => {
this.comparisonPreviewDataSource = comparisonPreviewDataSource
}
this.comparisonPreviewDataSource = comparisonPreviewDataSource;
};
@action
setComparisonImportAcctResult = comparisonImportAcctResult => {
this.comparisonImportAcctResult = comparisonImportAcctResult
}
this.comparisonImportAcctResult = comparisonImportAcctResult;
};
// 编辑薪资表单数据
@action
setAcctresultDetailForm = (acctresultDetailForm) => {this.acctresultDetailForm = acctresultDetailForm}
setAcctresultDetailForm = (acctresultDetailForm) => {
this.acctresultDetailForm = acctresultDetailForm;
};
// 初始化操作
@action
doInit = () => {
this.getCondition();
this.getTableDatas();
}
};
// 获得高级搜索表单数据
@action
@ -110,10 +114,10 @@ export class calculateStore {
this.condition = res.condition;
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
} else {
message.error(res.msg || '接口调用失败!')
message.error(res.msg || "接口调用失败!");
}
}));
}
};
// 渲染table数据
@action
@ -126,11 +130,11 @@ export class calculateStore {
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.msg || '接口调用失败!')
message.error(res.msg || "接口调用失败!");
}
this.loading = false;
}));
}
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
@ -139,472 +143,516 @@ export class calculateStore {
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 薪资记录--薪资核算列表
@action
getSalaryAcctList = (params = {}) => {
this.loading = true
this.loading = true;
API.getSalaryAcctList(params).then(res => {
if(res.status) {
if (res.status) {
this.salaryListDataSource = res.data.list;
this.salaryListColumns = res.data.columns
this.salaryListPageInfo = res.data
this.salaryListColumns = res.data.columns;
this.salaryListPageInfo = res.data;
} else {
message.error(res.errormsg || '获取失败');
message.error(res.errormsg || "获取失败");
}
this.loading = false
})
}
this.loading = false;
});
};
// 薪资记录--保存薪资核算的基本信息
@action
saveBasic = (params = {}) => {
return new Promise((resolve, reject) => {
API.saveBasic(params).then(res => {
if(res.status) {
if (res.status) {
message.success("保存成功");
resolve(res.data)
resolve(res.data);
} else {
message.error(res.errormsg || "保存失败")
reject()
message.error(res.errormsg || "保存失败");
reject();
}
})
})
});
});
}
};
// 薪资记录--薪资核算详情
@action
salaryacctGetForm = (id) => {
return new Promise((resolve, reject) => {
API.salaryacctGetForm({id}).then(res => {
if(res.status) {
this.calculateBaseForm = res.data
resolve(res.data)
API.salaryacctGetForm({ id }).then(res => {
if (res.status) {
this.calculateBaseForm = res.data;
resolve(res.data);
} else {
message.error(res.errormsg || "获取失败")
reject()
message.error(res.errormsg || "获取失败");
reject();
}
})
})
}
});
});
};
// 核算人员--薪资核算人员确认列表
@action
acctemployeeList = (params) => {
API.acctemployeeList(params).then((res) => {
if(res.status) {
this.acctemployeeListDataSource = res.data.list ? res.data.list : []
this.acctemployeeListColumns = res.data.columns;
this.acctemployeeListPageInfo = res.data
} else {
message.error(res.errormsg || "获取失败")
const { departmentIds = "", positionIds = "", ...extraParams } = params || {};
params = {
...extraParams,
departmentIds: departmentIds ? departmentIds.split(",") : undefined,
positionIds: positionIds ? positionIds.split(",") : undefined
};
for (let key in params) {
if (params[key] === "") {
delete params[key];
}
})
}
}
API.acctemployeeList(params).then((res) => {
if (res.status) {
this.acctemployeeListDataSource = res.data.list ? res.data.list : [];
this.acctemployeeListColumns = res.data.columns;
this.acctemployeeListPageInfo = res.data;
} else {
message.error(res.errormsg || "获取失败");
}
});
};
// 核算人员--检查薪资核算人员的个税扣缴义务人
@action
checkTaxAgent = (id = "") => {
API.checkTaxAgent({salaryAcctRecordId: id}).then(res => {
if(res.status) {
API.checkTaxAgent({ salaryAcctRecordId: id }).then(res => {
if (res.status) {
} else {
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 核算人员--薪资核算环比上期减少人员列表
@action
reducedemployeeList = (params) => {
this.loading = true
API.reducedemployeeList(params).then(res => {
if(res.status) {
this.reducedemployeeListDataSource = res.data.list ? res.data.list: [];
this.reducedemployeeListColumns = res.data.columns;
this.reducedemployeeListPageInfo = res.data
} else {
message.error(res.errormsg || "获取失败")
this.loading = true;
const { departmentIds = "", positionIds = "", ...extraParams } = params || {};
params = {
...extraParams,
departmentIds: departmentIds ? departmentIds.split(",") : undefined,
positionIds: positionIds ? positionIds.split(",") : undefined
};
for (let key in params) {
if (params[key] === "") {
delete params[key];
}
this.loading = false
})
}
}
API.reducedemployeeList(params).then(res => {
if (res.status) {
this.reducedemployeeListDataSource = res.data.list ? res.data.list : [];
this.reducedemployeeListColumns = res.data.columns;
this.reducedemployeeListPageInfo = res.data;
} else {
message.error(res.errormsg || "获取失败");
}
this.loading = false;
});
};
// 薪资记录--获取薪资核算的薪资周期、考勤周期等
@action
getSalarySobCycle = (id = "") => {
API.getSalarySobCycle({salaryAcctRecordId: id}).then(res => {
if(res.status) {
this.baseSalarySobCycle = res.data
API.getSalarySobCycle({ salaryAcctRecordId: id }).then(res => {
if (res.status) {
this.baseSalarySobCycle = res.data;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 核算人员--添加薪资核算人员
@action
saveAcctemployee = (salaryAcctRecordId, employeeIds) => {
return new Promise((resolve, reject) => {
API.saveAcctemployee({salaryAcctRecordId, employeeIds}).then(res => {
if(res.status) {
API.saveAcctemployee({ salaryAcctRecordId, employeeIds }).then(res => {
if (res.status) {
resolve();
} else {
message.error(res.errormsg || "保存失败")
message.error(res.errormsg || "保存失败");
reject();
}
})
})
}
});
});
};
// 核算人员--导出环比减少人员
@action
exportReducedEmployee = (id) => {
API.exportReducedEmployee(id)
}
API.exportReducedEmployee(id);
};
// 核算人员--导出人员范围
@action
exportAcctEmployee = (id) => {
API.exportAcctEmployee(id)
}
API.exportAcctEmployee(id);
};
// 核算人员--删除薪资核算人员
@action
deleteAcctemployee = (salaryAcctRecordId, ids) => {
return new Promise((resolve, reject) => {
API.deleteAcctemployee({salaryAcctRecordId, ids}).then(res => {
if(res.status) {
API.deleteAcctemployee({ salaryAcctRecordId, ids }).then(res => {
if (res.status) {
message.success("删除成功");
resolve();
} else {
message.error(res.errormsg || "删除失败")
message.error(res.errormsg || "删除失败");
reject();
}
})
})
}
});
});
};
// 核算结果--列表
@action
acctResultList = (salaryAcctRecordId, employeeName = "", current = 1, params = {}) => {
this.loading = true
API.acctResultList({salaryAcctRecordId, employeeName, current, ...params}).then(res => {
if(res.status) {
// this.acctResultListTableStore.getDatas(res.data.dataKey.datas)
let list = res.data.pageInfo.list ? res.data.pageInfo.list: [];
list.map(item => {
item.key = item.id
})
this.acctResultListDateSource = list;
this.acctResultListPageInfo = res.data.pageInfo
this.acctResultListColumns = res.data.columns;
} else {
message.error(res.errormsg || "")
acctResultList = (params = {}) => {
this.loading = true;
const { departmentIds = "", positionIds = "", consolidatedTaxation = "0", ...extraParams } = params || {};
params = {
...extraParams,
departmentIds: departmentIds ? departmentIds.split(",") : undefined,
positionIds: positionIds ? positionIds.split(",") : undefined,
consolidatedTaxation: consolidatedTaxation === "0" ? null : "1"
};
for (let key in params) {
if (params[key] === "") {
delete params[key];
}
this.loading = false
})
}
}
API.acctResultList({ ...params }).then(res => {
if (res.status) {
let list = res.data.pageInfo.list ? res.data.pageInfo.list : [];
list.map(item => {
item.key = item.id;
});
this.acctResultListDateSource = list;
this.acctResultListPageInfo = res.data.pageInfo;
this.acctResultListColumns = res.data.columns;
this.getColumnDesc({ salaryAcctRecordId: params.salaryAcctRecordId });
} else {
message.error(res.errormsg || "");
}
this.loading = false;
});
};
@action
getColumnDesc = (params) => {
API.getColumnDesc(params).then(res => {
if (res.status) {
this.columnDescList = res.data;
} else {
message.error(res.errormsg);
}
});
};
// 核算结果--薪资核算
@action
acctresultAccounting = (salaryAcctRecordId) => {
return new Promise((resolve, reject) => {
API.acctresultAccounting({salaryAcctRecordId}).then(res => {
if(res.status) {
API.acctresultAccounting({ salaryAcctRecordId }).then(res => {
if (res.status) {
// message.success("核算成功")
resolve();
} else {
message.error(res.errormsg || "核算失败")
message.error(res.errormsg || "核算失败");
reject();
}
})
})
});
});
}
};
// 线下比对-列表
@action
comparisonresultList = (salaryAcctRecordId, params = {}) => {
API.comparisonresultList({salaryAcctRecordId, ...params}).then(res => {
if(res.status) {
API.comparisonresultList({ salaryAcctRecordId, ...params }).then(res => {
if (res.status) {
this.comparisonresultListDataSource = res.data.list ? res.data.list : [];
this.comparisonresultListColumns = res.data.columns
this.comparisonresultListColumns = res.data.columns;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 核算人员--刷新薪资核算人员的个税扣缴义务人
@action
refreshTaxAgent = (salaryAcctRecordId) => {
return new Promise((resolve, reject) => {
API.refreshTaxAgent({salaryAcctRecordId}).then(res => {
if(res.status) {
message.success("刷新成功")
API.refreshTaxAgent({ salaryAcctRecordId }).then(res => {
if (res.status) {
message.success("刷新成功");
resolve();
} else {
message.error(res.errormsg || "刷新失败")
message.error(res.errormsg || "刷新失败");
reject();
}
})
})
}
});
});
};
// 薪资核算-编辑表单
@action
acctresultDetail = (id) => {
API.acctresultDetail({id}).then(res => {
if(res.status) {
this.acctresultDetailForm = res.data
API.acctresultDetail({ id }).then(res => {
if (res.status) {
this.acctresultDetailForm = res.data;
} else {
message.error(res.errormsg || '获取失败')
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 薪资记录--删除薪资核算记录
@action
deleteSalaryacct = (ids) => {
return new Promise((resolve, reject) => {
API.deleteSalaryacct(ids).then(res => {
if(res.status) {
message.success("删除成功")
if (res.status) {
message.success("删除成功");
resolve();
} else {
message.error(res.errormsg || "删除失败")
message.error(res.errormsg || "删除失败");
reject();
}
})
})
}
});
});
};
// 薪资记录--归档薪资核算记录
@action
fileSalaryAcct = (id) => {
return new Promise((resolve, reject) => {
API.fileSalaryAcct({id}).then(res => {
if(res.status) {
message.success("归档成功")
API.fileSalaryAcct({ id }).then(res => {
if (res.status) {
message.success("归档成功");
resolve();
} else {
message.error(res.errormsg || "归档失败")
message.error(res.errormsg || "归档失败");
reject();
}
})
})
}
});
});
};
// 薪资记录-重新核算
@action
reAccounting = (salaryAcctRecordId) => {
return new Promise((resolve,reject) => {
API.reAccounting({salaryAcctRecordId}).then(res => {
if(res.status) {
message.success("保存成功")
return new Promise((resolve, reject) => {
API.reAccounting({ salaryAcctRecordId }).then(res => {
if (res.status) {
message.success("保存成功");
resolve();
} else {
message.error(res.errormsg || "保存失败")
message.error(res.errormsg || "保存失败");
reject();
}
})
})
});
});
}
};
// 薪资结果-编辑表单保存
@action
saveAcctResult = (recordId) => {
let inputItems = this.acctresultDetailForm.inputItems.map(item => {
let record = {}
record.salaryItemId = item.salaryItemId
record.resultValue = item.resultValue
let record = {};
record.salaryItemId = item.salaryItemId;
record.resultValue = item.resultValue;
return record;
})
});
let formulaItems = this.acctresultDetailForm.formulaItems.map(item =>{
let record = {}
record.salaryItemId = item.salaryItemId
record.resultValue = item.resultValue
let formulaItems = this.acctresultDetailForm.formulaItems.map(item => {
let record = {};
record.salaryItemId = item.salaryItemId;
record.resultValue = item.resultValue;
return record;
})
});
let items = inputItems.concat(formulaItems)
let items = inputItems.concat(formulaItems);
let params = {
salaryAcctEmpId: recordId,
items
}
return new Promise((resolve,reject) => {
};
return new Promise((resolve, reject) => {
API.saveAcctResult(params).then(res => {
if(res.status) {
message.success("保存成功")
if (res.status) {
message.success("保存成功");
resolve();
} else {
message.error(res.errormsg || "保存失败")
message.error(res.errormsg || "保存失败");
reject();
}
})
})
});
});
}
};
// 获取导入字段设置
@action
getImportField = (salaryAcctRecordId) => {
return new Promise((resolve, reject) => {
API.getImportField({salaryAcctRecordId}).then(res => {
if(res.status) {
this.importFieldData = res.data
resolve(res.data)
API.getImportField({ salaryAcctRecordId }).then(res => {
if (res.status) {
this.importFieldData = res.data;
resolve(res.data);
} else {
message.error(res.errormsg || "获取失败")
reject()
message.error(res.errormsg || "获取失败");
reject();
}
})
})
});
});
}
};
// 下载薪资导入核算模板
@action
getImportTemplate = (salaryItemIds, salaryAcctRecordId) => {
API.getImportTemplate(salaryItemIds, salaryAcctRecordId)
}
API.getImportTemplate(salaryItemIds, salaryAcctRecordId);
};
// 核算结果-导入预览
@action
fetchPreviewAcctResult = (params) => {
API.previewAcctResult(params).then((res) => {
if(res.status) {
this.previewAcctResultList = res.data
if (res.status) {
this.previewAcctResultList = res.data;
this.previewAcctResultColumns = res.data.headers.map((item, index) => {
let column = {}
let column = {};
column.title = item;
column.dataIndex = "" + index;
column.key = index + ""
return column
})
column.key = index + "";
return column;
});
this.previewAcctResultDataSource = res.data.list.map((item) => {
let data = {}
let data = {};
item.map((i, index) => {
data[index + ''] = i
})
return data
})
data[index + ""] = i;
});
return data;
});
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 核算结果-导入
@action
fetchImportAcctResult = (params) => {
API.importAcctResult(params).then(res=> {
if(res.status) {
this.importAcctResult = res.data
API.importAcctResult(params).then(res => {
if (res.status) {
this.importAcctResult = res.data;
} else {
message.error(res.errormsg || "导入失败")
message.error(res.errormsg || "导入失败");
}
})
}
});
};
// 核算结果-导出全部
@action
exportAll = (salaryAcctRecordId, ids = "") => {
API.exportAcctResult(salaryAcctRecordId, ids)
}
API.exportAcctResult(salaryAcctRecordId, ids);
};
// 线下对比-列表
@action
fetchComparisonResultList = (params) => {
this.loading = true
this.loading = true;
API.comparisonResultList(params).then(res => {
if(res.status) {
this.comparisonResultPageInfo = res.data
this.comparisonResultColumns = res.data.columns
if (res.status) {
this.comparisonResultPageInfo = res.data;
this.comparisonResultColumns = res.data.columns;
// this.comparisonResultTableStore.getDatas(res.data.dataKey.datas)
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
this.loading = false
})
}
this.loading = false;
});
};
// 线下对比-导入模板
@action
exportImportTemplate = (salaryAcctRecordId) => {
API.exportImportTemplate(salaryAcctRecordId)
}
API.exportImportTemplate(salaryAcctRecordId);
};
// 线下对比--导入预览
@action
previewComparisonResult = (params) => {
API.previewComparisonResult(params).then(res => {
if(res.status) {
if (res.status) {
this.comparisonPreviewColumns = res.data.headers.map((item, index) => {
let column = {}
let column = {};
column.title = item;
column.dataIndex = "" + index;
column.key = index + ""
return column
})
column.key = index + "";
return column;
});
this.comparisonPreviewDataSource = res.data.list.map((item) => {
let data = {}
let data = {};
item.map((i, index) => {
data[index + ''] = i
})
return data
})
data[index + ""] = i;
});
return data;
});
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 线下对比-导入
@action
importComparisonExcelAcctResult = (params) => {
API.importComparisonExcelAcctResult(params).then(res => {
if(res.status) {
this.comparisonImportAcctResult = res.data
if (res.status) {
this.comparisonImportAcctResult = res.data;
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 线下对比-导出
@action
exportComparisonResult = (salaryAcctRecordId) => {
API.exportComparisonResult(salaryAcctRecordId)
}
API.exportComparisonResult(salaryAcctRecordId);
};
// 核算进度条
@action
getCalculateProgress = (id) => {
return new Promise((resolve, reject) => {
API.getCalculateProgress(id).then(res => {
if(res.status) {
if (res.status) {
let progress = 0;
try {
progress = Number(res.data.progress) * 100
} catch(err) {
progress = Number(res.data.progress) * 100;
} catch (err) {
}
resolve(res.data)
resolve(res.data);
} else {
message.error(res.errormsg || "获取失败")
reject()
message.error(res.errormsg || "获取失败");
reject();
}
})
})
}
});
});
};
}

View File

@ -252,7 +252,8 @@ export class ProgrammeStore {
}
})
} catch(e) {
flag = false }
flag = false
}
return flag;
}

View File

@ -16,7 +16,9 @@
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
if(pair[0] == variable){
return pair[1];
}
}
return null;
}