冲突合并

This commit is contained in:
BianLzhaoMin 2024-11-26 18:10:28 +08:00
commit ff06debde4
5 changed files with 222 additions and 107 deletions

10
components.d.ts vendored
View File

@ -11,22 +11,14 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElTag: typeof import('element-plus/es')['ElTag']
EquipCard: typeof import('./src/components/equipCard.vue')['default'] EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default'] EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default']
EquipCardNew: typeof import('./src/components/equipCardNew/index.vue')['default'] EquipCardNew: typeof import('./src/components/equipCardNew/index.vue')['default']

1
env/.env.dev vendored
View File

@ -8,6 +8,7 @@ VITE_API_URL = '/proxyApi'
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 # VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
VITE_proxyTarget = 'http://192.168.2.246:18080' # 马帅 VITE_proxyTarget = 'http://192.168.2.246:18080' # 马帅
# VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
# VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证) # VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证)

View File

@ -35,7 +35,7 @@
</li> </li>
</ul> </ul>
<ul class="mobile-info"> <!-- <ul class="mobile-info">
<li>商城热线</li> <li>商城热线</li>
<li>供应商入驻开店续费资讯010-2345-1234</li> <li>供应商入驻开店续费资讯010-2345-1234</li>
<li>供应商咨询010-2345-1234</li> <li>供应商咨询010-2345-1234</li>
@ -45,84 +45,83 @@
工作时间周一至周五 8:30-1200 &nbsp;&nbsp;&nbsp;&nbsp; 工作时间周一至周五 8:30-1200 &nbsp;&nbsp;&nbsp;&nbsp;
1400-1730 1400-1730
</li> </li>
</ul> </ul> -->
</div> </div>
</div> </div>
</template> </template>
<style lang="scss"> <style lang="scss">
.footer-container { .footer-container {
margin-top: 40px; margin-top: 40px;
height: 650px; // height: 650px;
border-top: 1px solid #979797; border-top: 1px solid #979797;
background: url("../../assets/img/home/2023_12_01_beijing2/beijing2.png") background: url('../../assets/img/home/2023_12_01_beijing2/beijing2.png') no-repeat;
no-repeat; background-size: cover;
background-size: cover;
.icon-info { .icon-info {
height: 100px;
margin-top: 30px;
display: flex;
justify-content: space-around;
li {
height: 100px; height: 100px;
margin-top: 30px;
display: flex; display: flex;
justify-content: space-around; align-items: center;
li { span:first-child {
height: 100px; display: block;
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
border-radius: 50%;
border: 3px solid #3cb4a6;
color: #3cb4a6;
font-weight: bold;
font-size: 22px;
}
span:last-child {
display: block;
height: 50px;
margin-left: 15px;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: space-around;
span:first-child { i {
display: block; color: #8c8c8c;
width: 50px; }
height: 50px;
text-align: center; i:first-child {
line-height: 50px;
border-radius: 50%;
border: 3px solid #3cb4a6;
color: #3cb4a6;
font-weight: bold; font-weight: bold;
font-size: 22px; font-size: 18px;
color: #333;
} }
span:last-child {
display: block;
height: 50px;
margin-left: 15px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
i {
color: #8c8c8c;
}
i:first-child {
font-weight: bold;
font-size: 18px;
color: #333;
}
}
}
}
.mobile-info {
margin-top: 30px;
text-align: center;
li {
padding: 20px 0;
}
li:first-child {
padding: 30px 0;
font-size: 20px;
font-weight: bold;
letter-spacing: 1px;
}
li:last-child {
font-weight: bold;
} }
} }
} }
.mobile-info {
margin-top: 30px;
text-align: center;
li {
padding: 20px 0;
}
li:first-child {
padding: 30px 0;
font-size: 20px;
font-weight: bold;
letter-spacing: 1px;
}
li:last-child {
font-weight: bold;
}
}
}
</style> </style>

View File

@ -1,5 +1,15 @@
import { get } from '../../index' import { get, post } from '../../index'
// 预约车列表详情接口
export const getBookCarDetailsApi = () => { export const getBookCarDetailsApi = () => {
return get('/material-mall/bookCar/getBookCarDetails', {}) return get('/material-mall/bookCar/getBookCarDetails', {})
} }
// 预约车列表提交
export const submitBookCarApi = (data: any) => {
return post('/material-mall/order/submitBookCar', data)
}
// 预约车列表提交
export const deleteCartByIdApi = (data: any) => {
return post('/material-mall/bookCar/deleteById', data)
}

View File

