工单列表

This commit is contained in:
小朱 2025-04-30 17:34:50 +08:00
parent 5880d99258
commit c2a305cedf
6 changed files with 255 additions and 23 deletions

View File

@ -50,6 +50,11 @@
"style": { "style": {
"navigationBarTitleText": "景上运维" "navigationBarTitleText": "景上运维"
} }
}, {
"path": "pages/devops/workorder/workorderlist",
"style": {
"navigationBarTitleText": "工单列表"
}
} }
], ],
"subPackages": [{ "subPackages": [{
@ -405,6 +410,11 @@
"iconPath": "static/tabbar/home.png", "iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home_active.png", "selectedIconPath": "static/tabbar/home_active.png",
"text": "主页" "text": "主页"
}, {
"pagePath": "pages/devops/workorder/workorderlist",
"iconPath": "static/tabbar/order.png",
"selectedIconPath": "static/tabbar/order_active.png",
"text": "工单任务"
}, { }, {
"pagePath": "pages/mine/mine", "pagePath": "pages/mine/mine",
"iconPath": "static/tabbar/my.png", "iconPath": "static/tabbar/my.png",

View File

@ -380,7 +380,7 @@
const params = { const params = {
"bikeCode": ebikeInfo.value.bikeCode, "bikeCode": ebikeInfo.value.bikeCode,
"faultIds": faultIds, "faultIds": faultIds,
"receiver": userInfo.value.staffId "receiverId": userInfo.value.staffId
} }
api.callEbikeInfo("createWorkOrder", params).then((res) => { api.callEbikeInfo("createWorkOrder", params).then((res) => {
if (res.code == 200) { // if (res.code == 200) { //

View File

@ -0,0 +1,200 @@
<template>
<view class="container">
<view class="query-selector">
<view class="query-option" :class="{ 'query-select': selectedOption === option.value }"
v-for="(option, index) in options" :key="index" @click="selectOption(option.value)">
{{ option.name }}
</view>
</view>
<view class="">
<uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @cancel="cancel"
placeholder="输入车辆编号" clearButton="always" cancelButton="always">
</uni-search-bar>
</view>
<z-paging ref="paging" :fixed="false" height="85vh" v-model="dataList" @query="loadMoreData"
:default-page-no="1" :default-page-size="4" :auto-show-back-to-top="true">
<view v-for="(item,index) in dataList" :key="index">
<uni-card>
<template v-slot:title>
<view class="flex justify-between cardtitle">
<view class="flex align-center ">
<view class="cardtitleri">
{{item.orderTypeName}}
</view>
<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>
<uni-icons type="right" size="20"></uni-icons>
</view>
</view>
</template>
<uni-forms>
<uni-forms-item v-if="item.longitude" label="">
<view class="deepBlackBoldText">
{{getAreaByCoordinates(item.longitude,item.latitude)}}
</view>
</uni-forms-item>
<uni-forms-item v-if="item.bikeCode" label="车辆编号">
<view class="deepBlackBoldText">
{{item.bikeCode}}
</view>
</uni-forms-item>
<uni-forms-item v-if="item.bikeCount" label="车辆数量">
<view class="deepBlackBoldText">
{{item.bikeCount}}
</view>
</uni-forms-item>
<uni-forms-item v-if="item.dispatchType" label="调度类型">
<view class="deepBlackBoldText">
{{item.dispatchType}}
</view>
</uni-forms-item>
<uni-forms-item label="创建时间">
<view class="deepBlackBoldText">
{{item.createdAt}}
</view>
</uni-forms-item>
</uni-forms>
</uni-card>
</view>
</z-paging>
</view>
</template>
<script setup>
import QQMapWX from "@/utils/qqmap-wx-jssdk.js";
import * as map from "@/utils/map.js";
import {
ref,
onMounted
} from 'vue';
import * as api from '@/utils/api.js';
import config from '@/utils/config';
import {
onLoad
} from '@dcloudio/uni-app';
var qqmapsdk = new QQMapWX({
key: map.sdkKey
});
const dataList = ref([]);
const scrollHeight = ref(null);
const paging = ref(null);
const userInfo = ref(null);
const searchValue = ref("");
const options = ref([{
name: "全部",
value: ''
},
{
name: "换电",
value: '2'
},
{
name: "调度",
value: '3'
},
{
name: "维修",
value: '1'
}
]);
const selectedOption = ref("");
onLoad((options) => {
const systemInfo = uni.getSystemInfoSync();
userInfo.value = uni.getStorageSync('userInfo');
const screenHeight = systemInfo.screenHeight;
const statusBarHeight = systemInfo.statusBarHeight;
scrollHeight.value = screenHeight - statusBarHeight;
});
const loadMoreData = (pageNo, pageSize) => {
const params = {
"orderType": 1,
"pageParam": {
"pageNum": pageNo,
"pageSize": pageSize
}
};
api.callEbikeInfo("getWorkOrderList", params).then((res) => {
if (res.code === 200) {
const records = res.data.records;
paging.value.complete(records);
} else {
paging.value.complete([]);
}
});
};
const selectOption = (option) => {
selectedOption.value = option;
};
const blur = () => {
};
const cancel = () => {
};
const getAreaByCoordinates =(lng, lat)=>{
debugger;
map.reverseGeocoder(qqmapsdk, lng, lat, (res) => {
debugger;
return city;
}, (res) => {
return "";
});
}
</script>
<style>
.query-selector {
margin: 15px 10px 0px 10px;
display: flex;
flex-wrap: wrap;
}
.container {
height: 100vh;
padding: 0px 0px;
background-color: #ffffff;
}
.query-option {
padding: 5px 15px;
font-size: 13px;
font-weight: 400;
background: #f5f5f5;
margin: 5px 5px;
border-radius: 3px;
color: #000000;
}
.query-select {
color: #ffffff;
background: rgb(0, 132, 255);
}
.cardtitleri {
font-size: 15px;
color: #3a3a3a;
padding: 5px;
font-weight: bold;
}
.cardtitle {
margin: 5px 0px;
padding: 5px 0px;
border-bottom: solid 1px #f1f1f1;
}
.deepBlackBoldText {
font-weight: bold;
}
</style>

View File

@ -338,7 +338,7 @@
const params = { const params = {
"bikeCode": ebikeInfo.value.bikeCode, "bikeCode": ebikeInfo.value.bikeCode,
"faultIds": faultIds, "faultIds": faultIds,
"receiver": userInfo.value.staffId "receiverId": userInfo.value.staffId
} }
api.callEbikeInfo("createWorkOrder", params).then((res) => { api.callEbikeInfo("createWorkOrder", params).then((res) => {

View File

@ -301,7 +301,7 @@
"bikeCodes": customFormData.value.deviceValues, // "bikeCodes": customFormData.value.deviceValues, //
"status": statusZT.value, "status": statusZT.value,
"siteId": customFormData.value.reginvalue, "siteId": customFormData.value.reginvalue,
"DispatchType": "仓库车调度" "dispatchType": "仓库车调度"
} }
// API // API
api.callEbikeInfo("createWorkOrderDispatch", params).then((res) => { api.callEbikeInfo("createWorkOrderDispatch", params).then((res) => {

View File

@ -171,11 +171,25 @@
} }
const bikeCodeScanChange = (bikeCode) => { const bikeCodeScanChange = (bikeCode) => {
api.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode).then((res) => { api.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const ecuSn = res.data.ecuSn;
const ecuId = res.data.ecuId;
const bikeId = res.data.bikeId;
//
api.callCoreApi("gps?ecuId=" + ecuSn + "&bikeId=" + bikeId, {}, 'get')
.then((res) => {
api.callCoreApi("gpsMsg" + "?ecuSn=" + ecuSn, {}, 'get').then((res) => {
if (res.code == 200) {
const latitude = res.data.latitude;
const longitude = res.data.longitude;
const params = { const params = {
"orderId": orderId.value, "orderId": orderId.value,
"bikeCode": bikeCode, "bikeCode": bikeCode,
"dispatchState": 0 "dispatchState": 0,
"startVehicleLat":latitude,
"startVehicleLng":longitude
} }
newbikeCode.value = bikeCode; newbikeCode.value = bikeCode;
api.callEbikeInfo("createDispatchRecord", params) api.callEbikeInfo("createDispatchRecord", params)
@ -188,7 +202,15 @@
}) })
} else { } else {
showModelMessage("车辆不存在!") showModelMessage("车辆经纬度获取失败!");
}
})
});
} else {
showModelMessage("车辆不存在!");
} }
}); });
}; };
@ -203,7 +225,7 @@
{ {
const params = { const params = {
"orderId": orderId.value, "orderId": orderId.value,
"fileLists":fileLists.value "fileLists": fileLists.value
} }
api.callEbikeInfo("completeDeployment", params).then(res => { api.callEbikeInfo("completeDeployment", params).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -255,7 +277,7 @@
// //
console.log("推车操作"); console.log("推车操作");
} }
const onRingClick=(bikeCode)=>{ const onRingClick = (bikeCode) => {
uni.showLoading({ uni.showLoading({
title: "指令下发中...", title: "指令下发中...",
mask: true mask: true