bug修改

This commit is contained in:
wlikett 2023-12-09 15:37:20 +08:00
parent 84c5d75ee5
commit b941f3f81a
6 changed files with 176 additions and 89 deletions

File diff suppressed because one or more lines are too long

View File

@ -96,7 +96,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
// 资讯详情 // 资讯详情
{ {
path: '/consultationDetails', path: '/consultationDetails/:id',
name: 'consultationDetails', name: 'consultationDetails',
component: () => (import('views/consultationDetails/index.vue')) component: () => (import('views/consultationDetails/index.vue'))
}, },

View File

@ -1,14 +1,69 @@
<script setup lang="ts"></script>
<template> <template>
<!-- 咨询详情页面 --> <!-- 咨询详情页面 -->
<div class="consultation-details">咨询详情页面(占位)</div> <div class="consultation-details">
<div class="title">
{{ data.title }}
</div>
<div class="line"></div>
<div class="createTime">
发布时间{{ data.create_time }}
</div>
<div v-html="data.content"></div>
</div>
</template> </template>
<script setup lang="ts">
import baseData from "@/assets/baseInformation.json"
import {ref} from "vue";
import {useRoute} from "vue-router";
const router = useRoute()
const data = ref({})
//id
const getData = () => {
const id = router.params.id
data.value = baseData.find(key => key.id == id)
}
const init = () => {
getData()
}
init()
</script>
<style> <style>
.consultation-details { .consultation-details {
color: #000; .title{
background-color: skyblue; text-align: center;
height: 200px; font-size: 20px;
font-weight: 600;
}
.line{
position: relative;
width: 100%;
padding-top: 20px;
margin-bottom: 10px;
&:after{
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 1px;
background: #d1d1d1;
}
}
.createTime{
text-align: center;
}
.notice-content{
margin-top: 20px;
}
} }
</style> </style>

View File

