客户服务
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
FLL
2025-07-23 20:50:49 +08:00
parent 447ad7f004
commit 9d75dd2168
10 changed files with 266 additions and 88 deletions

View File

@@ -10,6 +10,8 @@ import { noticesAdd, noticesInfo, noticesUpdate } from '#/api/property/customerS
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
import {personList} from "#/api/property/resident/person";
import {renderDictValue} from "#/utils/render";
const emit = defineEmits<{ reload: [] }>();
@@ -21,7 +23,7 @@ const title = computed(() => {
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
formItemClass: 'col-span-1',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
@@ -43,7 +45,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
class: 'w-[60%]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
@@ -53,12 +55,15 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
await queryPersonData()
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await noticesInfo(id);
if(record.isAll === '0'){
record.noticePersion = null
}
await formApi.setValues(record);
}
await markInitialized();
@@ -76,6 +81,7 @@ async function handleConfirm() {
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
data.noticePersion = data.noticePersion?.join(',')
await (isUpdate.value ? noticesUpdate(data) : noticesAdd(data));
resetInitialized();
emit('reload');
@@ -91,6 +97,32 @@ async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
async function queryPersonData() {
let params = {
pageSize: 1000,
pageNum: 1,
}
const res = await personList(params);
const options = res.rows.map((user) => ({
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex')
+ '-' + user.phone + '-' + user.unitName,
value: user.id,
}));
formApi.updateSchema([{
componentProps: () => ({
options: options,
showSearch: true,
filterOption: filterOption,
mode: 'multiple',
}),
fieldName: 'noticePersion',
}])
}
const filterOption = (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
</script>
<template>