+
}
+ iconBgcolor="#F14A2D" showDropIcon={false}
+ >
+
+
this.handleAdd()}>新建
+ ] : []}
+ 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 })}
+ />
+ (
+
+ this.handleAdd(id)}
+ style={{ paddingRight: 8 }}>编辑
+ {/* this.handleDelete(id)}>删除*/}
+
+ )
+ }
+ ] : []}
+ dataSource={dataSource}
+ pagination={pagination}
+ rowSelection={rowSelection}
+ xWidth={800}
+ />
+
+
+
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.less b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less
new file mode 100644
index 00000000..8b13dd6f
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less
@@ -0,0 +1,14 @@
+.externalPerWrapper {
+ width: 100%;
+ height: 100%;
+
+ .externalPerCont {
+ height: 100%;
+ }
+}
+
+.slideOuterWrapper {
+ .hideFormItem {
+ display: none !important;
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
index d3660ebe..723b56b3 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
@@ -11,19 +11,24 @@ 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";
const APIFox = {
listInclude: getLedgerPersonRangeInclude,
- listExclude: getLedgerPersonRangeExclude
+ listExclude: getLedgerPersonRangeExclude,
+ externalList: getLedgerPersonRangeExtList
};
const APISaveFox = {
save: saveLedgerPersonRange
@@ -39,6 +44,8 @@ class LedgerAssociatedPersonnel extends Component {
selectedKey: "listInclude",
rowKeys: [],
previewDataSource: [],
+ externalPersonModalVisible: false,
+ loading: false,
importParams: {
visible: false,
step: 0,
@@ -52,6 +59,25 @@ class LedgerAssociatedPersonnel extends Component {
};
}
+ /*
+ * 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 +85,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 +142,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 +200,9 @@ class LedgerAssociatedPersonnel extends Component {
rowKeys,
personalAddModal,
importParams,
- previewDataSource
+ previewDataSource,
+ externalPersonModalVisible,
+ loading
} = this.state;
const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props;
const topTab = [
@@ -149,6 +213,10 @@ class LedgerAssociatedPersonnel extends Component {
{
title: "从范围中排除",
viewcondition: "listExclude"
+ },
+ {
+ title: "非系统人员范围",
+ viewcondition: "externalList"
}
];
const btns = showOperateBtn ? [
@@ -192,7 +260,7 @@ class LedgerAssociatedPersonnel extends Component {
datas={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 })}
/>