|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <a-dropdown v-model:visible="visible" :trigger="['click']">
|
|
|
+ <a-dropdown v-model:open="visible" :trigger="['click']">
|
|
|
<a-button v-if="!isShowClear" style="margin-left: 12px">
|
|
|
<align-center-outlined />
|
|
|
高级筛选
|
|
|
@@ -23,13 +23,19 @@
|
|
|
>
|
|
|
<a-select
|
|
|
v-model:value="formState.startUserId"
|
|
|
- show-search
|
|
|
placeholder="请选择审批人"
|
|
|
style="width: 418px"
|
|
|
- :options="copyUserIds"
|
|
|
+ :filter-option="false"
|
|
|
:field-names="{ label: 'text', value: 'id' }"
|
|
|
- :filter-option="filterOption"
|
|
|
- />
|
|
|
+ :not-found-content="fetching ? undefined : null"
|
|
|
+ :options="copyUserIds"
|
|
|
+ show-search
|
|
|
+ @search="fetchUser"
|
|
|
+ >
|
|
|
+ <template v-if="fetching" #notFoundContent>
|
|
|
+ <a-spin size="small" />
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="提交审批时间:">
|
|
|
<a-date-picker
|
|
|
@@ -115,6 +121,7 @@ const props = defineProps({
|
|
|
});
|
|
|
const formState = ref({});
|
|
|
const visible = ref(false);
|
|
|
+const fetching = ref(false);
|
|
|
const searchParams = ref({});
|
|
|
const isShowClear = ref(false);
|
|
|
const copyUserIds = ref([]);
|
|
|
@@ -149,10 +156,17 @@ onMounted(() => {
|
|
|
getUsers();
|
|
|
});
|
|
|
|
|
|
+const fetchUser = Common.debounce(value => {
|
|
|
+ copyUserIds.value = [];
|
|
|
+ fetching.value = true;
|
|
|
+ getUsers(value);
|
|
|
+}, 500);
|
|
|
+
|
|
|
+
|
|
|
// 筛选
|
|
|
-const filterOption = (input, option) => {
|
|
|
- return option.text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
-};
|
|
|
+// const filterOption = (input, option) => {
|
|
|
+// return option.text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
+// };
|
|
|
|
|
|
// 清空搜索条件
|
|
|
const clearFilter = () => {
|
|
|
@@ -181,19 +195,19 @@ const validValue = obj => {
|
|
|
};
|
|
|
|
|
|
// 查询审批人
|
|
|
-const getUsers = () => {
|
|
|
+const getUsers = value => {
|
|
|
const params = {
|
|
|
range: {
|
|
|
start: 0,
|
|
|
- length: 99999,
|
|
|
+ length: 1000,
|
|
|
},
|
|
|
- conditional: '',
|
|
|
+ conditional: value,
|
|
|
};
|
|
|
UserResource.listInGroupCompanyByCondition(params).then(
|
|
|
successData => {
|
|
|
if (successData != null && successData.resultList != null) {
|
|
|
successData.resultList.forEach(function (user) {
|
|
|
- user.text = user.name + '(';
|
|
|
+ user.text = user.name + '(' + user.no + ')' + '(';
|
|
|
if (user.organizations != null && user.organizations.length > 0) {
|
|
|
let isFirst = true;
|
|
|
user.organizations.forEach(item => {
|
|
|
@@ -211,8 +225,10 @@ const getUsers = () => {
|
|
|
} else {
|
|
|
copyUserIds.value = [];
|
|
|
}
|
|
|
+ fetching.value = false;
|
|
|
},
|
|
|
errorData => {
|
|
|
+ fetching.value = false;
|
|
|
Common.processException(errorData);
|
|
|
},
|
|
|
);
|