新增专区与问题修复
This commit is contained in:
parent
bb92996ed9
commit
ceda98aa00
|
|
@ -41,6 +41,7 @@ declare module 'vue' {
|
|||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
|
|
|
|||
|
|
@ -13,41 +13,77 @@ const route = useRoute()
|
|||
// { name: '通知公告', routerName: 'enterpriseZone' },
|
||||
// // { name: '综合查询', routerName: 'enterpriseZone' },
|
||||
// ]
|
||||
|
||||
const isType: any = localStorage.getItem('rolesType')
|
||||
const navMenuList = computed(() => {
|
||||
// return store.leaseAndLesseeList
|
||||
if (isType == 1)
|
||||
return [
|
||||
const isType: any = ref(null)
|
||||
// console.log('🚀 ~ onCreated ~ isType.value:', isType.value, localStorage.getItem('rolesType'))
|
||||
onMounted(() => {
|
||||
isType.value = localStorage.getItem('rolesType')
|
||||
// console.log('🚀 ~ onMounted ~ isType.value:', isType.value)
|
||||
})
|
||||
const navMenuList = ref<any[]>([])
|
||||
watch(isType, (newValue) => {
|
||||
if (newValue == 1) {
|
||||
navMenuList.value = [
|
||||
{ name: '首页', routerName: 'home' },
|
||||
{ name: '装备共享大厅', routerName: 'equipList' },
|
||||
{ name: '租赁需求大厅', routerName: 'parity' },
|
||||
// { name: '装备管理', routerName: 'goodsManagement' },
|
||||
// { name: '订单管理', routerName: 'orderManagementCz' },
|
||||
// { name: '接单管理', routerName: 'accept-orders' },
|
||||
// { name: '专区设备', routerName: 'zoneEquipment' },
|
||||
{ name: '公告', routerName: 'enterpriseZone' },
|
||||
// { name: '数据大屏', routerName: 'big-screen' },
|
||||
]
|
||||
if (isType == 2)
|
||||
return [
|
||||
} else if (newValue == 2) {
|
||||
navMenuList.value = [
|
||||
{ name: '首页', routerName: 'home' },
|
||||
{ name: '装备共享大厅', routerName: 'equipList' },
|
||||
{ name: '租赁需求大厅', routerName: 'parity' },
|
||||
// { name: '专区设备', routerName: 'zoneEquipment' },
|
||||
{ name: '订单管理', routerName: 'orderManagement' },
|
||||
{ name: '需求管理', routerName: 'sourcingNeed' },
|
||||
{ name: '通知公告', routerName: 'enterpriseZone' },
|
||||
// { name: '数据大屏', routerName: 'big-screen' },
|
||||
]
|
||||
|
||||
if (isType == 3)
|
||||
return [
|
||||
} else if (newValue == 3) {
|
||||
navMenuList.value = [
|
||||
{ name: '首页', routerName: 'home' },
|
||||
{ name: '装备共享大厅', routerName: 'equipList' },
|
||||
// { name: '专区设备', routerName: 'zoneEquipment' },
|
||||
{ name: '租赁需求大厅', routerName: 'parity' },
|
||||
{ name: '通知公告', routerName: 'enterpriseZone' },
|
||||
// { name: '数据大屏', routerName: 'big-screen' },
|
||||
]
|
||||
})
|
||||
} else {
|
||||
navMenuList.value = []
|
||||
}
|
||||
}, { immediate: true })
|
||||
// const navMenuList = computed(() => {
|
||||
// // return store.leaseAndLesseeList
|
||||
// if (isType == 1)
|
||||
// return [
|
||||
// { name: '首页', routerName: 'home' },
|
||||
// { name: '装备共享大厅', routerName: 'equipList' },
|
||||
// { name: '租赁需求大厅', routerName: 'parity' },
|
||||
// // { name: '装备管理', routerName: 'goodsManagement' },
|
||||
// // { name: '订单管理', routerName: 'orderManagementCz' },
|
||||
// // { name: '接单管理', routerName: 'accept-orders' },
|
||||
// { name: '公告', routerName: 'enterpriseZone' },
|
||||
// // { name: '数据大屏', routerName: 'big-screen' },
|
||||
// ]
|
||||
// if (isType == 2)
|
||||
// return [
|
||||
// { name: '首页', routerName: 'home' },
|
||||
// { name: '装备共享大厅', routerName: 'equipList' },
|
||||
// { name: '租赁需求大厅', routerName: 'parity' },
|
||||
// { name: '订单管理', routerName: 'orderManagement' },
|
||||
// { name: '需求管理', routerName: 'sourcingNeed' },
|
||||
// { name: '通知公告', routerName: 'enterpriseZone' },
|
||||
// // { name: '数据大屏', routerName: 'big-screen' },
|
||||
// ]
|
||||
|
||||
// if (isType == 3)
|
||||
// return [
|
||||
// { name: '首页', routerName: 'home' },
|
||||
// { name: '装备共享大厅', routerName: 'equipList' },
|
||||
// { name: '租赁需求大厅', routerName: 'parity' },
|
||||
// { name: '通知公告', routerName: 'enterpriseZone' },
|
||||
// // { name: '数据大屏', routerName: 'big-screen' },
|
||||
// ]
|
||||
// })
|
||||
|
||||
const navMenuClick = (name: any) => {
|
||||
const includeList = [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ export const getTypeListApi = (data: any = {}) => {
|
|||
export const getDeviceListApi = (data: any) => {
|
||||
return post('/material-mall/dev/list', data)
|
||||
}
|
||||
|
||||
// 获取专区装备列表
|
||||
export const getZoneListApi = (data: any) => {
|
||||
return post('/material-mall/dev/zone_list', data)
|
||||
}
|
||||
export const getCompanyCountApi = (data: any) => {
|
||||
return post('/material-mall/dev/getCompanyCount', data)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import axios from 'axios'
|
||||
import NProgress from 'nprogress'
|
||||
// import { mainStore } from 'store/main'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElLoading, ElMessage } from 'element-plus'
|
||||
import { saveAs } from 'file-saver'
|
||||
import router from '@/router'
|
||||
import { tansParams } from '@/utils/bonus'
|
||||
|
|
@ -56,6 +56,19 @@ service.interceptors.request.use(
|
|||
return error
|
||||
},
|
||||
)
|
||||
const openLoading = () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading...',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
setTimeout(() => {
|
||||
loading.close()
|
||||
resolve()
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
// 响应拦截
|
||||
service.interceptors.response.use(
|
||||
(res) => {
|
||||
|
|
@ -73,6 +86,7 @@ service.interceptors.response.use(
|
|||
ElMessage.error('请重新登录')
|
||||
// 清除token
|
||||
localStorage.removeItem('tokenNew')
|
||||
openLoading()
|
||||
// 根据环境变量 VITE_API_URL 判断是否是本地开发环境
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
router.push('/login')
|
||||
|
|
@ -86,6 +100,7 @@ service.interceptors.response.use(
|
|||
} else if (data.code == '401') {
|
||||
ElMessage.error('请重新登录')
|
||||
localStorage.removeItem('tokenNew')
|
||||
openLoading()
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
router.push('/login')
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -103,6 +103,16 @@ const routes: Array<RouteRecordRaw> = [
|
|||
activeName: 'equipList',
|
||||
}
|
||||
},
|
||||
// 专区设备
|
||||
{
|
||||
path: '/zoneEquipment',
|
||||
name: 'zoneEquipment',
|
||||
component: () => import('views/equip/zoneEquipment.vue'),
|
||||
meta: {
|
||||
title: '装备共享大厅',
|
||||
activeName: 'zoneEquipment',
|
||||
}
|
||||
},
|
||||
//装备详情
|
||||
{
|
||||
path: '/equipDetail',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,921 @@
|
|||
<template>
|
||||
<div class="equipList">
|
||||
<NavMenu></NavMenu>
|
||||
|
||||
<!-- <div class="class-container" v-if="currentIndex !== null">
|
||||
<a
|
||||
v-for="(item, index) in currentIndex == 1 ? levelList : levelList_2"
|
||||
:key="index"
|
||||
:style="index + 1 == currentIndex ? 'color:#000' : 'color: #333'"
|
||||
>{{ item.title
|
||||
}}{{
|
||||
currentIndex == 1
|
||||
? index == levelList.length - 1
|
||||
? ''
|
||||
: '>'
|
||||
: index == levelList_2.length - 1
|
||||
? ''
|
||||
: '>'
|
||||
}}
|
||||
</a>
|
||||
</div> -->
|
||||
<div class="screen">
|
||||
<div class="choose">
|
||||
<template v-for="(v, i) in screenChooseList" :key="i">
|
||||
<div class="line" v-if="v.isShow">
|
||||
<div class="label">
|
||||
{{ v.name }}
|
||||
</div>
|
||||
<div class="select">
|
||||
<template v-for="(val, index) in v.list" :key="index">
|
||||
<div
|
||||
class="item"
|
||||
@click="selectScreen(v.type, val, i)"
|
||||
:class="{
|
||||
active: val.isChecked,
|
||||
}"
|
||||
>
|
||||
<span style="color: #333">{{ val.name }}</span>
|
||||
<!-- <span v-else>
|
||||
{{ val.name }}
|
||||
{{
|
||||
index == 0
|
||||
? ''
|
||||
: val.maCount
|
||||
? `(${val.maCount})`
|
||||
: '(0)'
|
||||
}}
|
||||
</span> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-if="i == 3" style="display: flex; align-items: center">
|
||||
<el-input v-model="startPrice" style="width: 60px" size="small" />
|
||||
<span style="margin: 0 5px">-</span>
|
||||
<el-input v-model="endPrice" style="width: 60px" size="small" />
|
||||
<el-button
|
||||
@click.stop="onConfirmPrice"
|
||||
size="small"
|
||||
type="primary"
|
||||
style="margin-left: 20px"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="line" v-if="screenTags.length > 0">
|
||||
<div class="label">已选条件:</div>
|
||||
<div class="select tags">
|
||||
<el-tag
|
||||
v-for="(tag, i) in screenTags"
|
||||
:key="i"
|
||||
class="item"
|
||||
@close="handleClose(tag)"
|
||||
closable
|
||||
>
|
||||
{{ tag.name }}
|
||||
</el-tag>
|
||||
|
||||
<span class="clear-btn" @click="onClearTags"> 清除选项 </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div
|
||||
class="item"
|
||||
@click="changeOption(v)"
|
||||
:class="v.id == optionActive && 'active'"
|
||||
v-for="(v, i) in screenOptionList"
|
||||
:key="i"
|
||||
>
|
||||
{{ v.name }}
|
||||
<template v-if="v.sort">
|
||||
<el-icon class="icon" v-show="v.sort == 'DESC'">
|
||||
<CaretBottom />
|
||||
</el-icon>
|
||||
<el-icon class="icon" v-show="v.sort == 'ASC'">
|
||||
<CaretTop />
|
||||
</el-icon>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="showScreen">
|
||||
<div class="title">筛选条件:</div>
|
||||
<div class="tags">
|
||||
<el-tag
|
||||
v-for="(tag, i) in screenTags"
|
||||
:key="i"
|
||||
class="item"
|
||||
@close="handleClose(tag, i)"
|
||||
closable
|
||||
>
|
||||
{{ tag.name }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
class="item"
|
||||
v-if="screenTags.length > 0"
|
||||
type="danger"
|
||||
@close="tagClear"
|
||||
closable
|
||||
>
|
||||
清空所有条件
|
||||
</el-tag>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="showList" v-if="total > 0">
|
||||
<EquipCardHall
|
||||
class="card"
|
||||
v-for="(v, i) in equipList"
|
||||
:key="i"
|
||||
:url="v.picUrl"
|
||||
:name="v.deviceName"
|
||||
:price="v.dayLeasePrice"
|
||||
:company="v.companyName"
|
||||
:personPhone="v.personPhone"
|
||||
:typeName="v.typeName"
|
||||
@click="onHandleDetails(v.maId)"
|
||||
/>
|
||||
<!-- <equip-card
|
||||
class="card"
|
||||
v-for="(v, i) in equipList"
|
||||
:key="i"
|
||||
:url="v.picUrl"
|
||||
:company="v.companyName"
|
||||
:tags="[v.maStatusStr, v.cityStr || '合肥市']"
|
||||
:name="`${v.modelName}${v.deviceName}`"
|
||||
:price="v.monthLeasePrice"
|
||||
:id="v.maId"
|
||||
time-unit="月"
|
||||
@on-click="toDetail"
|
||||
></equip-card> -->
|
||||
</div>
|
||||
<div class="noData" v-else>
|
||||
<el-empty :image-size="200" />
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<!-- <el-pagination
|
||||
v-model:current-page="pageData.pageNum"
|
||||
:page-size="pageData.pageSize"
|
||||
@current-change="pageChange"
|
||||
:pager-count="5"
|
||||
layout="prev, pager, next"
|
||||
/> -->
|
||||
|
||||
<el-pagination
|
||||
size="small"
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
:page-size="pageData.pageSize"
|
||||
:total="total"
|
||||
class="mt-4"
|
||||
@current-change="onCurrentChange"
|
||||
v-if="total > 0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue'
|
||||
import EquipCard from '@/components/equipCard.vue'
|
||||
import EquipCardHall from '@/components/equipCardHall/index.vue'
|
||||
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
apiGetAddressList,
|
||||
apiGetEquipTypeList,
|
||||
getTypeListApi,
|
||||
getZoneListApi,
|
||||
getCompanyCountApi,
|
||||
} from 'http/api/equip'
|
||||
import { getCompanyListApi, getGoodsClassListApi } from 'http/api/home'
|
||||
import $bus from '@/utils/bus'
|
||||
import NavMenu from '@/components/Navmenu/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const router = useRouter()
|
||||
const route: any = useRoute()
|
||||
const startPrice: any = ref(0)
|
||||
const endPrice: any = ref(0)
|
||||
const levelList = ref<any>([{ title: '一级分类' }, { title: '二级分类' }])
|
||||
const levelList_2 = ref<any>([{ title: '一级分类' }, { title: '二级分类' }, { title: '三级分类' }])
|
||||
let currentIndex = route.query.level || null
|
||||
|
||||
const onConfirmPrice = () => {
|
||||
ElMessage.closeAll()
|
||||
let rex = /^[1-9][0-9]*$/
|
||||
if (!rex.test(startPrice.value) || !rex.test(endPrice.value)) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请输入大于0且不能以0开头的正整数',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (parseInt(endPrice.value) < parseInt(startPrice.value)) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '结束值不可小于起始值',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const itemInfo = {
|
||||
name: `${parseInt(startPrice.value)}-${parseInt(endPrice.value)}`,
|
||||
value: [parseInt(startPrice.value), parseInt(endPrice.value)],
|
||||
isChecked: true,
|
||||
index: 2,
|
||||
isShow: false,
|
||||
isAdd: true,
|
||||
}
|
||||
|
||||
screenChooseList[3].list[0].isChecked = false
|
||||
screenChooseList[3].list.push(itemInfo)
|
||||
|
||||
getDeviceListData()
|
||||
}
|
||||
|
||||
//筛选条件列表数据
|
||||
const screenChooseList: any = reactive([
|
||||
{
|
||||
name: '使用年限:',
|
||||
type: 'userYear',
|
||||
isShow: true,
|
||||
list: [
|
||||
{
|
||||
isChecked: true,
|
||||
name: '全部',
|
||||
value: '',
|
||||
index: 0,
|
||||
},
|
||||
{
|
||||
isChecked: false,
|
||||
name: '0-1年',
|
||||
value: [0, 1],
|
||||
index: 0,
|
||||
},
|
||||
{
|
||||
isChecked: false,
|
||||
name: '1-3年',
|
||||
value: [1, 3],
|
||||
index: 0,
|
||||
},
|
||||
{
|
||||
isChecked: false,
|
||||
name: '3-5年',
|
||||
value: [3, 5],
|
||||
index: 0,
|
||||
},
|
||||
{
|
||||
isChecked: false,
|
||||
name: '5-8年',
|
||||
value: [5, 8],
|
||||
index: 0,
|
||||
},
|
||||
{
|
||||
isChecked: false,
|
||||
name: '10年以上',
|
||||
value: ['', 10],
|
||||
index: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'deviceClass',
|
||||
name: '装备分类:',
|
||||
isShow: true,
|
||||
list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
index: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'deviceClass',
|
||||
name: '下级分类:',
|
||||
isShow: currentIndex === null ? false : true,
|
||||
list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
index: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'leasePrice',
|
||||
name: '租金(天/元):',
|
||||
isShow: true,
|
||||
list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '0-500',
|
||||
value: [0, 500],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '500-1000',
|
||||
value: [500, 1000],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '1000-1500',
|
||||
value: [1000, 1500],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '1500-2000',
|
||||
value: [1500, 2000],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '2000-2500',
|
||||
value: [2000, 2500],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
{
|
||||
name: '2500-3000',
|
||||
value: [2500, 3000],
|
||||
isChecked: false,
|
||||
index: 3,
|
||||
isShow: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// type: 'companyId',
|
||||
// name: '所属公司',
|
||||
// isShow: true,
|
||||
// list: [
|
||||
// {
|
||||
// isChecked: true,
|
||||
// name: '全部',
|
||||
// value: '',
|
||||
// index: 4,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
type: 'temp',
|
||||
name: '',
|
||||
isShow: false,
|
||||
list: [],
|
||||
},
|
||||
])
|
||||
|
||||
// 已选条件的tag标签
|
||||
const screenTags = computed(() => {
|
||||
const selectTagList: any = []
|
||||
screenChooseList.forEach((e: any) => {
|
||||
e.list.forEach((j: any) => {
|
||||
if (j.isChecked && j.name !== '全部') {
|
||||
console.log(j, '******')
|
||||
selectTagList.push(j)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
return selectTagList
|
||||
})
|
||||
// 综合排序 更新时间 月租金 排序按钮
|
||||
const screenOptionList: any = reactive([
|
||||
{
|
||||
name: '综合排序',
|
||||
id: 0,
|
||||
sort: '',
|
||||
},
|
||||
{
|
||||
name: '租金',
|
||||
id: 1,
|
||||
sort: 'DESC',
|
||||
},
|
||||
{
|
||||
name: '上架时间',
|
||||
id: 2,
|
||||
sort: 'DESC', //desc or desc
|
||||
},
|
||||
])
|
||||
//激活 排序按钮
|
||||
const optionActive = ref(0)
|
||||
|
||||
//分页参数
|
||||
const pageData = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
})
|
||||
|
||||
// 总条数
|
||||
const total = ref(0)
|
||||
|
||||
//装备列表
|
||||
const equipList: any = ref([])
|
||||
|
||||
// 获取装备分类
|
||||
const getTypeListData = async () => {
|
||||
let params: any = {}
|
||||
if (route.query.level > 1) {
|
||||
params.id = route.query.typeId
|
||||
}
|
||||
const res = await getTypeListApi()
|
||||
const typeList = res.data.map((e: any) => {
|
||||
return { ...e, name: e.typeName, value: e.typeId, isChecked: false, index: 1 }
|
||||
})
|
||||
screenChooseList[1].list.push(...typeList)
|
||||
}
|
||||
// 获取下级分类
|
||||
const lowerClassData = async () => {
|
||||
const res = await getTypeListApi({
|
||||
typeId: route.query.typeId,
|
||||
level: route.query.level,
|
||||
})
|
||||
|
||||
const typeList_1 = res.data
|
||||
.filter((e: any) => e.level == route.query.level)
|
||||
.map((j: any) => {
|
||||
return { ...j, name: j.typeName, value: j.typeId, isChecked: false, index: 1 }
|
||||
})
|
||||
const typeList_2 = res.data
|
||||
.filter((e: any) => e.level == route.query.level * 1 + 1)
|
||||
.map((j: any) => {
|
||||
return { ...j, name: j.typeName, value: j.typeId, isChecked: false, index: 1 }
|
||||
})
|
||||
|
||||
console.log(typeList_2, 'typeList_2')
|
||||
|
||||
screenChooseList[1].list.push(...typeList_1)
|
||||
screenChooseList[2].list.push(...typeList_2)
|
||||
|
||||
// const typeList = res.data.map((e: any) => {
|
||||
// return { ...e, name: e.typeName, value: e.typeId, isChecked: false, index: 1 }
|
||||
// })
|
||||
// screenChooseList[2].list.push(...typeList)
|
||||
}
|
||||
|
||||
// 获取设备所在地
|
||||
const getCompanyAddressListData = async () => {
|
||||
const res: any = await getCompanyListApi()
|
||||
const addressList = res.data
|
||||
.filter((e: any) => e.isShow)
|
||||
.map((e: any) => {
|
||||
// console.log('🚀 ~ addressList ~ e:', e)
|
||||
return { ...e, name: e.companyName, value: e.companyId, isChecked: false, index: 4 }
|
||||
})
|
||||
screenChooseList[4].list.push(...addressList)
|
||||
}
|
||||
// 获取分类
|
||||
|
||||
// 查询装备列表数据
|
||||
const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
||||
// 组装查询参数
|
||||
const searchParams: any = {
|
||||
keyWord: keyWord ? keyWord : keyWordsSearch.value ? keyWordsSearch.value : '',
|
||||
ageMin: '',
|
||||
ageMax: '',
|
||||
companyId: '',
|
||||
dayLeasePriceMin: '',
|
||||
dayLeasePriceMax: '',
|
||||
typeId: '',
|
||||
level: '',
|
||||
maStatus: 2,
|
||||
dayLeasePriceOrderBy:
|
||||
optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
|
||||
updateTimeOrderBy: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '',
|
||||
}
|
||||
|
||||
screenChooseList.forEach((e: any, index: number) => {
|
||||
e.list.forEach((j: any) => {
|
||||
if (index === 0 && j.isChecked && j.value.length > 0) {
|
||||
searchParams.ageMin = j.value[0]
|
||||
searchParams.ageMax = j.value[1]
|
||||
}
|
||||
if (index === 1 && j.isChecked) {
|
||||
searchParams.typeId = j.value
|
||||
searchParams.level = j.level
|
||||
}
|
||||
if (index === 2 && j.isChecked && currentIndex !== null && j.value != '') {
|
||||
searchParams.typeId = j.value
|
||||
searchParams.level = j.level
|
||||
}
|
||||
if (index === 3 && j.isChecked && j.value.length > 0) {
|
||||
searchParams.dayLeasePriceMin = j.value[0]
|
||||
searchParams.dayLeasePriceMax = j.value[1]
|
||||
}
|
||||
if (index === 4 && j.isChecked) {
|
||||
searchParams.companyId = j.value
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (params) {
|
||||
searchParams.level = params.level ? params.level : ''
|
||||
searchParams.typeId = params.typeId ? params.typeId : ''
|
||||
searchParams.companyId = params.companyId ? params.companyId : ''
|
||||
searchParams.keyWord = params.keyWord ? params.keyWord : ''
|
||||
}
|
||||
|
||||
Object.assign(searchParams, pageData)
|
||||
const { data: res } = await getZoneListApi(searchParams)
|
||||
|
||||
const searchParams_2 = JSON.parse(JSON.stringify(searchParams))
|
||||
searchParams_2.companyId = ''
|
||||
const result: any = await getCompanyCountApi(searchParams_2)
|
||||
screenChooseList[4].list.forEach((e: any, index: any) => {
|
||||
if (index != 0) {
|
||||
e.name = e.companyName + `(${0})`
|
||||
}
|
||||
})
|
||||
for (let key in result.data) {
|
||||
screenChooseList[4].list.forEach((e: any, index: any) => {
|
||||
if (e.companyId == key) {
|
||||
e.name = ''
|
||||
e.name = e.companyName + `(${result.data[key]})`
|
||||
}
|
||||
})
|
||||
}
|
||||
equipList.value = res.rows
|
||||
total.value = res.total
|
||||
}
|
||||
|
||||
// 清除筛选条件
|
||||
const onClearTags = () => {
|
||||
screenChooseList.forEach((e: any, i: any) => {
|
||||
e.list.forEach((j: any, index: number) => {
|
||||
j.isChecked = false
|
||||
if (i != 5) {
|
||||
if (index === 0) {
|
||||
j.isChecked = true
|
||||
}
|
||||
}
|
||||
if (j.isAdd) {
|
||||
startPrice.value = 0
|
||||
endPrice.value = 0
|
||||
screenChooseList[2].list = screenChooseList[2].list.filter(
|
||||
(e: any) => e.isAdd != true,
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
getDeviceListData()
|
||||
}
|
||||
|
||||
//删除条件
|
||||
const handleClose = (tag: any) => {
|
||||
console.log(tag, '***')
|
||||
tag.isChecked = false
|
||||
if (tag.index != 5) {
|
||||
screenChooseList[tag.index].list[0].isChecked = true
|
||||
}
|
||||
|
||||
if (tag.isAdd) {
|
||||
startPrice.value = 0
|
||||
endPrice.value = 0
|
||||
}
|
||||
screenChooseList[tag.index].list = screenChooseList[tag.index].list.filter(
|
||||
(e: any) => e.isAdd != true,
|
||||
)
|
||||
getDeviceListData()
|
||||
}
|
||||
|
||||
// 排序操作
|
||||
const changeOption = (val: any) => {
|
||||
if (val.sort && optionActive.value == val.id) {
|
||||
val.sort = val.sort == 'ASC' ? 'DESC' : 'ASC'
|
||||
}
|
||||
|
||||
console.log(screenOptionList, 'screenOptionList')
|
||||
optionActive.value = val.id
|
||||
getDeviceListData()
|
||||
}
|
||||
|
||||
//选中后添加到 大类中的select字段
|
||||
const selectScreen = async (type: any, item: any, index: number) => {
|
||||
screenChooseList[index].list.forEach((e: any) => {
|
||||
e.isChecked = false
|
||||
})
|
||||
|
||||
if (index == 1) {
|
||||
screenChooseList[2].list = screenChooseList[2].list.slice(0, 1)
|
||||
|
||||
const params = {
|
||||
typeId: '',
|
||||
level: '',
|
||||
}
|
||||
if (item.value) {
|
||||
params.typeId = item.typeId
|
||||
params.level = item.level
|
||||
} else {
|
||||
params.typeId = route.query.typeId
|
||||
params.level = route.query.level
|
||||
}
|
||||
const res = await getTypeListApi(params)
|
||||
|
||||
const typeList_2 = res.data
|
||||
.filter((e: any) => e.level == route.query.level * 1 + 1)
|
||||
.map((j: any) => {
|
||||
return { ...j, name: j.typeName, value: j.typeId, isChecked: false, index: 1 }
|
||||
})
|
||||
screenChooseList[2].list.push(...typeList_2)
|
||||
}
|
||||
|
||||
if (index == 2) {
|
||||
currentIndex = route.query.level * 1 + 1
|
||||
}
|
||||
item.isChecked = !item.isChecked
|
||||
getDeviceListData()
|
||||
}
|
||||
|
||||
//分页page变化
|
||||
const onCurrentChange = (val: number) => {
|
||||
pageData.pageNum = val
|
||||
getDeviceListData()
|
||||
}
|
||||
const keyWordsSearch = ref('')
|
||||
onMounted(() => {
|
||||
$bus.on('search', (val: any) => {
|
||||
keyWordsSearch.value = val
|
||||
getDeviceListData(null, val)
|
||||
})
|
||||
let routeParams: any = null
|
||||
if (route.query.level && route.query.typeId) {
|
||||
routeParams = {
|
||||
level: route.query.level,
|
||||
typeId: route.query.typeId,
|
||||
}
|
||||
|
||||
Promise.all([getCompanyAddressListData(), lowerClassData()]).then(() => {
|
||||
if (route.query.level == 1) {
|
||||
screenChooseList[1].list.forEach((e: any, index: number) => {
|
||||
if (index == 0) {
|
||||
e.isChecked = false
|
||||
}
|
||||
if (route.query.typeId == e.typeId) {
|
||||
e.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (route.query.level == 2 || route.query.level == 3) {
|
||||
screenChooseList[1].list.forEach((e: any, index: number) => {
|
||||
if (index == 0) {
|
||||
e.isChecked = false
|
||||
}
|
||||
if (route.query.typeId == e.typeId) {
|
||||
e.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (route.query.companyId) {
|
||||
routeParams = {
|
||||
companyId: route.query.companyId,
|
||||
}
|
||||
screenChooseList[4].list[0].isChecked = false
|
||||
screenChooseList[4].list.forEach((e: any) => {
|
||||
if (route.query.companyId == e.companyId) {
|
||||
e.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
getDeviceListData(routeParams, null)
|
||||
})
|
||||
}
|
||||
|
||||
if (route.query.keyWord) {
|
||||
routeParams = {
|
||||
keyWord: route.query.keyWord,
|
||||
}
|
||||
}
|
||||
|
||||
if (!route.query.level && !route.query.typeId) {
|
||||
Promise.all([getCompanyAddressListData(), getTypeListData()]).then(() => {
|
||||
if (route.query.level == 1) {
|
||||
screenChooseList[1].list.forEach((e: any) => {
|
||||
if (route.query.typeId == e.typeId) {
|
||||
e.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (route.query.level == 2 || route.query.level == 3) {
|
||||
{
|
||||
const item = {
|
||||
isChecked: true,
|
||||
name: route.query.name,
|
||||
value: route.query.typeId,
|
||||
index: 5,
|
||||
}
|
||||
screenChooseList[5].list = []
|
||||
screenChooseList[5].list.push(item)
|
||||
}
|
||||
}
|
||||
if (route.query.companyId) {
|
||||
routeParams = {
|
||||
companyId: route.query.companyId,
|
||||
}
|
||||
screenChooseList[4].list[0].isChecked = false
|
||||
screenChooseList[4].list.forEach((e: any) => {
|
||||
if (route.query.companyId == e.companyId) {
|
||||
e.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
getDeviceListData(routeParams, null)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
$bus.off('search')
|
||||
})
|
||||
|
||||
// 点击跳转装备详情
|
||||
const onHandleDetails = (id: number | string) => {
|
||||
router.push({
|
||||
name: 'equipDetail',
|
||||
query: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.equipList {
|
||||
.showScreen {
|
||||
margin: 15px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #ccc;
|
||||
// height: 30px;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #949494;
|
||||
}
|
||||
}
|
||||
|
||||
.screen {
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
.choose {
|
||||
margin-top: 10px;
|
||||
|
||||
.line {
|
||||
padding: 14px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// border-bottom: 1px solid #dddddd;
|
||||
|
||||
.label {
|
||||
// width: 100px;
|
||||
box-sizing: border-box;
|
||||
|
||||
// padding: 0 15px;
|
||||
// background: #f3f3f3;
|
||||
}
|
||||
|
||||
.select {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
padding: 0 15px;
|
||||
|
||||
.item {
|
||||
padding: 2px 16px;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
color: #939393;
|
||||
// font-size: 15px;
|
||||
font-size: 17px;
|
||||
line-height: 25px;
|
||||
height: 25px;
|
||||
|
||||
&:hover {
|
||||
color: #3cb4a6;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: #3cb4a6;
|
||||
color: #fff !important;
|
||||
border-radius: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #138472;
|
||||
.item {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.clear-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
background-color: #fff;
|
||||
border: 1px solid #138472;
|
||||
color: #138472;
|
||||
}
|
||||
:deep .el-tag .el-tag__close {
|
||||
color: #138472;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #138472 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// margin-top: 20px;
|
||||
|
||||
.item {
|
||||
background: #f7f9fa;
|
||||
border-radius: 12px;
|
||||
padding: 10px 20px;
|
||||
|
||||
// font-size: 17px;
|
||||
font-weight: 500;
|
||||
color: #9d9d9d;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
.icon {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.showList {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.card {
|
||||
width: calc((100% - 45px) / 4);
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
&:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
:deep.el-pagination.is-background .el-pager li.is-active {
|
||||
background-color: #3cb4a6;
|
||||
}
|
||||
|
||||
.class-container {
|
||||
margin-top: 20px;
|
||||
// font-size: 14px;
|
||||
color: #ccc;
|
||||
|
||||
a {
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -258,6 +258,8 @@ const getDetailData = async (row: any) => {
|
|||
devInfoProperties,
|
||||
tableList,
|
||||
maintenanceAlarmDay,
|
||||
isZone,
|
||||
zoneId,
|
||||
} = res
|
||||
|
||||
Object.assign(addAndEditForm, {
|
||||
|
|
@ -282,6 +284,8 @@ const getDetailData = async (row: any) => {
|
|||
devInfoProperties,
|
||||
tableList,
|
||||
maintenanceAlarmDay,
|
||||
isZone,
|
||||
zoneId,
|
||||
})
|
||||
|
||||
if (settleinTitle.value == '装备编辑') {
|
||||
|
|
@ -640,6 +644,30 @@ const equipRules = ref({
|
|||
// //
|
||||
// { required: true, message: '整机重量不能为空', trigger: 'blur' },
|
||||
// ],
|
||||
// isZone: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请选择是否在租',
|
||||
// trigger: 'change',
|
||||
// },
|
||||
// ],
|
||||
// zoneId: [
|
||||
// {
|
||||
// required: true,
|
||||
// validator: (rule: any, value: any, callback: any) => {
|
||||
// if (addAndEditForm.isZone) {
|
||||
// if (value == '') {
|
||||
// callback(new Error('请选择关联公司'))
|
||||
// } else {
|
||||
// callback()
|
||||
// }
|
||||
// } else {
|
||||
// callback()
|
||||
// }
|
||||
// },
|
||||
// trigger: 'change',
|
||||
// },
|
||||
// ],
|
||||
})
|
||||
|
||||
const getProertyNameRules = (item: any) => {
|
||||
|
|
@ -1110,6 +1138,8 @@ const addAndEditForm = reactive<any>({
|
|||
examinationPdfs: [],
|
||||
devInfoProperties: [],
|
||||
tableList: [],
|
||||
isZone: true, // 是否上架专区
|
||||
zoneId: '', // 专区id
|
||||
})
|
||||
// const addAndEditFormTemp = reactive<any>()
|
||||
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
|
||||
|
|
@ -1985,6 +2015,30 @@ const changeNextDate = (row: any) => {
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 暂时不展示 -->
|
||||
<!-- <TitleTip :titleText="`专区`" />
|
||||
<el-form-item label="是否上架专区" prop="isZone">
|
||||
<el-radio-group v-model="addAndEditForm.isZone">
|
||||
<el-radio :value="true" :label="true">是</el-radio>
|
||||
<el-radio :value="false" :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联公司" prop="zoneId">
|
||||
<el-select
|
||||
v-model="addAndEditForm.zoneId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择关联公司"
|
||||
:disabled="!addAndEditForm.isZone"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in companyDataList"
|
||||
:key="item.companyId"
|
||||
:label="item.companyName"
|
||||
:value="item.companyId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<div style="display: flex; align-items: center">
|
||||
<TitleTip :titleText="`装备证书`" />
|
||||
<el-button
|
||||
|
|
@ -2192,6 +2246,7 @@ const changeNextDate = (row: any) => {
|
|||
style="width: 100%"
|
||||
placeholder="请输入唯一标识符"
|
||||
maxlength="20"
|
||||
:disabled="disabledForm"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -2256,6 +2311,7 @@ const changeNextDate = (row: any) => {
|
|||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入检修人"
|
||||
:disabled="disabledForm"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -2273,6 +2329,7 @@ const changeNextDate = (row: any) => {
|
|||
placeholder="请选择"
|
||||
@change="changeDate(row, $index)"
|
||||
style="width: 100%"
|
||||
:disabled="disabledForm"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -2291,6 +2348,7 @@ const changeNextDate = (row: any) => {
|
|||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
@change="changeNextDate(row)"
|
||||
:disabled="disabledForm"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -2309,6 +2367,7 @@ const changeNextDate = (row: any) => {
|
|||
:limit="5"
|
||||
:on-success="(file: any) => handleSuccess(file, row, 2)"
|
||||
accept=".jpg,.png,.pdf, .doc, .docx"
|
||||
:disabled="!isAdd"
|
||||
>
|
||||
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
|
||||
</el-upload>
|
||||
|
|
@ -2329,6 +2388,7 @@ const changeNextDate = (row: any) => {
|
|||
:limit="5"
|
||||
:on-success="(file: any) => handleSuccess(file, row, 1)"
|
||||
accept=".jpg,.png,.pdf, .doc, .docx"
|
||||
:disabled="!isAdd"
|
||||
>
|
||||
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
|
||||
</el-upload>
|
||||
|
|
|
|||
|
|
@ -8,10 +8,11 @@ const store: any = useStore()
|
|||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const isAdmin = ref(JSON.parse(localStorage.getItem('main')).userInfo.admin)
|
||||
console.log('🚀 ~ isAdmin:', isAdmin)
|
||||
// 临时管理员权限
|
||||
// const isAdmin = ref(JSON.parse(localStorage.getItem('main')).userInfo.userName == 'yuecuishan_4261')
|
||||
console.log('🚀 ~ isAdmin:', isAdmin.value)
|
||||
|
||||
import imgSrc from '@/assets/img/logo.png'
|
||||
import { el } from 'element-plus/es/locale'
|
||||
|
||||
const handleSelect = (name: any, path: any) => {
|
||||
console.log('🚀 ~ handleSelect ~ name:', name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue