Commit 1e6e210a92709bb8c04c429360c5932782cf6827
1 parent
932941fd
提交
Showing
3 changed files
with
309 additions
and
89 deletions
garbage-removal/src/apis/order.js
| ... | ... | @@ -188,3 +188,19 @@ export async function queryBadgeByType(type) { |
| 188 | 188 | export async function queryByCarCode(carCode) { |
| 189 | 189 | return await request.get(`/order/queryByCarCode/${carCode}`); |
| 190 | 190 | } |
| 191 | + | |
| 192 | +export async function queryGarRealCarCountByGarOrderNo(orderNo) { | |
| 193 | + return await request.get(`/order/queryGarRealCarCountByGarOrderNo/${orderNo}`); | |
| 194 | +} | |
| 195 | + | |
| 196 | +export async function queryByOrderNo(orderNo) { | |
| 197 | + return await request.get(`/order/queryByOrderNo/${orderNo}`); | |
| 198 | +} | |
| 199 | + | |
| 200 | +export async function queryByOrderNoDriver(orderNo) { | |
| 201 | + return await request.get(`/order/queryByOrderNoDriver/${orderNo}`); | |
| 202 | +} | |
| 203 | + | |
| 204 | +export async function updateCarCount(params) { | |
| 205 | + return await request.post(`/order/updateCarCount`, params); | |
| 206 | +} | ... | ... |
garbage-removal/src/pages/order-info/order-driver/detail/index.vue
| ... | ... | @@ -75,12 +75,13 @@ |
| 75 | 75 | 车辆信息 |
| 76 | 76 | </view> |
| 77 | 77 | <view class="order-detail-container-header-item" style="justify-content: space-between;" |
| 78 | - v-for="(item) in dataGram.garCarInfoList" :key="item.garId"> | |
| 79 | - <text class="order-detail-container-header-title" style="color: #303133;">{{ item.garOrderCarType }} | |
| 78 | + v-for="(item) in handlerList"> | |
| 79 | + <text class="order-detail-container-header-title" style="color: #303133;"> | |
| 80 | + {{item.garOrderHandlerName}}/{{ item.garHandlerCarCode }}/{{item.garOrderContainerVolume}} | |
| 80 | 81 | </text> |
| 81 | 82 | <view class="order-detail-container-header-content"> |
| 82 | 83 | <text class="order-detail-container-header-title"> |
| 83 | - {{ cleanStatus(dataGram.garOrderHandlerStatus) }} | |
| 84 | + 趟次:{{item.garCarCount}}车 | |
| 84 | 85 | </text> |
| 85 | 86 | </view> |
| 86 | 87 | </view> |
| ... | ... | @@ -227,7 +228,7 @@ |
| 227 | 228 | |
| 228 | 229 | <script setup> |
| 229 | 230 | import { |
| 230 | - createHandlerQrCode, queryErrType, | |
| 231 | + createHandlerQrCode, queryByOrderNo, queryByOrderNoDriver, queryErrType, | |
| 231 | 232 | queryGarOrderMatchAsk, |
| 232 | 233 | queryGarOrderMatchAsks, |
| 233 | 234 | queryOrderDetail, |
| ... | ... | @@ -251,6 +252,7 @@ const putOnImagesGrouped = ref([]) // 新增这个变量 |
| 251 | 252 | const putDownImages = ref([]) |
| 252 | 253 | const emptyBase64Image = ref(zStatic.base64Empty) |
| 253 | 254 | const showUQRcode = ref(false) |
| 255 | +const handlerList = ref([]) | |
| 254 | 256 | const spaceStr = ref("") |
| 255 | 257 | const cancelShow = ref(false) |
| 256 | 258 | const currentCancelName = ref("") |
| ... | ... | @@ -468,6 +470,7 @@ const createQrCodeValid = (val) => { |
| 468 | 470 | * @param {string} putType |
| 469 | 471 | */ |
| 470 | 472 | |
| 473 | + | |
| 471 | 474 | const handleUploadImage = (orderId, putType) => { |
| 472 | 475 | const data = dataGram.value; |
| 473 | 476 | |
| ... | ... | @@ -482,6 +485,16 @@ const handleUploadImage = (orderId, putType) => { |
| 482 | 485 | |
| 483 | 486 | // 检查当前要上传的是第几趟 |
| 484 | 487 | const currentGroupIndex = putOnImagesGrouped.value.length + 1; |
| 488 | + | |
| 489 | + // 如果handlerList中有数据且其garCarCount小于或等于图片列表长度,提示订单趟次已完成 | |
| 490 | + if (handlerList.value && handlerList.value.length > 0 && handlerList.value[0].garCarCount !== undefined) { | |
| 491 | + const totalTrips = parseInt(handlerList.value[0].garCarCount); | |
| 492 | + if (putOnImagesGrouped.value.length >= totalTrips) { | |
| 493 | + uni.$u.toast('当前订单趟次已经运完'); | |
| 494 | + return; | |
| 495 | + } | |
| 496 | + } | |
| 497 | + | |
| 485 | 498 | if(number !== 0){ |
| 486 | 499 | await queryGarOrderMatchAsks(orderId).then(res => { |
| 487 | 500 | if (res.data.data === 0) { |
| ... | ... | @@ -549,6 +562,13 @@ onShow(() => { |
| 549 | 562 | } catch (error) { |
| 550 | 563 | console.log(error); |
| 551 | 564 | } |
| 565 | + queryByOrderNoDriver(orderId.value).then(res => { | |
| 566 | + if (res.data.success) { | |
| 567 | + handlerList.value = res.data.data | |
| 568 | + } | |
| 569 | + }).catch(err => { | |
| 570 | + console.error('获取订单信息失败:', err); | |
| 571 | + }) | |
| 552 | 572 | }) |
| 553 | 573 | </script> |
| 554 | 574 | ... | ... |
garbage-removal/src/pages/order-info/order-other/detail/index.vue
| ... | ... | @@ -120,6 +120,9 @@ |
| 120 | 120 | <view class="order-detail-container-header-card-uicon"></view> |
| 121 | 121 | 车辆信息 |
| 122 | 122 | </view> |
| 123 | + <view style="margin-bottom: 8px"> | |
| 124 | + 当前订单总计需发车次数:{{realCarCount}} | |
| 125 | + </view> | |
| 123 | 126 | <view class="order-detail-container-box-card" v-if="driverList.length > 0"> |
| 124 | 127 | <view class="driver-info-container"> |
| 125 | 128 | <view class="driver-info-row" v-for="(driver, index) in driverList" :key="index"> |
| ... | ... | @@ -130,27 +133,43 @@ |
| 130 | 133 | </view> |
| 131 | 134 | </view> |
| 132 | 135 | <view class="order-detail-container-header-item" style="justify-content: space-between;" |
| 133 | - v-for="(item) in dataGram.garCarInfoList" :key="item.garId"> | |
| 134 | - <text class="order-detail-container-header-title" style="color: #303133;">{{ item.garOrderCarType }} | |
| 136 | + v-for="(item) in handlerList"> | |
| 137 | + <text class="order-detail-container-header-title" style="color: #303133;"> | |
| 138 | + {{item.garOrderHandlerName}}/{{ item.garHandlerCarCode }}/{{item.garOrderContainerVolume}} | |
| 135 | 139 | </text> |
| 136 | 140 | <view class="order-detail-container-header-content"> |
| 137 | 141 | <text class="order-detail-container-header-title"> |
| 138 | - {{dataGram.garHandlerCarCode}}{{ cleanStatus(dataGram.garOrderHandlerStatus) }} | |
| 142 | + 趟次:{{item.garCarCount}}车 | |
| 139 | 143 | </text> |
| 140 | 144 | </view> |
| 141 | 145 | </view> |
| 146 | + | |
| 142 | 147 | <view v-if="userType == '运输企业负责人'" class="order-detail-container-header-item" style="justify-content: space-between; align-items: center;"> |
| 143 | - <text class="order-detail-container-header-title" style="color: #303133;">新增趟次:</text> | |
| 148 | + <text class="order-detail-container-header-title" style="color: #303133;">分配趟次:</text> | |
| 149 | + | |
| 150 | + <select v-model="selectedHandlerTel" style="margin-left: 20rpx; width: 160rpx; height: 46rpx; border: 1px solid #DCDFE6; border-radius: 4px; padding: 0 10px; outline: none;"> | |
| 151 | + <option value="">请选择分配人员</option> | |
| 152 | + <option value="ADD_TOTAL_TRIPS">新增总趟次</option> | |
| 153 | + <option | |
| 154 | + v-for="handler in handlerList" | |
| 155 | + :key="handler.garOrderHandlerTel" | |
| 156 | + :value="handler.garOrderHandlerTel"> | |
| 157 | + {{ handler.garOrderHandlerName }} | |
| 158 | + </option> | |
| 159 | + </select> | |
| 160 | + | |
| 161 | + | |
| 144 | 162 | <view class="order-detail-container-header-content" style="display: flex; align-items: center;"> |
| 145 | 163 | <u-number-box |
| 146 | - v-model="totalCarNumber" | |
| 164 | + v-model="carCount" | |
| 147 | 165 | :min="0" |
| 148 | 166 | :max="999" |
| 149 | 167 | integer |
| 150 | 168 | buttonSize="46" |
| 151 | - inputWidth="100"> | |
| 169 | + inputWidth="70"> | |
| 152 | 170 | </u-number-box> |
| 153 | - <u-button type="primary" color="#19a97c" style="margin-left: 20rpx; height: 46rpx; width: 120rpx;" @click="confirmAddVehicle">确定</u-button> | |
| 171 | +<!-- :disabled="!isDriverAssigned"--> | |
| 172 | + <u-button type="primary" color="#19a97c" style="margin-left: 20rpx; height: 46rpx; width: 120rpx;" @click="confirmAddVehicle" >确定</u-button> | |
| 154 | 173 | </view> |
| 155 | 174 | </view> |
| 156 | 175 | </view> |
| ... | ... | @@ -250,35 +269,31 @@ |
| 250 | 269 | v-if="dataGram.garOrderScanHandlerFlag === 0 && userType == '用户' && dataGram.garOrderHandlerStatus != 3 && dataGram.garAskStatus != '1'" |
| 251 | 270 | @click="handlerUpdateOrderClick()" shape="square" color="#19a97c" text="修改车辆数"></u-button> |
| 252 | 271 | </view> |
| 253 | - | |
| 254 | - <view class="order-detail-bottom-center" v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.handleFlag && dataGram.garCancelFlag === 0"> | |
| 255 | - <view class="button-group"> | |
| 272 | + <view class="order-detail-bottom-center" v-show="showCenterButtons"> | |
| 273 | + <!-- 修改按钮组容器类名和结构 --> | |
| 274 | + <view class="button-group-wrap" v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.handleFlag && dataGram.garCancelFlag === 0"> | |
| 256 | 275 | <u-button @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" text="分配驾驶员"></u-button> |
| 257 | 276 | <u-button @click="handleDisposalDispatchClick(orderId)" shape="square" color="#19a97c" text="分配处置场所"></u-button> |
| 258 | 277 | <u-button |
| 259 | 278 | @click="handleOrder(orderId)" |
| 260 | 279 | shape="square" |
| 261 | 280 | color="#19a97c" |
| 262 | - text="处理订单" | |
| 281 | + text="开始运输" | |
| 263 | 282 | :disabled="!isDriverAndDisposalAssigned()"> |
| 264 | 283 | </u-button> |
| 265 | 284 | </view> |
| 266 | - </view> | |
| 267 | 285 | |
| 268 | - <view class="order-detail-bottom-center" v-else-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'"> | |
| 269 | - <view class="button-group"> | |
| 270 | - <u-button @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" text="重新分配驾驶员"></u-button> | |
| 271 | - <u-button @click="handleDisposalDispatchClick(orderId)" shape="square" color="#19a97c" text="重新分配处置场所"></u-button> | |
| 286 | + <view class="button-group-spread" v-else-if="!isAllTripsCompleted()"> | |
| 287 | + <u-button class="btn-left" @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" text="重新分配驾驶员"></u-button> | |
| 288 | + <u-button class="btn-right" @click="handleDisposalDispatchClick(orderId)" shape="square" color="#19a97c" text="重新分配处置场所"></u-button> | |
| 272 | 289 | </view> |
| 273 | - </view> | |
| 274 | - | |
| 275 | 290 | |
| 276 | - | |
| 277 | - <view class="order-detail-bottom-center" v-else-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人' && isAllTripsCompleted()"> | |
| 278 | - <u-button @click="handleSubmitSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button> | |
| 291 | + <view v-else-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人' && isAllTripsCompleted()"> | |
| 292 | + <u-button @click="handleSubmitSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button> | |
| 293 | + </view> | |
| 279 | 294 | </view> |
| 280 | 295 | |
| 281 | - <view class="order-detail-bottom-right"> | |
| 296 | + <view class="order-detail-bottom-right" v-show="showRightButtons"> | |
| 282 | 297 | <u-button |
| 283 | 298 | v-if="dataGram.garOrderHandlerStatus === 0 && userType == '用户' && dataGram.garCancelFlag === 0" |
| 284 | 299 | @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button> |
| ... | ... | @@ -340,7 +355,7 @@ |
| 340 | 355 | queryOrderDetail, |
| 341 | 356 | queryOrderDispatch, sendToDriver, updateGarRealCarCount, |
| 342 | 357 | updateOrder, |
| 343 | - queryCarCode | |
| 358 | + queryCarCode, queryByOrderNo, updateCarCount, queryGarRealCarCountByGarOrderNo | |
| 344 | 359 | } from "@/apis/order.js"; |
| 345 | 360 | import { |
| 346 | 361 | createQrCode |
| ... | ... | @@ -356,9 +371,9 @@ |
| 356 | 371 | onLoad, |
| 357 | 372 | onShow |
| 358 | 373 | } from '@dcloudio/uni-app'; |
| 359 | - import { | |
| 360 | - computed | |
| 361 | - } from 'vue'; | |
| 374 | + import { | |
| 375 | + computed, watch | |
| 376 | + } from 'vue'; | |
| 362 | 377 | import { ref } from 'vue'; |
| 363 | 378 | const paramFrom = ref({ |
| 364 | 379 | carNumber: 0, |
| ... | ... | @@ -375,6 +390,12 @@ |
| 375 | 390 | const clashDisposalDispatchRef = ref() |
| 376 | 391 | const driverPersonnelList = ref([]) |
| 377 | 392 | const disposalPersonnelList = ref([]) |
| 393 | + const handlerList = ref([]) | |
| 394 | + const orderNo = ref(null) | |
| 395 | + const carCount = ref(null) | |
| 396 | + const tel = ref(null) | |
| 397 | + const selectedHandlerTel = ref("") | |
| 398 | + const realCarCount = ref(null) | |
| 378 | 399 | const store = useMainStore(); |
| 379 | 400 | const userType = computed(() => store.userType) |
| 380 | 401 | const dataGram = ref(); |
| ... | ... | @@ -394,7 +415,7 @@ |
| 394 | 415 | const garCarLabelInfoList = ref({}) |
| 395 | 416 | const garCarLabelInfoNow = ref() |
| 396 | 417 | const driverAssigned = ref(false); // 添加这行,跟踪驾驶员是否已分配 |
| 397 | -const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否已分配 | |
| 418 | + const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否已分配 | |
| 398 | 419 | |
| 399 | 420 | const list = computed(() => { |
| 400 | 421 | let reason = [{ |
| ... | ... | @@ -421,6 +442,10 @@ const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否 |
| 421 | 442 | return reason |
| 422 | 443 | }) |
| 423 | 444 | |
| 445 | + const isDriverAssigned = computed(() => { | |
| 446 | + // 检查是否有分配的驾驶员 | |
| 447 | + return driverList.value && driverList.value.length > 0; | |
| 448 | + }); | |
| 424 | 449 | const isDriverAndDisposalAssigned = () => { |
| 425 | 450 | // 直接使用已有的响应式变量来判断分配状态 |
| 426 | 451 | const hasDrivers = driverAssigned.value; |
| ... | ... | @@ -442,6 +467,7 @@ const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否 |
| 442 | 467 | const completedTrips = putOnImagesGrouped.value.length; |
| 443 | 468 | |
| 444 | 469 | // 如果完成的趟次数大于等于要求的趟次数,则表示全部运完 |
| 470 | + console.log("实际完成次数" + completedTrips + "要求次数" + requiredTrips) | |
| 445 | 471 | return completedTrips >= requiredTrips; |
| 446 | 472 | } |
| 447 | 473 | |
| ... | ... | @@ -461,27 +487,104 @@ const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否 |
| 461 | 487 | }); |
| 462 | 488 | }; |
| 463 | 489 | |
| 490 | + watch(selectedHandlerTel, (newVal) => { | |
| 491 | + tel.value = newVal; | |
| 492 | + }); | |
| 493 | + | |
| 494 | + const refreshOrderData = () => { | |
| 495 | + // 刷新处理人员列表 | |
| 496 | + queryByOrderNo(orderNo.value).then(res => { | |
| 497 | + if (res.data.success) { | |
| 498 | + handlerList.value = res.data.data | |
| 499 | + } | |
| 500 | + }).catch(err => { | |
| 501 | + console.error('获取订单信息失败:', err); | |
| 502 | + }) | |
| 503 | + | |
| 504 | + // 刷新总趟次数 | |
| 505 | + queryGarRealCarCountByGarOrderNo(orderNo.value).then(res => { | |
| 506 | + if (res.data.success) { | |
| 507 | + realCarCount.value = res.data.data | |
| 508 | + } | |
| 509 | + }) | |
| 510 | + }; | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 464 | 514 | const confirmAddVehicle = () => { |
| 465 | - console.log('新增车辆数量:', totalCarNumber.value); | |
| 515 | + console.log('新增车辆数量:', carCount.value); | |
| 516 | + console.log('选中处理人员电话:', tel.value); | |
| 517 | + | |
| 518 | + // 检查必填字段 | |
| 519 | + if (!carCount.value) { | |
| 520 | + uni.$u.toast(`请选择分配的趟次!`); | |
| 521 | + return; | |
| 522 | + } | |
| 523 | + if (!tel.value) { | |
| 524 | + uni.$u.toast(`请选择分配人员!`); | |
| 525 | + return; | |
| 526 | + } | |
| 527 | + | |
| 528 | + | |
| 529 | + if (selectedHandlerTel.value === 'ADD_TOTAL_TRIPS') { | |
| 530 | + const newTotalTrips = (realCarCount.value || 0) + carCount.value; | |
| 531 | + updateGarRealCarCount(orderId.value, carCount.value) | |
| 532 | + .then(res => { | |
| 533 | + if (res.data.success) { | |
| 534 | + uni.$u.toast(`总趟次更新成功!`); | |
| 535 | + // 刷新订单详情 | |
| 536 | + handleOrderDetail(orderId.value); | |
| 537 | + refreshOrderData() | |
| 538 | + } else { | |
| 539 | + uni.$u.toast(`总趟次更新失败!`); | |
| 540 | + } | |
| 541 | + }) | |
| 542 | + .catch(err => { | |
| 543 | + uni.$u.toast('总趟次更新请求失败'); | |
| 544 | + console.error('总趟次更新失败:', err); | |
| 545 | + }); | |
| 546 | + return; | |
| 547 | + } | |
| 548 | + | |
| 549 | + // 检查已分配趟次总和是否超过订单要求的总发车次数 | |
| 550 | + const allocatedTrips = handlerList.value.reduce((sum, handler) => sum + parseInt(handler.garCarCount || 0), 0); | |
| 551 | + const totalRequiredTrips = realCarCount.value || 0; | |
| 552 | + | |
| 553 | + console.log('已分配趟次总和:', allocatedTrips); | |
| 554 | + console.log('总需求趟次:', totalRequiredTrips); | |
| 555 | + | |
| 556 | + if (allocatedTrips >= totalRequiredTrips) { | |
| 557 | + uni.$u.toast(`全部趟次已分配完成,无需再分配!`); | |
| 558 | + return; | |
| 559 | + } | |
| 560 | + | |
| 561 | + // 检查本次分配后是否会超过总发车次数 | |
| 562 | + if (allocatedTrips + carCount.value > totalRequiredTrips) { | |
| 563 | + uni.$u.toast(`分配趟次过多,最多只能再分配${totalRequiredTrips - allocatedTrips}趟!`); | |
| 564 | + return; | |
| 565 | + } | |
| 466 | 566 | |
| 467 | 567 | // 调用API传递订单ID和新增车辆数量 |
| 468 | - updateGarRealCarCount(orderId.value, totalCarNumber.value) | |
| 568 | + const params = { | |
| 569 | + carCount: carCount.value, | |
| 570 | + tel: tel.value | |
| 571 | + }; | |
| 572 | + | |
| 573 | + updateCarCount(params) | |
| 469 | 574 | .then(res => { |
| 470 | 575 | if (res.data.success) { |
| 471 | - uni.$u.toast(`成功新增${totalCarNumber.value}辆车`); | |
| 472 | - getGarOrderMatchHandlers(orderId.value).then(res => { | |
| 473 | - console.log('司机列表:', res.data); | |
| 474 | - if (res.data.success && res.data.data && res.data.data.length > 0) { | |
| 475 | - driverListForAssignment.value = res.data.data; | |
| 476 | - driverListPopupShowFlag.value = true; | |
| 477 | - } | |
| 478 | - }) | |
| 479 | - // 重置输入框 | |
| 480 | - totalCarNumber.value = 0; | |
| 576 | + uni.$u.toast(`分配成功!`); | |
| 481 | 577 | // 刷新订单详情 |
| 482 | 578 | handleOrderDetail(orderId.value); |
| 579 | + queryByOrderNo(orderNo.value).then(res => { | |
| 580 | + if (res.data.success) { | |
| 581 | + handlerList.value = res.data.data | |
| 582 | + } | |
| 583 | + }).catch(err => { | |
| 584 | + console.error('获取订单信息失败:', err); | |
| 585 | + }) | |
| 483 | 586 | } else { |
| 484 | - uni.$u.toast(res.data.msg || '新增车辆失败'); | |
| 587 | + uni.$u.toast(`分配失败!`); | |
| 485 | 588 | } |
| 486 | 589 | }) |
| 487 | 590 | .catch(err => { |
| ... | ... | @@ -944,13 +1047,33 @@ const handleDriverDispatchConfirm = (val) => { |
| 944 | 1047 | } |
| 945 | 1048 | }); |
| 946 | 1049 | } |
| 1050 | + const showLeftButtons = computed(() => { | |
| 1051 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.garCancelFlag === 0) || | |
| 1052 | + (dataGram.value?.garOrderScanHandlerFlag === 0 && userType.value == '用户' && dataGram.value?.garOrderHandlerStatus != 3 && dataGram.value?.garAskStatus != '1'); | |
| 1053 | + }); | |
| 1054 | + | |
| 1055 | + const showCenterButtons = computed(() => { | |
| 1056 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.handleFlag && dataGram.value?.garCancelFlag === 0) || | |
| 1057 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人') || | |
| 1058 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && isAllTripsCompleted()); | |
| 1059 | + }); | |
| 1060 | + | |
| 1061 | + const showRightButtons = computed(() => { | |
| 1062 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '用户' && dataGram.value?.garCancelFlag === 0) || | |
| 1063 | + (dataGram.value?.garEvaluateFlag === 0 && userType.value === '用户') || | |
| 1064 | + (dataGram.value?.garHandlerEvaluateFlag === 0 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1065 | + (dataGram.value?.garHandlerEvaluateFlag === 1 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1066 | + (dataGram.value?.garEvaluateFlag === 1 && userType.value === '用户'); | |
| 1067 | + }); | |
| 947 | 1068 | |
| 948 | 1069 | /** |
| 949 | 1070 | * 初始化信息 |
| 950 | 1071 | */ |
| 951 | 1072 | onLoad((options) => { |
| 952 | 1073 | orderId.value = options.orderId |
| 1074 | + orderNo.value = options.orderId | |
| 953 | 1075 | handleOrderDetail(orderId.value) |
| 1076 | + refreshOrderData() | |
| 954 | 1077 | }) |
| 955 | 1078 | |
| 956 | 1079 | onShow(() => { |
| ... | ... | @@ -997,6 +1120,7 @@ const handleDriverDispatchConfirm = (val) => { |
| 997 | 1120 | flex: 1; |
| 998 | 1121 | display: flex; |
| 999 | 1122 | justify-content: center; |
| 1123 | + width: 100%; // 确保占满可用宽度 | |
| 1000 | 1124 | |
| 1001 | 1125 | .button-group { |
| 1002 | 1126 | display: flex; |
| ... | ... | @@ -1007,6 +1131,30 @@ const handleDriverDispatchConfirm = (val) => { |
| 1007 | 1131 | white-space: nowrap; |
| 1008 | 1132 | } |
| 1009 | 1133 | } |
| 1134 | + | |
| 1135 | + // 修复重新分配按钮的样式(重点修改这里) | |
| 1136 | + .button-group-spread { | |
| 1137 | + display: flex; | |
| 1138 | + justify-content: space-between; // 两端对齐 | |
| 1139 | + align-items: center; // 垂直居中 | |
| 1140 | + width: 100%; // 占满父容器宽度 | |
| 1141 | + padding: 0; // 移除左右内边距,让按钮更贴边 | |
| 1142 | + gap: 40rpx; // 中间间距(可根据需要调整大小) | |
| 1143 | + | |
| 1144 | + .btn-left { | |
| 1145 | + margin-right: auto; // 强制靠左 | |
| 1146 | + } | |
| 1147 | + | |
| 1148 | + .btn-right { | |
| 1149 | + margin-left: auto; // 强制靠右 | |
| 1150 | + } | |
| 1151 | + | |
| 1152 | + u-button { | |
| 1153 | + min-width: 220rpx; // 固定最小宽度,确保按钮宽度一致 | |
| 1154 | + white-space: nowrap; | |
| 1155 | + padding: 0 30rpx; // 按钮内部左右 padding,让按钮更舒展 | |
| 1156 | + } | |
| 1157 | + } | |
| 1010 | 1158 | } |
| 1011 | 1159 | |
| 1012 | 1160 | .order-detail-bottom-right { |
| ... | ... | @@ -1098,56 +1246,92 @@ const handleDriverDispatchConfirm = (val) => { |
| 1098 | 1246 | } |
| 1099 | 1247 | |
| 1100 | 1248 | |
| 1101 | - .order-detail-bottom { | |
| 1102 | - position: absolute; | |
| 1103 | - width: 100%; | |
| 1104 | - // height: 100%; | |
| 1105 | - bottom: 0; | |
| 1106 | - left: 0; | |
| 1107 | - | |
| 1108 | - .movableAreaDetail { | |
| 1109 | - pointer-events: none; | |
| 1110 | - position: fixed; | |
| 1111 | - left: 0; | |
| 1112 | - top: 0; | |
| 1113 | - width: 100%; | |
| 1114 | - height: calc(100% - $custom-bottom-height); | |
| 1115 | - z-index: 999; | |
| 1249 | + .order-detail-bottom { | |
| 1250 | + position: fixed; // 改为fixed定位,确保始终在底部 | |
| 1251 | + width: 100%; | |
| 1252 | + bottom: 0; | |
| 1253 | + left: 0; | |
| 1254 | + background-color: #fff; // 添加背景色,避免穿透 | |
| 1255 | + box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05); // 添加阴影,提升层次感 | |
| 1256 | + padding: 20rpx $custom-page-padding; // 上下内边距,左右和页面一致 | |
| 1257 | + box-sizing: border-box; | |
| 1116 | 1258 | |
| 1117 | - .movableView { | |
| 1118 | - pointer-events: auto; | |
| 1119 | - min-height: 60rpx; | |
| 1120 | - min-width: 60rpx; | |
| 1259 | + .order-detail-bottom-box { | |
| 1260 | + height: auto; // 取消固定高度,自适应内容 | |
| 1261 | + padding: 0; // 移除原有内边距 | |
| 1262 | + display: flex; | |
| 1263 | + flex-wrap: wrap; // 允许换行 | |
| 1264 | + gap: 16rpx; // 按钮之间统一间距 | |
| 1265 | + align-items: center; | |
| 1266 | + } | |
| 1121 | 1267 | |
| 1122 | - .order-detail-call-box-container { | |
| 1123 | - min-height: 60rpx; | |
| 1124 | - min-width: 60rpx; | |
| 1125 | - display: flex; | |
| 1126 | - align-items: center; | |
| 1127 | - justify-content: center; | |
| 1128 | - background-color: #19a97c; | |
| 1129 | - border-radius: 100%; | |
| 1130 | - } | |
| 1131 | - } | |
| 1132 | - } | |
| 1268 | + // 左中右三个区域统一处理 | |
| 1269 | + .order-detail-bottom-left, | |
| 1270 | + .order-detail-bottom-center, | |
| 1271 | + .order-detail-bottom-right { | |
| 1272 | + min-width: auto; // 取消最小宽度限制 | |
| 1273 | + flex: 1; // 三个区域平均分配宽度 | |
| 1274 | + display: flex; | |
| 1275 | + justify-content: center; | |
| 1276 | + align-items: center; | |
| 1277 | + } | |
| 1133 | 1278 | |
| 1134 | - .order-detail-bottom-box { | |
| 1135 | - height: $custom-bottom-height; | |
| 1136 | - padding: 50rpx; | |
| 1137 | - box-sizing: border-box; | |
| 1138 | - display: flex; | |
| 1139 | - justify-content: space-between; | |
| 1140 | - align-items: center; | |
| 1279 | + // 左侧区域单独处理(取消订单按钮) | |
| 1280 | + .order-detail-bottom-left { | |
| 1281 | + justify-content: flex-start; | |
| 1282 | + } | |
| 1141 | 1283 | |
| 1142 | - .order-detail-bottom-left { | |
| 1143 | - min-width: 200rpx; | |
| 1144 | - } | |
| 1284 | + // 右侧区域单独处理(评价相关按钮) | |
| 1285 | + .order-detail-bottom-right { | |
| 1286 | + justify-content: flex-end; | |
| 1287 | + } | |
| 1288 | + } | |
| 1145 | 1289 | |
| 1146 | - .order-detail-bottom-right { | |
| 1147 | - min-width: 200rpx; | |
| 1148 | - } | |
| 1149 | - } | |
| 1150 | - } | |
| 1290 | + // 中间按钮组优化(分配/处理订单按钮) | |
| 1291 | + .order-detail-bottom-center { | |
| 1292 | + .button-group-wrap { | |
| 1293 | + display: flex; | |
| 1294 | + flex-wrap: wrap; // 超出时自动换行 | |
| 1295 | + gap: 16rpx; // 按钮之间间距 | |
| 1296 | + justify-content: center; | |
| 1297 | + width: 100%; | |
| 1298 | + } | |
| 1299 | + | |
| 1300 | + // 单个按钮样式统一优化 | |
| 1301 | + u-button { | |
| 1302 | + flex: 0 0 auto; // 不自动拉伸 | |
| 1303 | + min-width: 180rpx; // 最小宽度,确保按钮不会太窄 | |
| 1304 | + max-width: 240rpx; // 最大宽度,避免过宽 | |
| 1305 | + height: 72rpx; // 统一按钮高度 | |
| 1306 | + line-height: 72rpx; // 垂直居中 | |
| 1307 | + font-size: 26rpx; // 字体大小优化 | |
| 1308 | + padding: 0 20rpx; | |
| 1309 | + border-radius: 36rpx; // 圆角优化,更美观 | |
| 1310 | + } | |
| 1311 | + | |
| 1312 | + // 重新分配按钮组样式 | |
| 1313 | + .button-group-spread { | |
| 1314 | + display: flex; | |
| 1315 | + justify-content: space-between; | |
| 1316 | + align-items: center; | |
| 1317 | + width: 100%; | |
| 1318 | + gap: 16rpx; // 中间间距 | |
| 1319 | + } | |
| 1320 | + } | |
| 1321 | + | |
| 1322 | + // 适配小屏幕,当按钮过多时自动换行 | |
| 1323 | + @media (max-width: 375px) { | |
| 1324 | + .order-detail-bottom-box { | |
| 1325 | + gap: 12rpx; | |
| 1326 | + } | |
| 1327 | + | |
| 1328 | + .order-detail-bottom-center u-button { | |
| 1329 | + min-width: 160rpx; | |
| 1330 | + font-size: 24rpx; | |
| 1331 | + height: 68rpx; | |
| 1332 | + line-height: 68rpx; | |
| 1333 | + } | |
| 1334 | + } | |
| 1151 | 1335 | } |
| 1152 | 1336 | |
| 1153 | 1337 | .mask-container { | ... | ... |