车辆投放创建调度工单
This commit is contained in:
parent
a9d9a42a1a
commit
6c61cd13f9
@ -357,6 +357,14 @@
|
|||||||
"navigationBarTitleText": "审核用户报障"
|
"navigationBarTitleText": "审核用户报障"
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
}, {
|
||||||
|
"root": "pages/warehouse/vehicledispatch",
|
||||||
|
"pages": [{
|
||||||
|
"path": "vehicledispatch",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "车辆调度"
|
||||||
|
}
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|||||||
@ -192,11 +192,11 @@
|
|||||||
const statusBarHeight = systemInfo.statusBarHeight;
|
const statusBarHeight = systemInfo.statusBarHeight;
|
||||||
// 计算去掉状态栏后的可用区域高度
|
// 计算去掉状态栏后的可用区域高度
|
||||||
usableHeight.value = screenHeight - statusBarHeight - 170;
|
usableHeight.value = screenHeight - statusBarHeight - 170;
|
||||||
let userZone = uni.getStorageSync('userZone');
|
let userOperation = uni.getStorageSync('userOperation');
|
||||||
userZone.forEach(res => {
|
userOperation.forEach(res => {
|
||||||
let quyuemap = {
|
let quyuemap = {
|
||||||
"text": res.name,
|
"text": res.regionName,
|
||||||
"value": res.id
|
"value": res.regionId
|
||||||
};
|
};
|
||||||
regindata.value.push(quyuemap);
|
regindata.value.push(quyuemap);
|
||||||
});
|
});
|
||||||
@ -240,7 +240,7 @@
|
|||||||
const params = {
|
const params = {
|
||||||
"bikeCode": customFormData.value.deviceValues, //车辆编号
|
"bikeCode": customFormData.value.deviceValues, //车辆编号
|
||||||
"status": statusZT.value, //入库时间 例:2025-03-21
|
"status": statusZT.value, //入库时间 例:2025-03-21
|
||||||
"regionId":customFormData.reginvalue
|
"reginId":customFormData.value.reginvalue
|
||||||
}
|
}
|
||||||
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
<view class="popup-content" :class="{ 'popup-height': typepopup === 'left' || typepopup === 'right' }">
|
<view class="popup-content" :class="{ 'popup-height': typepopup === 'left' || typepopup === 'right' }">
|
||||||
<view class="padding plcrk">
|
<view class="padding plcrk">
|
||||||
<uni-forms ref="customForm" :rules="customRules" :modelValue="customFormData">
|
<uni-forms ref="customForm" :rules="customRules" :modelValue="customFormData">
|
||||||
<uni-section title="站点" type="line">
|
<uni-section v-if="statusZT==2" title="站点" type="line">
|
||||||
<uni-forms-item required name="reginvalue">
|
<uni-forms-item required name="reginvalue">
|
||||||
<uni-data-select v-model="customFormData.reginvalue" :localdata="regindata"
|
<uni-data-select v-model="customFormData.reginvalue" :localdata="regindata"
|
||||||
@change="changeZT"></uni-data-select>
|
@change="changeZT"></uni-data-select>
|
||||||
@ -189,7 +189,8 @@
|
|||||||
// getUserRegionInfo();
|
// getUserRegionInfo();
|
||||||
let userDefultOperation = uni.getStorageSync('userDefultOperation');
|
let userDefultOperation = uni.getStorageSync('userDefultOperation');
|
||||||
//获取站点信息
|
//获取站点信息
|
||||||
api.callOperateApi("ebikeRegion/getRegion?regionId="+userDefultOperation.regionId,{} ,"get").then(res=>{
|
api.callOperateApi("ebikeRegion/getRegion?regionId=" + userDefultOperation.regionId, {}, "get").then(
|
||||||
|
res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
res.data.forEach(res => {
|
res.data.forEach(res => {
|
||||||
let quyuemap = {
|
let quyuemap = {
|
||||||
@ -243,16 +244,32 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const submit = (ref) => {
|
const submit = (ref) => {
|
||||||
customForm.value.validate().then(res => {
|
customForm.value.validate().then(res => {
|
||||||
|
if (statusZT.value == 0) { // 下架
|
||||||
|
handleLeaveWarehouse();
|
||||||
|
} else { // 投放
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/warehouse/vehicledispatch/vehicledispatch?orderId=272553556257517568"
|
||||||
|
})
|
||||||
|
// handleLaunch();
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log('err', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理下架逻辑
|
||||||
|
const handleLeaveWarehouse = () => {
|
||||||
const params = {
|
const params = {
|
||||||
"bikeCode": customFormData.value.deviceValues, // 车辆编号
|
"bikeCode": customFormData.value.deviceValues, // 车辆编号
|
||||||
"status": statusZT.value, //入库时间 例:2025-03-21
|
"status": statusZT.value,
|
||||||
|
"reginId": ""
|
||||||
}
|
}
|
||||||
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
popup.value.close("center")
|
popup.value.close("center");
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '操作成功',
|
title: '操作成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -260,20 +277,45 @@
|
|||||||
});
|
});
|
||||||
searchInfo();
|
searchInfo();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '操作失败',
|
title: '操作失败',
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
console.log('err', err);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理投放逻辑
|
||||||
|
const handleLaunch = () => {
|
||||||
|
// 在这里编写投放的具体逻辑
|
||||||
|
console.log('投放逻辑执行');
|
||||||
|
const params={
|
||||||
|
"bikeCodes": customFormData.value.deviceValues, // 车辆编号
|
||||||
|
"status": statusZT.value,
|
||||||
|
"siteId": customFormData.value.reginvalue,
|
||||||
|
"DispatchType":"仓库车调度"
|
||||||
|
}
|
||||||
|
// 例如,调用API处理投放
|
||||||
|
api.callEbikeInfo("createWorkOrderDispatch",params).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
popup.value.close("center");
|
||||||
|
uni.showToast({
|
||||||
|
title: '操作成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '操作失败',
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onPullDownRefresh = () => {
|
const onPullDownRefresh = () => {
|
||||||
console.log('onPullDownRefresh')
|
console.log('onPullDownRefresh')
|
||||||
|
|||||||
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<view class="container">
|
||||||
|
<view class="cu-btn bg-blue" @click="getInfoList">
|
||||||
|
调度
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref
|
||||||
|
} from 'vue';
|
||||||
|
import * as api from '@/utils/api.js';
|
||||||
|
import {onLoad} from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
const orderId=ref("");
|
||||||
|
onLoad((options)=>{
|
||||||
|
debugger;
|
||||||
|
orderId.value=options.orderId;;
|
||||||
|
})
|
||||||
|
const getInfoList =()=>{
|
||||||
|
debugger;
|
||||||
|
api.callEbikeInfo("getDispatchVehicleByOrderId?orderId="+orderId.value, {}, "get").then(
|
||||||
|
res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dispatch-container {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dispatch-button {
|
||||||
|
padding: 10px 20px;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dispatch-button:hover {
|
||||||
|
background-color: #45a049;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-display {
|
||||||
|
margin-top: 20px;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user