Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m15s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m15s
This commit is contained in:
commit
f620debe43
@ -10,8 +10,7 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass
|
|||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
import { packageSelectList } from "#/api/system/tenant-package";
|
import { assetTypeselect } from "#/api/property/assetManage/assetType";
|
||||||
import { assetTypeselect } from "#/api/property/assetType";
|
|
||||||
import { depotList } from "#/api/property/assetManage/depot";
|
import { depotList } from "#/api/property/assetManage/depot";
|
||||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import type {FormSchemaGetter} from '#/adapter/form';
|
import type {FormSchemaGetter} from '#/adapter/form';
|
||||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
import { renderDict } from "#/utils/render";
|
import {assetTypeList} from "#/api/property/assetManage/assetType";
|
||||||
import { DictEnum } from '@vben/constants';
|
import type {AssetTypeVO} from "#/api/property/assetManage/assetType/model";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
@ -16,6 +15,13 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
component: 'Select',
|
component: 'Select',
|
||||||
fieldName: 'model',
|
fieldName: 'model',
|
||||||
label: '资产类型',
|
label: '资产类型',
|
||||||
|
componentProps: {
|
||||||
|
showSearch:true,
|
||||||
|
placeholder:'根据类型名称搜索...',
|
||||||
|
onSearch:handleSearch,
|
||||||
|
onChange:handleChange,
|
||||||
|
options:typeData
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
@ -28,8 +34,6 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{type: 'checkbox', width: 60},
|
{type: 'checkbox', width: 60},
|
||||||
{
|
{
|
||||||
@ -47,7 +51,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '资产类型',
|
title: '资产类型',
|
||||||
field: 'modelName',
|
field: 'model',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '规格',
|
title: '规格',
|
||||||
@ -66,16 +70,16 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'unit',
|
field: 'unit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '仓库',
|
title: '仓库id',
|
||||||
field: 'depotName',
|
field: 'depotId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '描述信息',
|
title: '描述信息',
|
||||||
field: 'msg',
|
field: 'msg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供应商',
|
title: '供应商id',
|
||||||
field: 'suppliersName',
|
field: 'suppliersId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '入库时间',
|
title: '入库时间',
|
||||||
@ -84,11 +88,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '固定资产',
|
title: '固定资产',
|
||||||
field: 'type',
|
field: 'type',
|
||||||
slots: {
|
|
||||||
default: ({ row }) => {
|
|
||||||
return renderDict(row.type, DictEnum.WY_SF);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
@ -121,7 +120,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '类型',
|
label: '类型',
|
||||||
fieldName: 'model',
|
fieldName: 'model',
|
||||||
component: 'Select',
|
component: 'Textarea',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '规格',
|
label: '规格',
|
||||||
@ -144,9 +143,9 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '仓库',
|
label: '仓库id',
|
||||||
fieldName: 'depotId',
|
fieldName: 'depotId',
|
||||||
component: 'Select',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述信息',
|
label: '描述信息',
|
||||||
@ -156,7 +155,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '供应商id',
|
label: '供应商id',
|
||||||
fieldName: 'suppliersId',
|
fieldName: 'suppliersId',
|
||||||
component: 'Select',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '入库时间',
|
label: '入库时间',
|
||||||
@ -172,8 +171,34 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
label: '固定资产类型',
|
label: '固定资产类型',
|
||||||
fieldName: 'type',
|
fieldName: 'type',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {},
|
||||||
options: getDictOptions('wy_sf'),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
let typeData:AssetTypeVO[]=[]
|
||||||
|
const handleSearch = (val: string) => {
|
||||||
|
queryAssetsType(val, (d: any[]) => (typeData = d));
|
||||||
|
};
|
||||||
|
const handleChange = (val: string) => {
|
||||||
|
queryAssetsType(val, (d: any[]) => (typeData = d));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function queryAssetsType(value: string, callback: any) {
|
||||||
|
let queryParam={
|
||||||
|
pageNum:100,
|
||||||
|
pageSize:1,
|
||||||
|
assetTypeName:value
|
||||||
|
}
|
||||||
|
assetTypeList(queryParam).then(res=>{
|
||||||
|
const data: any[] = [];
|
||||||
|
res.rows.forEach((r: any) => {
|
||||||
|
data.push({
|
||||||
|
value: r.assetTypeName,
|
||||||
|
label: r.id,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
callback(data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ function handleDownloadExcel() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page :auto-content-height="true">
|
<Page :auto-content-height="true">
|
||||||
|
|
||||||
<BasicTable table-title="资产列表">
|
<BasicTable table-title="资产列表">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
|
@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
|
|||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetType';
|
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetManage/assetType';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
@ -8,20 +8,17 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'assetTypeName',
|
fieldName: 'assetTypeName',
|
||||||
label: '分类名称',
|
label: '分类名称',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'sort',
|
|
||||||
label: '排序',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '主键',
|
title: '序号',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({rowIndex}) => {
|
||||||
|
return (rowIndex+1).toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '分类名称',
|
title: '分类名称',
|
||||||
@ -35,10 +32,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '创建人',
|
|
||||||
field: 'createBy',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
@ -62,10 +55,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
label: '分类名称',
|
label: '分类名称',
|
||||||
fieldName: 'assetTypeName',
|
fieldName: 'assetTypeName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
rules:'required'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '排序',
|
label: '排序',
|
||||||
fieldName: 'sort',
|
fieldName: 'sort',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
},
|
},
|
||||||
];
|
];
|
@ -1,13 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
@ -19,8 +14,8 @@ import {
|
|||||||
assetTypeExport,
|
assetTypeExport,
|
||||||
assetTypeList,
|
assetTypeList,
|
||||||
assetTypeRemove,
|
assetTypeRemove,
|
||||||
} from '#/api/property/assetType';
|
} from '#/api/property/assetManage/assetType';
|
||||||
import type { AssetTypeForm } from '#/api/property/assetType/model';
|
import type { AssetTypeForm } from '#/api/property/assetManage/assetType/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import assetTypeModal from './assetType-modal.vue';
|
import assetTypeModal from './assetType-modal.vue';
|
||||||
@ -35,15 +30,6 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
@ -55,8 +41,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
@ -1,6 +1,7 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@ -49,6 +50,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '性别',
|
title: '性别',
|
||||||
field: 'gender',
|
field: 'gender',
|
||||||
|
slots:{
|
||||||
|
default: ({row})=>{
|
||||||
|
return renderDict(row.gender,'sys_user_sex')
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'img',
|
field: 'img',
|
||||||
@ -75,7 +81,9 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
// slots: { default: 'state' },
|
slots:{
|
||||||
|
default: 'state'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
personExport,
|
personExport,
|
||||||
personList,
|
personList,
|
||||||
personRemove,
|
personRemove, personUpdate,
|
||||||
} from '#/api/property/resident/person';
|
} from '#/api/property/resident/person';
|
||||||
import type { PersonForm } from '#/api/property/resident/person/model';
|
import type { PersonForm } from '#/api/property/resident/person/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
@ -22,7 +22,8 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
|||||||
import personModal from './person-modal.vue';
|
import personModal from './person-modal.vue';
|
||||||
import personDetail from './person-detail.vue';
|
import personDetail from './person-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
// import {TableSwitch} from "#/components/table";
|
import {useAccess} from "@vben/access";
|
||||||
|
import {TableSwitch} from "#/components/table";
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@ -44,8 +45,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@ -80,6 +79,7 @@ const [PersonDetail, personDetailApi] = useVbenModal({
|
|||||||
connectedComponent: personDetail,
|
connectedComponent: personDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { hasAccessByCodes } = useAccess();
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({});
|
modalApi.setData({});
|
||||||
@ -120,7 +120,6 @@ function handleInfo(row: Required<PersonForm>) {
|
|||||||
personDetailApi.setData({ id: row.id });
|
personDetailApi.setData({ id: row.id });
|
||||||
personDetailApi.open();
|
personDetailApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -154,16 +153,16 @@ function handleInfo(row: Required<PersonForm>) {
|
|||||||
<template #img="{ row }">
|
<template #img="{ row }">
|
||||||
<Avatar :src="row.img" />
|
<Avatar :src="row.img" />
|
||||||
</template>
|
</template>
|
||||||
<!-- <template #state="{ row }">-->
|
<template #state="{ row }">
|
||||||
<!-- <TableSwitch-->
|
<TableSwitch
|
||||||
<!-- v-model:value="row.status"-->
|
:checkedValue="1"
|
||||||
<!-- :api="() => personStatusChange(row)"-->
|
:unCheckedValue="0"
|
||||||
<!-- :disabled="-->
|
v-model:value="row.state"
|
||||||
<!-- row.userId === 1 || !hasAccessByCodes(['system:user:edit'])-->
|
:api="() => personUpdate(row)"
|
||||||
<!-- "-->
|
:disabled="!hasAccessByCodes(['property:person:edit'])"
|
||||||
<!-- @reload="() => tableApi.query()"-->
|
@reload="() => tableApi.query()"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- </template>-->
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
<ghost-button
|
<ghost-button
|
||||||
|
@ -8,11 +8,10 @@ import dayjs from 'dayjs';
|
|||||||
import duration from 'dayjs/plugin/duration';
|
import duration from 'dayjs/plugin/duration';
|
||||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
|
|
||||||
// import {personInfo} from '#/api/property/resident/person';
|
import {personInfo} from '#/api/property/resident/person';
|
||||||
import type {Person} from "#/api/property/resident/person/model";
|
import type {Person} from "#/api/property/resident/person/model";
|
||||||
import {accessControlColumns,carColumns} from "#/views/property/resident/person/data";
|
import {accessControlColumns,carColumns} from "#/views/property/resident/person/data";
|
||||||
// import {personList} from "#/api/property/resident/person";
|
import { renderDictValue} from "#/utils/render";
|
||||||
// import {renderDict} from "#/utils/render";
|
|
||||||
|
|
||||||
|
|
||||||
dayjs.extend(duration);
|
dayjs.extend(duration);
|
||||||
@ -36,11 +35,9 @@ async function handleOpenChange(open: boolean) {
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
// const {id} = modalApi.getData() as { id: number | string };
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
// const response = await personInfo(id);
|
|
||||||
const response = {id:1};
|
|
||||||
// 赋值
|
// 赋值
|
||||||
personDetail.value = response;
|
personDetail.value = await personInfo(id);
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
@ -52,25 +49,25 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<BasicModal :footer="false" :fullscreen-button="false" title="入驻人员信息" class="w-[70%]">
|
<BasicModal :footer="false" :fullscreen-button="false" title="入驻人员信息" class="w-[70%]">
|
||||||
<Descriptions v-if="personDetail" size="small" :column="1" bordered :labelStyle="{width:'100px'}">
|
<Descriptions v-if="personDetail" size="small" :column="1" bordered :labelStyle="{width:'100px'}">
|
||||||
<DescriptionsItem label="入驻人员">
|
<DescriptionsItem label="入驻人员">
|
||||||
{{ '入驻人员' }}
|
{{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="所属单位">
|
<DescriptionsItem label="所属单位">
|
||||||
{{ '单位名称' }}
|
{{personDetail.unitName+'-'+personDetail.unitId }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="入驻位置">
|
<DescriptionsItem label="入驻位置">
|
||||||
{{ '单位名称' }}
|
{{ personDetail.locathon }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="人脸图片">
|
<DescriptionsItem label="人脸图片">
|
||||||
{{ '单位名称' }}
|
{{ personDetail.img }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="入驻时间">
|
<DescriptionsItem label="入驻时间">
|
||||||
{{ '单位名称' }}
|
{{ personDetail.time}}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="车牌号码">
|
<DescriptionsItem label="车牌号码">
|
||||||
{{ '单位名称' }}
|
{{personDetail.carNumber}}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="备注">
|
<DescriptionsItem label="备注">
|
||||||
{{ '单位名称' }}
|
{{ personDetail.remark }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
@ -85,7 +82,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane key="2" tab="车辆记录">
|
<TabPane key="2" tab="车辆记录" v-if="personDetail?.carNumber">
|
||||||
<Table :dataSource="[]" :columns="carColumns" :pagination="false" >
|
<Table :dataSource="[]" :columns="carColumns" :pagination="false" >
|
||||||
<template #bodyCell="{ column, index }">
|
<template #bodyCell="{ column, index }">
|
||||||
<template v-if="column.field === 'id'">
|
<template v-if="column.field === 'id'">
|
||||||
|
@ -27,6 +27,7 @@ let userInfo = reactive({
|
|||||||
});
|
});
|
||||||
let unitName = ref('');
|
let unitName = ref('');
|
||||||
const userId = ref<number | string>(0);
|
const userId = ref<number | string>(0);
|
||||||
|
const unitId = ref<number | string>(0);
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
@ -69,7 +70,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await personInfo(id);
|
const record = await personInfo(id);
|
||||||
userId.value = record.userId;
|
userId.value = record.userId;
|
||||||
console.log(userId.value,'====================1111')
|
unitId.value = record.unitId;
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@ -87,10 +88,12 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
let data = cloneDeep(await formApi.getValues());
|
let data = cloneDeep(await formApi.getValues());
|
||||||
if (!isUpdate.value) {
|
if (userInfo) {
|
||||||
data.userName = userInfo.userName
|
data.userName = userInfo.userName
|
||||||
data.phone = userInfo.phone
|
data.phone = userInfo.phone
|
||||||
data.gender = userInfo.gender
|
data.gender = userInfo.gender
|
||||||
|
}
|
||||||
|
if(unitName.value){
|
||||||
data.unitName = unitName.value
|
data.unitName = unitName.value
|
||||||
}
|
}
|
||||||
await (isUpdate.value ? personUpdate(data) : personAdd(data));
|
await (isUpdate.value ? personUpdate(data) : personAdd(data));
|
||||||
@ -125,7 +128,7 @@ function getUnitInfo(unit: { name: string }) {
|
|||||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
|
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
|
||||||
</template>
|
</template>
|
||||||
<template #unitId="slotProps">
|
<template #unitId="slotProps">
|
||||||
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :disabled="isUpdate"/>
|
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :isUpdate="isUpdate" :unitId="unitId"/>
|
||||||
</template>
|
</template>
|
||||||
</BasicForm>
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref} from 'vue';
|
import {ref, watch} from 'vue';
|
||||||
import {Select} from 'ant-design-vue';
|
import {Select} from 'ant-design-vue';
|
||||||
import {resident_unitList} from "#/api/property/resident/unit";
|
import {resident_unitList,resident_unitInfo} from "#/api/property/resident/unit";
|
||||||
|
|
||||||
defineOptions({name: 'QueryUnitList'});
|
defineOptions({name: 'QueryUnitList'});
|
||||||
|
|
||||||
withDefaults(defineProps<{ disabled?: boolean; placeholder?: string }>(), {
|
const props= withDefaults(defineProps<{
|
||||||
|
disabled?: boolean;
|
||||||
|
placeholder?: string;
|
||||||
|
isUpdate?:boolean;
|
||||||
|
unitId?:string;
|
||||||
|
}>(), {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
placeholder: '可根据单位名称进行搜索...',
|
placeholder: '可根据单位名称进行搜索...',
|
||||||
|
isUpdate:false,
|
||||||
|
unitId:'',
|
||||||
});
|
});
|
||||||
|
|
||||||
async function queryUnit(value: string, callback: any) {
|
async function queryUnit(value: string, callback: any) {
|
||||||
@ -15,11 +22,14 @@ async function queryUnit(value: string, callback: any) {
|
|||||||
name: value,
|
name: value,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
state:1,
|
||||||
}
|
}
|
||||||
const res = await resident_unitList(queryData);
|
const res = await resident_unitList(queryData);
|
||||||
const options = res.rows.map((unit) => ({
|
const options = res.rows.map((unit) => ({
|
||||||
label: unit.name+'-'+unit.id,
|
label: unit.name+'-'+unit.id,
|
||||||
value: unit.id,
|
value: unit.id,
|
||||||
|
name:unit.name,
|
||||||
|
unitNumber:unit.unitNumber,
|
||||||
}));
|
}));
|
||||||
callback(options);
|
callback(options);
|
||||||
}
|
}
|
||||||
@ -32,19 +42,33 @@ const handleSearch = (val: string) => {
|
|||||||
const emit = defineEmits(['update:unitInfo']);
|
const emit = defineEmits(['update:unitInfo']);
|
||||||
const handleChange = (val: string) => {
|
const handleChange = (val: string) => {
|
||||||
value.value = val;
|
value.value = val;
|
||||||
const unitInfoStr = data.value.find(option => option.value === val)?.label;
|
const unitInfo = data.value.find(option => option.value === val);
|
||||||
let arr = unitInfoStr.split('-')
|
|
||||||
let unitInfo = {
|
|
||||||
name: arr[0],
|
|
||||||
unitNumber: arr[1],
|
|
||||||
}
|
|
||||||
emit('update:unitInfo', unitInfo);
|
emit('update:unitInfo', unitInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function getUnitInfo(val) {
|
||||||
|
const unit = await resident_unitInfo(val)
|
||||||
|
if (unit) {
|
||||||
|
data.value = [{
|
||||||
|
label: unit.name+'-'+unit.id,
|
||||||
|
value: unit.id,
|
||||||
|
name:unit.name,
|
||||||
|
unitNumber:unit.id,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(() => props.unitId,
|
||||||
|
(newX) => {
|
||||||
|
if (props.isUpdate) {
|
||||||
|
getUnitInfo(newX)
|
||||||
|
}
|
||||||
|
}, {immediate: true})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- v-model:value="value"-->
|
|
||||||
<Select
|
<Select
|
||||||
|
v-model="value"
|
||||||
show-search
|
show-search
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@ -17,10 +17,10 @@ const props = withDefaults(defineProps<{
|
|||||||
isUpdate: false,
|
isUpdate: false,
|
||||||
userId: 0
|
userId: 0
|
||||||
});
|
});
|
||||||
watch(() => props.isUpdate,
|
watch(() => props.userId,
|
||||||
(newX) => {
|
(newX) => {
|
||||||
if (newX) {
|
if (props.isUpdate) {
|
||||||
getUserInfo()
|
getUserInfo(newX)
|
||||||
}
|
}
|
||||||
}, {immediate: true})
|
}, {immediate: true})
|
||||||
|
|
||||||
@ -50,30 +50,33 @@ const handleSearch = (val: string) => {
|
|||||||
};
|
};
|
||||||
const emit = defineEmits(['update:userInfo']);
|
const emit = defineEmits(['update:userInfo']);
|
||||||
const handleChange = (val: string) => {
|
const handleChange = (val: string) => {
|
||||||
// value.value = val;
|
value.value = val;
|
||||||
const userInfo = data.value.find(option => option.value === val);
|
const userInfo = data.value.find(option => option.value === val);
|
||||||
queryUser(val, (d: any[]) => (data.value = d));
|
queryUser(val, (d: any[]) => (data.value = d));
|
||||||
emit('update:userInfo', userInfo);
|
emit('update:userInfo', userInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getUserInfo() {
|
async function getUserInfo(val) {
|
||||||
console.log(value.value, '=============value')
|
if (!val) return;
|
||||||
const user = await (await findUserInfo(value.value)).user
|
const res = await findUserInfo(val)
|
||||||
console.log(user, '=================ss')
|
const user = res.user
|
||||||
if(user){
|
if (user) {
|
||||||
data.value=[{
|
data.value = [{
|
||||||
label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
|
// label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
|
||||||
|
label: user.nickName + '-' + user.phonenumber,
|
||||||
value: user.userId,
|
value: user.userId,
|
||||||
userName: user.userName,
|
userName: user.userName,
|
||||||
gender: user.sex,
|
gender: user.sex,
|
||||||
phone: user.phonenumber,
|
phone: user.phonenumber,
|
||||||
}]
|
}]
|
||||||
|
emit('update:userInfo', data.value[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Select
|
<Select
|
||||||
|
:disabled="isUpdate"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
show-search
|
show-search
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
Loading…
Reference in New Issue
Block a user