Merge branch 'dev-wangyiming'

# Conflicts:
#	src/views/equip/detail.vue
This commit is contained in:
wlikett 2023-12-09 11:47:37 +08:00
commit 4f927df3f4
3 changed files with 52 additions and 180 deletions

View File

@ -3,7 +3,7 @@
border
:header-cell-class-name="headerClassName"
style="width: 100%">
<el-table-column label="装备" min-width="200" >
<el-table-column label="装备" min-width="210" >
<template #default="scope">
<div class="equipData">
<div class="name">
@ -27,12 +27,12 @@
</div>
</template>
</el-table-column>
<el-table-column prop="name" label="租金" min-width="120" >
<el-table-column prop="name" label="租金" min-width="80" >
<template #default="scope">
{{ scope.row.price }}/{{ scope.row.unit }}
{{ scope.row.price }}{{ scope.row.unit }}
</template>
</el-table-column>
<el-table-column prop="company" label="供应商" min-width="180" />
<el-table-column prop="company" label="供应商" min-width="120" />
</el-table>
</template>
<script lang="ts" setup>

View File

@ -68,7 +68,7 @@
:key="i"
:url="v.picUrl"
:company="v.companyName"
:tags="[v.maStatus,v.city || '合肥市']"
:tags="[v.maStatusStr,v.city || '合肥市']"
:name="`${v.modelName}${v.deviceName}`"
:price="v.monthLeasePrice"
:id="v.maId"
@ -292,6 +292,9 @@ const handleClose = (tag, index) => {
screenChooseList[tag.parentIndex].select.splice(tag.index)
screenChooseList[tag.parentIndex].index = tag.index
const data = JSON.parse(JSON.stringify(screenChooseList[tag.parentIndex].select))
getTypeData( data.pop()?.typeId || '' )
getData()
}
//
@ -323,7 +326,6 @@ const selectScreen = (parentIndex, val, index) => {
)
screenChooseList[parentIndex].index++
getData()
if (screenChooseList[parentIndex].index == screenChooseList[parentIndex].list.length) {
@ -374,6 +376,8 @@ const getTypeData = async (typeId = null) => {
if (typeId) {
params = {typeId}
}
const index = screenChooseList.findIndex(key => key.name == 'type')
screenChooseList[index].list[screenChooseList[index].index].select = []
const res = await apiGetEquipTypeList(params)
const list = res.rows.map(
item => {
@ -384,9 +388,10 @@ const getTypeData = async (typeId = null) => {
}
}
)
const index = screenChooseList.findIndex(key => key.name == 'type')
screenChooseList[index].list[screenChooseList[index].index].select = list
console.log('getTypeData ===============', list)
}
//
@ -446,7 +451,7 @@ const getData = async (text = '') => {
}
const getParams = () => {
const paramsKey = ['keyWord']
const paramsKey = ['keyWord','typeTag']
let params = {}
paramsKey.forEach(key => {
if (history.state[key]) {
@ -458,13 +463,33 @@ const getParams = () => {
const init = () => {
const params = getParams()
if (params && params.keyWord) {
$bus.emit('callBackText', params.keyWord)
$bus.off('callBackText')
if (params) {
if(params.keyWord){
$bus.emit('callBackText', params.keyWord)
$bus.off('callBackText')
}
if(params.typeTag){
const index = screenChooseList.findIndex(key => key.name == 'type')
const data = params.typeTag.map((key,i) => {
return{
...key,
name:key.typeName,
index:i,
parentIndex:index
}
})
screenChooseList[index].select = data
screenChooseList[index].index = data.length
}else {
getTypeData()
}
}else {
getTypeData()
}
getTypeData()
getAddressData()
getData()
getData(params.keyWord || '')
}
init()

View File

@ -18,172 +18,19 @@
getGoodsClassList()
const handlerGoodsDetails = (...arg) => {
const arr = arg.map((key,index) => {
return {
level: index + 1 + '',
typeId:key.id,
typeName:key.name
}
})
// [
// {
// name: '',
// children: [
// {
// title: '',
// children: [
// { goodsName: '' },
// { goodsName: '' },
// { goodsName: '' },
// { goodsName: '' },
// { goodsName: '' },
// { goodsName: '' }
// ]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// },
// {
// name: '',
// children: [
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// },
// {
// title: '',
// children: [{ goodsName: '' }]
// }
// ]
// }
// ]
const handlerGoodsDetails = () => {
console.log('去往商品详情页')
router.push({
name:'equipList',
state:{ typeTag:arr }
})
}
const detailsList = ref([
@ -243,7 +90,7 @@
<a
v-for="son in child.children"
:key="son.id"
@click="handlerGoodsDetails">
@click="handlerGoodsDetails(item,child,son)">
{{ son.name }}
</a>
</span>