预约车问题修复
This commit is contained in:
parent
7483216b82
commit
37ca7a532e
|
|
@ -1,6 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="custom-date-picker">
|
<div class="custom-date-picker">
|
||||||
<el-button @click="showPicker = !showPicker" :size="size" class="date-picker-button">
|
<el-button
|
||||||
|
@click="showPicker = !showPicker"
|
||||||
|
:size="size"
|
||||||
|
class="date-picker-button"
|
||||||
|
:disabled="props.isDisabled"
|
||||||
|
>
|
||||||
{{ displayDate }}
|
{{ displayDate }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -25,7 +30,7 @@ const disabledDate = (date) => {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
// 禁用今天之前的日期
|
// 禁用今天之前的日期
|
||||||
// return date.getTime() < today.getTime()
|
// return date.getTime() < today.getTime()
|
||||||
return date.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0);
|
return date.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -65,6 +70,10 @@ const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
isDisabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'onLeaseDateChange'])
|
const emit = defineEmits(['update:modelValue', 'onLeaseDateChange'])
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,19 @@
|
||||||
v-model="goods.isChecked"
|
v-model="goods.isChecked"
|
||||||
@change="onChangeGoods(index)"
|
@change="onChangeGoods(index)"
|
||||||
:key="goods.id"
|
:key="goods.id"
|
||||||
|
:disabled="goods.maStatus != 2"
|
||||||
>
|
>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="9" class="goods-info">
|
<el-col :span="9" class="goods-info">
|
||||||
<img :src="goods.picUrl" alt="" />
|
<div class="img-box">
|
||||||
|
<img :src="goods.picUrl" alt="" />
|
||||||
|
<div class="img-mask" v-if="goods.maStatus != 2">
|
||||||
|
<span> 装备已下架 </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="goods-code">
|
<div class="goods-code">
|
||||||
<div style="font-size: 14px; font-weight: bold">
|
<div style="font-size: 14px; font-weight: bold">
|
||||||
{{ goods.deviceName }}
|
{{ goods.deviceName }}
|
||||||
|
|
@ -112,6 +119,7 @@
|
||||||
size="large"
|
size="large"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
@onLeaseDateChange="onLeaseDateChange"
|
@onLeaseDateChange="onLeaseDateChange"
|
||||||
|
:isDisabled="goods.maStatus != 2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -133,6 +141,7 @@
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="goods.deviceCount || 1"
|
:max="goods.deviceCount || 1"
|
||||||
size="small"
|
size="small"
|
||||||
|
:disabled="goods.maStatus != 2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -406,7 +415,9 @@ const onChangeAll = (e: boolean) => {
|
||||||
cardList.value.forEach((item: any) => {
|
cardList.value.forEach((item: any) => {
|
||||||
item.isChecked = e
|
item.isChecked = e
|
||||||
item.devInfoVoList.forEach((j: any) => {
|
item.devInfoVoList.forEach((j: any) => {
|
||||||
j.isChecked = e
|
if (j.maStatus == 2) {
|
||||||
|
j.isChecked = e
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +430,11 @@ const onChangeGoods = (index: number) => {
|
||||||
}
|
}
|
||||||
// 公司全选事件
|
// 公司全选事件
|
||||||
const onChangeCompany = (e: boolean, index: number, item: any) => {
|
const onChangeCompany = (e: boolean, index: number, item: any) => {
|
||||||
cardList.value[index].devInfoVoList.every((j) => (j.isChecked = e))
|
cardList.value[index].devInfoVoList.every((j: any) => {
|
||||||
|
if (j.maStatus == 2) {
|
||||||
|
j.isChecked = e
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算所有装备
|
// 计算所有装备
|
||||||
|
|
@ -435,7 +450,7 @@ const allChecked = computed(() => {
|
||||||
if (cardList.value.length < 1) {
|
if (cardList.value.length < 1) {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
return cardList.value.every((e: any) => e.isChecked === true)
|
return cardList.value.every((e: any) => e.maStatus == 2 && e.isChecked === true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -444,19 +459,19 @@ const amountDevice = computed(() => {
|
||||||
let amountNum = 0
|
let amountNum = 0
|
||||||
cardList.value.forEach((e: any) => {
|
cardList.value.forEach((e: any) => {
|
||||||
e.devInfoVoList.forEach((g: any) => {
|
e.devInfoVoList.forEach((g: any) => {
|
||||||
if (g.isChecked) {
|
if (g.isChecked && g.maStatus == 2) {
|
||||||
amountNum++
|
amountNum++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return amountNum
|
return amountNum
|
||||||
})
|
})
|
||||||
// 已勾选的装备数量
|
// 已勾选的装备列表
|
||||||
const amountDeviceList = computed(() => {
|
const amountDeviceList = computed(() => {
|
||||||
let selectList: any = []
|
let selectList: any = []
|
||||||
cardList.value.forEach((e: any) => {
|
cardList.value.forEach((e: any) => {
|
||||||
e.devInfoVoList.forEach((g: any) => {
|
e.devInfoVoList.forEach((g: any) => {
|
||||||
if (g.isChecked) {
|
if (g.isChecked && g.maStatus == 2) {
|
||||||
selectList.push(g)
|
selectList.push(g)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -469,7 +484,7 @@ const orderAmountPice = computed(() => {
|
||||||
let orderAmountPice = 0
|
let orderAmountPice = 0
|
||||||
cardList.value.forEach((e: any) => {
|
cardList.value.forEach((e: any) => {
|
||||||
e.devInfoVoList.forEach((g: any) => {
|
e.devInfoVoList.forEach((g: any) => {
|
||||||
if (g.isChecked) {
|
if (g.isChecked && g.maStatus == 2) {
|
||||||
orderAmountPice = g.num * g.dayLeasePrice * g.days + orderAmountPice
|
orderAmountPice = g.num * g.dayLeasePrice * g.days + orderAmountPice
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -854,6 +869,30 @@ getReceiptGoodsAddress()
|
||||||
display: flex;
|
display: flex;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
|
||||||
|
.img-box {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.img-mask {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 10px;
|
||||||
|
opacity: 0.6;
|
||||||
|
background-color: #333;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 160px;
|
width: 160px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue