Commit 932941fd4e6ef0e36f7868547a7b3b5f1a18cc95
1 parent
62b28cac
分配流程调整
Showing
1 changed file
with
88 additions
and
54 deletions
garbage-removal/src/pages/order-info/order-other/detail/index.vue
| @@ -238,50 +238,66 @@ | @@ -238,50 +238,66 @@ | ||
| 238 | </view> | 238 | </view> |
| 239 | <view class="space-box">{{ spaceStr }}</view> | 239 | <view class="space-box">{{ spaceStr }}</view> |
| 240 | </view> | 240 | </view> |
| 241 | - <!-- 占位符 --> | ||
| 242 | - <view class="order-detail-bottom"> | ||
| 243 | - <view class="order-detail-bottom-box"> | ||
| 244 | - <view class=" order-detail-bottom-left"> | ||
| 245 | - <u-button | ||
| 246 | - v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.garCancelFlag === 0" | ||
| 247 | - @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button> | ||
| 248 | - <u-button | ||
| 249 | - v-if="dataGram.garOrderScanHandlerFlag === 0 && userType == '用户' && dataGram.garOrderHandlerStatus != 3 && dataGram.garAskStatus != '1'" | ||
| 250 | - @click="handlerUpdateOrderClick()" shape="square" color="#19a97c" text="修改车辆数"></u-button> | ||
| 251 | - <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'" | ||
| 252 | - @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" | ||
| 253 | - text="分配驾驶员"></u-button> | ||
| 254 | - </view> | ||
| 255 | 241 | ||
| 256 | - <view class="order-detail-bottom-center" v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人' && isAllTripsCompleted()"> | ||
| 257 | - <u-button @click="handleSubmitSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button> | 242 | + <!-- 占位符 --> |
| 243 | + <view class="order-detail-bottom"> | ||
| 244 | + <view class="order-detail-bottom-box"> | ||
| 245 | + <view class="order-detail-bottom-left"> | ||
| 246 | + <u-button | ||
| 247 | + v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.garCancelFlag === 0" | ||
| 248 | + @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button> | ||
| 249 | + <u-button | ||
| 250 | + v-if="dataGram.garOrderScanHandlerFlag === 0 && userType == '用户' && dataGram.garOrderHandlerStatus != 3 && dataGram.garAskStatus != '1'" | ||
| 251 | + @click="handlerUpdateOrderClick()" shape="square" color="#19a97c" text="修改车辆数"></u-button> | ||
| 258 | </view> | 252 | </view> |
| 259 | - <view class="order-detail-bottom-right"> | ||
| 260 | - <u-button | ||
| 261 | - v-if="dataGram.garOrderHandlerStatus === 0 && userType == '用户' && dataGram.garCancelFlag === 0" | ||
| 262 | - @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button> | ||
| 263 | - <u-button @click="handleOrder(orderId)" | ||
| 264 | - v-if="dataGram.garOrderHandlerStatus === 0 && dataGram.handleFlag && dataGram.garCancelFlag === 0 && userType === '运输企业负责人'" | ||
| 265 | - shape="square" color="#19a97c" text="处理订单"></u-button> | ||
| 266 | - <u-button @click="handleEvaluate(orderId, userType)" | ||
| 267 | - v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#19a97c" | ||
| 268 | - text="去评价"></u-button> | ||
| 269 | - <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 270 | - v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" | ||
| 271 | - shape="square" color="#19a97c" text="查看评价"></u-button> | ||
| 272 | - <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 273 | - v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" | ||
| 274 | - shape="square" color="#19a97c" text="查看评价"></u-button> | ||
| 275 | - <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 276 | - v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#19a97c" | ||
| 277 | - text="查看评价"></u-button> | ||
| 278 | - <u-button v-if="dataGram.garOrderHandlerStatus === 1 && userType == '运输企业负责人'" | ||
| 279 | - @click="handleDisposalDispatchClick(orderId)" shape="square" color="#19a97c" | ||
| 280 | - text="分配处置场所"></u-button> | ||
| 281 | - </view> | ||
| 282 | 253 | ||
| 283 | - </view> | ||
| 284 | - </view> | 254 | + <view class="order-detail-bottom-center" v-if="dataGram.garOrderHandlerStatus === 0 && userType == '运输企业负责人' && dataGram.handleFlag && dataGram.garCancelFlag === 0"> |
| 255 | + <view class="button-group"> | ||
| 256 | + <u-button @click="handleOrderDispatchClick(orderId)" shape="square" color="#19a97c" text="分配驾驶员"></u-button> | ||
| 257 | + <u-button @click="handleDisposalDispatchClick(orderId)" shape="square" color="#19a97c" text="分配处置场所"></u-button> | ||
| 258 | + <u-button | ||
| 259 | + @click="handleOrder(orderId)" | ||
| 260 | + shape="square" | ||
| 261 | + color="#19a97c" | ||
| 262 | + text="处理订单" | ||
| 263 | + :disabled="!isDriverAndDisposalAssigned()"> | ||
| 264 | + </u-button> | ||
| 265 | + </view> | ||
| 266 | + </view> | ||
| 267 | + | ||
| 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> | ||
| 272 | + </view> | ||
| 273 | + </view> | ||
| 274 | + | ||
| 275 | + | ||
| 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> | ||
| 279 | + </view> | ||
| 280 | + | ||
| 281 | + <view class="order-detail-bottom-right"> | ||
| 282 | + <u-button | ||
| 283 | + v-if="dataGram.garOrderHandlerStatus === 0 && userType == '用户' && dataGram.garCancelFlag === 0" | ||
| 284 | + @click="handleOderCancelClick()" shape="square" color="#19a97c" text="取消订单"></u-button> | ||
| 285 | + <u-button @click="handleEvaluate(orderId, userType)" | ||
| 286 | + v-if="dataGram.garEvaluateFlag === 0 && userType === '用户'" shape="square" color="#19a97c" | ||
| 287 | + text="去评价"></u-button> | ||
| 288 | + <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 289 | + v-if="dataGram.garHandlerEvaluateFlag === 0 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" | ||
| 290 | + shape="square" color="#19a97c" text="查看评价"></u-button> | ||
| 291 | + <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 292 | + v-if="dataGram.garHandlerEvaluateFlag === 1 && userType === '运输企业负责人' && dataGram.haveEvaluateOfClient==1" | ||
| 293 | + shape="square" color="#19a97c" text="查看评价"></u-button> | ||
| 294 | + <u-button @click="handleEvaluateDetail(orderId, userType)" | ||
| 295 | + v-if="dataGram.garEvaluateFlag === 1 && userType === '用户'" shape="square" color="#19a97c" | ||
| 296 | + text="查看评价"></u-button> | ||
| 297 | + </view> | ||
| 298 | + | ||
| 299 | + </view> | ||
| 300 | + </view> | ||
| 285 | <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" | 301 | <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" |
| 286 | @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" | 302 | @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" |
| 287 | :show="cancelShow"> | 303 | :show="cancelShow"> |
| @@ -405,6 +421,14 @@ const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否 | @@ -405,6 +421,14 @@ const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否 | ||
| 405 | return reason | 421 | return reason |
| 406 | }) | 422 | }) |
| 407 | 423 | ||
| 424 | + const isDriverAndDisposalAssigned = () => { | ||
| 425 | + // 直接使用已有的响应式变量来判断分配状态 | ||
| 426 | + const hasDrivers = driverAssigned.value; | ||
| 427 | + const hasDisposalSites = disposalAssigned.value; | ||
| 428 | + | ||
| 429 | + return hasDrivers && hasDisposalSites; | ||
| 430 | + }; | ||
| 431 | + | ||
| 408 | const isAllTripsCompleted = () => { | 432 | const isAllTripsCompleted = () => { |
| 409 | // 检查所有趟次是否已完成 | 433 | // 检查所有趟次是否已完成 |
| 410 | if (!dataGram.value || !dataGram.value.garCarInfoList || !putOnImagesGrouped.value) { | 434 | if (!dataGram.value || !dataGram.value.garCarInfoList || !putOnImagesGrouped.value) { |
| @@ -771,22 +795,12 @@ const handleSubmitSuccess = (orderId) => { | @@ -771,22 +795,12 @@ const handleSubmitSuccess = (orderId) => { | ||
| 771 | // 标记处置场所已分配 | 795 | // 标记处置场所已分配 |
| 772 | disposalAssigned.value = true; | 796 | disposalAssigned.value = true; |
| 773 | // 检查是否两个任务都已完成 | 797 | // 检查是否两个任务都已完成 |
| 774 | - checkAndRedirect(); | ||
| 775 | } else { | 798 | } else { |
| 776 | uni.$u.toast("指定人员失败,请重试") | 799 | uni.$u.toast("指定人员失败,请重试") |
| 777 | } | 800 | } |
| 778 | clashDriverDispatchRef.value.close() | 801 | clashDriverDispatchRef.value.close() |
| 779 | }) | 802 | }) |
| 780 | } | 803 | } |
| 781 | - const checkAndRedirect = () => { | ||
| 782 | - // 当两个任务都完成时跳转到订单页 | ||
| 783 | - if (driverAssigned.value && disposalAssigned.value) { | ||
| 784 | - uni.$u.route({ | ||
| 785 | - type: "reLaunch", | ||
| 786 | - url: `pages/order/index`, | ||
| 787 | - }); | ||
| 788 | - } | ||
| 789 | - } | ||
| 790 | 804 | ||
| 791 | const handlerUpdateOrderClick = () => { | 805 | const handlerUpdateOrderClick = () => { |
| 792 | carPopupShowFlag.value = true; | 806 | carPopupShowFlag.value = true; |
| @@ -854,8 +868,6 @@ const handleDriverDispatchConfirm = (val) => { | @@ -854,8 +868,6 @@ const handleDriverDispatchConfirm = (val) => { | ||
| 854 | uni.$u.toast(res.data.msg); | 868 | uni.$u.toast(res.data.msg); |
| 855 | // 标记驾驶员已分配 | 869 | // 标记驾驶员已分配 |
| 856 | driverAssigned.value = true; | 870 | driverAssigned.value = true; |
| 857 | - // 检查是否两个任务都已完成 | ||
| 858 | - checkAndRedirect(); | ||
| 859 | } else { | 871 | } else { |
| 860 | uni.$u.toast("指定人员失败,请重试"); | 872 | uni.$u.toast("指定人员失败,请重试"); |
| 861 | } | 873 | } |
| @@ -982,11 +994,33 @@ const handleDriverDispatchConfirm = (val) => { | @@ -982,11 +994,33 @@ const handleDriverDispatchConfirm = (val) => { | ||
| 982 | } | 994 | } |
| 983 | 995 | ||
| 984 | .order-detail-bottom-center { | 996 | .order-detail-bottom-center { |
| 985 | - min-width: 200rpx; | 997 | + flex: 1; |
| 998 | + display: flex; | ||
| 999 | + justify-content: center; | ||
| 1000 | + | ||
| 1001 | + .button-group { | ||
| 1002 | + display: flex; | ||
| 1003 | + gap: 20rpx; | ||
| 1004 | + flex-wrap: nowrap; | ||
| 1005 | + | ||
| 1006 | + u-button { | ||
| 1007 | + white-space: nowrap; | ||
| 1008 | + } | ||
| 1009 | + } | ||
| 986 | } | 1010 | } |
| 987 | 1011 | ||
| 988 | .order-detail-bottom-right { | 1012 | .order-detail-bottom-right { |
| 989 | min-width: 200rpx; | 1013 | min-width: 200rpx; |
| 1014 | + display: flex; | ||
| 1015 | + justify-content: flex-end; | ||
| 1016 | + | ||
| 1017 | + u-button { | ||
| 1018 | + margin-left: 20rpx; | ||
| 1019 | + } | ||
| 1020 | + | ||
| 1021 | + u-button:first-child { | ||
| 1022 | + margin-left: 0; | ||
| 1023 | + } | ||
| 990 | } | 1024 | } |
| 991 | } | 1025 | } |
| 992 | 1026 |