Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
commit
2c1373fd17
@ -10,7 +10,7 @@ import { requestClient } from '#/api/request';
|
||||
* @returns 绿植租赁-订单收费列表
|
||||
*/
|
||||
export function orderChargeList(params?: OrderChargeQuery) {
|
||||
return requestClient.get<PageResult<OrderChargeVO>>('/system/orderCharge/list', { params });
|
||||
return requestClient.get<PageResult<OrderChargeVO>>('/property/orderCharge/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -19,7 +19,7 @@ export function orderChargeList(params?: OrderChargeQuery) {
|
||||
* @returns 绿植租赁-订单收费列表
|
||||
*/
|
||||
export function orderChargeExport(params?: OrderChargeQuery) {
|
||||
return commonExport('/system/orderCharge/export', params ?? {});
|
||||
return commonExport('/property/orderCharge/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@ export function orderChargeExport(params?: OrderChargeQuery) {
|
||||
* @returns 绿植租赁-订单收费详情
|
||||
*/
|
||||
export function orderChargeInfo(id: ID) {
|
||||
return requestClient.get<OrderChargeVO>(`/system/orderCharge/${id}`);
|
||||
return requestClient.get<OrderChargeVO>(`/property/orderCharge/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,7 +37,7 @@ export function orderChargeInfo(id: ID) {
|
||||
* @returns void
|
||||
*/
|
||||
export function orderChargeAdd(data: OrderChargeForm) {
|
||||
return requestClient.postWithMsg<void>('/system/orderCharge', data);
|
||||
return requestClient.postWithMsg<void>('/property/orderCharge', data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,7 +46,7 @@ export function orderChargeAdd(data: OrderChargeForm) {
|
||||
* @returns void
|
||||
*/
|
||||
export function orderChargeUpdate(data: OrderChargeForm) {
|
||||
return requestClient.putWithMsg<void>('/system/orderCharge', data);
|
||||
return requestClient.putWithMsg<void>('/property/orderCharge', data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,5 +55,5 @@ export function orderChargeUpdate(data: OrderChargeForm) {
|
||||
* @returns void
|
||||
*/
|
||||
export function orderChargeRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/system/orderCharge/${id}`);
|
||||
return requestClient.deleteWithMsg<void>(`/property/orderCharge/${id}`);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ export interface PersonVO {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number;
|
||||
state: number|string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@ -1,8 +1,6 @@
|
||||
import type { VisitorManagementVO, VisitorManagementForm, VisitorManagementQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
@ -59,3 +57,4 @@ export function visitorManagementUpdate(data: VisitorManagementForm) {
|
||||
export function visitorManagementRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/visitorManagement/${id}`);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,6 @@ export interface VisitorManagementVO {
|
||||
* 预约状态(0:待确认,1:已确认,2:已取消,3:已完成)
|
||||
*/
|
||||
serveStatus: number;
|
||||
|
||||
}
|
||||
|
||||
export interface VisitorManagementForm extends BaseEntity {
|
||||
@ -143,7 +142,6 @@ export interface VisitorManagementForm extends BaseEntity {
|
||||
* 预约状态(0:待确认,1:已确认,2:已取消,3:已完成)
|
||||
*/
|
||||
serveStatus?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface VisitorManagementQuery extends PageQuery {
|
||||
@ -217,3 +215,76 @@ export interface VisitorManagementQuery extends PageQuery {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface VisitorManagementDetail extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 访客姓名
|
||||
*/
|
||||
visitorName?: string;
|
||||
|
||||
/**
|
||||
* 所属公司
|
||||
*/
|
||||
visitorUnit?: string;
|
||||
|
||||
/**
|
||||
* 访客电话
|
||||
*/
|
||||
visitorPhone?: string;
|
||||
|
||||
/**
|
||||
* 拜访事由
|
||||
*/
|
||||
visitingReason?: string;
|
||||
|
||||
/**
|
||||
* 被访人
|
||||
*/
|
||||
interviewedPerson?: string;
|
||||
|
||||
/**
|
||||
* 被访单位
|
||||
*/
|
||||
interviewedUnit?: string;
|
||||
|
||||
/**
|
||||
* 被访人联系方式
|
||||
*/
|
||||
interviewedPhone?: string;
|
||||
|
||||
/**
|
||||
* 拜访开始时间
|
||||
*/
|
||||
visitingBeginTime?: string;
|
||||
|
||||
/**
|
||||
* 拜访结束时间
|
||||
*/
|
||||
visitingEndTime?: string;
|
||||
|
||||
/**
|
||||
* 预约车位(0:预约,1:不预约)
|
||||
*/
|
||||
bookingParkingSpace?: number;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
licensePlate?: string;
|
||||
|
||||
/**
|
||||
* 人脸图片
|
||||
*/
|
||||
facePictures?: string;
|
||||
|
||||
/**
|
||||
* 预约状态(0:待确认,1:已确认,2:已取消,3:已完成)
|
||||
*/
|
||||
serveStatus?: number;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -161,7 +161,8 @@ export function renderDict(value: number | string, dictName: string) {
|
||||
}
|
||||
export function renderDictValue(value: number | string, dictName: string) {
|
||||
const dictInfo = getDictOptions(dictName);
|
||||
return dictInfo[0].label??'';
|
||||
const matchedItem = dictInfo.find((item) => item.value == value);
|
||||
return matchedItem ? matchedItem.label : value;
|
||||
}
|
||||
export function renderIconSpan(
|
||||
icon: ComponentType,
|
||||
|
@ -6,7 +6,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import { cloneDeep,handleNode,getPopupContainer } from '@vben/utils';
|
||||
|
||||
import { Button, Table } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
@ -20,12 +20,11 @@ import {
|
||||
clean_orderUpdate,
|
||||
} from '#/api/property/clean_order';
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
import RoomSelect from '#/components/roomSelect/room-select.vue';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import cleanDetailModal from './clean-detail-modal.vue';
|
||||
import { modalSchema } from './data';
|
||||
|
||||
import { communityTree } from '#/api/property/community';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
// 计算合计费用
|
||||
@ -118,6 +117,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
setupCommunitySelect()
|
||||
modalApi.modalLoading(true);
|
||||
const { id, readonly } = modalApi.getData() as {
|
||||
id?: number | string;
|
||||
@ -216,44 +216,39 @@ const detailGridOptions: VxeGridProps = {
|
||||
data: [],
|
||||
};
|
||||
const detailColumns = [
|
||||
{ title: '序号', key: 'index', width: 'auto' },
|
||||
{ title: '劳务名称', dataIndex: 'name', key: 'name', width: 'auto' },
|
||||
{ title: '计量单位', dataIndex: 'measure', key: 'measure', width: 'auto' },
|
||||
{ title: '计算方式', dataIndex: 'method', key: 'method', width: 'auto' },
|
||||
{ title: '序号', key: 'index' },
|
||||
{ title: '劳务名称', dataIndex: 'name', key: 'name' },
|
||||
{ title: '计量单位', dataIndex: 'measure', key: 'measure' },
|
||||
{ title: '计算方式', dataIndex: 'method', key: 'method' },
|
||||
{
|
||||
title: '申报单价含税(元)',
|
||||
dataIndex: 'peices',
|
||||
key: 'peices',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '保洁频率',
|
||||
dataIndex: 'frequency',
|
||||
key: 'frequency',
|
||||
width: 'auto',
|
||||
},
|
||||
{ title: '保洁标准', dataIndex: 'standard', key: 'standard', width: 'auto' },
|
||||
{ title: '备注', dataIndex: 'remark', key: 'remark', width: 'auto' },
|
||||
{ title: '保洁标准', dataIndex: 'standard', key: 'standard' },
|
||||
{ title: '备注', dataIndex: 'remark', key: 'remark' },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'stater',
|
||||
key: 'stater',
|
||||
width: 'auto',
|
||||
customRender: ({ value }: { value: number }) =>
|
||||
value === 1 ? '启用' : '禁用',
|
||||
},
|
||||
{ title: '保洁面积', dataIndex: 'area', key: 'area', width: 'auto' },
|
||||
{ title: '保洁面积', dataIndex: 'area', key: 'area' },
|
||||
{
|
||||
title: '合计费用',
|
||||
dataIndex: 'sumPeices',
|
||||
key: 'sumPeices',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right' as const,
|
||||
width: 'auto',
|
||||
},
|
||||
];
|
||||
|
||||
@ -281,6 +276,8 @@ function handleDeleteDetail(record: any, index: number) {
|
||||
}
|
||||
|
||||
async function handleConfirm() {
|
||||
console.log('handleConfirm123123123');
|
||||
|
||||
if (isReadonly.value) {
|
||||
modalApi.close();
|
||||
return;
|
||||
@ -301,6 +298,8 @@ async function handleConfirm() {
|
||||
// 劳务数据缓存 cleanListData 已有
|
||||
// 查找label
|
||||
const unitObj = unitListData.find((item) => item.id === data.unit);
|
||||
console.log(unitObj,'unitObj');
|
||||
|
||||
const cleanObj = cleanListData.find((item) => item.id === data.name);
|
||||
|
||||
data.unit = unitObj ? unitObj.name : data.unit || '';
|
||||
@ -311,12 +310,18 @@ async function handleConfirm() {
|
||||
: isUpdate.value
|
||||
? editCleanId.value
|
||||
: '';
|
||||
data.sumPeices = totalSumPeices;
|
||||
// 组装 cleanIds
|
||||
data.cleanIds = detailTable.value.map((item: any) => item.id);
|
||||
data.details = detailTable.value;
|
||||
|
||||
await (isUpdate.value ? clean_orderUpdate(data) : clean_orderAdd(data));
|
||||
data.sumPeices = parseInt(totalSumPeices.value, 10);
|
||||
|
||||
// 组装 cleanIds
|
||||
// data.cleanIds = detailTable.value.map((item: any) => item.id);
|
||||
data.cleanList = detailTable.value;
|
||||
console.log(data);
|
||||
console.log(12037847120120);
|
||||
await clean_orderAdd(data)
|
||||
// isUpdate.value ? await clean_orderUpdate(data) : await clean_orderAdd(data);
|
||||
console.log('1231273');
|
||||
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
@ -331,14 +336,47 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
// 获取服务地址
|
||||
async function setupCommunitySelect() {
|
||||
const areaList = await communityTree(5);
|
||||
// 选中后显示在输入框的值 即父节点 / 子节点
|
||||
// addFullName(areaList, 'areaName', ' / ');
|
||||
const splitStr = '/';
|
||||
handleNode(areaList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 5) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
getPopupContainer,
|
||||
placeholder: '请选择服务地址',
|
||||
showSearch: true,
|
||||
treeData: areaList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: { showLeafIcon: false },
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
}),
|
||||
fieldName: 'location',
|
||||
},
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #location="soltProps">
|
||||
<RoomSelect v-bind="soltProps" />
|
||||
</template>
|
||||
</BasicForm>
|
||||
<!-- 添加订单详情部分 -->
|
||||
<div class="mt-4">
|
||||
@ -399,4 +437,15 @@ async function handleClosed() {
|
||||
.font-medium {
|
||||
font-weight: 500;
|
||||
}
|
||||
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
|
||||
:deep(.ant-input[disabled]),
|
||||
:deep(.ant-input-number-disabled .ant-input-number-input),
|
||||
:deep(.ant-select-disabled .ant-select-selection-item),
|
||||
:deep(.ant-picker-disabled .ant-picker-input > input) {
|
||||
/* 设置一个更深的颜色 */
|
||||
color: rgb(0 0 0 / 65%) !important;
|
||||
|
||||
/* 有些浏览器需要这个来覆盖默认颜色 */
|
||||
-webkit-text-fill-color: rgb(0 0 0 / 65%) !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -12,6 +12,13 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'location',
|
||||
label: '服务地址',
|
||||
},
|
||||
// {
|
||||
// label: '服务地址(房间号)',
|
||||
// component: 'TreeSelect',
|
||||
// defaultValue: undefined,
|
||||
// fieldName: 'location',
|
||||
// rules: 'required',
|
||||
// },
|
||||
// {
|
||||
// label: '服务地址(房间号)',
|
||||
// fieldName: 'location',
|
||||
@ -161,14 +168,9 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '服务地址(房间号)',
|
||||
component: 'Input',
|
||||
defaultValue: undefined,
|
||||
fieldName: 'location',
|
||||
componentProps: {
|
||||
placeholder: '请选择房间',
|
||||
},
|
||||
slots: {
|
||||
default: 'location',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
rules: 'required',
|
||||
},
|
||||
// {
|
||||
|
@ -95,7 +95,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 'auto',
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -7,37 +7,25 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orderId',
|
||||
label: '订单id',
|
||||
label: '订单号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userId',
|
||||
label: '租赁人id',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_invoice_status'),
|
||||
},
|
||||
fieldName: 'invoiceStatus',
|
||||
label: '开票状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userName',
|
||||
label: '租赁人名称',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'rent',
|
||||
label: '租金',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'deposit',
|
||||
label: '押金',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'penalty',
|
||||
label: '违约金',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'totalAmount',
|
||||
label: '总金额',
|
||||
label: '租赁人',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
@ -57,19 +45,6 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'paymentMethod',
|
||||
label: '支付方式',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_invoice_status'),
|
||||
},
|
||||
fieldName: 'invoiceStatus',
|
||||
label: '开票状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'invoiceType',
|
||||
label: '发票类型',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
@ -83,11 +58,16 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键',
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '订单id',
|
||||
title: '订单号',
|
||||
field: 'orderId',
|
||||
},
|
||||
{
|
||||
@ -95,7 +75,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'userId',
|
||||
},
|
||||
{
|
||||
title: '租赁人名称',
|
||||
title: '租赁人',
|
||||
field: 'userName',
|
||||
},
|
||||
{
|
||||
@ -169,7 +149,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '订单id',
|
||||
label: '订单号',
|
||||
fieldName: 'orderId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
@ -181,7 +161,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '租赁人名称',
|
||||
label: '租赁人',
|
||||
fieldName: 'userName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
@ -204,32 +184,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '总金额',
|
||||
fieldName: 'totalAmount',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '收费日期',
|
||||
fieldName: 'chargeDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '支付方式',
|
||||
fieldName: 'paymentMethod',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_payment_method'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '开票状态',
|
||||
fieldName: 'invoiceStatus',
|
||||
|
@ -51,7 +51,7 @@ const gridOptions: VxeGridProps = {
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'system-orderCharge-index'
|
||||
id: 'property-orderCharge-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@ -105,7 +105,7 @@ function handleDownloadExcel() {
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['system:orderCharge:export']"
|
||||
v-access:code="['property:orderCharge:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
@ -114,13 +114,13 @@ function handleDownloadExcel() {
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['system:orderCharge:remove']"
|
||||
v-access:code="['property:orderCharge:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['system:orderCharge:add']"
|
||||
v-access:code="['property:orderCharge:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
@ -130,7 +130,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['system:orderCharge:edit']"
|
||||
v-access:code="['property:orderCharge:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
@ -143,7 +143,7 @@ function handleDownloadExcel() {
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['system:orderCharge:remove']"
|
||||
v-access:code="['property:orderCharge:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
|
@ -12,12 +12,12 @@ const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
return isUpdate.value ? $t('pages.common.edit') : '添加收费';
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
@ -36,7 +36,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[60%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
|
@ -9,11 +9,13 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
fieldName: 'planName',
|
||||
label: '方案名称',
|
||||
labelWidth: 120
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'rentalPeriod',
|
||||
label: '租赁周期',
|
||||
labelWidth: 120,
|
||||
componentProps: {
|
||||
options:[
|
||||
{ label: '月', value: 0 },
|
||||
@ -121,7 +123,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '基础服务项',
|
||||
fieldName: 'price',
|
||||
component: 'Select',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '优惠活动',
|
||||
|
@ -21,9 +21,9 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
labelWidth: 120,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@ -91,11 +91,67 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
const detailColumns = [
|
||||
{ title: '序号', key: 'index' },
|
||||
{ title: '产品编号', dataIndex: 'plantCode', key: 'plantCode' },
|
||||
{ title: '产品名称', dataIndex: 'plantName', key: 'plantName' },
|
||||
{ title: '产品分类', dataIndex: 'plantType', key: 'plantType' },
|
||||
{
|
||||
title: '图片',
|
||||
dataIndex: 'imgPath',
|
||||
key: 'imgPath',
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
dataIndex: 'specification',
|
||||
key: 'specification',
|
||||
},
|
||||
{ title: '租金', dataIndex: 'rent', key: 'rent' },
|
||||
{ title: '备注', dataIndex: 'remark', key: 'remark' },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'state',
|
||||
key: 'state',
|
||||
customRender: ({ value }: { value: number }) =>
|
||||
value === 1 ? '上架' : '下架',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right' as const,
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<!-- 添加订单详情部分、 -->
|
||||
<div class="mt-4">
|
||||
<div class="mb-2 flex items-center justify-between">
|
||||
<h3 class="text-lg font-medium">添加保洁订单详情</h3>
|
||||
<a-button type="primary" @click="handleAddDetail">
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</div>
|
||||
<Table
|
||||
:data-source="detailTable"
|
||||
:columns="detailColumns"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ column, index, record }">
|
||||
<template v-if="column.key === 'index'">
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'action'">
|
||||
<Button danger @click="handleDeleteDetail(record, index)">
|
||||
删除
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
<div>费用合计:{{ totalSumPeices }}元</div>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@ -7,7 +7,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orderNo',
|
||||
label: '订单编号',
|
||||
label: '订单号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
@ -17,6 +17,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_khlx')
|
||||
},
|
||||
fieldName: 'customerType',
|
||||
label: '客户类型',
|
||||
@ -42,76 +43,84 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '订单号',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
field: 'orderNo',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '客户名称',
|
||||
field: 'customerName',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '客户类型',
|
||||
field: 'customerType',
|
||||
slots: {default: 'customerType'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '租赁周期',
|
||||
field: 'rentalPeriod',
|
||||
slots: {default: 'rentalPeriod'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '租赁开始时间',
|
||||
field: 'startTime',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '租赁结束时间',
|
||||
field: 'endTime',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '应付总额',
|
||||
field: 'totalAmount',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '租赁方式',
|
||||
field: 'rentalType',
|
||||
slots: {default: 'rentalType'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '租赁方案id',
|
||||
title: '租赁商品',
|
||||
field: 'planId',
|
||||
},
|
||||
{
|
||||
title: '绿植产品id',
|
||||
field: 'productId',
|
||||
},
|
||||
{
|
||||
title: '租赁产品数量',
|
||||
field: 'productNum',
|
||||
slots: {default: 'planId'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
field: 'paymentStatus',
|
||||
slots: {default: 'paymentStatus'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '是否续租',
|
||||
field: 'isRelet',
|
||||
slots: {default: 'isRelet'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '合同状态',
|
||||
field: 'contractStatus',
|
||||
slots: {default: 'contractStatus'},
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '签署时间',
|
||||
field: 'signTime',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
minWidth: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@ -125,12 +134,12 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '订单号',
|
||||
fieldName: 'orderNo',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
// {
|
||||
// label: '订单号',
|
||||
// fieldName: 'orderNo',
|
||||
// component: 'Input',
|
||||
// rules: 'required',
|
||||
// },
|
||||
{
|
||||
label: '客户名称',
|
||||
fieldName: 'customerName',
|
||||
@ -142,6 +151,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'customerType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_khlx')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@ -150,28 +160,67 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'rentalPeriod',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_time_unit')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '租赁开始时间',
|
||||
fieldName: 'startTime',
|
||||
component: 'DatePicker',
|
||||
label: '租赁时间',
|
||||
fieldName: 'rentalTime',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '租赁方式',
|
||||
fieldName: 'rentalType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_zlfs')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '租赁方案id',
|
||||
fieldName: 'planId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 2(套餐) 时显示
|
||||
show: (formValues) => formValues.rentalType === '2',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '绿植产品id',
|
||||
fieldName: 'productId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues) => formValues.rentalType === '1',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '租赁结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
label: '租赁数量',
|
||||
fieldName: 'productNum',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
min: 1,
|
||||
precision: 0,
|
||||
step: 1
|
||||
},
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues) => formValues.rentalType === '1',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
@ -181,29 +230,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '租赁方式',
|
||||
fieldName: 'rentalType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '租赁方案id',
|
||||
fieldName: 'planId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '绿植产品id',
|
||||
fieldName: 'productId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '租赁产品数量',
|
||||
fieldName: 'productNum',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '支付状态',
|
||||
fieldName: 'paymentStatus',
|
||||
@ -212,20 +238,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '是否续租',
|
||||
fieldName: 'isRelet',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '是否续租',
|
||||
// fieldName: 'isRelet',
|
||||
// component: 'RadioGroup',
|
||||
// componentProps: {
|
||||
// buttonStyle: 'solid',
|
||||
// optionType: 'button',
|
||||
// options: getDictOptions('wy_sf'),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '合同状态',
|
||||
fieldName: 'contractStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_htzt'),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ function handleDownloadExcel() {
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="绿植租赁-订单管理列表">
|
||||
<BasicTable table-title="租赁订单列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
|
@ -21,7 +21,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
|
@ -214,7 +214,16 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="row"></div>
|
||||
<div class="row">
|
||||
<div class="box">
|
||||
<div class="title">总订单数</div>
|
||||
<div class="number">13,132</div>
|
||||
<div class="percent">8.9%</div>
|
||||
</div>
|
||||
<div class="box"></div>
|
||||
<div class="box"></div>
|
||||
<div class="box"></div>
|
||||
</div>
|
||||
<div class="row-first">
|
||||
<div class="item1">
|
||||
<EchartsUI
|
||||
@ -304,11 +313,26 @@ onMounted(() => {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
background-color: #962020;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.box{
|
||||
width: 300px;
|
||||
height: 120px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
margin: 40px 0px;
|
||||
padding: 10px;
|
||||
.title{
|
||||
font-size: 20px;
|
||||
}
|
||||
.number{
|
||||
font-size: 25px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.percent{
|
||||
font-size: 15px; }
|
||||
}
|
||||
}
|
||||
|
||||
.row-first {
|
||||
|
@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
@ -149,6 +153,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
// rules:'required',
|
||||
// formItemClass: 'col-span-2',
|
||||
// },
|
||||
{
|
||||
label: '入驻时间',
|
||||
fieldName: 'time',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules:"required"
|
||||
},
|
||||
{
|
||||
label: '车牌号码',
|
||||
fieldName: 'carNumber',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '人脸图片',
|
||||
fieldName: 'img',
|
||||
@ -159,21 +179,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '入驻时间',
|
||||
fieldName: 'time',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '车牌号码',
|
||||
fieldName: 'carNumber',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '人员状态',
|
||||
fieldName: 'state',
|
||||
@ -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})
|
||||
|
@ -35,6 +35,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
width: 60
|
||||
},
|
||||
{
|
||||
title: '单位编号',
|
||||
@ -42,11 +43,13 @@ export const columns: VxeGridProps['columns'] = [
|
||||
slots:{
|
||||
default: ({ row }) => {
|
||||
return row.id;
|
||||
}}
|
||||
}},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '单位名称',
|
||||
field: 'name',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '单位类型',
|
||||
@ -56,46 +59,55 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.type, 'wy_qylx');
|
||||
},
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '联系人',
|
||||
field: 'contactPerson',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
field: 'phone',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '入驻位置',
|
||||
field: 'location',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '入驻时间',
|
||||
field: 'time',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {default: 'state'}
|
||||
slots: {default: 'state'},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '员工数量',
|
||||
field: 'number',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
minWidth: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@ -137,15 +149,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: z.string().regex(/^1[3-9]\d{9}$/, { message: '格式错误' }),
|
||||
},
|
||||
|
||||
{
|
||||
label: '入驻位置',
|
||||
fieldName: 'location',
|
||||
component: 'Select',
|
||||
slots:{
|
||||
default:'location'
|
||||
},
|
||||
rules: 'required',
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import {cloneDeep, getPopupContainer, handleNode} from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { resident_unitAdd, resident_unitInfo, resident_unitUpdate } from '#/api/property/resident/unit';
|
||||
@ -11,6 +11,7 @@ import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import RoomSelect from "#/views/property/room/room-select.vue";
|
||||
import {communityTree} from "#/api/property/community";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@ -57,7 +58,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
initLocationOptions()
|
||||
if (isUpdate.value && id) {
|
||||
const record = await resident_unitInfo(id);
|
||||
await formApi.setValues(record);
|
||||
@ -87,6 +88,42 @@ async function handleConfirm() {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 入驻位置数据
|
||||
*/
|
||||
async function initLocationOptions() {
|
||||
const locationList = await communityTree(5);
|
||||
const splitStr = '/';
|
||||
handleNode(locationList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 5) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
getPopupContainer,
|
||||
placeholder: '请选择入驻位置',
|
||||
showSearch: true,
|
||||
treeData: locationList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: { showLeafIcon: false },
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
}),
|
||||
fieldName: 'location',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
@ -97,9 +134,9 @@ async function handleClosed() {
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #location="slotProps">
|
||||
<RoomSelect v-bind="slotProps" :isUpdate="isUpdate" :level="2"/>
|
||||
</template>
|
||||
<!-- <template #location="slotProps">-->
|
||||
<!-- <RoomSelect v-bind="slotProps" :isUpdate="isUpdate" :level="2"/>-->
|
||||
<!-- </template>-->
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@ -1,172 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
visitorManagementExport,
|
||||
visitorManagementList,
|
||||
visitorManagementRemove,
|
||||
} from '#/api/property/visitorManagement';
|
||||
import type { VisitorManagementForm } from '#/api/property/visitorManagement/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import visitorManagementModal from './visitorManagement-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await visitorManagementList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-visitorManagement-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [VisitorManagementModal, modalApi] = useVbenModal({
|
||||
connectedComponent: visitorManagementModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<VisitorManagementForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<VisitorManagementForm>) {
|
||||
await visitorManagementRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<VisitorManagementForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await visitorManagementRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(visitorManagementExport, '访客管理数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="访客管理列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:visitorManagement:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:visitorManagement:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:visitorManagement:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:visitorManagement:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:visitorManagement:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<VisitorManagementModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@ -1,6 +1,5 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
@ -10,35 +9,23 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'visitorName',
|
||||
label: '访客姓名',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'visitorUnit',
|
||||
label: '所属公司',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'visitorPhone',
|
||||
label: '访客电话',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'visitingReason',
|
||||
label: '拜访事由',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'interviewedPerson',
|
||||
label: '被访人',
|
||||
label: '邀约人',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'interviewedUnit',
|
||||
label: '被访单位',
|
||||
label: '邀约单位',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'interviewedPhone',
|
||||
label: '被访人联系方式',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_appointment_tatus'),
|
||||
},
|
||||
fieldName: 'serveStatus',
|
||||
label: '预约状态',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
@ -48,7 +35,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'visitingBeginTime',
|
||||
label: '拜访开始时间',
|
||||
label: '拜访时间',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
@ -57,103 +44,83 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'visitingEndTime',
|
||||
label: '拜访结束时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bookingParkingSpace',
|
||||
label: '预约车位',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'licensePlate',
|
||||
label: '车牌号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'facePictures',
|
||||
label: '人脸图片',
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_APPOINTMENT_TATUS 便于维护
|
||||
options: getDictOptions('wy_appointment_tatus'),
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
fieldName: 'serveStatus',
|
||||
label: '预约状态',
|
||||
fieldName: 'createTime',
|
||||
label: '提交时间',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: 'id',
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '访客姓名',
|
||||
field: 'visitorName',
|
||||
},
|
||||
{
|
||||
title: '访客电话',
|
||||
field: 'visitorPhone',
|
||||
},
|
||||
{
|
||||
title: '所属公司',
|
||||
field: 'visitorUnit',
|
||||
},
|
||||
{
|
||||
title: '访客电话',
|
||||
field: 'visitorPhone',
|
||||
title: '邀约人',
|
||||
field: 'interviewedPerson',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
field: 'interviewedPhone',
|
||||
},
|
||||
{
|
||||
title: '邀约单位',
|
||||
field: 'interviewedUnit',
|
||||
},
|
||||
{
|
||||
title: '拜访事由',
|
||||
field: 'visitingReason',
|
||||
},
|
||||
{
|
||||
title: '被访人',
|
||||
field: 'interviewedPerson',
|
||||
title: '拜访时间',
|
||||
field: 'visitingTimeRange',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
const beginTime = row.visitingBeginTime || '';
|
||||
const endTime = row.visitingEndTime || '';
|
||||
return `${beginTime} - ${endTime}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '被访单位',
|
||||
field: 'interviewedUnit',
|
||||
},
|
||||
{
|
||||
title: '被访人联系方式',
|
||||
field: 'interviewedPhone',
|
||||
},
|
||||
{
|
||||
title: '拜访开始时间',
|
||||
field: 'visitingBeginTime',
|
||||
},
|
||||
{
|
||||
title: '拜访结束时间',
|
||||
field: 'visitingEndTime',
|
||||
},
|
||||
{
|
||||
title: '预约车位',
|
||||
title: '是否预约车位',
|
||||
field: 'bookingParkingSpace',
|
||||
},
|
||||
{
|
||||
title: '车牌号',
|
||||
field: 'licensePlate',
|
||||
},
|
||||
{
|
||||
title: '人脸图片',
|
||||
field: 'facePictures',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.bookingParkingSpace, 'wy_parking_spot');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
field: 'serveStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_APPOINTMENT_TATUS 便于维护
|
||||
return renderDict(row.serveStatus, 'wy_appointment_tatus');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@ -179,12 +146,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '所属公司',
|
||||
fieldName: 'visitorUnit',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '访客电话',
|
||||
fieldName: 'visitorPhone',
|
||||
@ -192,8 +153,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '拜访事由',
|
||||
fieldName: 'visitingReason',
|
||||
label: '所属公司',
|
||||
fieldName: 'visitorUnit',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
@ -204,17 +165,19 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '被访单位',
|
||||
fieldName: 'interviewedUnit',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '被访人联系方式',
|
||||
label: '联系电话',
|
||||
fieldName: 'interviewedPhone',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '拜访开始时间',
|
||||
label: '拜访事由',
|
||||
fieldName: 'visitingReason',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '拜访时间',
|
||||
fieldName: 'visitingBeginTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
@ -222,43 +185,33 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '拜访结束时间',
|
||||
fieldName: 'visitingEndTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预约车位',
|
||||
fieldName: 'bookingParkingSpace',
|
||||
component: 'Input',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '否', value: '1' },
|
||||
{ label: '是', value: '0' },
|
||||
],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '车牌号',
|
||||
fieldName: 'licensePlate',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '人脸图片',
|
||||
fieldName: 'facePictures',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '预约状态',
|
||||
fieldName: 'serveStatus',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_APPOINTMENT_TATUS 便于维护
|
||||
options: getDictOptions('wy_appointment_tatus'),
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '人脸图片',
|
||||
// fieldName: 'facePictures',
|
||||
// component: 'ImageUpload',
|
||||
// componentProps: {
|
||||
// maxCount: 1,
|
||||
// },
|
||||
// formItemClass: 'col-span-2',
|
||||
// },
|
||||
];
|
@ -0,0 +1,104 @@
|
||||
<script setup lang="ts">
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { Space } from 'ant-design-vue';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
import {
|
||||
visitorManagementList,
|
||||
} from '#/api/property/visitorManagement';
|
||||
import type { VisitorManagementForm } from '#/api/property/visitorManagement/model';
|
||||
import VisitorInvitationModal from './visitorInvitation-modal.vue';
|
||||
import VisitorInvitationDetail from './visitorInvitation-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
highlight: true,
|
||||
reserve: true,
|
||||
},
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await visitorManagementList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
id: 'property-visitorManagement-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [VisitorManagement, modalApi] = useVbenModal({
|
||||
connectedComponent: VisitorInvitationModal,
|
||||
});
|
||||
|
||||
const [visitorManagementDetailModal, visitorManagementDetailApi] = useVbenModal({
|
||||
connectedComponent: VisitorInvitationDetail,
|
||||
});
|
||||
|
||||
async function handleInfo(row: Required<VisitorManagementForm>) {
|
||||
visitorManagementDetailApi.setData({ id: row.id });
|
||||
visitorManagementDetailApi.open();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="访客邀约列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:visitorManagement:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ '添加邀约' }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<VisitorManagement @reload="tableApi.query()" />
|
||||
<visitorManagementDetailModal/>
|
||||
</Page>
|
||||
</template>
|
@ -0,0 +1,77 @@
|
||||
<script setup lang="ts">
|
||||
import type {VisitorManagementDetail} from '#/api/property/visitorManagement/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {visitorManagementInfo} from '#/api/property/visitorManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
unitDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const unitDetail = shallowRef<null | VisitorManagementDetail>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await visitorManagementInfo(id);
|
||||
unitDetail.value = response;
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
|
||||
<Descriptions v-if="unitDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="访客姓名">
|
||||
{{ unitDetail.visitorName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="访客电话">
|
||||
{{ unitDetail.visitorPhone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属公司">
|
||||
{{ unitDetail.visitorUnit}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="被访人">
|
||||
{{ unitDetail.interviewedPerson }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系电话">
|
||||
{{ unitDetail.interviewedPhone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="被访单位">
|
||||
{{ unitDetail.interviewedUnit }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="拜访事由">
|
||||
{{ unitDetail.visitingReason }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="拜访时间">
|
||||
{{ unitDetail.visitingBeginTime+' - '+unitDetail.visitingBeginTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否预约车位" v-if="unitDetail.bookingParkingSpace!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.bookingParkingSpace,'wy_parking_spot')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约状态" v-if="unitDetail.serveStatus!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.serveStatus,'wy_appointment_tatus')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="提交时间">
|
||||
{{ unitDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -1,8 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
@ -14,14 +13,11 @@ import { modalSchema } from './data';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@ -43,7 +39,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[60%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@ -94,7 +90,7 @@ async function handleClosed() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicModal title="添加邀约">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
@ -0,0 +1,131 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'visitorName',
|
||||
label: '访客姓名',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'interviewedPerson',
|
||||
label: '被访人',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'interviewedUnit',
|
||||
label: '被访单位',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_appointment_tatus'),
|
||||
},
|
||||
fieldName: 'serveStatus',
|
||||
label: '预约状态',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'visitingBeginTime',
|
||||
label: '拜访时间',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'createTime',
|
||||
label: '提交时间',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '访客姓名',
|
||||
field: 'visitorName',
|
||||
},
|
||||
{
|
||||
title: '访客电话',
|
||||
field: 'visitorPhone',
|
||||
},
|
||||
{
|
||||
title: '所属公司',
|
||||
field: 'visitorUnit',
|
||||
},
|
||||
{
|
||||
title: '被访人',
|
||||
field: 'interviewedPerson',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
field: 'interviewedPhone',
|
||||
},
|
||||
{
|
||||
title: '被访单位',
|
||||
field: 'interviewedUnit',
|
||||
},
|
||||
{
|
||||
title: '拜访事由',
|
||||
field: 'visitingReason',
|
||||
},
|
||||
{
|
||||
title: '拜访时间',
|
||||
field: 'visitingTimeRange',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
const beginTime = row.visitingBeginTime || '';
|
||||
const endTime = row.visitingEndTime || '';
|
||||
return `${beginTime} - ${endTime}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否预约车位',
|
||||
field: 'bookingParkingSpace',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.bookingParkingSpace, 'wy_parking_spot');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
field: 'serveStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.serveStatus, 'wy_appointment_tatus');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
@ -0,0 +1,77 @@
|
||||
<script setup lang="ts">
|
||||
import type {VisitorManagementDetail} from '#/api/property/visitorManagement/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {visitorManagementInfo} from '#/api/property/visitorManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
unitDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const unitDetail = shallowRef<null | VisitorManagementDetail>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await visitorManagementInfo(id);
|
||||
unitDetail.value = response;
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="访客管理信息" class="w-[70%]">
|
||||
<Descriptions v-if="unitDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="访客姓名">
|
||||
{{ unitDetail.visitorName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="访客电话">
|
||||
{{ unitDetail.visitorPhone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属公司">
|
||||
{{ unitDetail.visitorUnit}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="被访人">
|
||||
{{ unitDetail.interviewedPerson }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系电话">
|
||||
{{ unitDetail.interviewedPhone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="被访单位">
|
||||
{{ unitDetail.interviewedUnit }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="拜访事由">
|
||||
{{ unitDetail.visitingReason }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="拜访时间">
|
||||
{{ unitDetail.visitingBeginTime+' - '+unitDetail.visitingBeginTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否预约车位" v-if="unitDetail.bookingParkingSpace!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.bookingParkingSpace,'wy_parking_spot')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约状态" v-if="unitDetail.serveStatus!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.serveStatus,'wy_appointment_tatus')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="提交时间">
|
||||
{{ unitDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -28,8 +28,8 @@ export default defineConfig(async () => {
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
// target: 'http://by.missmoc.top:3010/',
|
||||
target: 'http://127.0.0.1:8080/',
|
||||
// target: 'http://47.109.37.87:3010',
|
||||
// target: 'http://192.168.0.103:8080',
|
||||
target: 'http://47.109.37.87:3010',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user