@ -133,7 +133,7 @@
<el-row> <el-row>
<el-col :span="15"> <el-col :span="15">
<el-form-item label="设备进场地址" prop="address"> <el-form-item label="设备进场地址" prop="address">
<el-cascader :props="addressCascader" v-model="ruleForm.address" /> <el-cascader :props="addressCascader" v-model="ruleForm.address"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -161,9 +161,10 @@
<el-form-item label="工期时长" prop="duration"> <el-form-item label="工期时长" prop="duration">
<el-input v-model.number="ruleForm.duration" type="number" placeholder="请输入工期时长"> <el-input v-model.number="ruleForm.duration" type="number" placeholder="请输入工期时长">
<template #append> <template #append>
<el-select v-model="ruleForm.durationUnit" placeholder="Select" style="width: 85px" @change="priceChange"> <el-select v-model="ruleForm.durationUnit" placeholder="Select"
<el-option label="天" value="0" /> style="width: 85px" @change="priceChange">
<el-option label="月" value="1" /> <el-option label="天" value="0"/>
<el-option label="月" value="1"/>
</el-select> </el-select>
</template> </template>
</el-input> </el-input>
@ -253,7 +254,7 @@
import ShowImg from './comoonents/showImg.vue' import ShowImg from './comoonents/showImg.vue'
import {computed, reactive, ref} from 'vue' import {computed, reactive, ref} from 'vue'
import EquipCard from 'components/equipCard.vue' import EquipCard from 'components/equipCard.vue'
import {getDetail,getHotList,equipCollect,apiSubmitLease,apiGetAddressList} from "@/http/api/equip" import {getDetail, getHotList, equipCollect, apiSubmitLease, apiGetAddressList} from "@/http/api/equip"
import {useRoute, useRouter} from "vue-router"; import {useRoute, useRouter} from "vue-router";
import Navmenu from '@/components/Navmenu/index.vue' import Navmenu from '@/components/Navmenu/index.vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
@ -273,7 +274,7 @@ const equipBaseInfoList = reactive([
}, },
{ {
label: '设备位置', label: '设备位置',
key: 'city' key: 'provinceStr,cityStr,areaStr'
}, },
{ {
label: '配备机手', label: '配备机手',
@ -394,12 +395,12 @@ const isCollect = ref(false)
// //
const hotList = ref([]) const hotList = ref([])
const checkDuration = (rule,value,callback) => { const checkDuration = (rule, value, callback) => {
if((value == '' || value == null) && value !== 0) { if ((value == '' || value == null) && value !== 0) {
return callback(new Error('请输入工期时长')) return callback(new Error('请输入工期时长'))
}else if(value <= 0){ } else if (value <= 0) {
return callback(new Error('工期时长需大于0')) return callback(new Error('工期时长需大于0'))
}else { } else {
return callback() return callback()
} }
} }
@ -410,7 +411,7 @@ const ruleForm = ref({
detailAddress: '',// detailAddress: '',//
entryTime: '',// entryTime: '',//
duration: null,// duration: null,//
durationUnit:'0',// 0 > 1 -> durationUnit: '0',// 0 > 1 ->
machinist: 0,// machinist: 0,//
invoiceType: '',// invoiceType: '',//
projectDescription: ''// projectDescription: ''//
@ -426,7 +427,7 @@ const rules = reactive({
{required: true, message: '请选择进场时间', trigger: 'blur'}, {required: true, message: '请选择进场时间', trigger: 'blur'},
], ],
duration: [ duration: [
{validator:checkDuration, trigger: 'blur'} {validator: checkDuration, trigger: 'blur'}
], ],
machinist: [ machinist: [
@ -441,7 +442,6 @@ const rules = reactive({
}) })
// //
const openLease = () => { const openLease = () => {
dialoglease.value = true dialoglease.value = true
@ -450,15 +450,15 @@ const openLease = () => {
const collectChange = async () => { const collectChange = async () => {
isCollect.value = !isCollect.value isCollect.value = !isCollect.value
const params = { const params = {
maId:pageData.value.maId, maId: pageData.value.maId,
isCollect:isCollect.value isCollect: isCollect.value
} }
const res = await equipCollect(params) const res = await equipCollect(params)
if(res.code == '200'){ if (res.code == '200') {
ElMessage({ ElMessage({
type:'success', type: 'success',
duration:1000, duration: 1000,
message:`装备${isCollect.value ? '收藏' : '取消收藏'}成功` message: `装备${isCollect.value ? '收藏' : '取消收藏'}成功`
}) })
} }
} }
@ -474,14 +474,14 @@ const priceChange = computed(() => {
// //
let duration = 0 let duration = 0
if(ruleForm.value.durationUnit == '0'){ if (ruleForm.value.durationUnit == '0') {
unitPrice = Number(pageData.value.dayLeasePrice) unitPrice = Number(pageData.value.dayLeasePrice)
jsPrice = Number(pageData.value.jsDayPrice) jsPrice = Number(pageData.value.jsDayPrice)
}else { } else {
unitPrice = Number(pageData.value.monthLeasePrice) unitPrice = Number(pageData.value.monthLeasePrice)
jsPrice = Number(pageData.value.jsMonthPrice) jsPrice = Number(pageData.value.jsMonthPrice)
} }
if(!ruleForm.value.machinist){ if (!ruleForm.value.machinist) {
jsPrice = 0 jsPrice = 0
} }
@ -500,7 +500,7 @@ const openPhone = () => {
// pdf // pdf
const openPdf = (name) => { const openPdf = (name) => {
if(name){ if (name) {
window.open(name) window.open(name)
} }
} }
@ -510,23 +510,23 @@ const that = {
const addressCascader = { const addressCascader = {
lazy:true, lazy: true,
label:'name', label: 'name',
value:'id', value: 'id',
lazyLoad: async (node,resolve) =>{ lazyLoad: async (node, resolve) => {
const { level,data } = node const {level, data} = node
let nodes = [] let nodes = []
if(level == 0){ if (level == 0) {
const arr = await getAddressData() const arr = await getAddressData()
nodes = arr nodes = arr
}else if(level == 1){ } else if (level == 1) {
const arr = await getAddressData(data.code) const arr = await getAddressData(data.code)
nodes = arr nodes = arr
}else if(level == 2){ } else if (level == 2) {
const arr = await getAddressData(data.code) const arr = await getAddressData(data.code)
nodes = arr.map((item) => ({ nodes = arr.map((item) => ({
...item, ...item,
leaf:true leaf: true
})) }))
} }
resolve(nodes) resolve(nodes)
@ -537,8 +537,8 @@ const addressCascader = {
// //
const getAddressData = async (code = '') => { const getAddressData = async (code = '') => {
let params = {} let params = {}
if(code){ if (code) {
params = { code } params = {code}
} }
const res = await apiGetAddressList(params) const res = await apiGetAddressList(params)
@ -566,8 +566,8 @@ const getData = async () => {
// //
const gethotList = async () => { const gethotList = async () => {
const params = { const params = {
pageNum:1, pageNum: 1,
pageSize:3 pageSize: 3
} }
const res = await getHotList(params) const res = await getHotList(params)
hotList.value = res.rows hotList.value = res.rows
@ -576,13 +576,12 @@ const gethotList = async () => {
// //
const goDetail = (val) => { const goDetail = (val) => {
router.push({ router.push({
path:`/equipDetail/${val.id}` path: `/equipDetail/${val.id}`
}) })
} }
// //
const submit = async() => { const submit = async () => {
console.log(ruleForm.value)
const params = { const params = {
addressId: ruleForm.value.address[2], addressId: ruleForm.value.address[2],
address: ruleForm.value.detailAddress, address: ruleForm.value.detailAddress,
@ -591,34 +590,35 @@ const submit = async() => {
isMachinist: ruleForm.value.machinist, isMachinist: ruleForm.value.machinist,
invoiceType: ruleForm.value.invoiceType, invoiceType: ruleForm.value.invoiceType,
description: ruleForm.value.projectDescription, description: ruleForm.value.projectDescription,
durationType: ruleForm.value.durationUnit durationType: ruleForm.value.durationUnit,
cost: priceChange.value
} }
const res = await apiSubmitLease(params) const res = await apiSubmitLease(params)
if(res.code == '200'){ if (res.code == '200') {
ElMessage({ ElMessage({
message:'提交租赁申请成功', message: '提交租赁申请成功',
type:'success', type: 'success',
duration:1500 duration: 1500
}) })
} }
dialoglease.value = false dialoglease.value = false
} }
const init = async () => { const init = async () => {
await gethotList() await gethotList()
await getData() await getData()
} }
init() init()
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
:deep(.dialoglease){ :deep(.dialoglease) {
margin: 10px auto 0 !important; margin: 10px auto 0 !important;
min-width: 855px !important; min-width: 855px !important;
} }
:deep(.el-form-item){ :deep(.el-form-item) {
display: flex; display: flex;
width: 100%; width: 100%;
@ -647,34 +647,38 @@ init()
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
overflow: hidden;
.equipInfo { .equipInfo {
display: flex; display: flex;
.left { .left {
margin-right: 5px; margin-right: 5px;
width: 62%;
.title { .title {
display: flex;
align-items: center;
.name { .name {
font-size: 24px; font-size: 24px;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.tag { .tag {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 10px;
.item { .item {
font-size: 13px; font-size: 13px;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 400;
color: #005af2; color: #005af2;
margin-left: 15px; margin-right: 15px;
padding: 2px 10px; padding: 2px 10px;
border: 1px solid #005af2; border: 1px solid #005af2;
border-radius: 4px; border-radius: 4px;

View File

@ -303,7 +303,7 @@ const tagClear = () => {
key.select = [] key.select = []
key.index = 0 key.index = 0
}) })
getTypeData()
getData() getData()
} }
@ -389,15 +389,13 @@ const getTypeData = async (typeId = null) => {
} }
) )
screenChooseList[index].list[screenChooseList[index].index].select = list screenChooseList[index].list[screenChooseList[index].index].select = list
} }
// //
const getData = async (text = '') => { const getData = async (text = '') => {
// //
const address = screenChooseList.find(key => key.name == 'address').select.slice(-1)[0] || null const address = screenChooseList.find(key => key.name == 'address').select
// //
const type = screenChooseList.find(key => key.name == 'type').select.slice(-1)[0] || null const type = screenChooseList.find(key => key.name == 'type').select.slice(-1)[0] || null
// //
@ -408,13 +406,17 @@ const getData = async (text = '') => {
const time = screenChooseList.find(key => key.name == 'time').select.slice(-1)[0] || null const time = screenChooseList.find(key => key.name == 'time').select.slice(-1)[0] || null
console.log('addres',address)
const params = { const params = {
keyWord: text, keyWord: text,
pageSize: pageData.pageSize, pageSize: pageData.pageSize,
pageNum: pageData.pageNum, pageNum: pageData.pageNum,
updateTimeOrderBy: '', updateTimeOrderBy: '',
monthLeasePriceOrderBy: '', monthLeasePriceOrderBy: '',
location: address ? address.id : '', provinceId:address[0]?.id || '',
cityId:address[1]?.id || '',
areaId:address[2]?.id || '',
typeId: type ? type.typeId : '', typeId: type ? type.typeId : '',
monthLeasePriceMin: '', monthLeasePriceMin: '',
monthLeasePriceMax: '', monthLeasePriceMax: '',

View File

@ -5,6 +5,8 @@
import { useStore } from 'store/main' import { useStore } from 'store/main'
import { getHotList } from 'http/api/equip' import { getHotList } from 'http/api/equip'
import {reactive} from "vue"; import {reactive} from "vue";
import baseData from "@/assets/baseInformation.json"
const router = useRouter() const router = useRouter()
const leftNavList = ref([]) const leftNavList = ref([])
@ -33,26 +35,26 @@
}) })
} }
const detailsList = ref([ const goInformation = (id) => {
{ router.push({
v_title: '实锤了,确实挖掘技术强!山东用挖掘机在海外市场“挖呀挖”', path:`/consultationDetails/${id}`
v_content_info: })
'天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存', }
v_time: '[2023/11/28]'
}, const detailsList = ref([])
{
v_title: '实锤了,确实挖掘技术强!山东用挖掘机在海外市场“挖呀挖”', const handelInformation = () => {
v_content_info: detailsList.value = baseData.map(item => {
'天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存', return {
v_time: '[2023/11/28]' v_title:item.title,
}, v_content_info:'',
{ v_time:`[${item.create_time}]`,
v_title: '实锤了,确实挖掘技术强!山东用挖掘机在海外市场“挖呀挖”', id:item.id
v_content_info: }
'天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存天眼查数据显示截至今年4月中旬全国存', })
v_time: '[2023/11/28]' }
} handelInformation()
])
const hotDeviceList: any = ref([]) const hotDeviceList: any = ref([])
@ -127,7 +129,7 @@
@onClick="onClick" @onClick="onClick"
:company="item.companyName || '安徽博诺斯有限公司'" :company="item.companyName || '安徽博诺斯有限公司'"
:price="item.monthLeasePrice" :price="item.monthLeasePrice"
:tags="['待租', '合肥']" :tags="[item.maStatusStr || '待租', item.cityStr || '合肥']"
:name="item.modelName + item.deviceName" :name="item.modelName + item.deviceName"
:url="item.picUrl" :url="item.picUrl"
:id="item.maId" /> :id="item.maId" />
@ -164,11 +166,11 @@
<div class="right-consult"> <div class="right-consult">
<div <div
class="consult-box" class="consult-box"
@click="$router.push('/consultationDetails')" @click="goInformation(item.id)"
v-for="item in detailsList" v-for="item in detailsList"
:key="item.v_time"> :key="item.v_time">
<div class="consult-title"> <div class="consult-title">
<h2>{{ item.v_title }}</h2> <h3>{{ item.v_title }}</h3>
<span>{{ item.v_time }}</span> <span>{{ item.v_time }}</span>
</div> </div>
@ -356,9 +358,10 @@
flex: 1; flex: 1;
width: calc(100% - 340px); width: calc(100% - 340px);
// padding-left: 35px; // padding-left: 35px;
overflow-y: auto;
.consult-box { .consult-box {
height: 70px; margin-bottom: 10px;
//height: 70px;
padding-left: 15px; padding-left: 15px;
cursor: pointer; cursor: pointer;
.consult-title { .consult-title {
@ -379,7 +382,7 @@
.consult-info { .consult-info {
width: calc(100% - 100px); width: calc(100% - 100px);
height: 40px; height: 10px;
line-height: 40px; line-height: 40px;
border-bottom: 1px dashed #979797; border-bottom: 1px dashed #979797;
overflow: hidden; overflow: hidden;