1release/2.16.1.2410.01

This commit is contained in:
lys 2024-11-01 14:50:37 +08:00
parent 8488f54aac
commit 1f7fe615be
8 changed files with 118 additions and 165 deletions

View File

@ -57,6 +57,10 @@ export const deleteLedgerPersonExtRange = params => {
export const saveLedgerPersonRange = params => {
return postFetch("/api/bs/hrmsalary/salarysob/range/save", params);
};
//编辑薪资帐套人员范围
export const editLedgerPersonRange = params => {
return postFetch("/api/bs/hrmsalary/salarysob/range/edit", params);
};
//删除薪资帐套人员范围
export const deleteLedgerPersonRange = params => {

View File

@ -48,6 +48,10 @@ export const deleteTaxAgent = (params) => {
export const taxAgentRangeSave = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
};
//编辑人员范围
export const taxAgentRangeEdit = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/edit", params);
};
//非系统人员范围查询
export const taxAgentRangelistExt = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params);

View File

@ -39,47 +39,33 @@ class PersonalScopeModal extends Component {
}
componentDidMount() {
const { isTaxgent = true } = this.props;
if (isTaxgent) {
this.getTaxAgentRangeForm();
} else {
this.commonEnumList();
// const employeeStatus = [
// { key: "TRIAL", showname: "试用" },
// { key: "FORMAL", showname: "正式" },
// { key: "TEMPORARY", showname: "临时" },
// { key: "DELAY", showname: "试用延期" },
// { key: "FIRE", showname: "解雇" },
// { key: "DEPARTURE", showname: "离职" },
// { key: "RETIRED", showname: "退休" }
// ];
// const targetTypeList = [
// {
// key: "EMPLOYEE",
// showname: "人员",
// selected: false
// },
// {
// key: "SUBCOMPANY",
// showname: "分部",
// selected: false
// },
// {
// key: "DEPT",
// showname: "部门",
// selected: false
// },
// {
// key: "POSITION",
// showname: "岗位",
// selected: false
// }
// ];
// this.setState({ targetTypeList, employeeStatus });
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { isTaxgent = true } = nextProps;
if (isTaxgent) {
this.getTaxAgentRangeForm();
} else {
this.commonEnumList(nextProps);
}
if (!_.isEmpty(nextProps.record)) {
this.setState({
targetType: nextProps.record.targetTypeName,
targetTypeIds: nextProps.record.target,
targetTypeIdsNames: nextProps.record.targetName,
status: nextProps.record.status,
statusAll: ""
});
} else {
this.handleReset();
}
}
}
commonEnumList = () => {
commonEnumList = (props) => {
const { record } = props;
commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => {
if (status) {
const targetTypeList = [
@ -112,6 +98,11 @@ class PersonalScopeModal extends Component {
this.setState({
targetTypeList,
employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel }))
}, () => {
if (!_.isEmpty(record)) {
const bool = _.every(_.map(this.state.employeeStatus, it => it.key), item => record.status.split(",").includes(item));
this.setState({ statusAll: bool ? "0" : "" });
}
});
}
});
@ -129,7 +120,7 @@ class PersonalScopeModal extends Component {
};
handleSubmit = () => {
const { status, targetTypeIds, targetType } = this.state;
const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox } = this.props;
const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox, record } = this.props;
if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) {
Modal.warning({
title: "信息确认",
@ -139,14 +130,14 @@ class PersonalScopeModal extends Component {
}
const payload = {
employeeStatus: status.split(","),
includeType,
includeType, id: record.id,
targetParams: targetType !== "SQL" ?
_.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) :
[{ targetType, targetId: "0", target: targetTypeIds }],
[saveKeyVal["key"]]: saveKeyVal["value"]
};
this.setState({ loading: true });
APISaveFox["save"](payload).then(({ status, errormsg }) => {
APISaveFox[_.isEmpty(record) ? "save" : "edit"](payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("保存成功");

View File

@ -59,7 +59,10 @@ class PersonalScopeTable extends Component {
columns: _.map(columns, item => {
return {
...item,
render: (text) => {
render: (text, record) => {
if (record.targetTypeName === "SQL" && item.dataIndex === "targetName") {
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
}
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};

View File

@ -13,6 +13,7 @@ import PersonalScopeModal from "../../../components/PersonalScopeModal";
import {
deleteLedgerPersonExtRange,
deleteLedgerPersonRange,
editLedgerPersonRange,
getLedgerPersonRangeExclude,
getLedgerPersonRangeExtList,
getLedgerPersonRangeInclude,
@ -32,7 +33,8 @@ const APIFox = {
externalList: getLedgerPersonRangeExtList
};
const APISaveFox = {
save: saveLedgerPersonRange
save: saveLedgerPersonRange,
edit: editLedgerPersonRange
};
@inject("taxAgentStore")
@ -55,7 +57,8 @@ class LedgerAssociatedPersonnel extends Component {
personalAddModal: {
visible: false,
title: "关联人员",
includeType: ""
includeType: "",
record: {}
},
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
};
@ -157,7 +160,7 @@ class LedgerAssociatedPersonnel extends Component {
* Params:
* Date: 2022/11/30
*/
handleAddPersonal = () => {
handleAddPersonal = (record = {}) => {
const { personalAddModal, selectedKey } = this.state;
if (selectedKey === "externalList") {
this.setState({ externalPersonModalVisible: true });
@ -165,7 +168,7 @@ class LedgerAssociatedPersonnel extends Component {
this.setState({
personalAddModal: {
...personalAddModal,
visible: true,
visible: true, record,
includeType: selectedKey === "listInclude" ? 1 : 0
}
});
@ -256,7 +259,7 @@ class LedgerAssociatedPersonnel extends Component {
disabled={_.isEmpty(rowKeys)}
onClick={this.taxAgentRangeDelete}
/>,
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>,
<WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
@ -287,6 +290,7 @@ class LedgerAssociatedPersonnel extends Component {
tabActive={selectedKey}
searchValue={searchValue}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/>
{/*关联人员范围导入*/}
{importParams.visible && (

View File

@ -25,6 +25,24 @@ export default class AddTaxAgentModal extends React.Component {
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
if (!_.isEmpty(nextProps.scopeRecord)) {
const { employeeStatus } = nextProps;
const checked = _.map(employeeStatus, it => it.id);
const bool = _.every(checked, it => nextProps.scopeRecord.status.indexOf(it) !== -1);
this.setState({
selectedKey: nextProps.scopeRecord.targetType,
checkboxValue: nextProps.scopeRecord.status,
checkAll: bool ? "1" : "0",
ids: nextProps.scopeRecord.target
});
} else {
this.handleReset();
}
}
}
onCheckboxChange = (checkboxValue) => {
const { employeeStatus } = this.props;
const checked = _.map(employeeStatus, it => it.id);
@ -45,7 +63,7 @@ export default class AddTaxAgentModal extends React.Component {
// 保存
handleSave = () => {
const { onTaxAgentSave } = this.props;
const { onTaxAgentSave, scopeRecord } = this.props;
const { checkboxValue, ids, selectedKey } = this.state;
const payload = {
employeeStatus: checkboxValue.split(","),
@ -67,13 +85,13 @@ export default class AddTaxAgentModal extends React.Component {
this.refs.weaError1.showError();
return;
}
onTaxAgentSave && onTaxAgentSave(payload);
onTaxAgentSave && onTaxAgentSave({ ...payload, id: scopeRecord.id });
};
// 重置
handleReset = () => {
this.setState({
selectedKey: "EMPLOYEE",
selectedKey: !_.isEmpty(this.props.scopeRecord) ? "SQL" : "EMPLOYEE",
checkboxValue: "",
checkAll: "0",
ids: ""
@ -81,7 +99,7 @@ export default class AddTaxAgentModal extends React.Component {
};
render() {
const { employeeStatus, targetTypeList, visible, onCancel, loading } = this.props;
const { employeeStatus, targetTypeList, visible, onCancel, loading, scopeRecord } = this.props;
return (
<WeaDialog
visible={visible}
@ -107,7 +125,7 @@ export default class AddTaxAgentModal extends React.Component {
<Col span={16}>
<div style={{ display: "inline-block", marginRight: 12 }}>
<WeaSelect
style={{ height: "30px" }}
style={{ height: "30px" }} disabled={!_.isEmpty(scopeRecord)}
options={_.map(targetTypeList, (it) => ({
...it,
key: it.id,

View File

@ -8,6 +8,7 @@ import React, { Component } from "react";
import { message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import SlideTaxagentUser from "./slideTaxagentUser";
import { taxAgentRangeEdit } from "../../apis/taxAgent";
import "./index.less";
const personScopeWarrper = {};
@ -199,7 +200,7 @@ export default class PersonalScope extends Component {
taxAgentRangeSave = (module) => {
const { taxAgentId } = this.props;
const { pageObj } = this.state;
const { includeType } = module;
const { includeType, id } = module;
const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore;
this.setState({ submitLoading: true });
if (includeType === "2") {
@ -214,26 +215,25 @@ export default class PersonalScope extends Component {
}
});
} else {
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 || "新增失败");
}
const API= id ? taxAgentRangeEdit : taxAgentRangeSave;
API({ ...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);
}
);
});
}
};
@ -285,7 +285,7 @@ export default class PersonalScope extends Component {
onTaxAngetSearch={({ targetName, targetWorkcode, tab }) => {
tab == "1"
? this.getTaxAgentRangeListInclude({ targetName, targetWorkcode })
: tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }):
: tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }) :
this.taxAgentRangelistExt({ targetName, targetWorkcode });
}}
onChangeTab={(tab) => {

View File

@ -15,6 +15,7 @@ export default class SlideTaxagentUser extends React.Component {
showSearchAd: false,
externalPersonModalVisible: false, //外部人员关联弹框
addTaxagentModalVisible: false,
scopeRecord: {},
includeType: "1",
selectedRowKeys: [],
searchValue: "",
@ -131,7 +132,8 @@ export default class SlideTaxagentUser extends React.Component {
externalPersonModalVisible,
importParams,
previewDataSource,
showSearchAd, extEmpsWitch
showSearchAd, extEmpsWitch,
scopeRecord
} = this.state;
const {
submitLoading,
@ -224,106 +226,33 @@ export default class SlideTaxagentUser extends React.Component {
onSearchChange={searchValue => this.setState({ searchValue })}
onChange={v => this.setState({ includeType: v }, () => onChangeTab && onChangeTab(this.state.includeType))}
/>
{/*<div*/}
{/* style={{*/}
{/* height: "47px",*/}
{/* lineHeight: "47px",*/}
{/* paddingLeft: "10px",*/}
{/* paddingRight: "10px",*/}
{/* display: "flex",*/}
{/* justifyContent: "space-between"*/}
{/* }}>*/}
{/* <div*/}
{/* style={{*/}
{/* display: "inlineBlock",*/}
{/* color: "#666"*/}
{/* }}>*/}
{/* <span*/}
{/* style={{*/}
{/* cursor: "pointer",*/}
{/* color: includeType == 1 ? "#4ba9f2" : "#000"*/}
{/* }}*/}
{/* onClick={() => {*/}
{/* this.handleTabClick(1);*/}
{/* }}>*/}
{/* 人员范围*/}
{/* </span>|<span*/}
{/* style={{*/}
{/* cursor: "pointer",*/}
{/* color: includeType == 0 ? "#4ba9f2" : "#000"*/}
{/* }}*/}
{/* onClick={() => {*/}
{/* this.handleTabClick(0);*/}
{/* }}>*/}
{/* 从范围中排除*/}
{/* </span>*/}
{/* </div>*/}
{/* <div>*/}
{/* <div*/}
{/* style={{*/}
{/* color: "#4ba9f2",*/}
{/* display: "inlineBlock",*/}
{/* float: "left"*/}
{/* }}>*/}
{/* {*/}
{/* (hideIconInTax || showSalaryItemBtn) && <div className="operateBtn">*/}
{/* {*/}
{/* includeType == "1" &&*/}
{/* <Button*/}
{/* type="primary"*/}
{/* size="small"*/}
{/* onClick={() => {*/}
{/* this.setState({ importParams: { ...importParams, visible: true, step: 0 } });*/}
{/* }}*/}
{/* ><span className="icon-coms-leading-in" title="导入"></span></Button>*/}
{/* }*/}
{/* <div className="addOrDelBtn">*/}
{/* <Button type="primary"*/}
{/* size="small"*/}
{/* onClick={() => {*/}
{/* this.handleTabDelete();*/}
{/* }}*/}
{/* ><span className="icon-coms-form-delete-hot" title="删除"></span></Button>*/}
{/* <Button type="primary"*/}
{/* size="small"*/}
{/* style={{ marginRight: 10 }}*/}
{/* onClick={() => this.setState({ addTaxagentModalVisible: true })}*/}
{/* ><span className="icon-coms-Add-to-hot" title="添加"></span></Button>*/}
{/* </div>*/}
{/* </div>*/}
{/* }*/}
{/* </div>*/}
{/* <WeaInputSearch*/}
{/* style={{ marginTop: "8px", float: "right" }}*/}
{/* value={searchValue}*/}
{/* onChange={value => {*/}
{/* this.setState({ searchValue: value });*/}
{/* }}*/}
{/* onSearch={value => {*/}
{/* this.handleSearch(value);*/}
{/* }}*/}
{/* />*/}
{/* </div>*/}
{/*</div>*/}
<div style={{ maxHeight: "500px", scrollY: "scroll" }}>
<WeaTable
rowKey="id"
loading={queryLoading}
rowSelection={rowSelection}
dataSource={dataSource}
columns={taxAgentColumns}
pagination={pagination}
/>
<WeaTable rowKey="id" loading={queryLoading} rowSelection={rowSelection} dataSource={dataSource}
pagination={pagination}
columns={_.map(taxAgentColumns, o => {
return {
...o, render: (text, record) => {
if (record.targetType === "SQL" && o.dataIndex === "targetName") {
return <a href="javascript:void(0);" onClick={() => {
const key = includeType === "2" ? "externalPersonModalVisible" : "addTaxagentModalVisible";
this.setState({ [key]: true, scopeRecord: record });
}}>{text}</a>;
}
return <span>{text}</span>;
}
};
})}/>
</div>
<ExternalPersonModal
visible={externalPersonModalVisible}
loading={submitLoading}
onCancel={() => this.setState({ externalPersonModalVisible: false })}
onCancel={() => this.setState({ externalPersonModalVisible: false, scopeRecord: {} })}
onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })}
/>
<AddTaxAgentModal
ref={(ref) => this.addTaxRef = ref}
scopeRecord={scopeRecord}
loading={submitLoading}
employeeStatus={employeeStatus}
targetTypeList={targetTypeList}
@ -332,7 +261,7 @@ export default class SlideTaxagentUser extends React.Component {
onTaxAgentSave({ ...val, includeType: includeType })}
visible={addTaxagentModalVisible}
onCancel={() => {
this.setState({ addTaxagentModalVisible: false });
this.setState({ addTaxagentModalVisible: false, scopeRecord: {} });
}}
/>
{importParams.visible && (