工单列表前端

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

View File

@ -7,7 +7,7 @@
</view> </view>
</view> </view>
<view class=""> <view class="">
<uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @cancel="cancel" <uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @clear="clearSearch" @cancel="cancel"
placeholder="输入车辆编号" clearButton="always" cancelButton="always"> placeholder="输入车辆编号" clearButton="always" cancelButton="always">
</uni-search-bar> </uni-search-bar>
</view> </view>
@ -21,33 +21,34 @@
<view class="cardtitleri"> <view class="cardtitleri">
{{item.orderTypeName}} {{item.orderTypeName}}
</view> </view>
<view style="margin-left: 10px;"> <!-- <view style="margin-left: 10px;">
<view class="cu-tag radius line-green" <view class="cu-tag radius line-green"
style="background-color:rgba(203,240,204,0.4);">图标</view> style="background-color:rgba(203,240,204,0.4);">图标</view>
</view> </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>
</view> </view>
</template> </template>
<uni-forms> <uni-forms>
<uni-forms-item v-if="item.longitude" label=""> <!-- <uni-forms-item v-if="item.longitude &&item.longitude !=''" label="">
<view class="deepBlackBoldText"> <view class="deepBlackBoldText">
{{getAreaByCoordinates(item.longitude,item.latitude)}} {{getAreaByCoordinates(item.longitude,item.latitude)}}
</view> </view>
</uni-forms-item> </uni-forms-item> -->
<uni-forms-item v-if="item.bikeCode" label="车辆编号"> <uni-forms-item v-if="item.bikeCode && item.bikeCode !='' " label="车辆编号">
<view class="deepBlackBoldText"> <view class="deepBlackBoldText">
{{item.bikeCode}} <span style="color: rgb(19,131,255);"
@click="gotoebikeInfo(item.bikeCode)">{{item.bikeCode}}</span>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item v-if="item.bikeCount" label="车辆数量"> <uni-forms-item v-if="item.bikeCount && item.bikeCount !='' " label="车辆数量">
<view class="deepBlackBoldText"> <view class="deepBlackBoldText">
{{item.bikeCount}} {{item.bikeCount}}
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item v-if="item.dispatchType" label="调度类型"> <uni-forms-item v-if="item.dispatchType && item.dispatchType !='' " label="调度类型">
<view class="deepBlackBoldText"> <view class="deepBlackBoldText">
{{item.dispatchType}} {{item.dispatchType}}
</view> </view>
@ -64,6 +65,7 @@
</view> </view>
</z-paging> </z-paging>
</view> </view>
<zero-loading v-if="isloading" color="#c1c1c0" type="pulse" mask="true"></zero-loading>
</template> </template>
<script setup> <script setup>
@ -79,7 +81,9 @@
onLoad onLoad
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
const isCancelOrClear = ref(false);
const isloading = ref(false);
var qqmapsdk = new QQMapWX({ var qqmapsdk = new QQMapWX({
key: map.sdkKey key: map.sdkKey
}); });
@ -115,8 +119,10 @@
}); });
const loadMoreData = (pageNo, pageSize) => { const loadMoreData = (pageNo, pageSize) => {
const params = { const params = {
"orderType": 1, "orderType": selectedOption.value,
"bikeCode": searchValue.value,
"pageParam": { "pageParam": {
"pageNum": pageNo, "pageNum": pageNo,
"pageSize": pageSize "pageSize": pageSize
@ -134,22 +140,80 @@
const selectOption = (option) => { const selectOption = (option) => {
selectedOption.value = 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) => {
if (value == "") return;
searchValue.value = "";
paging.value.reload();
}
const clearSearch = (value) => {
if (value == "") return;
searchValue.value = "";
paging.value.reload();
}
const getAreaByCoordinates = (lng, lat) => { const getAreaByCoordinates = (lng, lat) => {
debugger;
map.reverseGeocoder(qqmapsdk, lng, lat, (res) => { map.reverseGeocoder(qqmapsdk, lng, lat, (res) => {
debugger; const {
return city; address
} = res
return address;
}, (res) => { }, (res) => {
return ""; 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> </script>
<style> <style>
@ -197,4 +261,20 @@
.deepBlackBoldText { .deepBlackBoldText {
font-weight: bold; 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> </style>