工单列表前端

This commit is contained in:
小朱 2025-05-06 17:57:31 +08:00
parent e99b9b936a
commit 37ccfd03a5

View File

@ -7,8 +7,8 @@
</view>
</view>
<view class="">
<uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @cancel="cancel"
placeholder="输入车辆编号" clearButton="always" cancelButton="always">
<uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @clear="clearSearch" @cancel="cancel"
placeholder="输入车辆编号" clearButton="always" cancelButton="always">
</uni-search-bar>
</view>
<z-paging ref="paging" :fixed="false" height="85vh" v-model="dataList" @query="loadMoreData"
@ -16,38 +16,39 @@
<view v-for="(item,index) in dataList" :key="index">
<uni-card>
<template v-slot:title>
<view class="flex justify-between cardtitle">
<view class="flex justify-between cardtitle">
<view class="flex align-center ">
<view class="cardtitleri">
{{item.orderTypeName}}
{{item.orderTypeName}}
</view>
<view style="margin-left: 10px;">
<!-- <view style="margin-left: 10px;">
<view class="cu-tag radius line-green"
style="background-color:rgba(203,240,204,0.4);">图标</view>
</view>
</view> -->
</view>
<view>
<uni-icons type="right" size="20"></uni-icons>
<uni-icons @click="gotoPage(item.orderType,item)" type="right" size="20"></uni-icons>
</view>
</view>
</template>
<uni-forms>
<uni-forms-item v-if="item.longitude" label="">
<!-- <uni-forms-item v-if="item.longitude &&item.longitude !=''" label="">
<view class="deepBlackBoldText">
{{getAreaByCoordinates(item.longitude,item.latitude)}}
</view>
</uni-forms-item>
<uni-forms-item v-if="item.bikeCode" label="车辆编号">
</uni-forms-item> -->
<uni-forms-item v-if="item.bikeCode && item.bikeCode !='' " label="车辆编号">
<view class="deepBlackBoldText">
{{item.bikeCode}}
<span style="color: rgb(19,131,255);"
@click="gotoebikeInfo(item.bikeCode)">{{item.bikeCode}}</span>
</view>
</uni-forms-item>
<uni-forms-item v-if="item.bikeCount" label="车辆数量">
<uni-forms-item v-if="item.bikeCount && item.bikeCount !='' " label="车辆数量">
<view class="deepBlackBoldText">
{{item.bikeCount}}
</view>
</uni-forms-item>
<uni-forms-item v-if="item.dispatchType" label="调度类型">
<uni-forms-item v-if="item.dispatchType && item.dispatchType !='' " label="调度类型">
<view class="deepBlackBoldText">
{{item.dispatchType}}
</view>
@ -64,6 +65,7 @@
</view>
</z-paging>
</view>
<zero-loading v-if="isloading" color="#c1c1c0" type="pulse" mask="true"></zero-loading>
</template>
<script setup>
@ -79,7 +81,9 @@
onLoad
} from '@dcloudio/uni-app';
const isCancelOrClear = ref(false);
const isloading = ref(false);
var qqmapsdk = new QQMapWX({
key: map.sdkKey
});
@ -115,8 +119,10 @@
});
const loadMoreData = (pageNo, pageSize) => {
const params = {
"orderType": 1,
"orderType": selectedOption.value,
"bikeCode": searchValue.value,
"pageParam": {
"pageNum": pageNo,
"pageSize": pageSize
@ -134,22 +140,80 @@
const selectOption = (option) => {
selectedOption.value = option;
paging.value.reload();
};
const blur = () => {
};
const blur = (value) => {
if (value == searchValue.value) return;
paging.value.reload();
const cancel = () => {
};
const cancel = (value) => {
const getAreaByCoordinates =(lng, lat)=>{
debugger;
if (value == "") return;
searchValue.value = "";
paging.value.reload();
}
const clearSearch = (value) => {
if (value == "") return;
searchValue.value = "";
paging.value.reload();
}
const getAreaByCoordinates = (lng, lat) => {
map.reverseGeocoder(qqmapsdk, lng, lat, (res) => {
debugger;
return city;
const {
address
} = res
return address;
}, (res) => {
return "";
});
}
const gotoebikeInfo = (bikeCode) => {
isloading.value = true;
api.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode).then((res) => {
if (res.code == 200) {
const bikeId = res.data.bikeId;
const ecuId = res.data.ecuId;
const ecuSn = res.data.ecuSn;
uni.navigateTo({
url: "/pages/devops/ebikeinfo/ebikeinfo?bikeId=" + bikeId + "&ecuId=" + ecuId +
"&ecuSn=" + ecuSn,
});
setTimeout(() => {
isloading.value = false;
}, 500);
}
})
}
const gotoPage = (orderType, item) => {
switch (orderType) {
case "1":
uni.navigateTo({
url: `/pages/devops/maintenancepage/maintenancepage?bikeCode=${item.bikeCode}`
})
console.log("跳转到维修页面");
// 使 window.location.href
break;
case "2":
//
console.log("跳转到换电页面");
// 使
break;
case "3":
uni.navigateTo({
url: `/pages/warehouse/vehicledispatch/vehicledispatch?orderId=${item.orderId}`
});
console.log("跳转到调度页面");
//
break;
default:
// orderType123
console.log("无效的orderType");
break;
}
};
</script>
<style>
@ -197,4 +261,20 @@
.deepBlackBoldText {
font-weight: bold;
}
.uni-forms-item__content {
position: relative;
font-size: 14px;
flex: 1;
box-sizing: border-box;
line-height: 36px;
flex-direction: row;
}
.uni-forms-item {
position: relative;
display: flex;
margin-bottom: 2px !important;
flex-direction: row;
}
</style>