Merge branch 'dev-wangyiming'
This commit is contained in:
commit
5691c044ad
|
|
@ -7,18 +7,27 @@ export const getList = (params = {}) => {
|
||||||
|
|
||||||
//获取装备详情
|
//获取装备详情
|
||||||
export const getDetail = (id = '') => {
|
export const getDetail = (id = '') => {
|
||||||
return get(`/dev/${id}`)
|
return get(`/zlpt-equip/dev/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取 推荐装备列表
|
//获取 推荐装备列表
|
||||||
export const getHotList = (params) => {
|
export const getHotList = (params) => {
|
||||||
return get('/dev/hotList', params)
|
return get('/zlpt-equip/dev/hotList', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//装备收藏 取消收藏
|
||||||
export const equipCollect = (params = {}) => {
|
export const equipCollect = (params = {}) => {
|
||||||
return put('/collect', params)
|
return put('/zlpt-equip/collect', params)
|
||||||
}
|
}
|
||||||
|
//提交租赁申请
|
||||||
export const apiSubmitLease = (params = {}) => {
|
export const apiSubmitLease = (params = {}) => {
|
||||||
return post('/details', params)
|
return post('/zlpt-order/info', params)
|
||||||
|
}
|
||||||
|
//获取装备分类列表 (级联)
|
||||||
|
export const apiGetEquipTypeList = (params = {}) => {
|
||||||
|
return post('/zlpt-equip/type/list',params)
|
||||||
|
}
|
||||||
|
//获取省市区列表 (级联)
|
||||||
|
export const apiGetAddressList = (params = {}) => {
|
||||||
|
return post('/zlpt-company/baseAddress/selectAddress',params)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,12 @@
|
||||||
import {computed, onMounted, onUnmounted, reactive, ref} from "vue";
|
import {computed, onMounted, onUnmounted, reactive, ref} from "vue";
|
||||||
import EquipCard from "@/components/equipCard.vue";
|
import EquipCard from "@/components/equipCard.vue";
|
||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import { getList } from "@/http/api/equip"
|
import {apiGetAddressList, apiGetEquipTypeList, getList} from "@/http/api/equip"
|
||||||
import $bus from "@/utils/bus"
|
import $bus from "@/utils/bus"
|
||||||
import NavMenu from "@/components/Navmenu/index.vue"
|
import NavMenu from "@/components/Navmenu/index.vue"
|
||||||
import address from "@/assets/temporaryAddress.json"
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const addressData = reactive(address)
|
|
||||||
|
|
||||||
//筛选条件列表数据
|
//筛选条件列表数据
|
||||||
const screenChooseList = reactive([
|
const screenChooseList = reactive([
|
||||||
|
|
@ -111,86 +109,13 @@ const screenChooseList = reactive([
|
||||||
name: '省份',
|
name: '省份',
|
||||||
value: '',
|
value: '',
|
||||||
parent: 'address',
|
parent: 'address',
|
||||||
select: [
|
select: []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '上海'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '北京'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '四川'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '河南'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '城市',
|
name: '城市',
|
||||||
value: '',
|
value: '',
|
||||||
parent: 'address',
|
parent: 'address',
|
||||||
select: [
|
select: []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '安徽'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -203,43 +128,19 @@ const screenChooseList = reactive([
|
||||||
name: '类别',
|
name: '类别',
|
||||||
value: '',
|
value: '',
|
||||||
parent: 'type',
|
parent: 'type',
|
||||||
select: [
|
select: []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '挖掘机械'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '土方机械'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '组别',
|
name: '组别',
|
||||||
value: '',
|
value: '',
|
||||||
parent: 'type',
|
parent: 'type',
|
||||||
select: [
|
select: []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '组别1'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '产品名称',
|
name: '产品名称',
|
||||||
value: '',
|
value: '',
|
||||||
parent: 'type',
|
parent: 'type',
|
||||||
select: [
|
select: []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '产品1'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '产品2'
|
|
||||||
}, {
|
|
||||||
id: 1,
|
|
||||||
name: '产品3'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -254,16 +155,20 @@ const screenChooseList = reactive([
|
||||||
parent: 'rent',
|
parent: 'rent',
|
||||||
select: [{
|
select: [{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '5千元以下'
|
name: '5千元以下',
|
||||||
|
value:['',5000]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '5千-1万'
|
name: '5千-1万',
|
||||||
|
value:[5000,10000]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '1万-5万'
|
name: '1万-5万',
|
||||||
|
value: [10000,50000]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '5万-10万'
|
name: '5万-10万',
|
||||||
|
value: [50000,100000]
|
||||||
},]
|
},]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -279,16 +184,20 @@ const screenChooseList = reactive([
|
||||||
parent: 'rent',
|
parent: 'rent',
|
||||||
select: [{
|
select: [{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '一年以下'
|
name: '一年以下',
|
||||||
|
value: ['',1]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '1年-3年'
|
name: '1年-3年',
|
||||||
|
value: [1,3]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '3年-6年'
|
name: '3年-6年',
|
||||||
|
value: [3,6]
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '10年以上'
|
name: '10年以上',
|
||||||
|
value: [10,'']
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -332,11 +241,13 @@ const screenOptionList = reactive([
|
||||||
}, {
|
}, {
|
||||||
name: '更新时间',
|
name: '更新时间',
|
||||||
id: '2',
|
id: '2',
|
||||||
sort: 'asc' //asc or desc
|
sort: 'asc', //asc or desc
|
||||||
|
key:'updateTimeOrderBy'
|
||||||
}, {
|
}, {
|
||||||
name: '月租金',
|
name: '月租金',
|
||||||
id: '3',
|
id: '3',
|
||||||
sort: 'asc'
|
sort: 'asc',
|
||||||
|
key:'monthLeasePriceOrderBy'
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
//激活 排序按钮
|
//激活 排序按钮
|
||||||
|
|
@ -400,6 +311,18 @@ const selectScreen = (parentIndex, val, index) => {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
screenChooseList[parentIndex].index++
|
screenChooseList[parentIndex].index++
|
||||||
|
|
||||||
|
if(screenChooseList[parentIndex].index == screenChooseList[parentIndex].list.length){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch (screenChooseList[parentIndex].name){
|
||||||
|
case 'address':
|
||||||
|
getAddressData(val.code)
|
||||||
|
break;
|
||||||
|
case 'type':
|
||||||
|
getTypeData(val.typeId)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//装备card被点击
|
//装备card被点击
|
||||||
|
|
@ -414,15 +337,45 @@ const pageChange = (val) => {
|
||||||
pageData.pageNum = val
|
pageData.pageNum = val
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
//获取地址 省市区字典集合
|
||||||
|
const getAddressData = async (code = null) => {
|
||||||
|
let params = {}
|
||||||
|
if(code){
|
||||||
|
params = {
|
||||||
|
code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const res = await apiGetAddressList(params)
|
||||||
|
const index = screenChooseList.findIndex(key => key.name == 'address')
|
||||||
|
screenChooseList[index].list[ screenChooseList[index].index ].select = res.data
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取装备分类字典集合
|
||||||
|
const getTypeData = async (typeId = null) => {
|
||||||
|
let params = {}
|
||||||
|
if(typeId){
|
||||||
|
params = {typeId}
|
||||||
|
}
|
||||||
|
const res = await apiGetEquipTypeList(params)
|
||||||
|
|
||||||
|
console.log('getTypeData ===============',res)
|
||||||
|
}
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const getData = async (text = '') => {
|
const getData = async (text = '') => {
|
||||||
|
//地址信息
|
||||||
|
const address = screenChooseList.find(key => key.name == 'address').select
|
||||||
|
//类别信息
|
||||||
|
const type = screenChooseList.find(key => key.name == 'type').select
|
||||||
const params = {
|
const params = {
|
||||||
keyWord: text,
|
keyWord: text,
|
||||||
pageSize:pageData.pageSize,
|
pageSize:pageData.pageSize,
|
||||||
pageNum:pageData.pageNum,
|
pageNum:pageData.pageNum,
|
||||||
updateTimeOrderBy:'',
|
updateTimeOrderBy:'',
|
||||||
monthLeasePriceOrderBy:'',
|
monthLeasePriceOrderBy:'',
|
||||||
typeId:'',
|
location: address && address.length > 0 ? address[address.length - 1] : '',
|
||||||
|
typeId: type && type.length > 0 ? type[address.length - 1] : '',
|
||||||
monthLeasePriceMin:0,
|
monthLeasePriceMin:0,
|
||||||
monthLeasePriceMax:'',
|
monthLeasePriceMax:'',
|
||||||
ageMin:'',
|
ageMin:'',
|
||||||
|
|
@ -431,6 +384,7 @@ const getData = async (text = '') => {
|
||||||
workingHoursMax:''
|
workingHoursMax:''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(optionActive.value == '1'){
|
if(optionActive.value == '1'){
|
||||||
|
|
||||||
}else if(optionActive.value == '2'){
|
}else if(optionActive.value == '2'){
|
||||||
|
|
@ -438,7 +392,8 @@ const getData = async (text = '') => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await getList(params)
|
const res = await getList(params)
|
||||||
pageData.total = res.total
|
|
||||||
|
pageData.total = res.total || 0
|
||||||
equipList.value = res.rows
|
equipList.value = res.rows
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -453,23 +408,15 @@ const getParams = () => {
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|
||||||
const handelInitScreen = () => {
|
const init = async () => {
|
||||||
const index = screenChooseList.findIndex(key => key.name == 'address')
|
|
||||||
|
|
||||||
screenChooseList[index].list[0].select = addressData.province
|
|
||||||
screenChooseList[index].list[1].select = addressData.city
|
|
||||||
|
|
||||||
console.log(screenChooseList)
|
|
||||||
}
|
|
||||||
|
|
||||||
const init = () => {
|
|
||||||
const params = getParams()
|
const params = getParams()
|
||||||
if(params && params.keyWord){
|
if(params && params.keyWord){
|
||||||
$bus.emit('callBackText',params.keyWord)
|
$bus.emit('callBackText',params.keyWord)
|
||||||
$bus.off('callBackText')
|
$bus.off('callBackText')
|
||||||
}
|
}
|
||||||
handelInitScreen()
|
await getTypeData()
|
||||||
getData()
|
await getAddressData()
|
||||||
|
await getData()
|
||||||
}
|
}
|
||||||
init()
|
init()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue