Merge branch 'feature/V2-非系统人员管理开发' into release/2.8.3.2307.02

# Conflicts:
#	pc4mobx/hrmSalary/pages/ruleConfig/index.js
This commit is contained in:
黎永顺 2023-07-20 13:47:42 +08:00
commit c062f172f6
24 changed files with 1175 additions and 116 deletions

View File

@ -0,0 +1,27 @@
import { postFetch } from "../util/request";
import { WeaTools } from "ecCom";
//非系统人员-保存
export const save = (params) => {
return postFetch("/api/bs/hrmsalary/extEmp/save", params);
};
//非系统人员-修改
export const update = (params) => {
return postFetch("/api/bs/hrmsalary/extEmp/update", params);
};
//非系统人员-列表
export const listPage = (params) => {
return postFetch("/api/bs/hrmsalary/extEmp/listPage", params);
};
//非系统人员-删除
export const deleteExtEmp = (params) => {
return postFetch("/api/bs/hrmsalary/extEmp/delete", params);
};
//非系统人员-详情
export const detail = params => {
return WeaTools.callApi("/api/bs/hrmsalary/extEmp/detail", "get", params);
};

View File

@ -71,6 +71,17 @@ export const saveLedgerBasic = params => {
}).then(res => res.json());
};
//薪资帐套外部人员范围(包含)列表
export const getLedgerPersonRangeExtList = params => {
return fetch("/api/bs/hrmsalary/salarysob/range/ext/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//薪资帐套人员范围(包含)列表
export const getLedgerPersonRangeInclude = params => {
return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", {
@ -104,6 +115,28 @@ export const getLedgerPersonRangeForm = params => {
);
};
//保存薪资帐套外部人员范围
export const saveLedgerPersonExtRange = params => {
return fetch("/api/bs/hrmsalary/salarysob/ext/save", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//删除薪资帐套外部人员范围
export const deleteLedgerPersonExtRange = params => {
return fetch("/api/bs/hrmsalary/salarysob/range/ext/delete", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//保存薪资帐套人员范围
export const saveLedgerPersonRange = params => {
return fetch("/api/bs/hrmsalary/salarysob/range/save", {

View File

@ -6,6 +6,10 @@ export const commonEnumList = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params);
};
export const sysinfo = params => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/info", "GET", params);
};
export const sysOrderRule = params => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params);
};
@ -47,6 +51,10 @@ export const operateTaxDeclarationFunction = (params) => {
export const saveArchiveDelete = (params) => {
return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params);
};
//保存系统规则开关
export const saveSysOperate = (params) => {
return postFetch("/api/bs/hrmsalary/sys/operate", params);
};
//保存个税申报撤回规则
export const saveWithDrawTaxDeclaration = (params) => {
return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params);

View File

@ -70,6 +70,18 @@ export const deleteTaxAgent = (params) => {
export const taxAgentRangeSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
};
//非系统人员范围查询
export const taxAgentRangelistExt = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params);
};
//非系统人员范围删除
export const taxAgentRangeExtDelete = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/delete", params);
};
//非系统人员范围保存
export const taxAgentRangeExtSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/save", params);
};
//人员范围删除
export const taxAgentRangeDelete = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params);

View File

@ -0,0 +1,86 @@
/*
* Author: 黎永顺
* name: 外部人员添加弹框
* Description:
* Date: 2023/3/14
*/
import React, { Component } from "react";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup } from "ecCom";
import { Button, Modal } from "antd";
class Index extends Component {
constructor(props) {
super(props);
this.state = {
targetIds: "",
targetNames: ""
};
}
handleExternalPersonSave = () => {
const { targetIds } = this.state;
const { onExternalPersonSave } = this.props;
if (!_.isEmpty(targetIds)) {
onExternalPersonSave({ targetIds: targetIds.split(",") });
} else {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
}
};
render() {
const { targetIds, targetNames } = this.state;
const { onCancel, visible, loading } = this.props;
const buttons = [
<Button type="primary" onClick={this.handleExternalPersonSave} loading={loading}>确定</Button>,
<Button type="ghost" onClick={onCancel}>取消</Button>
];
return (
<WeaDialog
title="关联非系统人员"
visible={visible}
style={{ width: 600 }}
buttons={buttons}
onCancel={onCancel}
>
<WeaSearchGroup col={1} needTigger title="" showGroup center>
<WeaFormItem label="非系统人员" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaBrowser
title="非系统人员"
type={162}
viewAttr={3}
isSingle={false}
value={targetIds}
valueSpan={targetNames}
completeParams={{
type: 162,
fielddbtype: "browser.salaryExtEmp",
f_weaver_belongto_usertype: "0"
}}
conditionDataParams={{
type: "browser.salaryExtEmp",
fielddbtype: "browser.salaryExtEmp",
f_weaver_belongto_usertype: "0"
}}
dataParams={{
type: "browser.salaryExtEmp",
f_weaver_belongto_usertype: "0"
}}
destDataParams={{
type: "browser.salaryExtEmp",
f_weaver_belongto_usertype: "0"
}}
isMultCheckbox
inputStyle={{ width: 375 }}
onChange={(targetIds, targetNames) => this.setState({ targetIds, targetNames })}
/>
</WeaFormItem>
</WeaSearchGroup>
</WeaDialog>
);
}
}
export default Index;

View File

