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

This commit is contained in:
fyy 2025-07-02 14:43:17 +08:00
commit 63c3a8b550
17 changed files with 1039 additions and 140 deletions

View File

@ -65,7 +65,6 @@ export interface OrderChargeVO {
*
*/
chargeStatus: number;
}
export interface OrderChargeForm extends BaseEntity {
@ -133,7 +132,6 @@ export interface OrderChargeForm extends BaseEntity {
*
*/
chargeStatus?: number;
}
export interface OrderChargeQuery extends PageQuery {
@ -202,3 +200,70 @@ export interface OrderChargeQuery extends PageQuery {
*/
params?: any;
}
export interface orderChargeDetailForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
* id
*/
orderId?: string | number;
/**
* id
*/
userId?: string | number;
/**
*
*/
userName?: string;
/**
*
*/
rent?: number;
/**
*
*/
deposit?: number;
/**
*
*/
penalty?: number;
/**
*
*/
totalAmount?: number;
/**
*
*/
chargeDate?: string;
/**
*
*/
paymentMethod?: number;
/**
*
*/
invoiceStatus?: number;
/**
*
*/
invoiceType?: number;
/**
*
*/
chargeStatus?: number;
}

View File

@ -0,0 +1,59 @@
import type { OrderMaintainVO, OrderMaintainForm, OrderMaintainQuery } 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';
/**
* 绿-
* @param params
* @returns 绿-
*/
export function orderMaintainList(params?: OrderMaintainQuery) {
return requestClient.get<PageResult<OrderMaintainVO>>('/property/orderMaintain/list', { params });
}
/**
* 绿-
* @param params
* @returns 绿-
*/
export function orderMaintainExport(params?: OrderMaintainQuery) {
return commonExport('/property/orderMaintain/export', params ?? {});
}
/**
* 绿-
* @param id id
* @returns 绿-
*/
export function orderMaintainInfo(id: ID) {
return requestClient.get<OrderMaintainVO>(`/property/orderMaintain/${id}`);
}
/**
* 绿-
* @param data
* @returns void
*/
export function orderMaintainAdd(data: OrderMaintainForm) {
return requestClient.postWithMsg<void>('/property/orderMaintain', data);
}
/**
* 绿-
* @param data
* @returns void
*/
export function orderMaintainUpdate(data: OrderMaintainForm) {
return requestClient.putWithMsg<void>('/property/orderMaintain', data);
}
/**
* 绿-
* @param id id
* @returns void
*/
export function orderMaintainRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/orderMaintain/${id}`);
}

View File

@ -0,0 +1,247 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface OrderMaintainVO {
/**
*
*/
id: string | number;
/**
*
*/
maintainName: string;
/**
* id
*/
communityId: string | number;
/**
* id
*/
buildingId: string | number;
/**
* id
*/
floorId: string | number;
/**
*
*/
serveType: number;
/**
*
*/
periodType: number;
/**
*
*/
periodFrequency: number;
/**
* id
*/
orderId: string | number;
/**
*
*/
startTime: string;
/**
*
*/
endTime: string;
/**
*
*/
inspectResult: number;
/**
*
*/
measure: string;
/**
*
*/
customerScore: number;
/**
*
*/
customerAdvice: string;
/**
*
*/
state: number;
}
export interface OrderMaintainForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
*
*/
maintainName?: string;
/**
* id
*/
communityId?: string | number;
/**
* id
*/
buildingId?: string | number;
/**
* id
*/
floorId?: string | number;
/**
*
*/
serveType?: number;
/**
*
*/
periodType?: number;
/**
*
*/
periodFrequency?: number;
/**
* id
*/
orderId?: string | number;
/**
*
*/
startTime?: string;
/**
*
*/
endTime?: string;
/**
*
*/
inspectResult?: number;
/**
*
*/
measure?: string;
/**
*
*/
customerScore?: number;
/**
*
*/
customerAdvice?: string;
/**
*
*/
state?: number;
}
export interface OrderMaintainQuery extends PageQuery {
/**
*
*/
maintainName?: string;
/**
* id
*/
communityId?: string | number;
/**
* id
*/
buildingId?: string | number;
/**
* id
*/
floorId?: string | number;
/**
*
*/
serveType?: number;
/**
*
*/
periodType?: number;
/**
*
*/
periodFrequency?: number;
/**
* id
*/
orderId?: string | number;
/**
*
*/
startTime?: string;
/**
*
*/
endTime?: string;
/**
*
*/
inspectResult?: number;
/**
*
*/
measure?: string;
/**
*
*/
customerScore?: number;
/**
*
*/
customerAdvice?: string;
/**
*
*/
state?: number;
/**
*
*/
params?: any;
}

View File

@ -19,7 +19,7 @@ export interface PropertyVO {
/**
*
*/
plantType: number;
plantType: number|string;
/**
*
@ -44,7 +44,7 @@ export interface PropertyVO {
/**
* 0 1
*/
state: number;
state: number|string;
/**
*
@ -72,8 +72,7 @@ export interface PropertyForm extends BaseEntity {
/**
*
*/
plantType?: number;
plantType?: number|string;
/**
*
*/
@ -97,7 +96,7 @@ export interface PropertyForm extends BaseEntity {
/**
* 0 1
*/
state?: number;
state?: number|string;
/**
*
@ -120,7 +119,7 @@ export interface PropertyQuery extends PageQuery {
/**
*
*/
plantType?: number;
plantType?: number|string;
/**
*
@ -145,7 +144,7 @@ export interface PropertyQuery extends PageQuery {
/**
* 0 1
*/
state?: number;
state?: number|string;
/**
*
@ -172,7 +171,7 @@ export interface plantsProduct extends BaseEntity {
/**
*
*/
plantType?: number;
plantType?: number|string;
/**
*
@ -182,7 +181,7 @@ export interface plantsProduct extends BaseEntity {
/**
*
*/
specification?: string;
specification?: number|string;
/**
*
@ -197,7 +196,7 @@ export interface plantsProduct extends BaseEntity {
/**
* 0 1
*/
state?: number;
state?: number|string;
/**
*

View File

@ -1,18 +1,20 @@
import type { PersonLibVO, PersonLibForm, PersonLibQuery } from './model';
import type { PersonLibForm, PersonLibQuery, PersonLibVO } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import type { ID, IDS, PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
*
@param params
@returns
* @param params
* @returns
*/
export function personLibList(params?: PersonLibQuery) {
return requestClient.get<PageResult<PersonLibVO>>('/sis/personLib/list', { params });
return requestClient.get<PageResult<PersonLibVO>>('/sis/personLib/list', {
params,
});
}
/**
@ -39,7 +41,7 @@ export function personLibInfo(id: ID) {
* @returns void
*/
export function personLibAdd(data: PersonLibForm) {
return requestClient.postWithMsg<void>('/sis/personLib', data);
return requestClient.postWithMsg<void>('/sis/personLib/add', data);
}
/**

View File

@ -2,18 +2,14 @@ import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
import {orderChargeList} from "#/api/property/chargeManagement";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
component: 'Select',
fieldName: 'orderId',
label: '订单号',
},
{
component: 'Input',
fieldName: 'userId',
label: '租赁人id',
},
{
component: 'Select',
componentProps: {
@ -27,16 +23,19 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'userName',
label: '租赁人',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'chargeDate',
label: '收费日期',
},
// {
// component: 'RangePicker',
// componentProps: {
// showTime: {
// format: 'HH:mm:ss'
// },
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// placeholder: ['开始时间', '结束时间']
// },
// fieldName: 'chargeDate',
// label: '收费日期',
// },
{
component: 'Select',
componentProps: {
@ -71,7 +70,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'orderId',
},
{
title: '租赁人id',
title: '租赁合同编号',
field: 'userId',
},
{
@ -129,6 +128,10 @@ export const columns: VxeGridProps['columns'] = [
},
},
},
{
title: '创建时间',
field: 'createTime',
},
{
field: 'action',
fixed: 'right',
@ -148,16 +151,21 @@ export const modalSchema: FormSchemaGetter = () => [
triggerFields: [''],
},
},
// {
// label: '订单号',
// fieldName: 'orderId',
// component: 'Input',
// rules: 'required',
// },
{
label: '订单号',
fieldName: 'orderId',
component: 'Input',
rules: 'required',
component: 'ApiSelect',
componentProps: {
api: orderChargeList,
resultField: 'rows',
valueField: 'orderId',
},
{
label: '租赁人id',
fieldName: 'userId',
component: 'Input',
rules: 'required',
},
{

View File

@ -8,13 +8,12 @@ import {
type VxeGridProps
} from '#/adapter/vxe-table';
import {
orderChargeExport,
orderChargeList,
orderChargeRemove,
} from '#/api/property/chargeManagement';
import type { OrderChargeForm } from '#/api/property/chargeManagement/model';
import { commonDownloadExcel } from '#/utils/file/download';
import orderChargeModal from './orderCharge-modal.vue';
import orderChargeDetail from './orderCharge-detail.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
@ -63,6 +62,15 @@ const [OrderChargeModal, modalApi] = useVbenModal({
connectedComponent: orderChargeModal,
});
const [orderChargeDetailModal, orderChargeDetailApi] = useVbenModal({
connectedComponent: orderChargeDetail,
});
async function handleInfo(row: Required<OrderChargeForm>) {
orderChargeDetailApi.setData({ id: row.id });
orderChargeDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
@ -91,12 +99,6 @@ function handleMultiDelete() {
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(orderChargeExport, '绿植租赁-订单收费数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
@ -104,12 +106,6 @@ function handleDownloadExcel() {
<BasicTable table-title="绿植租赁-订单收费列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:orderCharge:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
@ -129,6 +125,11 @@ function handleDownloadExcel() {
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:orderCharge:edit']"
@click.stop="handleEdit(row)"
@ -153,5 +154,6 @@ function handleDownloadExcel() {
</template>
</BasicTable>
<OrderChargeModal @reload="tableApi.query()" />
<orderChargeDetailModal/>
</Page>
</template>

View File

@ -0,0 +1,83 @@
<script setup lang="ts">
import type {orderChargeDetailForm} from '#/api/property/chargeManagement/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 {orderChargeInfo} from '#/api/property/chargeManagement';
import {renderDict} from "#/utils/render";
dayjs.extend(duration);
dayjs.extend(relativeTime);
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
orderChargeDetail.value = null;
},
});
const orderChargeDetail = shallowRef<null | orderChargeDetailForm>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await orderChargeInfo(id);
orderChargeDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="查看收费" class="w-[70%]">
<Descriptions v-if="orderChargeDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="订单号">
{{ orderChargeDetail.orderId }}
</DescriptionsItem>
<DescriptionsItem label="租赁合同编号">
{{ orderChargeDetail.orderId }}
</DescriptionsItem>
<DescriptionsItem label="租赁人">
{{ orderChargeDetail.userName}}
</DescriptionsItem>
<DescriptionsItem label="租金">
{{ orderChargeDetail.rent }}
</DescriptionsItem>
<DescriptionsItem label="押金">
{{ orderChargeDetail.deposit }}
</DescriptionsItem>
<DescriptionsItem label="违约金">
{{ orderChargeDetail.penalty }}
</DescriptionsItem>
<DescriptionsItem label="开票状态" v-if="orderChargeDetail.invoiceStatus!=null">
<component
:is="renderDict(orderChargeDetail.invoiceStatus,'pro_invoice_status')"
/>
</DescriptionsItem>
<DescriptionsItem label="发票类型">
{{ orderChargeDetail.invoiceType }}
</DescriptionsItem>
<DescriptionsItem label="收费状态" v-if="orderChargeDetail.chargeStatus!=null">
<component
:is="renderDict(orderChargeDetail.chargeStatus,'pro_charging_status')"
/>
</DescriptionsItem>
<DescriptionsItem label="产品编号">
{{ orderChargeDetail.createTime }}
</DescriptionsItem>
<DescriptionsItem label="购买植物">
{{ orderChargeDetail.createTime }}
</DescriptionsItem>
<DescriptionsItem label="价格">
{{ orderChargeDetail.createTime }}
</DescriptionsItem>
<DescriptionsItem label="产品图片">
<img :src="orderChargeDetail.imgPath" alt="">
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@ -0,0 +1,229 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
import {h} from "vue";
import {Rate} from "ant-design-vue";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'maintainName',
label: '养护名称',
},
{
component: 'Select',
componentProps: {
},
fieldName: 'state',
label: '处理状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '养护名称',
field: 'maintainName',
},
{
title: '小区id',
field: 'communityId',
},
{
title: '建筑id',
field: 'buildingId',
},
{
title: '楼层id',
field: 'floorId',
},
{
title: '服务类型',
field: 'serveType',
},
{
title: '养护周期类型',
field: 'periodType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_TIME_UNIT 便于维护
return renderDict(row.periodType, 'wy_time_unit');
},
},
},
{
title: '养护周期频次',
field: 'periodFrequency',
},
{
title: '订单id',
field: 'orderId',
},
{
title: '计划执行时间',
field: 'startTime',
},
{
title: '计划完成时间',
field: 'endTime',
},
{
title: '巡检结果',
field: 'inspectResult',
},
{
title: '处理措施',
field: 'measure',
},
{
title: '客户评分',
field: 'customerScore',
slots: {
default: ({ row }) => {
return h(Rate, {
value: row.customerScore || 0,
disabled: true,
});
},
},
width:200
},
{
title: '客户反馈',
field: 'customerAdvice',
},
{
title: '处理状态',
field: 'state',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '养护名称',
fieldName: 'maintainName',
component: 'Input',
rules: 'required',
},
{
label: '小区id',
fieldName: 'communityId',
component: 'Input',
rules: 'required',
},
{
label: '建筑id',
fieldName: 'buildingId',
component: 'Input',
rules: 'required',
},
{
label: '楼层id',
fieldName: 'floorId',
component: 'Input',
rules: 'required',
},
{
label: '服务类型',
fieldName: 'serveType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '养护周期类型',
fieldName: 'periodType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_TIME_UNIT 便于维护
options: getDictOptions('wy_time_unit'),
},
rules: 'selectRequired',
},
{
label: '养护周期频次',
fieldName: 'periodFrequency',
component: 'Input',
rules: 'required',
},
{
label: '订单id',
fieldName: 'orderId',
component: 'Input',
rules: 'required',
},
{
label: '计划执行时间',
fieldName: 'startTime',
component: 'DatePicker',
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',
},
{
label: '巡检结果',
fieldName: 'inspectResult',
component: 'Input',
},
{
label: '处理措施',
fieldName: 'measure',
component: 'Input',
},
{
label: '客户评分',
fieldName: 'customerScore',
component: 'Rate',
componentProps: {
allowHalf: false,
count: 5,
tooltips: ['1星', '2星', '3星', '4星', '5星'],
defaultValue: 0
},
rules: 'required',
},
{
label: '客户反馈',
fieldName: 'customerAdvice',
component: 'Textarea',
},
{
label: '处理状态',
fieldName: 'state',
component: 'Select',
componentProps: {
},
},
];

View File

@ -1,5 +1,143 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
orderMaintainList,
orderMaintainRemove,
} from '#/api/property/conservationManagement';
import type { OrderMaintainForm } from '#/api/property/conservationManagement/model';
import orderMaintainModal from './orderMaintain-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,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await orderMaintainList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
id: 'property-orderMaintain-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [OrderMaintainModal, modalApi] = useVbenModal({
connectedComponent: orderMaintainModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<OrderMaintainForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<OrderMaintainForm>) {
await orderMaintainRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<OrderMaintainForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await orderMaintainRemove(ids);
await tableApi.query();
},
});
}
</script>
<template>
<div>
养护管理
</div>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-订单养护管理列表">
<template #toolbar-tools>
<Space>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:orderMaintain:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:orderMaintain:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:orderMaintain: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:orderMaintain:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<OrderMaintainModal @reload="tableApi.query()" />
</Page>
</template>

View File

@ -0,0 +1,93 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { orderMaintainAdd, orderMaintainInfo, orderMaintainUpdate } from '#/api/property/conservationManagement';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
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',
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await orderMaintainInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? orderMaintainUpdate(data) : orderMaintainAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@ -46,6 +46,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '产品分类',
field: 'plantType',
slots: {
default: ({ row }) => {
return renderDict(row.plantType, 'pro_product_classification');
},
},
},
{
title: '图片',
@ -120,11 +125,6 @@ export const modalSchema: FormSchemaGetter = () => [
},
rules: 'required',
},
{
label: '图片',
fieldName: 'imgPath',
component: 'Input',
},
{
label: '规格',
fieldName: 'specification',
@ -152,6 +152,15 @@ export const modalSchema: FormSchemaGetter = () => [
},
rules: 'selectRequired',
},
{
label: '产品图片',
fieldName: 'imgPath',
component: 'ImageUpload',
componentProps: {
maxCount: 1,
},
formItemClass: 'col-span-2',
},
{
label: '备注',
fieldName: 'remark',

View File

@ -8,16 +8,14 @@ import {
type VxeGridProps
} from '#/adapter/vxe-table';
import {
plantsProductExport,
plantsProductList,
plantsProductRemove,
} from '#/api/property/productManagement';
import type { PropertyForm } from '#/api/property/productManagement/model';
import { commonDownloadExcel } from '#/utils/file/download';
import PlantsProductModal from './plantsProduct-modal.vue';
import PlantsProductDetail from './plantsProduct-detail.vue';
import { columns, querySchema } from './data';
import { ref } from 'vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
@ -101,12 +99,6 @@ function handleMultiDelete() {
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(plantsProductExport, '绿植租赁-绿植产品数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
@ -114,12 +106,6 @@ function handleDownloadExcel() {
<BasicTable table-title="绿植租赁-绿植产品列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:property:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger

View File

@ -2,8 +2,8 @@
import type {plantsProduct} from '#/api/property/productManagement/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {visitorManagementInfo} from '#/api/property/visitorManagement';
import {Descriptions, DescriptionsItem, Rate} from 'ant-design-vue';
import {plantsProductInfo} from '#/api/property/productManagement';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
@ -21,7 +21,7 @@ async function handleOpenChange(open: boolean) {
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await visitorManagementInfo(id);
const response = await plantsProductInfo(id);
plantsProductDetail.value = response;
modalApi.modalLoading(false);
}
@ -41,9 +41,6 @@ async function handleOpenChange(open: boolean) {
:is="renderDict(plantsProductDetail.plantType,'pro_product_classification')"
/>
</DescriptionsItem>
<DescriptionsItem label="图片">
{{ plantsProductDetail.imgPath }}
</DescriptionsItem>
<DescriptionsItem label="规格">
{{ plantsProductDetail.specification }}
</DescriptionsItem>
@ -58,6 +55,9 @@ async function handleOpenChange(open: boolean) {
:is="renderDict(plantsProductDetail.state,'product_management_status')"
/>
</DescriptionsItem>
<DescriptionsItem label="产品图片">
<img :src="plantsProductDetail.imgPath" alt="">
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ plantsProductDetail.remark }}
</DescriptionsItem>

View File

@ -17,7 +17,7 @@ const title = computed(() => {
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,
@ -50,6 +50,10 @@ const [BasicModal, modalApi] = useVbenModal({
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await plantsProductInfo(id);
record.state = record.state?.toString()
record.plantType = record.state?.toString()
record.specification = record.specification?.toString()
await formApi.setValues(record);
}
await markInitialized();

View File

@ -27,33 +27,9 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'serveStatus',
label: '预约状态',
},
{
component: 'RangePicker',
componentProps: {
showTime: {
format: 'HH:mm:ss'
},
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
placeholder: ['开始时间', '结束时间']
},
fieldName: 'visitingTimeRange',
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',

View File

@ -27,33 +27,32 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'serveStatus',
label: '预约状态',
},
{
component: 'RangePicker',
componentProps: {
showTime: {
format: 'HH:mm:ss'
},
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
placeholder: ['开始时间', '结束时间']
},
fieldName: 'visitingTimeRange',
label: '拜访时间',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'updateTime',
label: '提交时间',
},
// {
// component: 'RangePicker',
// componentProps: {
// showTime: {
// format: 'HH:mm:ss'
// },
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// placeholder: ['开始时间', '结束时间']
// },
// fieldName: 'visitingTimeRange',
// label: '拜访时间',
// },
// {
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// fieldName: 'updateTime',
// label: '提交时间',
// },
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',