bug修改 排序修改
This commit is contained in:
parent
f1eee059b6
commit
02e85a6d72
|
@ -1583,6 +1583,8 @@ export default {
|
||||||
}, 700);
|
}, 700);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 新增辅助方法处理状态消息
|
// 新增辅助方法处理状态消息
|
||||||
getStatusMessage(status) {
|
getStatusMessage(status) {
|
||||||
const messages = {
|
const messages = {
|
||||||
|
@ -1679,6 +1681,10 @@ export default {
|
||||||
this.bulepayback = false
|
this.bulepayback = false
|
||||||
this.payback()
|
this.payback()
|
||||||
}
|
}
|
||||||
|
if(this.bulebindcar){
|
||||||
|
this.bulebindcar = false
|
||||||
|
this.bluesub1()
|
||||||
|
}
|
||||||
// bulepayback: false,
|
// bulepayback: false,
|
||||||
// bulebindcar: false,
|
// bulebindcar: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,63 +3,57 @@
|
||||||
<u-navbar title="设备管理" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
|
<u-navbar title="设备管理" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
|
||||||
height='45'></u-navbar>
|
height='45'></u-navbar>
|
||||||
<view class="tap">
|
<view class="tap">
|
||||||
<!-- <view class="tap_cont " :class="curtitidx==0?'act1':''" @click="changeidx(0)">
|
|
||||||
投放中设备
|
|
||||||
</view>
|
|
||||||
<view class="tap_cont" :class="curtitidx==1?'act1':''" @click="changeidx(1)">
|
|
||||||
仓库中设备
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="background: #FFFFFF;width: 750rpx;padding-bottom: 36rpx;">
|
<view class="" style="background: #FFFFFF;width: 750rpx;padding-bottom: 36rpx;">
|
||||||
|
|
||||||
<view class="top_box" style="margin-top: 20rpx;">
|
<view class="top_box" style="margin-top: 20rpx;">
|
||||||
<!-- <view class="left_text" @click="show=true">
|
|
||||||
{{tit}} <view class="iconfont icon-xiangxia1"></view>
|
|
||||||
</view> -->
|
|
||||||
<view class="sear_ipt">
|
<view class="sear_ipt">
|
||||||
<input type="text"
|
<input type="text" v-model="searchKeyword" placeholder="请输入SN码" class="input"
|
||||||
v-model="searchKeyword"
|
placeholder-style="color:#C7CDD3" @input="search()">
|
||||||
placeholder="请输入SN码"
|
|
||||||
class="input"
|
|
||||||
placeholder-style="color:#C7CDD3"
|
|
||||||
@input="search()">
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="stause_box">
|
<view class="stause_box">
|
||||||
<view class="stause_li" @click="show=true">
|
<view class="stause_li" @click="show = true">
|
||||||
{{tit}}
|
{{ tit }}
|
||||||
<view class="iconfont icon-xiangxia1"></view>
|
<view class="iconfont icon-xiangxia1"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="stause_li" style="margin-left: 50rpx;" @click="showdsc=true">
|
<view class="stause_li" style="margin-left: 50rpx;" @click="showdsc = true">
|
||||||
{{sctit}}
|
{{ sctit }}
|
||||||
|
<view class="iconfont icon-xiangxia1"></view>
|
||||||
|
</view>
|
||||||
|
<view class="stause_li" style="margin-left: 50rpx;" @click="showtype = true">
|
||||||
|
{{ typeSortLabel }}
|
||||||
<view class="iconfont icon-xiangxia1"></view>
|
<view class="iconfont icon-xiangxia1"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info_card" style="margin-top: 20rpx;" v-for="(item,index) in filteredList" :key="index" @click.stop="todetail(item)">
|
<view class="info_card" style="margin-top: 20rpx;" v-for="(item, index) in filteredList" :key="index"
|
||||||
|
@click.stop="todetail(item)">
|
||||||
<view class="info_tit" style="margin-left: 36rpx;">
|
<view class="info_tit" style="margin-left: 36rpx;">
|
||||||
<view class="tit_right" :style="{ color: getStatusColors(item) }" style="margin-left: 0rpx;margin-right: 20rpx;">
|
<view class="tit_right" :style="{ color: getStatusColors(item) }"
|
||||||
|
style="margin-left: 0rpx;margin-right: 20rpx;">
|
||||||
|
|
||||||
<view class="yuan" :style="{ background: getStatusColors(item) }"></view>
|
<view class="yuan" :style="{ background: getStatusColors(item) }"></view>
|
||||||
{{statuss(item)}}
|
{{ statuss(item) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="tit_left" v-if="stepindex==1" >
|
<view class="tit_left" v-if="stepindex == 1">
|
||||||
<image src="https://lxnapi.ccttiot.com/bike/img/static/uTuWiPEViwzaPPHAgjdN" mode=""
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/uTuWiPEViwzaPPHAgjdN" mode="aspectFit"
|
||||||
v-if="!isSelected(item.sn)" @click.stop="selectItem(item.sn)"></image>
|
v-if="!isSelected(item.sn)" @click.stop="selectItem(item.sn)"></image>
|
||||||
<image src="https://lxnapi.ccttiot.com/bike/img/static/uGY25CNyW7Vz0LJcOYtS" mode=""
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/uGY25CNyW7Vz0LJcOYtS" mode="aspectFit"
|
||||||
v-if="isSelected(item.sn)" @click.stop="deselectItem(item.sn)"></image>
|
v-if="isSelected(item.sn)" @click.stop="deselectItem(item.sn)"></image>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<span v-if="item.vehicleNum"> 车牌号:{{item.vehicleNum}}</span>
|
<span v-if="item.vehicleNum"> 车牌号:{{ item.vehicleNum }}</span>
|
||||||
<span v-if="!item.vehicleNum"> 车牌号:--</span>
|
<span v-if="!item.vehicleNum"> 车牌号:--</span>
|
||||||
|
|
||||||
<view class="tit_right" :style="{ color: getStatusColor(item) }">
|
<view class="tit_right" :style="{ color: getStatusColor(item) }">
|
||||||
|
|
||||||
<view class="yuan" :style="{ background: getStatusColor(item) }"></view>
|
<view class="yuan" :style="{ background: getStatusColor(item) }"></view>
|
||||||
{{status(item)}}
|
{{ status(item) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lines"></view>
|
<view class="lines"></view>
|
||||||
|
@ -69,24 +63,24 @@
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
<view class="half_infoli">
|
<view class="half_infoli">
|
||||||
MAC:
|
MAC:
|
||||||
<span v-if="item.mac"> {{item.mac}}</span>
|
<span v-if="item.mac"> {{ item.mac }}</span>
|
||||||
<span v-if="!item.mac"> --</span>
|
<span v-if="!item.mac"> --</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="half_infoli">
|
<view class="half_infoli">
|
||||||
电量:
|
电量:
|
||||||
<span v-if="item.remainingPower"> {{item.remainingPower}}%</span>
|
<span v-if="item.remainingPower"> {{ item.remainingPower }}%</span>
|
||||||
<span v-else> --</span>
|
<span v-else> --</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
<view class="half_infoli">
|
<view class="half_infoli">
|
||||||
SN:
|
SN:
|
||||||
<span v-if="item.sn"> {{item.sn}}</span>
|
<span v-if="item.sn"> {{ item.sn }}</span>
|
||||||
<span v-else> --</span>
|
<span v-else> --</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="half_infoli">
|
<view class="half_infoli">
|
||||||
型号:
|
型号:
|
||||||
<span v-if="item.model"> {{item.model}}</span>
|
<span v-if="item.model"> {{ item.model }}</span>
|
||||||
<span v-else> --</span>
|
<span v-else> --</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -95,24 +89,24 @@
|
||||||
|
|
||||||
|
|
||||||
<view class="bot_box">
|
<view class="bot_box">
|
||||||
<view class="step1" v-if="stepindex ==0" style="padding: 50rpx;">
|
<view class="step1" v-if="stepindex == 0" style="padding: 50rpx;">
|
||||||
<view class="step1_left">
|
<view class="step1_left">
|
||||||
设备总数:<span>{{filteredList.length}}</span>
|
设备总数:<span>{{ filteredList.length }}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="right_box" @click="stepindex=1">
|
<view class="right_box" @click="stepindex = 1">
|
||||||
批量操作
|
批量操作
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="step2" v-if="stepindex ==1">
|
<view class="step2" v-if="stepindex == 1">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="top_left" @click="selectAll">
|
<view class="top_left" @click="selectAll">
|
||||||
<image
|
<image
|
||||||
:src="isAllSelected ? 'https://lxnapi.ccttiot.com/bike/img/static/uGY25CNyW7Vz0LJcOYtS' : 'https://lxnapi.ccttiot.com/bike/img/static/uTuWiPEViwzaPPHAgjdN'"
|
:src="isAllSelected ? 'https://lxnapi.ccttiot.com/bike/img/static/uGY25CNyW7Vz0LJcOYtS' : 'https://lxnapi.ccttiot.com/bike/img/static/uTuWiPEViwzaPPHAgjdN'"
|
||||||
mode=""></image>
|
mode="aspectFit"></image>
|
||||||
{{ isAllSelected ? '取消全选' : '全选' }}
|
{{ isAllSelected ? '取消全选' : '全选' }}
|
||||||
</view>
|
</view>
|
||||||
<view class="top_right">
|
<view class="top_right">
|
||||||
已选设备:{{selectedItems.length}}
|
已选设备:{{ selectedItems.length }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bot_btn">
|
<view class="bot_btn">
|
||||||
|
@ -143,12 +137,13 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<u-select v-model="show" :list="list" title='设备状态' @confirm="confirm"></u-select>
|
<u-select v-model="show" :list="list" title='设备状态' @confirm="confirm"></u-select>
|
||||||
<u-select v-model="showdsc" :list="lists" title='剩余电量' @confirm="confirms"></u-select>
|
<u-select v-model="showdsc" :list="lists" title='排序方式' @confirm="confirms"></u-select>
|
||||||
|
<u-select v-model="showtype" :list="sortTypeList" title='排序选择' @confirm="confirmSortType"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
curtitidx: 0,
|
curtitidx: 0,
|
||||||
|
@ -156,9 +151,25 @@
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
},
|
},
|
||||||
showdsc: false,
|
showdsc: false,
|
||||||
sctit: '从高到低',
|
sctit: '从低到高',
|
||||||
scidx: 'desc',
|
scidx: 'asc',
|
||||||
show: false,
|
show: false,
|
||||||
|
showtype: false,
|
||||||
|
typeSort: '1',
|
||||||
|
typeSortLabel: 'SN码排序',
|
||||||
|
// 添加排序类型列表
|
||||||
|
sortTypeList: [{
|
||||||
|
value: '1',
|
||||||
|
label: 'SN码排序'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '车型排序'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '车牌号排序'
|
||||||
|
}],
|
||||||
lists: [{
|
lists: [{
|
||||||
value: 'desc',
|
value: 'desc',
|
||||||
label: '从高到低'
|
label: '从高到低'
|
||||||
|
@ -203,8 +214,8 @@
|
||||||
deviceList: [],
|
deviceList: [],
|
||||||
stepindex: 0,
|
stepindex: 0,
|
||||||
selectedItems: [],
|
selectedItems: [],
|
||||||
searchKeyword:'',
|
searchKeyword: '',
|
||||||
filteredList:[],
|
filteredList: [],
|
||||||
areaId: 0,
|
areaId: 0,
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,14 +223,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// if(uni.getStorageSync('adminAreaid')){
|
|
||||||
// this.areaId = uni.getStorageSync('adminAreaid')
|
|
||||||
// this.getDevice()
|
|
||||||
// }
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(uni.getStorageSync('adminAreaid')){
|
if (uni.getStorageSync('adminAreaid')) {
|
||||||
this.areaId = uni.getStorageSync('adminAreaid')
|
this.areaId = uni.getStorageSync('adminAreaid')
|
||||||
this.getDevice()
|
this.getDevice()
|
||||||
}
|
}
|
||||||
|
@ -237,8 +243,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
search(){
|
search() {
|
||||||
if (this.searchKeyword!='') {
|
if (this.searchKeyword != '') {
|
||||||
this.filteredList = this.deviceList.filter(device =>
|
this.filteredList = this.deviceList.filter(device =>
|
||||||
device.sn.includes(this.searchKeyword)
|
device.sn.includes(this.searchKeyword)
|
||||||
);
|
);
|
||||||
|
@ -246,14 +252,20 @@
|
||||||
this.filteredList = this.deviceList;
|
this.filteredList = this.deviceList;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
todetail(item){
|
todetail(item) {
|
||||||
if(this.stepindex==0){
|
if (this.stepindex == 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages_admin/order/device_detail?id='+item.sn
|
url: '/pages_admin/order/device_detail?id=' + item.sn
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 添加新的排序类型确认方法
|
||||||
|
confirmSortType(e) {
|
||||||
|
this.typeSort = e[0].value
|
||||||
|
this.typeSortLabel = e[0].label
|
||||||
|
this.getDevice()
|
||||||
|
},
|
||||||
ban() {
|
ban() {
|
||||||
let data = {
|
let data = {
|
||||||
disableType: 'disable',
|
disableType: 'disable',
|
||||||
|
@ -288,7 +300,7 @@
|
||||||
// 处理接口请求失败的情况
|
// 处理接口请求失败的情况
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
gohome(){
|
gohome() {
|
||||||
let data = {
|
let data = {
|
||||||
disableType: 'inStash',
|
disableType: 'inStash',
|
||||||
sns: this.selectedItems.join(',')
|
sns: this.selectedItems.join(',')
|
||||||
|
@ -306,7 +318,7 @@
|
||||||
// 处理接口请求失败的情况
|
// 处理接口请求失败的情况
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
livehome(){
|
livehome() {
|
||||||
let data = {
|
let data = {
|
||||||
disableType: 'outStash',
|
disableType: 'outStash',
|
||||||
sns: this.selectedItems.join(',')
|
sns: this.selectedItems.join(',')
|
||||||
|
@ -331,22 +343,27 @@
|
||||||
this.getDevice()
|
this.getDevice()
|
||||||
},
|
},
|
||||||
getStatusColor(item) {
|
getStatusColor(item) {
|
||||||
// if (item.onlineStatus == 0) {
|
|
||||||
// // 离线状态为红色
|
|
||||||
// return 'red';
|
|
||||||
// } else
|
|
||||||
if (item.status == 0 || item.status == 8) {
|
if (item.status == 0 || item.status == 8) {
|
||||||
// 下线和未上架状态为灰色
|
return '#808080'; // 下线和未上架状态为灰色
|
||||||
return 'gray';
|
} else if (item.status == 1) {
|
||||||
} else {
|
return '#28a745'; // 待租状态为绿色
|
||||||
// 其他状态为蓝色
|
} else if (item.status == 2) {
|
||||||
// return 'blue';
|
return '#ff8c00'; // 预约中状态为橙色
|
||||||
|
} else if (item.status == 3) {
|
||||||
|
return '#007bff'; // 骑行中状态为蓝色
|
||||||
|
} else if (item.status == 4) {
|
||||||
|
return '#ffc107'; // 临时锁车中状态为黄色
|
||||||
|
} else if (item.status == 6) {
|
||||||
|
return '#6f42c1'; // 调度中状态为紫色
|
||||||
|
} else if (item.status == 7) {
|
||||||
|
return '#343a40'; // 未绑定状态为黑色
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getStatusColors(item) {
|
getStatusColors(item) {
|
||||||
if (item.onlineStatus == 0) {
|
if (item.onlineStatus == 0) {
|
||||||
// 离线状态为红色
|
return '#dc3545'; // 离线状态为红色
|
||||||
return 'red';
|
} else {
|
||||||
|
return '#28a745'; // 在线状态为绿色
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closestep() {
|
closestep() {
|
||||||
|
@ -400,18 +417,17 @@
|
||||||
statuss(item) {
|
statuss(item) {
|
||||||
if (item.onlineStatus == 0) {
|
if (item.onlineStatus == 0) {
|
||||||
return '离线'
|
return '离线'
|
||||||
}else{
|
} else {
|
||||||
return '在线'
|
return '在线'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDevice() {
|
getDevice() {
|
||||||
let data = {
|
let data = {
|
||||||
powerStart: '',
|
|
||||||
powerEnd: '',
|
|
||||||
sort: this.scidx,
|
sort: this.scidx,
|
||||||
status: this.typeidx,
|
status: this.typeidx,
|
||||||
areaId: this.areaId
|
areaId: this.areaId,
|
||||||
|
typeSort: this.typeSort
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectedItems = [];
|
this.selectedItems = [];
|
||||||
|
@ -440,16 +456,17 @@
|
||||||
this.curtitidx = idx
|
this.curtitidx = idx
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #F6F6F6;
|
background-color: #F6F6F6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
|
||||||
.top_box {
|
.top_box {
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -473,7 +490,8 @@
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
.icon-xiangxia1{
|
|
||||||
|
.icon-xiangxia1 {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -510,6 +528,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info_card {
|
.info_card {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
|
|
||||||
|
@ -585,6 +604,7 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 超出部分隐藏 */
|
/* 超出部分隐藏 */
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -761,5 +781,5 @@
|
||||||
color: #4C97E7;
|
color: #4C97E7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user