This commit is contained in:
parent
4bf741f63d
commit
73b2d27fa6
@ -77,6 +77,11 @@ export interface RentalPlanForm extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
remarks?: string;
|
remarks?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案下绿植产品
|
||||||
|
*/
|
||||||
|
productList:any[];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RentalPlanQuery extends PageQuery {
|
export interface RentalPlanQuery extends PageQuery {
|
||||||
|
@ -29,7 +29,7 @@ export interface Resident_unitVO {
|
|||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
phone: number;
|
phone: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入驻位置
|
* 入驻位置
|
||||||
@ -87,7 +87,7 @@ export interface Resident_unitForm extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
phone?: number;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入驻位置
|
* 入驻位置
|
||||||
@ -140,7 +140,7 @@ export interface Resident_unitQuery extends PageQuery {
|
|||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
phone?: number;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入驻位置
|
* 入驻位置
|
||||||
@ -197,13 +197,15 @@ export interface Unit extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
phone?: number;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入驻位置
|
* 入驻位置
|
||||||
*/
|
*/
|
||||||
location?: string;
|
location?: string;
|
||||||
|
|
||||||
|
locationDetail?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入驻时间
|
* 入驻时间
|
||||||
*/
|
*/
|
||||||
|
@ -69,7 +69,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'rentalPeriod',
|
field: 'rentalPeriod',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
return renderDict(row.rentalPeriod, 'wy_sjdw');
|
return renderDict(row.rentalPeriod, 'wy_time_unit');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: 100
|
width: 100
|
||||||
|
@ -150,12 +150,12 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
<ghost-button
|
<!-- <ghost-button-->
|
||||||
v-access:code="['property:rentalOrder:edit']"
|
<!-- v-access:code="['property:rentalOrder:edit']"-->
|
||||||
@click.stop="handleEdit(row)"
|
<!-- @click.stop="handleEdit(row)"-->
|
||||||
>
|
<!-- >-->
|
||||||
{{ $t('pages.common.edit') }}
|
<!-- {{ $t('pages.common.edit') }}-->
|
||||||
</ghost-button>
|
<!-- </ghost-button>-->
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
|
@ -14,10 +14,11 @@ import {
|
|||||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
import {plantsProductList} from "#/api/property/productManagement";
|
import {plantsProductList} from "#/api/property/productManagement";
|
||||||
import {rentalPlanList} from "#/api/property/rentalPlan";
|
import {rentalPlanInfo, rentalPlanList} from "#/api/property/rentalPlan";
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
import type {PropertyVO} from "#/api/property/productManagement/model";
|
import type {PropertyVO} from "#/api/property/productManagement/model";
|
||||||
import type {RentalPlanVO} from "#/api/property/rentalPlan/model";
|
import type {RentalPlanVO} from "#/api/property/rentalPlan/model";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@ -84,27 +85,42 @@ const modalSchema = [
|
|||||||
{
|
{
|
||||||
label: '租赁方案',
|
label: '租赁方案',
|
||||||
fieldName: 'planId',
|
fieldName: 'planId',
|
||||||
component: 'Select',
|
component: 'ApiSelect',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
// 仅当 租赁方式 为 2(套餐) 时显示
|
// 仅当 租赁方式 为 2(套餐) 时显示
|
||||||
show: (formValues: any) => formValues.rentalType === '2',
|
show: (formValues: any) => formValues.rentalType === '2',
|
||||||
triggerFields: ['rentalType'],
|
triggerFields: ['rentalType'],
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
formItemClass: 'col-span-2'
|
formItemClass: 'col-span-2',
|
||||||
|
componentProps: {
|
||||||
|
api: async () => {
|
||||||
|
const res = await rentalPlanList({pageNum: 1, pageSize: 1000, state: 1});
|
||||||
|
planList.value = res.rows || [];
|
||||||
|
return planList.value.map(item => ({
|
||||||
|
label: item.planName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
onChange: async (value: string) => {
|
||||||
|
await getPlanProducts(value)
|
||||||
|
// const plan= planList.value.find(item => item.id === value);
|
||||||
|
},
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: (input: any, option: any) =>
|
||||||
|
option.label.toLowerCase().includes(input.toLowerCase()),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '方案详情',
|
label: '方案详情',
|
||||||
fieldName: 'planInfo',
|
fieldName: 'planInfo',
|
||||||
component: 'Input',
|
component: 'Text',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
// 仅当 租赁方式 为 2(套餐) 时显示
|
// 仅当 租赁方式 为 2(套餐) 时显示
|
||||||
show: (formValues: any) => formValues.rentalType === '2' && formValues.planId != null,
|
show: (formValues: any) => formValues.rentalType === '2' && formValues.planId != null,
|
||||||
triggerFields: ['rentalType'],
|
triggerFields: ['planId', 'rentalType'],
|
||||||
},
|
},
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
componentProps: {}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '绿植产品',
|
label: '绿植产品',
|
||||||
@ -138,6 +154,12 @@ const modalSchema = [
|
|||||||
fieldName: 'productNum',
|
fieldName: 'productNum',
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
const formValues = await formApi.getValues();
|
||||||
|
if(formValues.productNum){
|
||||||
|
await formApi.setValues({
|
||||||
|
totalAmount: plants.rent*formValues.productNum,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: (input: any, option: any) =>
|
filterOption: (input: any, option: any) =>
|
||||||
@ -164,32 +186,30 @@ const modalSchema = [
|
|||||||
{
|
{
|
||||||
label: '应付总额',
|
label: '应付总额',
|
||||||
fieldName: 'totalAmount',
|
fieldName: 'totalAmount',
|
||||||
component: 'span',
|
component: 'InputNumber',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
// 仅当 租赁方式 为 1(单点) 时显示
|
// 仅当 租赁方式 为 1(单点) 时显示
|
||||||
show: (formValues: any) => formValues.totalAmount,
|
show: (formValues: any) => formValues.totalAmount,
|
||||||
triggerFields: ['totalAmount'],
|
triggerFields: ['totalAmount'],
|
||||||
|
disabled:true,
|
||||||
|
},
|
||||||
|
componentProps: {
|
||||||
|
addonAfter: '元',
|
||||||
|
precision: 2,
|
||||||
|
stringMode: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// label: '支付状态',
|
label: '是否续租',
|
||||||
// fieldName: 'paymentStatus',
|
fieldName: 'isRelet',
|
||||||
// component: 'Select',
|
component: 'RadioGroup',
|
||||||
// componentProps: {
|
componentProps: {
|
||||||
// options: getDictOptions('pro_charging_status'),
|
buttonStyle: 'solid',
|
||||||
// },
|
optionType: 'button',
|
||||||
// rules: 'selectRequired',
|
options: getDictOptions('wy_sf'),
|
||||||
// },
|
},
|
||||||
// {
|
rules: 'required'
|
||||||
// label: '是否续租',
|
},
|
||||||
// fieldName: 'isRelet',
|
|
||||||
// component: 'RadioGroup',
|
|
||||||
// componentProps: {
|
|
||||||
// buttonStyle: 'solid',
|
|
||||||
// optionType: 'button',
|
|
||||||
// options: getDictOptions('wy_sf'),
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
label: '合同状态',
|
label: '合同状态',
|
||||||
fieldName: 'contractStatus',
|
fieldName: 'contractStatus',
|
||||||
@ -263,8 +283,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
const {id} = modalApi.getData() as { id?: number | string };
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
await getPlanList()
|
|
||||||
// await getPlantsList()
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await rentalOrderInfo(id);
|
const record = await rentalOrderInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
@ -290,6 +308,10 @@ async function handleConfirm() {
|
|||||||
data.productId = undefined;
|
data.productId = undefined;
|
||||||
data.productNum = undefined;
|
data.productNum = undefined;
|
||||||
}
|
}
|
||||||
|
if(data.rentalTime){
|
||||||
|
data.startTime=data.rentalTime[0];
|
||||||
|
data.endTime=data.rentalTime[1];
|
||||||
|
}
|
||||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@ -302,56 +324,17 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取有库存的绿植
|
//获取有库存的绿植
|
||||||
async function getPlantsList() {
|
async function getPlanProducts(id: string) {
|
||||||
let params = {
|
const res = await rentalPlanInfo(id)
|
||||||
pageNum: 1,
|
if (res.productList) {
|
||||||
pageSize: 1000,
|
|
||||||
inventory: 0
|
|
||||||
}
|
}
|
||||||
const res = await plantsProductList(params)
|
formApi.updateSchema([{
|
||||||
plantsList.value = res.rows
|
fieldName: 'planInfo',
|
||||||
// formApi.updateSchema([
|
componentProps: {
|
||||||
// {
|
isHtml: true,
|
||||||
// componentProps: () => ({
|
value: '<div>222222222222222222</div>'
|
||||||
// class: 'w-full',
|
|
||||||
// options: res.rows.map(item => ({
|
|
||||||
// label: item.plantName + '-' + item.plantCode + '\xa0\xa0租金(元):' + item.rent + '\xa0\xa0库存数量:' + item.inventory,
|
|
||||||
// value: item.id,
|
|
||||||
// })),
|
|
||||||
// placeholder: '请选择绿植',
|
|
||||||
// showSearch: true,
|
|
||||||
// filterOption: (input: any, option: any) =>
|
|
||||||
// option.label.toLowerCase().includes(input.toLowerCase()),
|
|
||||||
// }),
|
|
||||||
// fieldName: 'productId',
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取绿植租赁方案
|
|
||||||
async function getPlanList() {
|
|
||||||
let params = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 1000,
|
|
||||||
state: 0,
|
|
||||||
}
|
|
||||||
const res = await rentalPlanList(params)
|
|
||||||
planList.value = res.rows
|
|
||||||
formApi.updateSchema([
|
|
||||||
{
|
|
||||||
componentProps: () => ({
|
|
||||||
class: 'w-full',
|
|
||||||
options: res.rows.map(item => ({
|
|
||||||
label: item.planName,
|
|
||||||
value: item.id,
|
|
||||||
})),
|
|
||||||
placeholder: '请选择绿植',
|
|
||||||
showSearch: true,
|
|
||||||
filterOption: (input: any, option: any) =>
|
|
||||||
option.label.toLowerCase().includes(input.toLowerCase()),
|
|
||||||
}),
|
|
||||||
fieldName: 'planId',
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,15 +39,15 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
// {
|
||||||
title: '序号',
|
// title: '序号',
|
||||||
field: 'id',
|
// field: 'id',
|
||||||
slots: {
|
// slots: {
|
||||||
default: ({ rowIndex }) => {
|
// default: ({ rowIndex }) => {
|
||||||
return (rowIndex + 1).toString();
|
// return (rowIndex + 1).toString();
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '员工编号',
|
title: '员工编号',
|
||||||
field: 'userId',
|
field: 'userId',
|
||||||
|
@ -27,16 +27,16 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{type: 'checkbox', width: 60},
|
{type: 'checkbox', width: 60},
|
||||||
{
|
// {
|
||||||
title: '序号',
|
// title: '序号',
|
||||||
field: 'id',
|
// field: 'id',
|
||||||
slots: {
|
// slots: {
|
||||||
default: ({ rowIndex }) => {
|
// default: ({ rowIndex }) => {
|
||||||
return (rowIndex + 1).toString();
|
// return (rowIndex + 1).toString();
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
width: 60
|
// width: 60
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '单位编号',
|
title: '单位编号',
|
||||||
field: 'unitNumber',
|
field: 'unitNumber',
|
||||||
@ -71,11 +71,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'phone',
|
field: 'phone',
|
||||||
width: 100
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '入驻位置',
|
// title: '入驻位置',
|
||||||
field: 'location',
|
// field: 'location',
|
||||||
width: 100,
|
// width: 100,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '入驻时间',
|
title: '入驻时间',
|
||||||
field: 'time',
|
field: 'time',
|
||||||
@ -87,11 +87,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
slots: {default: 'state'},
|
slots: {default: 'state'},
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '员工数量',
|
// title: '员工数量',
|
||||||
field: 'number',
|
// field: 'number',
|
||||||
width: 100,
|
// width: 100,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
|
@ -60,7 +60,7 @@ async function handleOpenChange(open: boolean) {
|
|||||||
{{ unitDetail.contactPerson +'-'+unitDetail.phone}}
|
{{ unitDetail.contactPerson +'-'+unitDetail.phone}}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="入驻位置" :span="2">
|
<DescriptionsItem label="入驻位置" :span="2">
|
||||||
{{ unitDetail.location }}
|
{{ unitDetail.locationDetail }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="入驻时间">
|
<DescriptionsItem label="入驻时间">
|
||||||
{{ unitDetail.time }}
|
{{ unitDetail.time }}
|
||||||
|
Loading…
Reference in New Issue
Block a user