From 9eac72593445f7c28a6a63c6f7d1fa4f73a37530 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Mon, 30 Jun 2025 14:45:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=BB=BF=E6=A4=8D=E7=A7=9F=E8=B5=81?= =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/property/resident/person/model.d.ts | 2 +- apps/web-antd/src/utils/render.tsx | 3 +- .../orderManagement/data.ts | 80 ++++++++++++------- .../orderManagement/index.vue | 2 +- .../orderManagement/rentalOrder-modal.vue | 4 +- .../views/property/resident/person/data.ts | 38 +++++---- .../resident/person/person-detail.vue | 9 +-- .../property/resident/person/person-modal.vue | 5 +- .../resident/person/query-unit-list.vue | 8 +- .../src/views/property/resident/unit/data.ts | 26 +++--- .../property/resident/unit/unit-modal.vue | 47 +++++++++-- 11 files changed, 148 insertions(+), 76 deletions(-) diff --git a/apps/web-antd/src/api/property/resident/person/model.d.ts b/apps/web-antd/src/api/property/resident/person/model.d.ts index edab3b11..524bd55a 100644 --- a/apps/web-antd/src/api/property/resident/person/model.d.ts +++ b/apps/web-antd/src/api/property/resident/person/model.d.ts @@ -59,7 +59,7 @@ export interface PersonVO { /** * 状态 */ - state: number; + state: number|string; /** * 备注 diff --git a/apps/web-antd/src/utils/render.tsx b/apps/web-antd/src/utils/render.tsx index f97f9c34..093e83f9 100644 --- a/apps/web-antd/src/utils/render.tsx +++ b/apps/web-antd/src/utils/render.tsx @@ -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, diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/data.ts b/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/data.ts index da4b1c13..7f6e4517 100644 --- a/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/data.ts +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/data.ts @@ -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'), }, }, { diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/index.vue b/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/index.vue index bf9bf429..b895b77f 100644 --- a/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/index.vue +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/orderManagement/index.vue @@ -122,7 +122,7 @@ function handleDownloadExcel() {