This commit is contained in:
parent
d24d03457a
commit
9eac725934
@ -59,7 +59,7 @@ export interface PersonVO {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number;
|
||||
state: number|string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
@ -142,6 +151,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'customerType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_khlx')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@ -150,30 +160,20 @@ 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',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '租赁结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '应付总额',
|
||||
@ -186,6 +186,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'rentalType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_sf')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@ -193,16 +194,34 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '租赁方案id',
|
||||
fieldName: 'planId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 2(套餐) 时显示
|
||||
show: (formValues) => formValues.rentalType === '2',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '绿植产品id',
|
||||
fieldName: 'productId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues) => formValues.rentalType === '1',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '租赁产品数量',
|
||||
fieldName: 'productNum',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues) => formValues.rentalType === '1',
|
||||
triggerFields: ['rentalType'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '支付状态',
|
||||
@ -219,6 +238,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -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,
|
||||
|
@ -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,24 +51,28 @@ 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',
|
||||
title: '人脸图片',
|
||||
@ -83,18 +82,21 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '所属单位',
|
||||
field: 'unitName',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '入驻位置',
|
||||
field: 'locathon',
|
||||
},
|
||||
// {
|
||||
// title: '入驻位置',
|
||||
// field: 'locathon',
|
||||
// },
|
||||
{
|
||||
title: '入驻时间',
|
||||
field: 'time',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '车牌号码',
|
||||
field: 'carNumber',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@ -103,18 +105,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
default: ({row})=>{
|
||||
return renderDict(row.state,'wy_rzryzt')
|
||||
}
|
||||
}
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
minWidth: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@ -168,6 +172,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules:"required"
|
||||
},
|
||||
{
|
||||
label: '车牌号码',
|
||||
@ -181,6 +186,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_rzryzt'),
|
||||
},
|
||||
rules:'selectRequired'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
@ -280,8 +286,8 @@ export async function getUnitList(): Promise<{ value: number; label: string }[]>
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.name,
|
||||
label: r.id,
|
||||
value: r.id,
|
||||
label: r.name,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
|
@ -49,15 +49,14 @@ async function handleOpenChange(open: boolean) {
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="入驻人员信息" class="w-[70%]">
|
||||
<Descriptions v-if="personDetail" size="small" :column="1" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="入驻人员">
|
||||
{{ personDetail.userName+'-'+personDetail.phone}}
|
||||
<!-- {{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}-->
|
||||
{{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="所属单位">
|
||||
{{personDetail.unitName+'-'+personDetail.unitId }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻位置">
|
||||
{{ personDetail.locathon }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="入驻位置">-->
|
||||
<!-- {{ personDetail.locathon }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="人脸图片">
|
||||
{{ personDetail.img }}
|
||||
</DescriptionsItem>
|
||||
|
@ -27,7 +27,7 @@ let userInfo = reactive({
|
||||
});
|
||||
let unitName = ref('');
|
||||
const userId = ref<number | string>(0);
|
||||
const unitId = ref<number | string>(0);
|
||||
const unitId = ref<string>('');
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
@ -70,7 +70,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (isUpdate.value && id) {
|
||||
const record = await personInfo(id);
|
||||
userId.value = record.userId;
|
||||
unitId.value = record.unitId;
|
||||
unitId.value = record.unitId.toString();
|
||||
record.state=record.state?.toString()
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
@ -9,12 +9,12 @@ const props= withDefaults(defineProps<{
|
||||
disabled?: boolean;
|
||||
placeholder?: string;
|
||||
isUpdate?:boolean;
|
||||
unitId?:number;
|
||||
unitId?:string;
|
||||
}>(), {
|
||||
disabled: false,
|
||||
placeholder: '可根据单位名称进行搜索...',
|
||||
isUpdate:false,
|
||||
unitId:0,
|
||||
unitId:'',
|
||||
});
|
||||
|
||||
async function queryUnit(value: string, callback: any) {
|
||||
@ -46,7 +46,7 @@ const handleChange = (val: string) => {
|
||||
emit('update:unitInfo', unitInfo);
|
||||
};
|
||||
|
||||
async function getUnitInfo(val:number) {
|
||||
async function getUnitInfo(val:string) {
|
||||
const unit = await resident_unitInfo(val)
|
||||
if (unit) {
|
||||
data.value = [{
|
||||
@ -60,7 +60,7 @@ async function getUnitInfo(val:number) {
|
||||
|
||||
watch(() => props.unitId,
|
||||
(newX) => {
|
||||
if (props.isUpdate) {
|
||||
if (props.isUpdate&&newX) {
|
||||
getUnitInfo(newX)
|
||||
}
|
||||
}, {immediate: true})
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user