添加权限

This commit is contained in:
liyongshun 2022-06-02 17:11:28 +08:00
parent 519ddd732b
commit e552f34103
11 changed files with 1078 additions and 766 deletions

View File

@ -1,236 +1,286 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
//数据采集-考勤引用-考勤数据列表
export const getAttendanceList = params => {
return fetch('/api/bs/hrmsalary/attendQuote/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const checkOperation = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/checkOperation", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤数据列表
export const getAttendanceList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤数据-获取导入参数
export const getImportAttendanceParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getImportParams', 'get', params);
}
export const getImportAttendanceParam = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getImportParams",
"get",
params
);
};
//数据采集-考勤引用-获取账套列表
export const getLedgerList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/selectSalarySobList', 'get', params);
}
export const getLedgerList = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/selectSalarySobList",
"get",
params
);
};
//数据采集-考勤引用-获取引用考勤表单
export const getAttendanceReferForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSyncForm', 'get', params);
}
export const getAttendanceReferForm = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSyncForm",
"get",
params
);
};
//数据采集-考勤引用-获取引用考勤表单周期数据
export const getAttendanceReferPeriod = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle', 'post', params);
}
export const getAttendanceReferPeriod = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
"post",
params
);
};
//数据采集-考勤引用-同步引用考勤数据
export const syncAttendanceRefer = params => {
return fetch('/api/bs/hrmsalary/attendQuote/syncAttendQuoteData', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const syncAttendanceRefer = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-查看考勤数据
export const getAttendanceDetail = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/view', 'get', params);
}
export const getAttendanceDetail = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/view", "get", params);
};
//数据采集-考勤引用-删除考勤数据
export const deleteAttendance = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/delete', 'POST', params);
}
export const deleteAttendance = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/delete",
"POST",
params
);
};
//数据采集-考勤引用-导出考勤数据
export const exportAttendance = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/export', 'POST', params);
}
export const exportAttendance = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/export",
"POST",
params
);
};
//数据采集- 考勤应用-导出模版+全量数据
export const exportForTemplate = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/exportForTemplate', 'POST', params);
}
export const exportForTemplate = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/exportForTemplate",
"POST",
params
);
};
//数据采集-考勤引用-考勤字段管理列表
export const getAttendanceFieldList = params => {
return fetch('/api/bs/hrmsalary/attendQuote/fieldList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getAttendanceFieldList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-获取考勤字段表单
export const getAttendanceFieldForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getFieldForm', 'get', params);
}
export const getAttendanceFieldForm = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getFieldForm",
"get",
params
);
};
//数据采集-考勤引用-新建考勤字段
export const saveAttendanceField = params => {
return fetch('/api/bs/hrmsalary/attendQuote/saveField', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const saveAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/saveField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-修改考勤字段
export const updateAttendanceField = params => {
return fetch('/api/bs/hrmsalary/attendQuote/updateField', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const updateAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/updateField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-启用/停用自定义字段
export const updateAttendanceFieldStatus = params => {
return fetch('/api/bs/hrmsalary/attendQuote/updateEnableStatus', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const updateAttendanceFieldStatus = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-删除考勤字段
export const deleteAttendanceField = params => {
return fetch('/api/bs/hrmsalary/attendQuote/deleteField', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const deleteAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/deleteField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤引用字段设置-列表
export const getAttendanceFieldSettingList = params => {
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const getAttendanceFieldSettingList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤引用字段设置-保存
export const saveAttendanceFieldSetting = params => {
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/save', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const saveAttendanceFieldSetting = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
export const returnToAttendanceFieldSettingDefault = params => {
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const returnToAttendanceFieldSettingDefault = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤引用字段设置-设为默认设置
export const saveAttendanceFieldSettingAsDefault = params => {
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
export const saveAttendanceFieldSettingAsDefault = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 考勤导入模板下载
export const downloadTemplate = (salaryYearMonth, salarySobId) => {
// /api/bs/hrmsalary/attendQuote/downloadTemplate
fetch('/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=' + salaryYearMonth + "&salarySobId=" + salarySobId).then(res => res.blob().then(blob => {
var filename=`考勤导入模板.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
// /api/bs/hrmsalary/attendQuote/downloadTemplate
fetch(
"/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=" +
salaryYearMonth +
"&salarySobId=" +
salarySobId
).then((res) =>
res.blob().then((blob) => {
var filename = `考勤导入模板.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
// 考勤导入预览
export const previewAttendQuote = (params) => {
return fetch('/api/bs/hrmsalary/attendQuote/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/attendQuote/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 考勤数据导入
export const importAttendQuoteData = (params) => {
return fetch('/api/bs/hrmsalary/attendQuote/importAttendQuoteData', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 查看考勤详情
// 查看考勤详情
export const viewAttendQuote = (ids) => {
return fetch('/api/bs/hrmsalary/attendQuote/view', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(ids)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/attendQuote/view", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(ids),
}).then((res) => res.json());
};
// 根据所属月和账套获取周期
export const getSalaryCycleAndAttendCycle = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle', 'get', params);
}
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
"get",
params
);
};

View File

@ -50,12 +50,23 @@ export default class RefereAttendFormModal extends React.Component {
// 同步点击回调
handleSync() {
const { attendanceStore: {syncAttendanceRefer}} = this.props
const { attendanceStore: {syncAttendanceRefer, checkOperation}} = this.props
if(!this.validate()) {
return
}
syncAttendanceRefer(this.state.request).then(() => {
this.props.onCancel()
const { salarySobId, salaryYearMonth:salaryYearMonthStr }=this.state.request
const payload={
salaryYearMonthStr,
salarySobId
}
checkOperation(payload).then(({status, data, errorMsg})=>{
if(status && data){
syncAttendanceRefer(this.state.request).then(() => {
this.props.onCancel()
})
}else{
message.warning('已经核算过不可操作');
}
})
}

View File

@ -405,9 +405,21 @@ export default class CumDeduct extends React.Component {
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
};
const rowSelection = {

View File

@ -407,9 +407,21 @@ export default class CumSituation extends React.Component {
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
};
const rowSelection = {

View File

@ -406,9 +406,21 @@ export default class OtherDeduct extends React.Component {
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
onChange(current) {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxAgentId,
declareMonth: monthValue && [monthValue],
});
},
};

View File

@ -1,134 +1,181 @@
import React from 'react'
import { Modal, Button, Row, Col, Radio } from 'antd'
import { WeaSelect, WeaBrowser } from "ecCom"
import { inject, observer } from 'mobx-react';
import RequiredLabelTip from '../../components/requiredLabelTip';
import React from "react";
import { Modal, Button, Row, Col, Radio } from "antd";
import { WeaSelect, WeaBrowser } from "ecCom";
import { inject, observer } from "mobx-react";
import RequiredLabelTip from "../../components/requiredLabelTip";
const objectOptions = [
{
key: "EMPLOYEE",
showname: "人员",
selected: false
},
{
key: "DEPT",
showname: "部门",
selected: false
},
{
key: "POSITION",
showname: "岗位",
selected: false
}
]
{
key: "EMPLOYEE",
showname: "人员",
selected: false,
},
{
key: "SUBCOMPANY",
showname: "分部",
selected: false,
},
{
key: "DEPT",
showname: "部门",
selected: false,
},
{
key: "POSITION",
showname: "岗位",
selected: false,
},
];
@inject('ledgerStore')
@inject("ledgerStore")
@observer
export default class AddUserModal extends React.Component {
constructor(props) {
super(props)
this.state = {
selectedKey: "EMPLOYEE",
radioValue: "ALL",
ids: ""
}
}
constructor(props) {
super(props);
this.state = {
selectedKey: "EMPLOYEE",
radioValue: "ALL",
ids: "",
};
}
onRadioChange(e) {
this.setState({radioValue: e.target.value})
}
onRadioChange(e) {
this.setState({ radioValue: e.target.value });
}
// 保存
handleSave() {
const { ledgerStore: {saveLedgerPersonRange, salarySobId, includeType} } = this.props;
saveLedgerPersonRange({
salarySobId: salarySobId,
includeType: includeType,
employeeStatus: this.state.radioValue,
targetParams: this.state.ids.split(",").map(id => ({targetType: this.state.selectedKey, targetId: id}))
})
}
// 保存
handleSave() {
const {
ledgerStore: { saveLedgerPersonRange, salarySobId, includeType },
} = this.props;
saveLedgerPersonRange({
salarySobId: salarySobId,
includeType: includeType,
employeeStatus: this.state.radioValue,
targetParams: this.state.ids
.split(",")
.map((id) => ({ targetType: this.state.selectedKey, targetId: id })),
});
}
// 重置
handleReset() {
this.setState({
selectedKey: "EMPLOYEE",
radioValue: "ALL",
ids: ""
})
}
// 重置
handleReset() {
this.setState({
selectedKey: "EMPLOYEE",
radioValue: "ALL",
ids: "",
});
}
render() {
return (
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={600}
title="关联人员"
footer={
<div style={{display:"inlne-block"}}>
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
<Button type="default" onClick={() => {this.handleReset()}}>重置</Button>
</div>
}
>
<div style={{padding: "20px"}}>
<Row style={{lineHeight: "40px"}}>
<Col span={8}>对象类型<RequiredLabelTip /></Col>
<Col span={16}>
<div style={{display: "inline-block", verticalAlign: "top"}}>
<WeaSelect style={{height: "30px", marginRight: "10px"}} options={objectOptions} value={this.state.selectedKey} onChange={(value) => {
this.setState({selectedKey: value, ids: ""})
}}/>
</div>
<div style={{display: "inline-block", verticalAlign: "middle"}}>
{
this.state.selectedKey == "EMPLOYEE" && <WeaBrowser
type={17}
title={"人员选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ids})
}}
/>
}
{
this.state.selectedKey == "DEPT" && <WeaBrowser
type={57}
title={"部门选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ids})
}}
/>
}
{
this.state.selectedKey == "POSITION" && <WeaBrowser
type={278}
title={"岗位选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ids})
}}
/>
}
</div>
</Col>
</Row>
<Row style={{lineHeight: "40px"}}>
<Col span={8}>选择员工状态<RequiredLabelTip /></Col>
<Col span={16}>
<Radio.Group onChange={(e) => this.onRadioChange(e)} value={this.state.radioValue}>
<Radio value={"ALL"}>全部</Radio>
<Radio value={"NORMAL"}>在职</Radio>
<Radio value={"UNAVAILABLE"}>离职</Radio>
</Radio.Group>
</Col>
</Row>
</div>
</Modal>
)
}
}
render() {
return (
<Modal
visible={this.props.visible}
onCancel={() => {
this.props.onCancel();
}}
width={600}
title="关联人员"
footer={
<div style={{ display: "inlne-block" }}>
<Button
type="primary"
onClick={() => {
this.handleSave();
}}>
保存
</Button>
<Button
type="default"
onClick={() => {
this.handleReset();
}}>
重置
</Button>
</div>
}>
<div style={{ padding: "20px" }}>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>
对象类型
<RequiredLabelTip />
</Col>
<Col span={16}>
<div style={{ display: "inline-block", verticalAlign: "top" }}>
<WeaSelect
style={{ height: "30px", marginRight: "10px" }}
options={objectOptions}
value={this.state.selectedKey}
onChange={(value) => {
this.setState({ selectedKey: value, ids: "" });
}}
/>
</div>
<div style={{ display: "inline-block", verticalAlign: "middle" }}>
{this.state.selectedKey == "EMPLOYEE" && (
<WeaBrowser
type={17}
title={"人员选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "DEPT" && (
<WeaBrowser
type={57}
title={"部门选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "SUBCOMPANY" && (
<WeaBrowser
type={164}
title={"分部选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "POSITION" && (
<WeaBrowser
type={278}
title={"岗位选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
</div>
</Col>
</Row>
<Row style={{ lineHeight: "40px" }}>
<Col span={8}>
选择员工状态
<RequiredLabelTip />
</Col>
<Col span={16}>
<Radio.Group
onChange={(e) => this.onRadioChange(e)}
value={this.state.radioValue}>
<Radio value={"ALL"}>全部</Radio>
<Radio value={"NORMAL"}>在职</Radio>
<Radio value={"UNAVAILABLE"}>离职</Radio>
</Radio.Group>
</Col>
</Row>
</div>
</Modal>
);
}
}

View File

@ -577,7 +577,7 @@ export default class Ledger extends React.Component {
{ title: "薪资项目", key: 2 },
{ title: "调薪计薪规则", key: 3 },
]}
editable={canEdit !== "true"}
editable={canEdit === "true"}
selectedTab={selectedTab}
onSave={() => this.handleEditSlideSave()}
subItemChange={(item) => {

View File

@ -1,32 +1,49 @@
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,
Table,
DatePicker,
Dropdown,
Menu,
message,
Modal,
} from "antd";
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable,
WeaInputSearch, WeaSlideModal, WeaCheckbox, WeaHelpfulTip } from 'ecCom';
import {
WeaTop,
WeaTab,
WeaRightMenu,
WeaRangePicker,
WeaTable,
WeaInputSearch,
WeaSlideModal,
WeaCheckbox,
WeaHelpfulTip,
} from "ecCom";
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from '../../components/customTab';
import ContentWrapper from '../../components/contentWrapper';
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法因为多个页面都会使用所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
import ContentWrapper from "../../components/contentWrapper";
import { columns, dataSource } from './columns';
import { columns, dataSource } from "./columns";
import ChangeSalaryModal from "./changeSalaryModal"
import EditAgentModal from './editAgentModal';
import SlideModalTitle from '../../components/slideModalTitle'
import SlideSalaryItem from './slideSalaryItem'
import SlideAgent from './slideAgent'
import ImportModal from '../../components/importModal'
import SalaryFileViewSlide from './saralyFileViewSlide'
import ChangeSalaryModal from "./changeSalaryModal";
import EditAgentModal from "./editAgentModal";
import SlideModalTitle from "../../components/slideModalTitle";
import SlideSalaryItem from "./slideSalaryItem";
import SlideAgent from "./slideAgent";
import ImportModal from "../../components/importModal";
import SalaryFileViewSlide from "./saralyFileViewSlide";
const { MonthPicker } = DatePicker;
import "./index.less"
import CustomTable from '../../components/customTable';
import "./index.less";
import CustomTable from "../../components/customTable";
@inject('salaryFileStore')
@inject("salaryFileStore")
@observer
export default class SalaryFile extends React.Component {
constructor(props) {
@ -45,203 +62,269 @@ export default class SalaryFile extends React.Component {
selectedRowKeys: [],
showSearchBar: false,
importResult: {},
searchValue: ""
}
searchValue: "",
};
}
componentWillMount() {
const { salaryFileStore: {doInit} } = this.props;
const {
salaryFileStore: { doInit },
} = this.props;
doInit();
}
// 设置导入步数
setStep(step) {
this.setState({step})
this.setState({ step });
}
// 渲染导入模板附加元素
renderFormComponent() {
return (
<div style={{display: "inline-block"}}>
<div style={{ display: "inline-block" }}>
<WeaCheckbox id="importData" content="导出现有数据" />
<WeaHelpfulTip
width={200}
title="提示:建议先导出现有最新数据,修改后再导入"
placement="topLeft"
/>
width={200}
title="提示:建议先导出现有最新数据,修改后再导入"
placement="topLeft"
/>
</div>
)
);
}
// 导入预览
handlePreviewImport(params) {
const { salaryFileStore: {importPreview}} = this.props;
const {
salaryFileStore: { importPreview },
} = this.props;
params.importType = this.state.importType;
importPreview(params)
importPreview(params);
}
// 导入档案
handleImportFile(params) {
const { salaryFileStore: {importSalaryArchive}} = this.props;
params.importType = this.state.importType
importSalaryArchive(params).then(data => {
data.errorData = data.errorNotice
const {
salaryFileStore: { importSalaryArchive },
} = this.props;
params.importType = this.state.importType;
importSalaryArchive(params).then((data) => {
data.errorData = data.errorNotice;
this.setState({
importResult: data
})
})
importResult: data,
});
});
}
// 导入完成按钮操作
handleImportFinish() {
this.setState({modalVisiable: false, step: 0})
this.setState({ modalVisiable: false, step: 0 });
}
// 导出全部
handleExportAll() {
const { salaryFileStore: {exportSalaryArchive}} = this.props;
const {
salaryFileStore: { exportSalaryArchive },
} = this.props;
exportSalaryArchive();
}
// 定制列
getColumns() {
const { salaryFileStore: {tableStore}} = this.props;
return tableStore.columns.filter(item => item.display == "true").map(item => {
item.width = item.oldWidth
if(item.dataIndex == "operate") {
item.render = (text, record) => (
<a onClick={() => this.handleEdit(record)}>查看</a>
)
item.fixed = 'right'
} else if(item.dataIndex == "username"){
item.fixed = 'left'
}
return item
})
const {
salaryFileStore: { tableStore },
} = this.props;
return tableStore.columns
.filter((item) => item.display == "true")
.map((item) => {
item.width = item.oldWidth;
if (item.dataIndex == "operate") {
item.render = (text, record) => (
<a onClick={() => this.handleEdit(record)}>查看</a>
);
item.fixed = "right";
} else if (item.dataIndex == "username") {
item.fixed = "left";
}
return item;
});
}
// 编辑行
handleEdit(record) {
this.setState({editSlideVisible: true})
const { salaryFileStore: {setCurrentId}} = this.props;
setCurrentId(record.id)
this.setState({ editSlideVisible: true });
const {
salaryFileStore: { setCurrentId },
} = this.props;
setCurrentId(record.id);
}
// 显示调整个税扣缴义务人表单
handSildeOptionMenuClick(e) {
const { salaryFileStore: {setEditAgentVisible}} = this.props;
setEditAgentVisible(true)
const {
salaryFileStore: { setEditAgentVisible },
} = this.props;
setEditAgentVisible(true);
}
// 查看 Slide 头部操作按钮
renderEditSlideOperate() {
return <div style={{display: "inline-block"}}>
<Dropdown.Button type="primary" overlay={
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
</Menu>
} onClick={() => {this.setState({changeSalaryVisible: true})}}>调薪</Dropdown.Button>
return (
<div style={{ display: "inline-block" }}>
<Dropdown.Button
type="primary"
overlay={
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
</Menu>
}
onClick={() => {
this.setState({ changeSalaryVisible: true });
}}>
调薪
</Dropdown.Button>
</div>
);
}
// table选中条目
onSelectChange = selectedRowKeys => {
onSelectChange = (selectedRowKeys) => {
this.setState({ selectedRowKeys });
};
// 显示影响搜索面板
handleShowSearchBar = () => {
this.setState({
showSearchBar: !this.state.showSearchBar
})
}
showSearchBar: !this.state.showSearchBar,
});
};
// 页面跳转
handlePageChange = (value) => {
const { salaryFileStore: {getTableDatas, form}} = this.props;
getTableDatas({ current: value })
}
const {
salaryFileStore: { getTableDatas, form },
} = this.props;
getTableDatas({ current: value });
};
// 搜索
handleSearch(value) {
const { salaryFileStore: {getTableDatas, form}} = this.props;
getTableDatas({username: value})
const {
salaryFileStore: { getTableDatas, form },
} = this.props;
getTableDatas({ username: value });
}
// 初始化导入参数
handleInitModal() {
const { salaryFileStore: { setPreviewDataSource } } = this.props;
setPreviewDataSource([])
const {
salaryFileStore: { setPreviewDataSource },
} = this.props;
setPreviewDataSource([]);
this.setState({
importResult: {}
})
importResult: {},
});
}
render() {
const { salaryFileStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryFileStore;
const { importType, previewColumns, previewDataSource, dataSource, currentId, editAgentVisible, setEditAgentVisible, pageInfo } = salaryFileStore;
const {
loading,
hasRight,
form,
condition,
tableStore,
showSearchAd,
getTableDatas,
doSearch,
setShowSearchAd,
} = salaryFileStore;
const {
importType,
previewColumns,
previewDataSource,
dataSource,
currentId,
editAgentVisible,
setEditAgentVisible,
pageInfo,
} = salaryFileStore;
const { selectedTab, step, selectedRowKeys } = this.state;
if (!hasRight && !loading) { // 无权限处理
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
}
const rightMenu = [// 右键菜单
{
key: 'BTN_COLUMN',
icon: <i className='icon-coms-Custom' />,
content: '显示列定制',
onClick: this.showColumn
const rightMenu = [
// 右键菜单
{
key: "BTN_COLUMN",
icon: <i className="icon-coms-Custom" />,
content: "显示列定制",
onClick: this.showColumn,
},
];
const collectParams = { // 收藏功能配置
favname: '薪资档案',
const collectParams = {
// 收藏功能配置
favname: "薪资档案",
favouritetype: 1,
objid: 0,
link: 'wui/index.html#/ns_demo03/index',
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>,
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={doSearch}>
搜索
</Button>,
<Button type="ghost" onClick={() => form.resetForm()}>
重置
</Button>,
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
取消
</Button>,
];
const topTab = [
];
const topTab = [];
const renderSearchOperationItem = () => {
}
const renderSearchOperationItem = () => {};
const handleMenuClick = (e) => {
this.setState({importType: e.key, modalVisiable: true, step: 0})
}
const { key } = e;
if (key === "init") {
Modal.confirm({
title: "信息确认",
content: `若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入,点击确定继续导入`,
onOk: () => {
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
},
onCancel() {},
});
} else {
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
}
};
const handleMenuClick2 = () => {
const { electedRowKeys } = this.state;
if(selectedRowKeys.length == 0) {
message.warning("未选择条目")
return
if (selectedRowKeys.length == 0) {
message.warning("未选择条目");
return;
}
const { salaryFileStore: {exportSalaryArchive}} = this.props;
exportSalaryArchive(selectedRowKeys.join(","))
}
const {
salaryFileStore: { exportSalaryArchive },
} = this.props;
exportSalaryArchive(selectedRowKeys.join(","));
};
const menu = (
<Menu onClick={handleMenuClick}>
{
importType.map(item => (
<Menu.Item key={item.id}>{item.content}</Menu.Item>
))
}
{importType.map((item) => (
<Menu.Item key={item.id}>{item.content}</Menu.Item>
))}
</Menu>
);
const menu2 = (
<Menu onClick={handleMenuClick2}>
<Menu.Item key="1">导出所选</Menu.Item>
@ -249,53 +332,82 @@ export default class SalaryFile extends React.Component {
);
const renderRightOperation = () => {
return (
<div style={{display: "inline-block", position: 'relative'}} className="salaryFileTabWrapper">
<WeaHelpfulTip
style={{marginRight: '10px'}}
width={200}
title="导入按钮使用场景说明\n
return (
<div
style={{ display: "inline-block", position: "relative" }}
className="salaryFileTabWrapper">
<WeaHelpfulTip
style={{ marginRight: "10px" }}
width={200}
title="导入按钮使用场景说明\n
1.档案初始化\n
a.初次使用薪酬模块全量导入员工的薪资档案数据\n
b.员工入职导入新入职的员工的薪资档案数据若导入表格中的人员已存在在薪资档案中初始化导入会将档案中该人员的数据清除再导入\n
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴\n
2.调薪档案中已存在的人员批量调整薪资项目值包括返聘人员的情况\n
3.调整个税扣缴义务人档案中已存在的人员批量调整个税扣缴义务人包括返聘人员的情况\n"
placement="topLeft"
/>
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu}>导入</Dropdown.Button>
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu2} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.setState({recordSlideVisible: true})}}>调薪记录</Button>
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({
searchValue: value
})}} onSearch={(value) => {this.handleSearch(value)}}/>
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
</div>
)
}
placement="topLeft"
/>
<Dropdown.Button
type="primary"
style={{ marginRight: "10px" }}
overlay={menu}>
导入
</Dropdown.Button>
<Dropdown.Button
style={{ marginRight: "10px" }}
overlay={menu2}
onClick={() => {
this.handleExportAll();
}}>
导出全部
</Dropdown.Button>
<Button
type="default"
style={{ marginRight: "10px" }}
onClick={() => {
this.setState({ recordSlideVisible: true });
}}>
调薪记录
</Button>
<WeaInputSearch
value={this.state.searchValue}
onChange={(value) => {
this.setState({
searchValue: value,
});
}}
onSearch={(value) => {
this.handleSearch(value);
}}
/>
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
</div>
);
};
const handleSlideMoreMenuClick = () => {
}
const handleSlideMoreMenuClick = () => {};
const slideMoreMenu = (
<Menu onClick={handleSlideMoreMenuClick}>
<Menu.Item key="1">导出全部</Menu.Item>
</Menu>
);
const renderCustomOperate = () => {
return (
<div style={{display: "inline-block"}}>
<Dropdown.Button type="primary" overlay={slideMoreMenu}>导出</Dropdown.Button>
<div style={{ display: "inline-block" }}>
<Dropdown.Button type="primary" overlay={slideMoreMenu}>
导出
</Dropdown.Button>
<Button type="default">自定义列</Button>
</div>
)
}
);
};
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange,
selectedRowKeys,
onChange: this.onSelectChange,
};
return (
@ -306,39 +418,35 @@ export default class SalaryFile 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()
}
/>
<CustomTable
<CustomTab searchOperationItem={renderRightOperation()} />
<CustomTable
loading={loading}
rowSelection={rowSelection}
columns={this.getColumns()}
dataSource={dataSource}
pagination={{
onChange: (value) => {this.handlePageChange(value)},
onChange: (value) => {
this.handlePageChange(value);
},
total: pageInfo.total,
showTotal: (total) => `${total}`,
current: pageInfo.pageNum
current: pageInfo.pageNum,
}}
scroll={{x: 2300}}
scroll={{ x: 2300 }}
/>
</WeaTop>
</WeaRightMenu>
{
this.state.modalVisiable &&
<ImportModal
{this.state.modalVisiable && (
<ImportModal
init={() => {
this.handleInitModal()
this.handleInitModal();
}}
params={{}}
columns={previewColumns}
@ -346,89 +454,110 @@ export default class SalaryFile extends React.Component {
setStep={this.setStep.bind(this)}
slideDataSource={previewDataSource}
importResult={this.state.importResult}
onFinish={() => {this.handleImportFinish()}}
previewImport={(params) => {
this.handlePreviewImport(params)
onFinish={() => {
this.handleImportFinish();
}}
previewImport={(params) => {
this.handlePreviewImport(params);
}}
importFile={(params) => {
this.handleImportFile(params);
}}
templateLink={
"/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" +
this.state.importType
}
renderFormComponent={() => {
this.renderFormComponent();
}}
visiable={this.state.modalVisiable}
onCancel={() => {
this.setState({ modalVisiable: false });
}}
importFile={(params) => {this.handleImportFile(params)}}
templateLink={"/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + this.state.importType}
renderFormComponent={() => {this.renderFormComponent()}}
visiable={this.state.modalVisiable}
onCancel={() => { this.setState({modalVisiable: false})}}
/>
}
{
this.state.changeSalaryVisible && <ChangeSalaryModal
)}
{this.state.changeSalaryVisible && (
<ChangeSalaryModal
currentId={currentId}
visible={this.state.changeSalaryVisible}
onCancel={() => {this.setState({changeSalaryVisible: false})}}
onCancel={() => {
this.setState({ changeSalaryVisible: false });
}}
/>
}
)}
{
editAgentVisible && <EditAgentModal
{editAgentVisible && (
<EditAgentModal
currentId={currentId}
visible={editAgentVisible}
onCancel={() => {setEditAgentVisible(false)}}
onCancel={() => {
setEditAgentVisible(false);
}}
/>
}
)}
{/* 操作记录 */}
{
this.state.recordSlideVisible &&
<WeaSlideModal visible={this.state.recordSlideVisible}
top={0}
width={40}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"操作记录"}
tabs={[{title: '薪资项目', key: 0}, {title: "个税扣缴义务人", key: 1}]}
editable={false}
selectedTab={selectedTab}
customOperate={() => {renderCustomOperate()}}
subItemChange={
(item) => {this.setState({selectedTab: item.key})}
}
/>
}
content={<div>
{
selectedTab == 0 && <SlideSalaryItem />
}
{
selectedTab == 1 && <SlideAgent />
}
</div>}
onClose={() => this.setState({recordSlideVisible: false})}
showMask={true}
closeMaskOnClick={() => this.setState({recordSlideVisible: false})} />
}
{this.state.recordSlideVisible && (
<WeaSlideModal
visible={this.state.recordSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"操作记录"}
tabs={[
{ title: "薪资项目", key: 0 },
{ title: "个税扣缴义务人", key: 1 },
]}
editable={false}
selectedTab={selectedTab}
customOperate={() => {
renderCustomOperate();
}}
subItemChange={(item) => {
this.setState({ selectedTab: item.key });
}}
/>
}
content={
<div>
{selectedTab == 0 && <SlideSalaryItem />}
{selectedTab == 1 && <SlideAgent />}
</div>
}
onClose={() => this.setState({ recordSlideVisible: false })}
showMask={true}
closeMaskOnClick={() =>
this.setState({ recordSlideVisible: false })
}
/>
)}
{
this.state.editSlideVisible &&
<WeaSlideModal visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={'right'}
measure={'%'}
title={
<SlideModalTitle
subtitle={"员工薪资档案"}
editable={false}
customOperate={this.renderEditSlideOperate()}
/>
}
content={<SalaryFileViewSlide id={currentId} />}
onClose={() => this.setState({editSlideVisible: false})}
showMask={true}
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
}
{this.state.editSlideVisible && (
<WeaSlideModal
visible={this.state.editSlideVisible}
top={0}
width={40}
height={100}
direction={"right"}
measure={"%"}
title={
<SlideModalTitle
subtitle={"员工薪资档案"}
editable={false}
customOperate={this.renderEditSlideOperate()}
/>
}
content={<SalaryFileViewSlide id={currentId} />}
onClose={() => this.setState({ editSlideVisible: false })}
showMask={true}
closeMaskOnClick={() => this.setState({ editSlideVisible: false })}
/>
)}
</div>
)
);
}
}

View File

@ -107,6 +107,17 @@ export default class AddTaxAgentModal extends React.Component {
}}
/>
)}
{this.state.selectedKey == "SUBCOMPANY" && (
<WeaBrowser
type={164}
title={"分部选择"}
isSingle={false}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) => {
this.setState({ ids });
}}
/>
)}
{this.state.selectedKey == "POSITION" && (
<WeaBrowser
type={278}

View File

@ -1,20 +1,20 @@
import { observable, action, toJS } from 'mobx';
import { message } from 'antd';
import { WeaForm, WeaTableNew } from 'comsMobx';
import { observable, action, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from '../apis/attendance'; // 引入API接口文件
import * as API from "../apis/attendance"; // 引入API接口文件
const { TableStore } = WeaTableNew;
export class AttendanceStore {
@observable tableStore = new TableStore(); // new table
@observable attendTableStore = new TableStore();
@observable attendTableStore = new TableStore();
@observable form = new WeaForm(); // nrew 一个form
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
@observable step = 0 ;
@observable step = 0;
@observable modalVisiable = false;
@observable slideVisiable = false;
@observable currentItem = {};
@ -40,7 +40,7 @@ export class AttendanceStore {
@observable previewAttendQuoteList = []; // 导入-预览列表
@observable previewAttendQuoteColumns = []; // 导入预览-列表对应列
@observable previewAttendQuoteDataSource = []; // 导入预览-列表
@observable importResult = {}
@observable importResult = {};
// 考勤数据详情
@observable attendQuoteDetailPageInfo = {}; // 详情列表分页数据
@ -48,104 +48,107 @@ export class AttendanceStore {
@observable cycle = {};
// ** 设置导入参数 start **
// ** 设置导入参数 start **
@action
setPreviewAttendQuoteColumns = (previewAttendQuoteColumns) => {
this.previewAttendQuoteColumns = previewAttendQuoteColumns;
}
};
@action
setPreviewAttendQuoteDataSource = (previewAttendQuoteDataSource) => {
this.previewAttendQuoteDataSource = previewAttendQuoteDataSource
}
this.previewAttendQuoteDataSource = previewAttendQuoteDataSource;
};
@action
setImportResult = (importResult) => {
this.importResult = importResult
}
// ** 设置导入参数 end **
this.importResult = importResult;
};
// ** 设置导入参数 end **
@action
searchFieldSettingList = (value) => {
if(value != "") {
if (value != "") {
let requestFeildAttendList = [...this.requestFeildAttendList];
this.fieldSettingAttendList = requestFeildAttendList.filter(item => item.name.indexOf(value) > -1)
let requestFeildCustomList = [...this.requestFeildCustomList]
this.fieldSettingCustomList = requestFeildCustomList.filter(item => item.name.indexOf(value) > -1)
this.fieldSettingAttendList = requestFeildAttendList.filter(
(item) => item.name.indexOf(value) > -1
);
let requestFeildCustomList = [...this.requestFeildCustomList];
this.fieldSettingCustomList = requestFeildCustomList.filter(
(item) => item.name.indexOf(value) > -1
);
} else {
this.fieldSettingAttendList = [...this.requestFeildAttendList];
this.fieldSettingCustomList = [...this.requestFeildCustomList];
}
}
};
@action
setFieldSettingAttendList = fieldSettingAttendList =>
{
this.fieldSettingAttendList = fieldSettingAttendList
let requestFeildAttendList = [...this.requestFeildAttendList]
requestFeildAttendList.map(item => {
this.fieldSettingAttendList.map(inner => {
if(inner.id == item.id && inner.checked != item.checked) {
item.checked = inner.checked
setFieldSettingAttendList = (fieldSettingAttendList) => {
this.fieldSettingAttendList = fieldSettingAttendList;
let requestFeildAttendList = [...this.requestFeildAttendList];
requestFeildAttendList.map((item) => {
this.fieldSettingAttendList.map((inner) => {
if (inner.id == item.id && inner.checked != item.checked) {
item.checked = inner.checked;
}
})
})
});
});
this.requestFeildAttendList = requestFeildAttendList;
}
};
@action
setFieldSettingCustomList = fieldSettingCustomList =>
{
this.fieldSettingCustomList = fieldSettingCustomList
let requestFeildCustomList = [...this.requestFeildCustomList]
requestFeildCustomList.map(item => {
this.fieldSettingCustomList.map(inner => {
if(inner.id == item.id && inner.checked != item.checked) {
item.checked = inner.checked
setFieldSettingCustomList = (fieldSettingCustomList) => {
this.fieldSettingCustomList = fieldSettingCustomList;
let requestFeildCustomList = [...this.requestFeildCustomList];
requestFeildCustomList.map((item) => {
this.fieldSettingCustomList.map((inner) => {
if (inner.id == item.id && inner.checked != item.checked) {
item.checked = inner.checked;
}
})
})
}
});
});
};
@action
setCurrentItem = currentItem => this.currentItem = currentItem;
setCurrentItem = (currentItem) => (this.currentItem = currentItem);
@action
setCurrentItemOperate = currentItemOperate => this.currentItemOperate = currentItemOperate;
setCurrentItemOperate = (currentItemOperate) =>
(this.currentItemOperate = currentItemOperate);
@action
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
@action
setStep = step => this.step = step
setStep = (step) => (this.step = step);
@action
setModalVisiable = modalVisiable => this.modalVisiable = modalVisiable
setModalVisiable = (modalVisiable) => (this.modalVisiable = modalVisiable);
// 初始化操作
@action
doInit = () => {
// this.getCondition();
// this.getTableDatas();
this.getAttendanceList({})
this.getAttendanceList({});
// this.getAttendanceFieldSettingList({sourceType:'IMPORT'})
}
};
// 获得高级搜索表单数据
@action
getCondition = () => {
API.getCondition().then(action(res => {
if (res.api_status) { // 接口请求成功/失败处理
this.condition = res.condition;
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || '接口调用失败!')
}
}));
}
API.getCondition().then(
action((res) => {
if (res.api_status) {
// 接口请求成功/失败处理
this.condition = res.condition;
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
} else {
message.error(res.errormsg || "接口调用失败!");
}
})
);
};
// 渲染table数据
@action
@ -153,298 +156,318 @@ export class AttendanceStore {
this.loading = true;
const formParams = this.form.getFormParams() || {};
params = params || formParams;
API.getTableDatas(params).then(action(res => {
if (res.api_status) { // 接口请求成功/失败处理
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.errormsg || '接口调用失败!')
}
this.loading = false;
}));
}
API.getTableDatas(params).then(
action((res) => {
if (res.api_status) {
// 接口请求成功/失败处理
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
message.error(res.errormsg || "接口调用失败!");
}
this.loading = false;
})
);
};
@action
setShowSearchAd = bool => this.showSearchAd = bool;
setShowSearchAd = (bool) => (this.showSearchAd = bool);
// 高级搜索 - 搜索
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
}
};
// 字段列表
@action getAttendanceFieldList = (params) => {
this.loading = true;
API.getAttendanceFieldList(params).then(res => {
if (res.status) { // 接口请求成功/失败处理
API.getAttendanceFieldList(params).then((res) => {
if (res.status) {
// 接口请求成功/失败处理
this.fieldTableStore.getDatas(res.data.dataKey.datas); // table 请求数据
this.fieldDataSource = res.data.pageInfo.list
this.fieldPageInfo = res.data.pageInfo
this.fieldDataSource = res.data.pageInfo.list;
this.fieldPageInfo = res.data.pageInfo;
} else {
message.error(res.errormsg || '接口调用失败!')
message.error(res.errormsg || "接口调用失败!");
}
this.loading = false;
})
}
});
};
@action saveAttendanceField = (params) => {
API.saveAttendanceField(params).then(res => {
if(res.status) {
message.success("保存成功")
API.saveAttendanceField(params).then((res) => {
if (res.status) {
message.success("保存成功");
} else {
message.error(res.errormsg ||"保存失败")
message.error(res.errormsg || "保存失败");
}
})
}
});
};
@action deleteAttendanceField = (params) => {
API.deleteAttendanceField(params).then(res => {
if(res.status) {
message.success("删除成功")
API.deleteAttendanceField(params).then((res) => {
if (res.status) {
message.success("删除成功");
} else {
message.error(res.errormsg ||"删除失败")
message.error(res.errormsg || "删除失败");
}
})
}
});
};
// 批量删除
@action
doBatchDelete = () => {
let ids = toJS(this.tableStore.selectedRowKeys)
if(ids.length == 0) {
let ids = toJS(this.tableStore.selectedRowKeys);
if (ids.length == 0) {
message.warning("未选择任何条目");
return
return;
}
API.deleteAttendanceField(this.tableStore.selectedRowKeys).then(res => {
if(res.status) {
message.success("删除成功")
API.deleteAttendanceField(this.tableStore.selectedRowKeys).then((res) => {
if (res.status) {
message.success("删除成功");
} else {
message.error(res.errormsg || "删除失败")
message.error(res.errormsg || "删除失败");
}
})
}
});
};
// 更新
@action
updateAttendanceField = (params) => {
API.updateAttendanceField(params).then(res => {
if(res.status) {
message.success("修改成功")
API.updateAttendanceField(params).then((res) => {
if (res.status) {
message.success("修改成功");
} else {
message.error(res.errormsg || "修改失败")
message.error(res.errormsg || "修改失败");
}
})
}
});
};
// 更新状态
@action
updateAttendanceFieldStatus = (params) => {
return API.updateAttendanceFieldStatus(params).then(res => {
if(res.status) {
return API.updateAttendanceFieldStatus(params).then((res) => {
if (res.status) {
message.success("修改成功");
return new Promise((resolve, reject) => {
resolve(true);
})
});
} else {
message.error( res.errormsg || "修改失败")
message.error(res.errormsg || "修改失败");
return new Promise((resolve, reject) => {
resolve(false);
})
});
}
})
}
});
};
// 考勤数据列表
@action
getAttendanceList = (params) => {
this.loading = true;
API.getAttendanceList(params).then(res => {
if (res.status) { // 接口请求成功/失败处理
API.getAttendanceList(params).then((res) => {
if (res.status) {
// 接口请求成功/失败处理
// this.attendTableStore.getDatas(res.data.datas); // table 请求数据
this.attendanceDataSource = res.data.list;
this.attendancePageInfo = res.data;
this.attendanceColumns = res.data.columns
this.attendanceColumns = res.data.columns;
} else {
message.error(res.errormsg || '接口调用失败!')
message.error(res.errormsg || "接口调用失败!");
}
this.loading = false;
})
}
});
};
//数据采集-考勤引用-考勤引用字段设置-列表
@action
getAttendanceFieldSettingList = (params) => {
this.loading = true;
API.getAttendanceFieldSettingList(params).then(res => {
if(res.status) {
this.requestFeildAttendList = res.data[0] ? res.data[0].items : []
this.fieldSettingAttendList = this.requestFeildAttendList
this.requestFeildCustomList = res.data[1] ? res.data[1].items : []
API.getAttendanceFieldSettingList(params).then((res) => {
if (res.status) {
this.requestFeildAttendList = res.data[0] ? res.data[0].items : [];
this.fieldSettingAttendList = this.requestFeildAttendList;
this.requestFeildCustomList = res.data[1] ? res.data[1].items : [];
this.fieldSettingCustomList = this.requestFeildCustomList;
} else {
message.error(res.errormsg || "接口调用失败!")
message.error(res.errormsg || "接口调用失败!");
}
this.loading = false;
})
}
});
};
//数据采集-考勤引用-考勤引用字段设置-保存
@action
@action
saveAttendanceFieldSetting = (sourceType = "IMPORT") => {
let attendList = this.requestFeildAttendList.map(item => ({id: item.id, checked: item.checked}))
let customList = this.requestFeildCustomList.map(item => ({id: item.id, checked: item.checked}))
let attendList = this.requestFeildAttendList.map((item) => ({
id: item.id,
checked: item.checked,
}));
let customList = this.requestFeildCustomList.map((item) => ({
id: item.id,
checked: item.checked,
}));
let request = {
sourceType: sourceType,
currentSettingFields: [...attendList, ...customList]
}
API.saveAttendanceFieldSetting(request).then(res => {
if(res.status) {
message.success("保存成功")
currentSettingFields: [...attendList, ...customList],
};
API.saveAttendanceFieldSetting(request).then((res) => {
if (res.status) {
message.success("保存成功");
} else {
message.error(res.errormsg || "保存失败")
message.error(res.errormsg || "保存失败");
}
})
}
});
};
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
@action
returnToAttendanceFieldSettingDefault = (sourceType = "IMPORT") => {
API.returnToAttendanceFieldSettingDefault({sourceType: sourceType}).then(res => {
if(res.status) {
this.requestFeildAttendList = res.data[0] ? res.data[0].items : []
this.fieldSettingAttendList = this.requestFeildAttendList
this.requestFeildCustomList = res.data[1] ? res.data[1].items : []
this.fieldSettingCustomList = this.requestFeildCustomList;
} else {
message.error(res.errormsg || "获取数据失败")
API.returnToAttendanceFieldSettingDefault({ sourceType: sourceType }).then(
(res) => {
if (res.status) {
this.requestFeildAttendList = res.data[0] ? res.data[0].items : [];
this.fieldSettingAttendList = this.requestFeildAttendList;
this.requestFeildCustomList = res.data[1] ? res.data[1].items : [];
this.fieldSettingCustomList = this.requestFeildCustomList;
} else {
message.error(res.errormsg || "获取数据失败");
}
}
})
}
);
};
//数据采集-考勤引用-考勤引用字段设置-设为默认设置
@action
saveAttendanceFieldSettingAsDefault = (sourceType = "IMPORT") => {
let attendList = this.requestFeildAttendList.map(item => ({id: item.id, checked: item.checked}))
let customList = this.requestFeildCustomList.map(item => ({id: item.id, checked: item.checked}))
let attendList = this.requestFeildAttendList.map((item) => ({
id: item.id,
checked: item.checked,
}));
let customList = this.requestFeildCustomList.map((item) => ({
id: item.id,
checked: item.checked,
}));
let request = {
sourceType:sourceType,
currentSettingFields: [...attendList, ...customList]
}
API.saveAttendanceFieldSettingAsDefault(request).then(res => {
if(res.status) {
message.success("设置成功")
sourceType: sourceType,
currentSettingFields: [...attendList, ...customList],
};
API.saveAttendanceFieldSettingAsDefault(request).then((res) => {
if (res.status) {
message.success("设置成功");
} else {
message.error( res.errormsg || "设置失败")
message.error(res.errormsg || "设置失败");
}
})
}
});
};
// 导入表单-账套列表
@action
getLedgerList = () => {
return new Promise((resolve, reject) => {
API.getLedgerList({}).then(res => {
if(res.status) {
this.importLedgerList = res.data
resolve(this.importLedgerList)
API.getLedgerList({}).then((res) => {
if (res.status) {
this.importLedgerList = res.data;
resolve(this.importLedgerList);
} else {
message.error(res.errormsg || "获取失败")
reject()
message.error(res.errormsg || "获取失败");
reject();
}
})
})
}
});
});
};
// 下载导入模板
@action
downloadTemplate = (salaryYearMonth, salarySobId) => {
API.downloadTemplate(salaryYearMonth, salarySobId)
}
API.downloadTemplate(salaryYearMonth, salarySobId);
};
// 导入预览
@action
previewAttendQuote = (params) => {
API.previewAttendQuote(params).then(res => {
if(res.status) {
this.previewAttendQuoteList = res.data
API.previewAttendQuote(params).then((res) => {
if (res.status) {
this.previewAttendQuoteList = res.data;
this.previewAttendQuoteColumns = res.data.headers.map((item, index) => {
let column = {}
column.title = item;
let column = {};
column.title = item;
column.dataIndex = "" + index;
column.key = index + ""
return column
})
column.key = index + "";
return column;
});
this.previewAttendQuoteDataSource = 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 || "获取失败");
}
})
}
});
};
// 考勤导入
@action
importAttendQuoteData = (params) => {
API.importAttendQuoteData(params).then(res => {
if(res.status) {
this.importResult = res.data
API.importAttendQuoteData(params).then((res) => {
if (res.status) {
this.importResult = res.data;
} else {
message.error(res.errormsg || "导入失败")
message.error(res.errormsg || "导入失败");
}
})
}
});
};
// 考勤数据详情
@action
viewAttendQuote = (params = {}) => {
API.viewAttendQuote(params).then(res => {
if(res.status) {
this.attendQuoteDetailPageInfo = res.data.pageInfo
this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas)
API.viewAttendQuote(params).then((res) => {
if (res.status) {
this.attendQuoteDetailPageInfo = res.data.pageInfo;
this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas);
} else {
message.error(res.errormsg || "获取失败")
message.error(res.errormsg || "获取失败");
}
})
}
});
};
// 考勤引用同步
@action
syncAttendanceRefer = (params) => {
return new Promise((resolve, reject) => {
API.syncAttendanceRefer(params).then(res => {
if(res.status) {
message.success("同步成功")
resolve()
API.syncAttendanceRefer(params).then((res) => {
if (res.status) {
message.success("同步成功");
resolve();
} else {
message.error(res.errormsg || "同步失败")
message.error(res.errormsg || "同步失败");
reject();
}
})
})
}
});
});
};
// 考勤引用同步
@action
checkOperation = (params) => {
return API.checkOperation(params);
};
// 根据所属月和账套获取周期
@action
getSalaryCycleAndAttendCycle = (salaryYearMonthStr, salarySobId) => {
API.getSalaryCycleAndAttendCycle({salaryYearMonthStr, salarySobId}).then(res => {
if(res.status) {
this.cycle = res.data
} else {
message.error(res.errormsg || "获取失败")
API.getSalaryCycleAndAttendCycle({ salaryYearMonthStr, salarySobId }).then(
(res) => {
if (res.status) {
this.cycle = res.data;
} else {
message.error(res.errormsg || "获取失败");
}
}
})
}
}
);
};
}

View File

@ -5,6 +5,7 @@
position: relative;
height: 100%;
text-align: center;
>div {
position: absolute;
top: 50%;
@ -29,3 +30,7 @@
overflow: hidden;
}
.ant-checkbox-wrapper+.ant-checkbox-wrapper {
margin-left: 0 !important;
}