@ -37,6 +37,7 @@ import EmployeeList from "./pages/employeeView";
import ReportView from "./pages/reportView";
import MySalaryView from "./pages/mySalary/mySalaryView";
import WatermarkPreview from "./pages/payroll/watermarkPreview";
import ExternalPersonManage from "./pages/externalPersonManage";
import stores from "./stores";
import "./style/index";
@ -86,6 +87,7 @@ const DataAcquisition = (props) => props.children;
// fieldManagement 字段管理
// analysisOfSalaryStatistics 薪酬统计分析
// reportView 薪酬报表查看
// externalPersonManage 非系统人员管理
const Routes = (
<Route
@ -163,6 +165,7 @@ const Routes = (
<Route key="analysisOfSalaryStatistics" path="analysisOfSalaryStatistics" component={AnalysisOfSalaryStatistics}/>
<Route key="analysisOfSalaryStatisticsId" path="analysisOfSalaryStatistics/:employeeId" component={EmployeeList}/>
<Route key="reportView" path="reportView" component={ReportView}/>
<Route key="externalPersonManage" path="externalPersonManage" component={ExternalPersonManage}/>
</Route>
);

View File

@ -0,0 +1,133 @@
/*
* Author: 黎永顺
* name: 非系统人员管理表单项
* Description:
* Date: 2023/3/13
*/
import React, { Component } from "react";
import { WeaSlideModal } from "ecCom";
import { message } from "antd";
import { getConditionDomkeys, getSearchs } from "../../../util";
import SlideModalTitle from "../../../components/slideModalTitle";
import { detail, save, update } from "../../../apis/externalPersonManage";
class ExternalPersonManageEditSlide extends Component {
constructor(props) {
super(props);
this.state = {
date: "",
loading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible && nextProps.id) this.detail(nextProps);
}
detail = (props) => {
const { form, id, condition } = props;
detail({ id }).then(({ status, data }) => {
if (status) {
form.updateFields({
"departmentId": {
value: data["departmentId"],
valueSpan: data["departmentOrgName"],
valueObj: [{ id: data["departmentId"], name: data["departmentOrgName"] }]
}
});
form.updateFields({
"subcompanyId": {
value: data["subcompanyId"],
valueSpan: data["subcompanyOrgName"],
valueObj: [{ id: data["subcompanyId"], name: data["subcompanyOrgName"] }]
}
});
// form.updateFields({
// "jobtitleId": {
// value: jobtitleId,
// valueSpan: data["jobtitleOrgName"],
// valueObj: [{ id: jobtitleId, name: data["jobtitleOrgName"] }]
// }
// });
_.map(_.without(getConditionDomkeys(condition), "departmentId", "subcompanyId"), item => {
form.updateFields({ [item]: { value: data[item] } }, false);
});
}
});
};
handleSubmit = () => {
const { form, id, onCancel, title } = this.props;
form.validateForm().then(f => {
if (f.isValid) {
const tmpV = _.reduce(_.keys(form.getFormDatas()), (pre, cur) => {
if (cur === "departmentId") {
return _.assign(pre, {
[cur]: form.getFormDatas()[cur].value,
departmentName: form.getFormDatas()["departmentId"].valueSpan
});
} else if (cur === "subcompanyId") {
return _.assign(pre, {
[cur]: form.getFormDatas()[cur].value,
subcompanyName: form.getFormDatas()["subcompanyId"].valueSpan
});
}
return _.assign(pre, { [cur]: form.getFormDatas()[cur].value });
}, {});
const payload = _.omitBy(form.getFormParams(), _.isNil);
this.setState({ loading: true });
const APIFOX = !id ? save : update;
APIFOX(id ? { ...payload, id } : payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(`${title}成功`);
onCancel(true);
} else {
message.error(errormsg || `${title}失败`);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
this.setState({ date: new Date() });
}
});
};
handleFormChange = (res) => {
const { form, id } = this.props;
if (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId") {
const key = _.replace(_.keys(res)[0], "Id", "Name");
form.updateFields({ [key]: res[_.keys(res)[0]].valueSpan || "" });
}
};
render() {
const { loading } = this.state;
const { visible, title, onCancel, showOperateBtn, form, condition } = this.props;
return (
<WeaSlideModal
className="slideOuterWrapper"
visible={visible}
top={0}
measureT="%"
width={800}
measureX="px"
height={100}
measureY="%"
direction="right"
title={
<SlideModalTitle
subtitle={title}
editable={true}
loading={loading}
showOperateBtn={showOperateBtn}
onSave={this.handleSubmit}
/>
}
content={getSearchs(form, condition, 1, false, this.handleFormChange)}
onClose={onCancel}
/>
);
}
}
export default ExternalPersonManageEditSlide;

View File

@ -0,0 +1,208 @@
export const searchCondition = [
{
items: [
{
colSpan: 2,
conditionType: "INPUT",
domkey: ["username"],
fieldcol: 16,
label: "姓名",
labelcol: 8,
value: "",
viewAttr: 2
}
],
defaultshow: true
}
];
export const condition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["username"],
rules: "required|string",
fieldcol: 18,
label: "姓名",
labelcol: 6,
value: "",
viewAttr: 3
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "部门",
type: "57",
viewAttr: 2
},
colSpan: 1,
conditionType: "BROWSER",
domkey: ["departmentId"],
fieldcol: 18,
label: "部门",
labelcol: 6,
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["departmentName"],
fieldcol: 18,
label: "部门名称",
labelcol: 6,
value: "",
hasBorder: true,
viewAttr: 1
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "分部",
type: "164",
viewAttr: 2
},
colSpan: 1,
conditionType: "BROWSER",
domkey: ["subcompanyId"],
fieldcol: 18,
label: "分部",
labelcol: 6,
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["subcompanyName"],
fieldcol: 18,
label: "分部名称",
labelcol: 6,
value: "",
hasBorder: true,
viewAttr: 1
},
// {
// browserConditionParam: {
// completeParams: {},
// conditionDataParams: {},
// dataParams: {},
// destDataParams: {},
// hasAddBtn: false,
// hasAdvanceSerach: false,
// idSeparator: ",",
// isAutoComplete: 1,
// isDetail: 0,
// isMultCheckbox: false,
// isSingle: true,
// icon: "icon-coms-hrm",
// linkUrl: "",
// pageSize: 10,
// quickSearchName: "",
// replaceDatas: [],
// title: "岗位",
// type: "24",
// viewAttr: 2,
// },
// colSpan: 1,
// conditionType: "BROWSER",
// domkey: ["jobtitleId"],
// fieldcol: 18,
// label: "岗位",
// labelcol: 6,
// viewAttr: 2,
// },
{
colSpan: 1,
conditionType: "DATEPICKER",
domkey: ["companystartdate"],
fieldcol: 18,
label: "入职日期",
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobile"],
fieldcol: 18,
label: "手机",
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["workcode"],
fieldcol: 18,
label: "工号",
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["idNo"],
fieldcol: 18,
label: "身份证号码",
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["bankCardNum"],
fieldcol: 18,
label: "本人开户的银行卡卡号",
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["bankName"],
fieldcol: 18,
label: "本人开户的银行卡开户支行全称",
labelcol: 6,
value: "",
viewAttr: 2
}
],
defaultshow: true,
title: "基本信息"
}
];

