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