This commit is contained in:
@@ -6,11 +6,6 @@ import {resident_unitList} from "#/api/property/resident/unit";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'unitId',
|
||||
label: '所属单位',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'unitId',
|
||||
@@ -24,8 +19,8 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择所属单位',
|
||||
filterOption:true
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
@@ -56,23 +51,27 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '员工编号',
|
||||
field: 'userId',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '员工名称',
|
||||
field: 'userName',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
field: 'phone',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
field: 'gender',
|
||||
slots:{
|
||||
default: ({row})=>{
|
||||
return renderDict(row.gender,'wy_rzryzt')
|
||||
return renderDict(row.gender,'sys_user_sex')
|
||||
}
|
||||
}
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
field: 'img',
|
||||
@@ -83,18 +82,21 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '所属单位',
|
||||
field: 'unitName',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '入驻位置',
|
||||
field: 'locathon',
|
||||
},
|
||||
// {
|
||||
// title: '入驻位置',
|
||||
// field: 'locathon',
|
||||
// },
|
||||
{
|
||||
title: '入驻时间',
|
||||
field: 'time',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '车牌号码',
|
||||
field: 'carNumber',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@@ -103,18 +105,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
default: ({row})=>{
|
||||
return renderDict(row.state,'wy_rzryzt')
|
||||
}
|
||||
}
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
minWidth: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -168,6 +172,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules:"required"
|
||||
},
|
||||
{
|
||||
label: '车牌号码',
|
||||
@@ -181,6 +186,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_rzryzt'),
|
||||
},
|
||||
rules:'selectRequired'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
@@ -280,8 +286,8 @@ export async function getUnitList(): Promise<{ value: number; label: string }[]>
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.name,
|
||||
label: r.id,
|
||||
value: r.id,
|
||||
label: r.name,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
|
@@ -49,15 +49,14 @@ async function handleOpenChange(open: boolean) {
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="入驻人员信息" class="w-[70%]">
|
||||
<Descriptions v-if="personDetail" size="small" :column="1" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="入驻人员">
|
||||
{{ personDetail.userName+'-'+personDetail.phone}}
|
||||
<!-- {{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}-->
|
||||
{{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属单位">
|
||||
{{personDetail.unitName+'-'+personDetail.unitId }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻位置">
|
||||
{{ personDetail.locathon }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="入驻位置">-->
|
||||
<!-- {{ personDetail.locathon }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="人脸图片">
|
||||
{{ personDetail.img }}
|
||||
</DescriptionsItem>
|
||||
|
@@ -27,7 +27,7 @@ let userInfo = reactive({
|
||||
});
|
||||
let unitName = ref('');
|
||||
const userId = ref<number | string>(0);
|
||||
const unitId = ref<number | string>(0);
|
||||
const unitId = ref<string>('');
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
@@ -70,7 +70,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (isUpdate.value && id) {
|
||||
const record = await personInfo(id);
|
||||
userId.value = record.userId;
|
||||
unitId.value = record.unitId;
|
||||
unitId.value = record.unitId.toString();
|
||||
record.state=record.state?.toString()
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
@@ -9,12 +9,12 @@ const props= withDefaults(defineProps<{
|
||||
disabled?: boolean;
|
||||
placeholder?: string;
|
||||
isUpdate?:boolean;
|
||||
unitId?:number;
|
||||
unitId?:string;
|
||||
}>(), {
|
||||
disabled: false,
|
||||
placeholder: '可根据单位名称进行搜索...',
|
||||
isUpdate:false,
|
||||
unitId:0,
|
||||
unitId:'',
|
||||
});
|
||||
|
||||
async function queryUnit(value: string, callback: any) {
|
||||
@@ -46,7 +46,7 @@ const handleChange = (val: string) => {
|
||||
emit('update:unitInfo', unitInfo);
|
||||
};
|
||||
|
||||
async function getUnitInfo(val:number) {
|
||||
async function getUnitInfo(val:string) {
|
||||
const unit = await resident_unitInfo(val)
|
||||
if (unit) {
|
||||
data.value = [{
|
||||
@@ -60,7 +60,7 @@ async function getUnitInfo(val:number) {
|
||||
|
||||
watch(() => props.unitId,
|
||||
(newX) => {
|
||||
if (props.isUpdate) {
|
||||
if (props.isUpdate&&newX) {
|
||||
getUnitInfo(newX)
|
||||
}
|
||||
}, {immediate: true})
|
||||
|
Reference in New Issue
Block a user