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:
FLL 2025-07-03 17:49:34 +08:00
commit e21c76cc6f
9 changed files with 111 additions and 122 deletions

View File

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

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; location?: string;
locationDetail?: string;
/** /**
* *
*/ */

View File

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

View File

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

View File

@ -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',
}, },
},
]); ]);
} }

View File

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

View File

@ -34,7 +34,7 @@ async function queryUser(value: string, callback: any) {
const options = res.rows.map((user) => ({ const options = res.rows.map((user) => ({
label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber, label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
value: user.userId, value: user.userId,
userName: user.userName, userName: user.nickName,
gender: user.sex, gender: user.sex,
phone: user.phonenumber, phone: user.phonenumber,
})); }));
@ -62,10 +62,9 @@ async function getUserInfo(val:number|string) {
const user = res.user const user = res.user
if (user) { if (user) {
data.value = [{ data.value = [{
// label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber, label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
label: user.nickName + '-' + user.phonenumber,
value: user.userId, value: user.userId,
userName: user.userName, userName: user.nickName,
gender: user.sex, gender: user.sex,
phone: user.phonenumber, phone: user.phonenumber,
}] }]

View File

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

View File

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