@ -15,7 +15,9 @@
<el-row class="cart-th"> <el-row class="cart-th">
<el-col :span="2"> <el-col :span="2">
<div> <div>
<el-checkbox v-model="allChecked" @change="onChangeAll"> 全选 </el-checkbox> <el-checkbox v-model="allChecked" @change="onChangeAll" :key="allKey">
全选
</el-checkbox>
</div> </div>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="9">
@ -47,6 +49,7 @@
<div style="text-align: center"> <div style="text-align: center">
<el-checkbox <el-checkbox
v-model="item.isChecked" v-model="item.isChecked"
:key="index"
@change="onChangeCompany($event, index, item)" @change="onChangeCompany($event, index, item)"
> >
</el-checkbox> </el-checkbox>
@ -59,10 +62,14 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row class="cart-list" v-for="(goods, j) in item.devInfoVoList" :key="j"> <el-row class="cart-list" v-for="(goods, j) in item.devInfoVoList" :key="goods.id">
<el-col :span="1"> <el-col :span="1">
<div style="text-align: center"> <div style="text-align: center">
<el-checkbox v-model="goods.isChecked" @change="onChangeGoods(index)"> <el-checkbox
v-model="goods.isChecked"
@change="onChangeGoods(index)"
:key="goods.id"
>
</el-checkbox> </el-checkbox>
</div> </div>
</el-col> </el-col>
@ -79,7 +86,9 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<div class="lease-date"> <div class="lease-date">
<div>{{ goods.lease_date_string }}</div> <div v-if="goods.rentBeginTime && goods.rentEndTime">
{{ goods.rentBeginTime }}-{{ goods.rentEndTime }}
</div>
<el-date-picker <el-date-picker
style="width: 100px; margin-top: 10px" style="width: 100px; margin-top: 10px"
v-model="goods.lease_date" v-model="goods.lease_date"
@ -92,44 +101,65 @@
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="red-font"> <div class="red-font">
{{ goods.lease_pic }} {{ goods.dayLeasePrice }}
</div> </div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="red-font" style="color: #0062ff"> <div class="red-font" style="color: #0062ff">
{{ goods.lease_day }} {{ goods.days }}
</div> </div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div> <div>
<el-input-number <el-input-number
v-model="goods.goods_num" v-model="goods.num"
style="width: 100px" style="width: 100px"
:min="1" :min="1"
:max="goods.deviceCount"
size="small" size="small"
/> />
</div> </div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="red-font"> <div class="red-font">
{{ goods.goods_num * goods.lease_pic * goods.lease_day }} {{ goods.num * goods.days * goods.dayLeasePrice }}
</div> </div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div> <div>
<el-button <!-- <el-button
@click="onDeleteGoods(j)" link
type="text" @click="onDeleteGoods(goods.id)"
style="color: #ff4800; font-weight: bold" style="color: #ff4800; font-weight: bold"
> >
删除 删除
</el-button> </el-button> -->
<el-popconfirm
width="220"
:icon="InfoFilled"
icon-color="#626AEF"
title="确定删除该条预约车记录吗?"
@confirm="onDeleteGoods(goods.id)"
>
<template #reference>
<el-button link style="color: #ff4800; font-weight: bold">
删除</el-button
>
</template>
<template #actions="{ confirm }">
<el-button size="small">取消</el-button>
<el-button type="danger" size="small" @click="confirm()">
确定
</el-button>
</template>
</el-popconfirm>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="protocol-handle"> <div class="protocol-handle" v-if="cardList.length > 0">
<el-row style="display: flex; align-items: center"> <el-row style="display: flex; align-items: center">
<el-col :span="16"> <el-col :span="16">
<div class="checkbox-container"> <div class="checkbox-container">
@ -174,23 +204,33 @@
import Header from '../../components/header/index.vue' import Header from '../../components/header/index.vue'
import FooterInfo from '../../components/FooterInfo/index.vue' import FooterInfo from '../../components/FooterInfo/index.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { getBookCarDetailsApi } from '../../http/api/cart/index' import {
import moment from 'moment' getBookCarDetailsApi,
submitBookCarApi,
deleteCartByIdApi,
} from '../../http/api/cart/index'
import moment, { max } from 'moment'
import { InfoFilled } from '@element-plus/icons-vue'
const protocolChecked = ref<boolean>(false) const protocolChecked = ref<boolean>(false)
const allKey = ref(0)
const cardList = ref<any>([]) const cardList = ref<any>([])
const getBookCarDetailsData = async () => { const getBookCarDetailsData = async () => {
const res: any = await getBookCarDetailsApi() const res: any = await getBookCarDetailsApi()
console.log(res, '----')
cardList.value = res.data
cardList.value = []
cardList.value = JSON.parse(JSON.stringify(res.data))
cardList.value.forEach((e: any) => { cardList.value.forEach((e: any) => {
e.isChecked = false e.isChecked = false
e.devInfoVoList.forEach((j: any) => { e.devInfoVoList.forEach((j: any) => {
j.isChecked = false j.days = 0
j.num = 1
j.costs = 0
j.rentBeginTime = ''
j.rentEndTime = ''
}) })
}) })
@ -204,13 +244,30 @@ onMounted(() => {
// change // change
const onLeaseDateChange = (e: any, item: any) => { const onLeaseDateChange = (e: any, item: any) => {
item.lease_date_string = `${e[0]}${e[1]}` console.log(e, '*****')
item.lease_day = moment(e[1]).diff(e[0], 'day') if (!e) {
item.rentBeginTime = ''
item.rentEndTime = ''
item.days = 0
} else {
item.rentBeginTime = e[0]
item.rentEndTime = e[1]
item.days = moment(e[1]).diff(e[0], 'day')
}
} }
// //
const onDeleteGoods = (index: number) => { const onDeleteGoods = async (id: number | string) => {
console.log('删除---', index) const res: any = deleteCartByIdApi({ id })
if (res.code === 200) {
ElMessage({
showClose: false,
message: '删除成功',
type: 'success',
})
getBookCarDetailsData()
}
} }
// change // change
@ -237,21 +294,25 @@ const onChangeCompany = (e: boolean, index: number, item: any) => {
// //
const amountNum = computed(() => { const amountNum = computed(() => {
let amountNum = 0 let amountNum = 0
cardList.value.forEach((e) => { cardList.value.forEach((e: any) => {
amountNum = e.devInfoVoList.length + amountNum amountNum = e.devInfoVoList.length + amountNum
}) })
return amountNum return amountNum
}) })
// //
const allChecked = computed(() => { const allChecked = computed(() => {
return cardList.value.every((e: any) => e.isChecked === true) if (cardList.value.length < 1) {
return false
} else {
return cardList.value.every((e: any) => e.isChecked === true)
}
}) })
// //
const amountDevice = computed(() => { const amountDevice = computed(() => {
let amountNum = 0 let amountNum = 0
cardList.value.forEach((e) => { cardList.value.forEach((e: any) => {
e.devInfoVoList.forEach((g) => { e.devInfoVoList.forEach((g: any) => {
if (g.isChecked) { if (g.isChecked) {
amountNum++ amountNum++
} }
@ -259,14 +320,26 @@ const amountDevice = computed(() => {
}) })
return amountNum return amountNum
}) })
//
const amountDeviceList = computed(() => {
let selectList: any = []
cardList.value.forEach((e: any) => {
e.devInfoVoList.forEach((g: any) => {
if (g.isChecked) {
selectList.push(g)
}
})
})
return selectList
})
// //
const orderAmountPice = computed(() => { const orderAmountPice = computed(() => {
let orderAmountPice = 0 let orderAmountPice = 0
cardList.value.forEach((e) => { cardList.value.forEach((e: any) => {
e.devInfoVoList.forEach((g) => { e.devInfoVoList.forEach((g: any) => {
if (g.isChecked) { if (g.isChecked) {
orderAmountPice = g.goods_num * g.lease_pic * g.lease_day + orderAmountPice orderAmountPice = g.num * g.dayLeasePrice * g.days + orderAmountPice
} }
}) })
}) })
@ -274,16 +347,56 @@ const orderAmountPice = computed(() => {
}) })
// //
const onCartSubmit = () => { const onCartSubmit = async () => {
ElMessage.closeAll() ElMessage.closeAll()
if (amountDevice.value < 1) {
ElMessage({
showClose: false,
message: '请选择装备',
type: 'error',
})
return
}
if (!protocolChecked.value) { if (!protocolChecked.value) {
ElMessage({ ElMessage({
showClose: false, showClose: false,
message: '请阅读公司合同', message: '请阅读公司合同',
type: 'error', type: 'error',
}) })
return
} }
console.log('提交订单')
//
const detailsList = amountDeviceList.value.map((e: any) => {
return {
maId: e.maId,
id: e.id,
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
rentEndTime: e.rentEndTime + ' ' + '00:00:00',
manageType: e.manageType,
days: e.days,
num: e.num,
costs: e.num * e.days * e.dayLeasePrice,
}
})
const submitParams = {
cost: orderAmountPice.value,
detailsList,
}
const res: any = await submitBookCarApi(submitParams)
if (res.code === 200) {
ElMessage({
showClose: false,
message: '提交成功',
type: 'success',
})
allKey.value++
getBookCarDetailsData()
}
// console.log(res, '')
} }
</script> </script>