View File

@ -0,0 +1,177 @@
/*
* Author: 黎永顺
* name: 非系统人员管理
* Description:
* Date: 2023/3/13
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaTab, WeaTable, WeaTop } from "ecCom";
import ExternalPersonManageEditSlide from "./components/externalPersonManageEditSlide";
import { Button, message, Modal } from "antd";
import { getSearchs } from "../../util";
import { condition, searchCondition } from "./conditions";
import { deleteExtEmp, listPage } from "../../apis/externalPersonManage";
import "./index.less";
@inject("externalPersonManageStore", "taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false,
selectedRowKeys: [],
pageInfo: { current: 1, pageSize: 10, total: 0 },
showSearchAd: false,
externalPersonManagePayload: {
visible: false, title: "新建", id: ""
}
};
}
componentDidMount() {
const { externalPersonManageStore: { form, addForm } } = this.props;
form.initFormFields(searchCondition);
addForm.initFormFields(condition);
this.listPage();
}
listPage = () => {
const { pageInfo } = this.state;
const { externalPersonManageStore: { form } } = this.props;
const payload = { ...pageInfo, ...form.getFormParams() };
listPage(payload).then(({ status, data }) => {
if (status) {
const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
this.setState({
dataSource, columns,
pageInfo: { ...pageInfo, current, pageSize, total }
});
}
});
};
deleteExtEmp = (ids) => {
deleteExtEmp(ids).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.listPage();
} else {
message.error(errormsg || "删除失败");
}
});
};
handleDelete = (id) => {
Modal.confirm({
title: "信息确认",
content: "确定删除吗",
onOk: () => this.deleteExtEmp([id])
});
};
handleCancel = (isRefresh) => {
const { externalPersonManagePayload } = this.state;
const { externalPersonManageStore: { addForm } } = this.props;
addForm.resetForm();
this.setState({
externalPersonManagePayload: {
...externalPersonManagePayload,
visible: false, title: "新建", id: ""
}
}, () => isRefresh && this.listPage());
};
handleAdd = (id = "") => {
const { externalPersonManagePayload } = this.state;
this.setState({
externalPersonManagePayload: {
...externalPersonManagePayload,
visible: true, id, title: id ? "编辑" : "新建"
}
});
};
getColumns = () => {
const { columns } = this.state;
return _.map(_.filter(columns, item => !!item.display), child => ({
...child,
render: (text) => {
return <span className="ellipsis" title={text}>{text}</span>;
}
}));
};
render() {
const { showSearchAd, externalPersonManagePayload, loading, pageInfo, selectedRowKeys, dataSource } = this.state;
const { externalPersonManageStore: { form, addForm }, taxAgentStore: { showOperateBtn } } = this.props;
const pagination = {
current: pageInfo.current,
pageSize: pageInfo.pageSize,
total: pageInfo.total,
showTotal: total => `${total}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.listPage());
},
onChange: current => {
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listPage());
}
};
const rowSelection = {
selectedRowKeys,
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
};
return (
<div className="externalPerWrapper">
<WeaTop
title="非系统人员管理" icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" showDropIcon={false}
>
<div className="externalPerCont">
<WeaTab
buttons={showOperateBtn ? [
<Button type="primary" onClick={() => this.handleAdd()}>新建</Button>
] : []}
searchType={["base", "advanced"]} showSearchAd={showSearchAd}
setShowSearchAd={(showSearchAd) => this.setState({ showSearchAd })}
searchsAd={getSearchs(form, searchCondition, 2)}
searchsBasePlaceHolder="请输入姓名" onSearch={this.listPage}
onSearchChange={username => form.updateFields({ username })}
searchsBaseValue={form.getFormParams().username}
onAdSearch={() => this.setState({ showSearchAd: false }, () => this.listPage())}
onAdReset={() => form.resetForm()} onAdCancel={() => this.setState({ showSearchAd: false })}
/>
<WeaTable
rowKey="id"
loading={loading}
columns={showOperateBtn ? [
...this.getColumns(),
{
dataIndex: "operate",
title: "操作",
width: 120,
render: (_, { id }) => (
<React.Fragment>
<a href="javascript: void(0);" onClick={() => this.handleAdd(id)}
style={{ paddingRight: 8 }}>编辑</a>
{/*<a href="javascript: void(0);" onClick={() => this.handleDelete(id)}>删除</a>*/}
</React.Fragment>
)
}
] : []}
dataSource={dataSource}
pagination={pagination}
rowSelection={rowSelection}
xWidth={800}
/>
<ExternalPersonManageEditSlide
showOperateBtn={showOperateBtn} form={addForm} condition={condition}
onCancel={this.handleCancel} {...externalPersonManagePayload}
/>
</div>
</WeaTop>
</div>
);
}
}
export default Index;

View File

@ -0,0 +1,14 @@
.externalPerWrapper {
width: 100%;
height: 100%;
.externalPerCont {
height: 100%;
}
}
.slideOuterWrapper {
.hideFormItem {
display: none !important;
}
}

View File

@ -11,19 +11,25 @@ import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
import PersonalScopeTable from "../../../components/PersonalScopeTable";
import PersonalScopeModal from "../../../components/PersonalScopeModal";
import {
deleteLedgerPersonExtRange,
deleteLedgerPersonRange,
getLedgerPersonRangeExclude,
getLedgerPersonRangeExtList,
getLedgerPersonRangeInclude,
salarysobRangeImportData,
salarysobRangePreview,
saveLedgerPersonExtRange,
saveLedgerPersonRange
} from "../../../apis/ledger";
import ImportModal from "../../../components/importModal";
import { importEmployColumns } from "../../taxAgent/columns";
import ExternalPersonModal from "../../../components/externalPersonModal";
import { sysinfo } from "../../../apis/ruleconfig";
const APIFox = {
listInclude: getLedgerPersonRangeInclude,
listExclude: getLedgerPersonRangeExclude
listExclude: getLedgerPersonRangeExclude,
externalList: getLedgerPersonRangeExtList
};
const APISaveFox = {
save: saveLedgerPersonRange
@ -39,6 +45,8 @@ class LedgerAssociatedPersonnel extends Component {
selectedKey: "listInclude",
rowKeys: [],
previewDataSource: [],
externalPersonModalVisible: false,
loading: false,
importParams: {
visible: false,
step: 0,
@ -48,10 +56,45 @@ class LedgerAssociatedPersonnel extends Component {
visible: false,
title: "关联人员",
includeType: ""
}
},
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
};
}
componentDidMount() {
this.getSysinfo();
}
/*
* Author: 黎永顺
* Description: 非系统人员开关查询
* Params:
* Date: 2023/7/14
*/
getSysinfo = () => {
sysinfo().then(({ status, data }) => {
if (status) this.setState({ extEmpsWitch: data.extEmpsWitch });
});
};
/*
* Author: 黎永顺
* Description:外部人员保存
* Params:
* Date: 2023/3/14
*/
handleSaveExternalPerson = (val) => {
const { editId: salarySobId, saveSalarySobId } = this.props;
saveLedgerPersonExtRange({ ...val, salarySobId: salarySobId || saveSalarySobId }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
this.setState({ externalPersonModalVisible: false });
this.personalScopeTableRef.getPersonalScopeList();
} else {
message.error(errormsg || "保存失败");
}
}).catch(() => this.setState({ loading: true }));
};
/*
* Author: 黎永顺
* Description: 删除人员范围
@ -59,23 +102,55 @@ class LedgerAssociatedPersonnel extends Component {
* Date: 2022/11/30
*/
taxAgentRangeDelete = () => {
const { selectedKey } = this.state;
Modal.confirm({
title: "信息确认",
content: "确认要删除吗?",
onOk: () => {
deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.setState({ rowKeys: [] }, () => {
this.personalScopeTableRef.clearRowkeys();
});
} else {
message.error(errormsg || "删除失败");
}
});
return new Promise((resolve, reject) => {
return selectedKey === "externalList" ? this.deleteLedgerPersonExtRange(resolve, reject) : this.deleteLedgerPersonRange(resolve, reject);
}).catch(() => console.log("出错!"));
}
});
};
deleteLedgerPersonExtRange = (resolve, reject) => {
message.destroy();
message.loading("正在删除中...", 0);
deleteLedgerPersonExtRange(this.state.rowKeys).then(({ status, errormsg }) => {
message.destroy();
resolve();
if (status) {
message.success("删除成功");
this.setState({ rowKeys: [] }, () => {
this.personalScopeTableRef.clearRowkeys();
});
} else {
message.error(errormsg || "删除失败");
}
}).catch(() => {
message.destroy();
reject();
});
};
deleteLedgerPersonRange = (resolve, reject) => {
message.destroy();
message.loading("正在删除中...", 0);
deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => {
message.destroy();
resolve();
if (status) {
message.success("删除成功");
this.setState({ rowKeys: [] }, () => {
this.personalScopeTableRef.clearRowkeys();
});
} else {
message.error(errormsg || "删除失败");
}
}).catch(() => {
message.destroy();
reject();
});
};
/*
* Author: 黎永顺
* Description:新增人员范围
@ -84,13 +159,17 @@ class LedgerAssociatedPersonnel extends Component {
*/
handleAddPersonal = () => {
const { personalAddModal, selectedKey } = this.state;
this.setState({
personalAddModal: {
...personalAddModal,
visible: true,
includeType: selectedKey === "listInclude" ? 1 : 0
}
});
if (selectedKey === "externalList") {
this.setState({ externalPersonModalVisible: true });
} else {
this.setState({
personalAddModal: {
...personalAddModal,
visible: true,
includeType: selectedKey === "listInclude" ? 1 : 0
}
});
}
};
/*
* Author: 黎永顺
@ -138,7 +217,9 @@ class LedgerAssociatedPersonnel extends Component {
rowKeys,
personalAddModal,
importParams,
previewDataSource
previewDataSource,
externalPersonModalVisible,
loading, extEmpsWitch
} = this.state;
const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props;
const topTab = [
@ -149,6 +230,10 @@ class LedgerAssociatedPersonnel extends Component {
{
title: "从范围中排除",
viewcondition: "listExclude"
},
{
title: "非系统人员范围",
viewcondition: "externalList"
}
];
const btns = showOperateBtn ? [
@ -189,10 +274,10 @@ class LedgerAssociatedPersonnel extends Component {
return (
<div>
<WeaTab
datas={topTab}
datas={extEmpsWitch === "0" ? _.dropRight(topTab) : topTab}
keyParam="viewcondition" //主键
selectedKey={selectedKey}
buttons={showOperateBtn && selectedKey === "listExclude" ? btns.slice(1) : btns}
buttons={showOperateBtn && selectedKey === "listInclude" ? btns : btns.slice(1)}
onChange={selectedKey => this.setState({ selectedKey })}
/>
<PersonalScopeTable
@ -234,6 +319,13 @@ class LedgerAssociatedPersonnel extends Component {
}}
/>
)}
{/*非系统人员添加*/}
<ExternalPersonModal
visible={externalPersonModalVisible}
loading={loading}
onCancel={() => this.setState({ externalPersonModalVisible: false })}
onExternalPersonSave={this.handleSaveExternalPerson}
/>
{/*新增人员范围*/}
<PersonalScopeModal
{...personalAddModal}

View File

