This commit is contained in:
@@ -31,14 +31,14 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'rentalType',
|
||||
label: '租赁方式',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_charging_status')
|
||||
},
|
||||
fieldName: 'paymentStatus',
|
||||
label: '支付状态',
|
||||
},
|
||||
// {
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_charging_status')
|
||||
// },
|
||||
// fieldName: 'paymentStatus',
|
||||
// label: '支付状态',
|
||||
// },
|
||||
|
||||
];
|
||||
|
||||
@@ -99,16 +99,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
field: 'paymentStatus',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.paymentStatus, 'pro_charging_status');
|
||||
},
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// title: '支付状态',
|
||||
// field: 'paymentStatus',
|
||||
// slots: {
|
||||
// default: ({ row }) => {
|
||||
// return renderDict(row.paymentStatus, 'pro_charging_status');
|
||||
// },
|
||||
// },
|
||||
// width: 100
|
||||
// },
|
||||
{
|
||||
title: '是否续租',
|
||||
field: 'isRelet',
|
||||
|
@@ -74,11 +74,11 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="支付状态">
|
||||
<component
|
||||
:is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="支付状态">-->
|
||||
<!-- <component-->
|
||||
<!-- :is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"-->
|
||||
<!-- />-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="是否续租">
|
||||
<component
|
||||
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
||||
|
@@ -156,9 +156,9 @@ const modalSchema = [
|
||||
min: 1,
|
||||
max: plantInfo.value?.inventory,
|
||||
precision: 0,
|
||||
onChange:async ()=>{
|
||||
onChange: async () => {
|
||||
const formValues = await formApi.getValues();
|
||||
if (formValues.productNum&&plantInfo.value?.rent) {
|
||||
if (formValues.productNum && plantInfo.value?.rent) {
|
||||
singleAmount.value = (plantInfo.value.rent * formValues.productNum).toFixed(2);
|
||||
}
|
||||
},
|
||||
@@ -182,7 +182,6 @@ const modalSchema = [
|
||||
step: 1,
|
||||
placeholder: '租赁数量不可超出绿植产品库存数量',
|
||||
onChange: async (value: number) => {
|
||||
console.log(value,'================vvvv')
|
||||
if (plantInfo.value) {
|
||||
singleAmount.value = (plantInfo.value.rent * value).toFixed(2);
|
||||
}
|
||||
@@ -202,8 +201,8 @@ const modalSchema = [
|
||||
slots: {default: 'totalAmount'},
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues: any) => formValues.productNum&&formValues.productId&&formValues.rentalType === '1',
|
||||
triggerFields: ['productNum','rentalType'],
|
||||
show: (formValues: any) => formValues.productNum && formValues.productId && formValues.rentalType === '1',
|
||||
triggerFields: ['productNum', 'rentalType'],
|
||||
disabled: true,
|
||||
},
|
||||
labelWidth: 110
|
||||
@@ -317,14 +316,14 @@ async function handleConfirm() {
|
||||
} else {
|
||||
data.productId = undefined;
|
||||
data.productNum = undefined;
|
||||
data.productList = plantsList.value
|
||||
data.productList = planProducts.value
|
||||
data.totalAmount = totalAmount.value
|
||||
}
|
||||
if (data.rentalTime) {
|
||||
data.startTime = data.rentalTime[0];
|
||||
data.endTime = data.rentalTime[1];
|
||||
}
|
||||
data.paymentStatus=0
|
||||
data.paymentStatus = 0
|
||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -339,7 +338,12 @@ async function handleConfirm() {
|
||||
//获取有库存的绿植
|
||||
async function getPlanProducts(id: string) {
|
||||
const res = await rentalPlanInfo(id)
|
||||
plantsList.value=res.productList;
|
||||
planProducts.value = res.productList.map(item => ({
|
||||
id:item.productId,
|
||||
plantName: item.product?.plantName,
|
||||
rent: item.product?.rent,
|
||||
inventory: item.productNum,
|
||||
}))
|
||||
totalAmount.value = planProducts.value?.reduce((sum, item: any) => sum + (item.rent * item.inventory), 0).toFixed(2)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user