绿植管理
This commit is contained in:
@@ -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',
|
||||
|
@@ -1,23 +1,21 @@
|
||||
<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 { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
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
|
||||
|
@@ -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>
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user