@ -26,7 +26,7 @@ class ImportMenu extends Component {
params.listType = "FIXED";
} else {
params.listType = this.state.importParams.importType;
params.importType = '';
params.importType = "";
}
API.salaryArchivePreview(params).then(({ status, data }) => {
if (status) {
@ -92,14 +92,15 @@ class ImportMenu extends Component {
};
// 导入档案
handleImportFile = (params) => {
const { isExtEmp = false } = this.props;
if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") {
params.importType = this.state.importParams.importType;
params.listType = "FIXED";
} else {
params.importType = '';
params.importType = "";
params.listType = this.state.importParams.importType;
}
API.importSalaryArchive(params).then(({ status, data }) => {
API.importSalaryArchive({ ...params, isExtEmp }).then(({ status, data }) => {
if (status) {
data.errorData = data.errorNotice;
this.setState({
@ -113,7 +114,7 @@ class ImportMenu extends Component {
};
render() {
const { importType, refreshList } = this.props;
const { importType, refreshList, isExtEmp } = this.props;
const { importParams, previewColumns, previewDataSource } = this.state;
let params = "";
if (importParams.importType === "init" || importParams.importType === "salaryItemAdjust") {
@ -121,6 +122,7 @@ class ImportMenu extends Component {
} else {
params = "" + "&listType=" + importParams.importType;
}
if (isExtEmp) params = params + "&extSalaryArchiveList=true";
return (
<React.Fragment>
<Menu className="dropdownMenuWrapper" onClick={this.handleMenuClick}>

View File

@ -26,5 +26,12 @@ export const tabCondition = [
showcount: true,
title: "停薪员工",
viewcondition: "stop"
},
{
color: "#000000",
groupid: "EXT",
showcount: true,
title: "非系统人员",
viewcondition: "ext"
}
];

View File

@ -31,6 +31,7 @@ import BatchSuspendsPay from "./components/batchSuspendsPay";
import SlideModalTitle from "../../components/slideModalTitle";
import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide";
import ChangeSalaryModal from "../salaryFile/changeSalaryModal";
import { sysinfo } from "../../apis/ruleconfig";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@ -86,7 +87,8 @@ class Index extends Component {
payStartDate: "",
payEndDate: ""
},
salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0 否, 1
salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0 否, 1 是,
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
};
}
@ -155,6 +157,7 @@ class Index extends Component {
fetchTaxAgentOption();
this.queryTabTotal();
this.queryList("/api/bs/hrmsalary/salaryArchive/pendingList");
this.getSysinfo();
const init = this.init();
window.addEventListener("message", this.handleReceive, false);
}
@ -163,6 +166,18 @@ class Index extends Component {
window.removeEventListener("message", this.handleReceive, false);
}
/*
* Author: 黎永顺
* Description: 非系统人员开关查询
* Params:
* Date: 2023/7/14
*/
getSysinfo = () => {
sysinfo().then(({ status, data }) => {
if (status) this.setState({ extEmpsWitch: data.extEmpsWitch });
});
};
handleReceive = ({ data }) => {
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({
@ -498,6 +513,27 @@ class Index extends Component {
}}/></Button>
</Dropdown>
];
} else if (selectedKey === "ext" && showOperateBtn) {
return [
<WeaHelpfulTip
width={300}
title={<HelpfulDiv/>}
placement="topLeft"
/>,
<Dropdown overlay={
<ImportMenu
isExtEmp importType={importType}
refreshList={() => {
this.query();
this.setState({ selectedRowKeys: [] });
}}/>
}>
<Button type="primary">导入<i className="icon-coms-down2" style={{
marginLeft: 8,
verticalAlign: "middle"
}}/></Button>
</Dropdown>
];
}
return [];
};
@ -584,7 +620,7 @@ class Index extends Component {
window.open(`${linkUrl}&salaryArchiveId=${id}`);
}}>发起调薪</Button>);
}
if (showOperateBtn && selectedKey === "fixed") {
if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) {
arrList.push(<Button type="primary" onClick={() => {
this.setState({ changeSalaryVisible: true });
}}>调薪</Button>);
@ -631,7 +667,7 @@ class Index extends Component {
salaryItemId: it.id,
adjustValue: String(it.value || "")
})),
status: _.upperCase(selectedKey)
status: selectedKey === "ext" ? "FIXED" : _.upperCase(selectedKey)
};
API.savePaySet(payload).then(({ status, errormsg }) => {
if (status) {
@ -664,9 +700,12 @@ class Index extends Component {
case "suspend":
this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList");
break;
default:
case "stop":
this.queryList("/api/bs/hrmsalary/salaryArchive/stopList");
break;
default:
this.queryList("/api/bs/hrmsalary/salaryArchive/extList");
break;
}
};
@ -679,7 +718,8 @@ class Index extends Component {
showSearchAd,
slideParams,
changeSalaryVisible,
paysetParams
paysetParams,
extEmpsWitch
} = this.state;
const { payrollFilesStore: { tableStore } } = this.props;
const renderSearch = () => {
@ -738,7 +778,7 @@ class Index extends Component {
dropMenuDatas={rightMenu}
>
<WeaTab
datas={tabCondition}
datas={extEmpsWitch === "0" ? _.dropRight(tabCondition) : tabCondition}
counts={tabCount}
className="payrollFilesTab"
keyParam="viewcondition" //主键

View File

@ -27,7 +27,8 @@ export default class Index extends Component {
operateTaxDeclaration: "",
matchRule: "",
confValue: "0",
withDrawTaxDeclaration: "0"
withDrawTaxDeclaration: "0",
extEmpsWitch: "0"
},
showEncryptOperationButton: "",
progressVisible: false,
@ -39,36 +40,52 @@ export default class Index extends Component {
const { saveParams } = this.state;
const [
matchRuleEnum, orderRuleEnum, ascOrDescEnum, matchEmployeeModeEnum,
orderRules, codeRule, appSettings
// orderRules, codeRule, appSettings,
sysInfo
] = await Promise.all([
this.matchRuleEnum(), this.orderRuleEnum(), this.ascOrDescEnum(), this.matchEmployeeModeEnum(),
this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting()
// this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting(),
this.sysinfo()
]);
const matchRuleOptions = _.map(matchRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const orderOptions = _.map(orderRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const ascOptions = _.map(ascOrDescEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const employeeOptions = _.map(matchEmployeeModeEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const { data: { ascOrDesc, orderRule } } = orderRules;
const { data: rule } = codeRule;
const {
data: {
showEncryptOperationButton,
isOpenEncrypt: enctry,
isOpenTaxDeclaration: operateTaxDeclaration,
salaryAcctEmployeeRule: matchRule,
salaryArchiveDelete: confValue, withDrawTaxDeclaration
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
taxDeclarationFunction: operateTaxDeclaration = "0", salaryArchiveDelete: confValue,
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
OPEN_APPLICATION_ENCRYPT: enctry = "0", extEmpsWitch = "0"
}
} = appSettings;
} = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules;
// const { data: rule } = codeRule;
// const {
// data: {
// showEncryptOperationButton,
// isOpenEncrypt: enctry
// isOpenTaxDeclaration: operateTaxDeclaration,
// salaryAcctEmployeeRule: matchRule,
// salaryArchiveDelete: confValue,
// withDrawTaxDeclaration
// }
// } = appSettings;
this.setState({
matchRuleOptions, orderOptions, ascOptions, employeeOptions,
showEncryptOperationButton,
saveParams: {
...saveParams,
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration,
extEmpsWitch
}
});
}
sysinfo = () => {
return API.sysinfo();
};
sysOrderRule = () => {
return API.sysOrderRule();
};
@ -210,6 +227,16 @@ export default class Index extends Component {
}
});
};
saveSysOperate = (payload) => {
API.saveSysOperate({ ...payload, confValue: this.state.saveParams.extEmpsWitch })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(22619, "保存成功!"));
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
});
};
withDrawTaxDeclaration = () => {
API.saveWithDrawTaxDeclaration({ confValue: _.pick(this.state.saveParams, ["withDrawTaxDeclaration"]).withDrawTaxDeclaration })
.then(({ status, errormsg }) => {
@ -256,6 +283,12 @@ export default class Index extends Component {
case "withDrawTaxDeclaration":
this.withDrawTaxDeclaration();
break;
case "extEmpsWitch":
this.saveSysOperate({
title: getLabel(111, "开启非系统人员"),
module: "basic", confKey: key
});
break;
default:
break;
}
@ -289,7 +322,8 @@ export default class Index extends Component {
operateTaxDeclaration,
matchRule,
confValue,
withDrawTaxDeclaration
withDrawTaxDeclaration,
extEmpsWitch
} = saveParams;
return (
<div className="ruleWrapper">
@ -352,6 +386,12 @@ export default class Index extends Component {
/>
</WeaFormItem>
</WeaSearchGroup>
<WeaSearchGroup title={getLabel(111, "非系统人员")} showGroup center>
<WeaFormItem label={getLabel(111, "开启非系统人员")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaCheckbox display="switch" value={extEmpsWitch}
onChange={val => this.handleChange("extEmpsWitch", val)}/>
</WeaFormItem>
</WeaSearchGroup>
{
this.state.progressVisible &&
<ProgressModal

View File

@ -87,7 +87,7 @@ export default class SalaryFileViewSlide extends React.Component {
{
com: PickDate({
label: "起始发薪日期",
viewAttr: selectedKey === "pending" ? 3 : 1,
viewAttr: (selectedKey === "pending" || selectedKey === "ext") ? 3 : 1,
value: paysetParams.payStartDate,
onChange: handleSetpay
})
@ -95,7 +95,7 @@ export default class SalaryFileViewSlide extends React.Component {
{
com: PickDate({
label: "最后发薪日期",
viewAttr: (selectedKey === "pending" || selectedKey === "fixed") ? 2 : selectedKey === "stop" ? 1 : 3,
viewAttr: (selectedKey === "pending" || selectedKey === "fixed" || selectedKey === "ext") ? 2 : selectedKey === "stop" ? 1 : 3,
value: paysetParams.payEndDate,
onChange: handleSetpay
})

View File

@ -3,6 +3,7 @@ import { Button } from "antd";
import { WeaDialog, WeaFormItem, WeaSearchGroup, WeaSteps, WeaTab } from "ecCom";
import { WeaSwitch } from "comsMobx";
import PersonalScope from "./personalScope";
import "./index.less";
const titleOuter = {
display: "flex",
@ -136,6 +137,7 @@ export default class EditModal extends React.Component {
</div>
}
initLoadCss
className="taxagentModalWrapper"
visible={visible}
style={{ width: 800, height: 450 }}
hasScroll>

View File

@ -113,3 +113,46 @@
}
}
}
.taxagentModalWrapper {
.topMenuWrapper {
height: 47px;
line-height: 47px;
padding: 0 10px;
display: flex;
justify-content: space-between;
.topMenuTabWrapper {
display: flex;
align-items: center;
.menuTabItem {
height: 24px;
padding: 0 16px;
border-radius: 3px;
margin-right: 6px;
display: flex;
align-items: center;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1 1 auto;
line-height: normal;
}
.menuTabItem:hover {
color: #5d9cec;
background: #e9f7ff;
}
.active {
color: #5d9cec;
background: #e9f7ff;
}
}
}
}

View File

@ -18,6 +18,7 @@ export default class PersonalScope extends Component {
constructor(props) {
super(props);
this.state = {
deleteLoading: false,
queryLoading: false,
submitLoading: false,
targetTypeList: [],
@ -46,7 +47,6 @@ export default class PersonalScope extends Component {
}
});
};
getTaxAgentRangeListInclude = (pageModule = {}) => {
const { taxAgentId } = this.props;
const { getTaxAgentRangeListInclude } = this.props.taxAgentStore;
@ -75,6 +75,35 @@ export default class PersonalScope extends Component {
}
);
};
taxAgentRangelistExt = (pageModule = {}) => {
const { taxAgentId } = this.props;
const { taxAgentRangelistExt } = this.props.taxAgentStore;
this.setState({ queryLoading: true });
taxAgentRangelistExt({ ...pageModule, taxAgentId }).then(
({ status, data }) => {
this.setState({ queryLoading: false });
if (status && !_.isEmpty(data)) {
const {
columns,
list: dataSource,
pageNum: current,
pageSize,
total
} = data;
this.setState({
columns,
dataSource,
pageObj: {
current,
pageSize,
total
}
});
}
}
);
};
getTaxAgentRangeListExclude = (pageModule = {}) => {
const { taxAgentId } = this.props;
const { getTaxAgentRangeListExclude } = this.props.taxAgentStore;
@ -105,17 +134,93 @@ export default class PersonalScope extends Component {
};
taxAgentRangeDelete = ({ ids, tab }) => {
const { taxAgentRangeDelete } = this.props.taxAgentStore;
const { pageObj } = this.state;
Modal.confirm({
title: "信息确认",
content: `确认删除该条数据吗?`,
onOk: () => {
taxAgentRangeDelete(ids).then(({ status, errorMsg }) => {
return new Promise((resolve, reject) => {
return tab === "2" ? this.taxAgentExtRangeDeleteComfirm(resolve, reject, ids) : this.taxAgentRangeDeleteComfirm(resolve, reject, ids, tab);
}).catch(() => console.log("出错!"));
}
});
};
taxAgentExtRangeDeleteComfirm = (resolve, reject, ids) => {
const { taxAgentRangeExtDelete } = this.props.taxAgentStore;
const { pageObj } = this.state;
message.destroy();
message.loading("正在删除中...", 0);
taxAgentRangeExtDelete(ids).then(({ status, errormsg }) => {
message.destroy();
resolve();
if (status) {
this.tagAgentRef.onSelectChange([]);
message.success("删除成功");
this.taxAgentRangelistExt({
current: pageObj.current,
pageSize: pageObj.pageSize
});
} else {
message.error(errormsg || "删除失败");
}
}).catch(() => {
message.destroy();
reject();
});
};
taxAgentRangeDeleteComfirm = (resolve, reject, ids, tab) => {
const { taxAgentRangeDelete } = this.props.taxAgentStore;
const { pageObj } = this.state;
message.destroy();
message.loading("正在删除中...", 0);
taxAgentRangeDelete(ids).then(({ status, errormsg }) => {
message.destroy();
resolve();
if (status) {
this.tagAgentRef.onSelectChange([]);
message.success("删除成功");
tab == "1"
? this.getTaxAgentRangeListInclude({
current: pageObj.current,
pageSize: pageObj.pageSize
})
: this.getTaxAgentRangeListExclude({
current: pageObj.current,
pageSize: pageObj.pageSize
});
} else {
message.error(errormsg || "删除失败");
}
}).catch(() => {
message.destroy();
reject();
});
};
taxAgentRangeSave = (module) => {
const { taxAgentId } = this.props;
const { pageObj } = this.state;
const { includeType } = module;
const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore;
this.setState({ submitLoading: true });
if (includeType === "2") {
taxAgentRangeExtSave({ taxAgentId, ..._.pick(module, "targetIds") }).then(({ status, errormsg }) => {
this.setState({ submitLoading: false });
if (status) {
this.tagAgentRef.closeModal();
message.success("新增成功");
this.taxAgentRangelistExt({ current: pageObj.current, pageSize: pageObj.pageSize });
} else {
message.error(errormsg || "新增失败");
}
});
} else {
taxAgentRangeSave({ ...module, taxAgentId }).then(
({ status, errormsg }) => {
this.setState({ submitLoading: false });
if (status) {
this.tagAgentRef.onSelectChange([]);
message.success("删除成功");
tab == "1"
this.tagAgentRef.closeModal();
message.success("新增成功");
includeType == "1"
? this.getTaxAgentRangeListInclude({
current: pageObj.current,
pageSize: pageObj.pageSize
@ -125,41 +230,11 @@ export default class PersonalScope extends Component {
pageSize: pageObj.pageSize
});
} else {
message.error(errorMsg || "删除失败");
message.error(errormsg || "新增失败");
}
});
},
onCancel() {
}
});
};
taxAgentRangeSave = (module) => {
const { taxAgentId } = this.props;
const { pageObj } = this.state;
const { includeType } = module;
const { taxAgentRangeSave } = this.props.taxAgentStore;
this.setState({ submitLoading: true });
taxAgentRangeSave({ ...module, taxAgentId }).then(
({ status, errormsg }) => {
this.setState({ submitLoading: false });
if (status) {
this.tagAgentRef.closeModal();
message.success("新增成功");
includeType == "1"
? this.getTaxAgentRangeListInclude({
current: pageObj.current,
pageSize: pageObj.pageSize
})
: this.getTaxAgentRangeListExclude({
current: pageObj.current,
pageSize: pageObj.pageSize
});
} else {
message.error(errormsg || "新增失败");
}
}
);
);
}
};
render() {
@ -198,7 +273,8 @@ export default class PersonalScope extends Component {
() => {
tab == "1"
? this.getTaxAgentRangeListInclude({ ...pageObj, ...params })
: this.getTaxAgentRangeListExclude({ ...pageObj, ...params });
: tab == "0" ? this.getTaxAgentRangeListExclude({ ...pageObj, ...params }) :
this.taxAgentRangelistExt({ ...pageObj, ...params });
}
);
}}
@ -209,12 +285,14 @@ export default class PersonalScope extends Component {
onTaxAngetSearch={({ targetName, targetWorkcode, tab }) => {
tab == "1"
? this.getTaxAgentRangeListInclude({ targetName, targetWorkcode })
: this.getTaxAgentRangeListExclude({ targetName, targetWorkcode });
: tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }):
this.taxAgentRangelistExt({ targetName, targetWorkcode });
}}
onChangeTab={(tab) => {
this.tagAgentRef.onSelectChange([]);
tab == "1"
? this.getTaxAgentRangeListInclude()
: this.getTaxAgentRangeListExclude();
: tab == "0" ? this.getTaxAgentRangeListExclude() : this.taxAgentRangelistExt();
}}
/>
</div>

View File

@ -4,14 +4,16 @@ import { WeaButtonIcon, WeaFormItem, WeaInput, WeaSearchGroup, WeaTab, WeaTable
import AddTaxAgentModal from "./addTaxAgentModal";
import ImportModal from "../../components/importModal";
import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent";
import { sysinfo } from "../../apis/ruleconfig";
import { importEmployColumns } from "./columns";
import ExternalPersonModal from "../../components/externalPersonModal";
export default class SlideTaxagentUser extends React.Component {
constructor(props) {
super(props);
this.state = {
showSearchAd: false,
externalPersonModalVisible: false, //外部人员关联弹框
addTaxagentModalVisible: false,
includeType: "1",
selectedRowKeys: [],
@ -22,30 +24,34 @@ export default class SlideTaxagentUser extends React.Component {
visible: false,
step: 0,
importResult: {}
}
},
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
};
}
handleTabClick(includeType) {
const { onChangeTab } = this.props;
this.setState(
{
includeType
},
() => {
onChangeTab && onChangeTab(includeType);
}
);
componentDidMount() {
this.getSysinfo();
}
/*
* Author: 黎永顺
* Description: 非系统人员开关查询
* Params:
* Date: 2023/7/14
*/
getSysinfo = () => {
sysinfo().then(({ status, data }) => {
if (status) this.setState({ extEmpsWitch: data.extEmpsWitch });
});
};
onSelectChange = selectedRowKeys => {
this.setState({ selectedRowKeys });
};
handleTabDelete = () => {
const { onDeleteTaxAgent } = this.props;
const { includeType } = this.state;
if (this.state.selectedRowKeys.length == 0) {
const { includeType, selectedRowKeys } = this.state;
if (selectedRowKeys.length === 0) {
message.warning("未选择条目");
return;
}
@ -64,9 +70,10 @@ export default class SlideTaxagentUser extends React.Component {
closeModal = () => {
this.setState({
addTaxagentModalVisible: false
addTaxagentModalVisible: false,
externalPersonModalVisible: false
}, () => {
this.addTaxRef.handleReset();
this.addTaxRef && this.addTaxRef.handleReset();
});
};
handleInitModal = () => {
@ -120,9 +127,10 @@ export default class SlideTaxagentUser extends React.Component {
selectedRowKeys,
searchValue,
addTaxagentModalVisible,
externalPersonModalVisible,
importParams,
previewDataSource,
showSearchAd
showSearchAd, extEmpsWitch
} = this.state;
const {
submitLoading,
@ -146,6 +154,7 @@ export default class SlideTaxagentUser extends React.Component {
onChange: this.onSelectChange
};
const pagination = {
...pageObj,
total: pageObj.total,
showTotal: total => `${total}`,
pageSizeOptions: ["10", "20", "50", "100"],
@ -177,16 +186,30 @@ export default class SlideTaxagentUser extends React.Component {
><span className="icon-coms-leading-in" title="导入"></span></Button>,
<WeaButtonIcon buttonType="del" type="primary" disabled={_.isEmpty(selectedRowKeys)}
onClick={this.handleTabDelete}/>,
<WeaButtonIcon buttonType="add" type="primary" onClick={() => this.setState({ addTaxagentModalVisible: true })}/>
<WeaButtonIcon
buttonType="add" type="primary"
onClick={() => {
const key = includeType === "2" ? "externalPersonModalVisible" : "addTaxagentModalVisible";
this.setState({ [key]: true });
}}
/>
];
includeType === "0" && btns.shift();
(includeType === "0" || includeType === "2") && btns.shift();
return (
<div className="slideRefereUser">
<WeaTab
datas={[
{ title: "人员范围", viewcondition: "1" },
{ title: "从范围中排除", viewcondition: "0" }
]}
datas={
extEmpsWitch === "0" ?
[
{ title: "人员范围", viewcondition: "1" },
{ title: "从范围中排除", viewcondition: "0" },
] :
[
{ title: "人员范围", viewcondition: "1" },
{ title: "从范围中排除", viewcondition: "0" },
{ title: "非系统人员范围", viewcondition: "2" }
]
}
keyParam="viewcondition" selectedKey={includeType}
searchType={["base"]} advanceHeight={200}
showSearchAd={showSearchAd} searchsAd={this.getSearchs()}
@ -292,7 +315,12 @@ export default class SlideTaxagentUser extends React.Component {
pagination={pagination}
/>
</div>
<ExternalPersonModal
visible={externalPersonModalVisible}
loading={submitLoading}
onCancel={() => this.setState({ externalPersonModalVisible: false })}
onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })}
/>
<AddTaxAgentModal
ref={(ref) => this.addTaxRef = ref}
loading={submitLoading}

View File

@ -0,0 +1,7 @@
import { observable } from "mobx";
import { WeaForm } from "comsMobx";
export class ExternalPersonManageStore {
@observable form = new WeaForm();
@observable addForm = new WeaForm();
}

View File

@ -18,6 +18,7 @@ import { DeclareStore } from "./declare";
import { StandingBookStore } from "./StandingBook";
import { PayrollFilesStore } from "./payrollFiles";
import { SpecialAddStore } from "./specialAdd";
import { ExternalPersonManageStore } from "./externalPersonManage";
module.exports = {
baseFormStore: new BaseFormStore(),
@ -39,5 +40,6 @@ module.exports = {
declareStore: new DeclareStore(),
standingBookStore: new StandingBookStore(),
payrollFilesStore: new PayrollFilesStore(),
specialAddStore: new SpecialAddStore()
specialAddStore: new SpecialAddStore(),
externalPersonManageStore: new ExternalPersonManageStore()
};

View File

@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/taxAgent"; // 引入API接口文件
import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions";
import { taxAgentRangeExtDelete } from "../apis/taxAgent";
const { TableStore } = WeaTableNew;
@ -171,6 +172,21 @@ export class TaxAgentStore {
getTaxAgentRangeForm = params => {
return API.getTaxAgentRangeForm(params);
};
// 非系统人员范围保存
@action
taxAgentRangeExtSave = params => {
return API.taxAgentRangeExtSave(params);
};
// 非系统人员范围查询
@action
taxAgentRangelistExt = params => {
return API.taxAgentRangelistExt(params);
};
// 非系统人员范围删除
@action
taxAgentRangeExtDelete = params => {
return API.taxAgentRangeExtDelete(params);
};
// 人员范围保存
@action
taxAgentRangeSave = params => {

View File

@ -32,6 +32,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
tipPosition="bottom" // 错误提示的显示位置: top/bottom
className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : ""}
>
<WeaSwitch
fieldConfig={fields}