1、租赁订单
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
dev_ljl 2025-07-02 18:00:26 +08:00
parent 4bf741f63d
commit 73b2d27fa6
8 changed files with 108 additions and 118 deletions

View File

@ -77,6 +77,11 @@ export interface RentalPlanForm extends BaseEntity {
*/
remarks?: string;
/**
* 绿
*/
productList:any[];
}
export interface RentalPlanQuery extends PageQuery {

View File

@ -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;
/**
*
*/

View File

@ -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

View File

@ -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"

View File

@ -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,56 +324,17 @@ 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>'
},
},
]);
}

View File

@ -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',

View File

@ -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',

View File

@ -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 }}