This commit is contained in:
@@ -16,9 +16,10 @@ import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import { modalSchema } from './data';
|
||||
import { TimeRangePicker } from 'ant-design-vue';
|
||||
import { renderDictValue } from '#/utils/render';
|
||||
import { personList } from '#/api/property/resident/person';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
import dayjs from 'dayjs';
|
||||
import {userList} from "#/api/system/user";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
@@ -67,15 +68,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
getDictOptions('sys_user_sex')
|
||||
await queryPerson();
|
||||
await initLocationOptions();
|
||||
if (isUpdate.value && id) {
|
||||
const record = await meetInfo(id);
|
||||
record.expenseType = record.expenseType.toString();
|
||||
record.isCheck = record.isCheck.toString();
|
||||
let hour = record.openHours.split('-');
|
||||
if (hour.length > 1) {
|
||||
record.openHours = [dayjs(hour[0], 'HH:mm'), dayjs(hour[1], 'HH:mm')];
|
||||
if (record.openStartHours&&record.openEndHours) {
|
||||
record.openHours = [dayjs(record.openStartHours, 'HH:mm'), dayjs(record.openEndHours, 'HH:mm')];
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
@@ -95,10 +96,8 @@ async function handleConfirm() {
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.openHours) {
|
||||
data.openHours =
|
||||
data.openHours[0]?.format('HH:mm') +
|
||||
'-' +
|
||||
data.openHours[1]?.format('HH:mm');
|
||||
data.openStartHours=data.openHours[0]?.format('HH:mm');
|
||||
data.openEndHours=data.openHours[1]?.format('HH:mm');
|
||||
}
|
||||
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
||||
resetInitialized();
|
||||
@@ -117,19 +116,18 @@ async function handleClosed() {
|
||||
}
|
||||
|
||||
async function queryPerson() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
const res = await userList({
|
||||
pageNum: 1,
|
||||
};
|
||||
const res = await personList(params);
|
||||
pageSize: 1000,
|
||||
});
|
||||
const options = res.rows.map((user) => ({
|
||||
label:
|
||||
user.userName +
|
||||
user.nickName +
|
||||
'-' +
|
||||
renderDictValue(user.gender, 'sys_user_sex') +
|
||||
renderDictValue(user.sex, 'sys_user_sex') +
|
||||
'-' +
|
||||
user.phone,
|
||||
value: user.id,
|
||||
user.phonenumber,
|
||||
value: user.userId,
|
||||
}));
|
||||
formApi.updateSchema([
|
||||
{
|
||||
@@ -143,6 +141,7 @@ async function queryPerson() {
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
Reference in New Issue
Block a user