Commit 42248e0a1fb38f35b2895407ffe84d9c6baf619d
1 parent
0e4ee266
调整
Showing
4 changed files
with
100 additions
and
18 deletions
garbage-removal/src/pages/order-info/order-disposal/transport-detail/index.vue
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | <view class="space-box">{{ spaceStr }}</view> | 100 | <view class="space-box">{{ spaceStr }}</view> |
| 101 | </view> | 101 | </view> |
| 102 | <!-- 占位符 --> | 102 | <!-- 占位符 --> |
| 103 | - <view class="order-detail-bottom" v-if="dataGram.garOrderDisposalStatus === 1"> | 103 | + <view class="order-detail-bottom" v-if="dataGram.garOrderDisposalStatus === 1 && transportWeightCount > 0"> |
| 104 | <view class="order-detail-bottom-box"> | 104 | <view class="order-detail-bottom-box"> |
| 105 | <u-button @click="handlerOrderSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button> | 105 | <u-button @click="handlerOrderSuccess(orderId)" shape="square" color="#19a97c" text="完成订单"></u-button> |
| 106 | </view> | 106 | </view> |
| @@ -132,6 +132,23 @@ const goTransportDetail = (val) => { | @@ -132,6 +132,23 @@ const goTransportDetail = (val) => { | ||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | const handlerOrderSuccess = (orderId) => { | 134 | const handlerOrderSuccess = (orderId) => { |
| 135 | + // 检查是否有运送信息和载重数据 | ||
| 136 | + if (!dataGram.value.transportDetails || dataGram.value.transportDetails.length === 0) { | ||
| 137 | + uni.showToast({ | ||
| 138 | + title: '请先添加运送信息', | ||
| 139 | + icon: 'none' | ||
| 140 | + }); | ||
| 141 | + return; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + // 检查载重合计是否大于0 | ||
| 145 | + if (!transportWeightCount.value || transportWeightCount.value <= 0) { | ||
| 146 | + uni.showToast({ | ||
| 147 | + title: '载重合计必须大于0才能完成订单', | ||
| 148 | + icon: 'none' | ||
| 149 | + }); | ||
| 150 | + return; | ||
| 151 | + } | ||
| 135 | // 提示 | 152 | // 提示 |
| 136 | uni.showModal({ | 153 | uni.showModal({ |
| 137 | title: '提示', | 154 | title: '提示', |
garbage-removal/src/pages/order-info/order-driver/detail/index.vue
| @@ -146,12 +146,21 @@ | @@ -146,12 +146,21 @@ | ||
| 146 | </view> | 146 | </view> |
| 147 | <view class="order-detail-container-header-item"> | 147 | <view class="order-detail-container-header-item"> |
| 148 | <text class=" order-detail-container-header-title">装车照片:</text> | 148 | <text class=" order-detail-container-header-title">装车照片:</text> |
| 149 | - | 149 | + |
| 150 | <view class="order-detail-container-header-content" style="flex-direction: column;"> | 150 | <view class="order-detail-container-header-content" style="flex-direction: column;"> |
| 151 | <view v-for="group in putOnImagesGrouped" :key="group.index" class="image-group"> | 151 | <view v-for="group in putOnImagesGrouped" :key="group.index" class="image-group"> |
| 152 | - <view class="image-group-title">{{ group.carName}}第 {{ group.index }} 趟</view> | 152 | + <view class="image-group-header"> |
| 153 | + <view class="image-group-title">{{ group.carName}}第 {{ group.index }} 趟</view> | ||
| 154 | + <!-- 根据group.index与真实发车数比较显示状态 --> | ||
| 155 | + <view class="car-status" :class="{ | ||
| 156 | + 'in-transit': group.index < dataGram.garCarInfoList.length, | ||
| 157 | + 'completed': group.index >= dataGram.garCarInfoList.length | ||
| 158 | + }"> | ||
| 159 | + {{ group.index < dataGram.garCarInfoList.length ? '运输中' : '已运完' }} | ||
| 160 | + </view> | ||
| 161 | + </view> | ||
| 153 | <u-upload width="180" height="130" :fileList="group.images" name="3" multiple :maxCount="20" | 162 | <u-upload width="180" height="130" :fileList="group.images" name="3" multiple :maxCount="20" |
| 154 | - :previewFullImage="true" :isReadOnly="true"></u-upload> | 163 | + :previewFullImage="true" :isReadOnly="true"></u-upload> |
| 155 | </view> | 164 | </view> |
| 156 | </view> | 165 | </view> |
| 157 | </view> | 166 | </view> |
| @@ -659,4 +668,27 @@ $custom-bottom-height: 200rpx; | @@ -659,4 +668,27 @@ $custom-bottom-height: 200rpx; | ||
| 659 | display: flex; | 668 | display: flex; |
| 660 | flex-wrap: wrap; | 669 | flex-wrap: wrap; |
| 661 | } | 670 | } |
| 671 | +.image-group-header { | ||
| 672 | + display: flex; | ||
| 673 | + justify-content: space-between; | ||
| 674 | + align-items: center; | ||
| 675 | + margin-bottom: 10rpx; | ||
| 676 | +} | ||
| 677 | + | ||
| 678 | +.car-status { | ||
| 679 | + padding: 4rpx 12rpx; | ||
| 680 | + border-radius: 6rpx; | ||
| 681 | + font-size: 24rpx; | ||
| 682 | + font-weight: bold; | ||
| 683 | + | ||
| 684 | + &.in-transit { | ||
| 685 | + background-color: #fff7e6; | ||
| 686 | + color: #ff9900; | ||
| 687 | + } | ||
| 688 | + | ||
| 689 | + &.completed { | ||
| 690 | + background-color: #e6f7ff; | ||
| 691 | + color: #19a97c; | ||
| 692 | + } | ||
| 693 | +} | ||
| 662 | </style> | 694 | </style> |
garbage-removal/src/pages/order-info/order-other/detail/index.vue
| @@ -180,16 +180,26 @@ | @@ -180,16 +180,26 @@ | ||
| 180 | 处理信息 | 180 | 处理信息 |
| 181 | </view> | 181 | </view> |
| 182 | <view v-if="putDownImages.length || putOnImages.length" style="width: 100%;"> | 182 | <view v-if="putDownImages.length || putOnImages.length" style="width: 100%;"> |
| 183 | - <view class="order-detail-container-header-item"> | ||
| 184 | - <text class=" order-detail-container-header-title">装车照片:</text> | ||
| 185 | - <view class="order-detail-container-header-content" style="flex-direction: column"> | ||
| 186 | - <view v-for="group in putOnImagesGrouped" :key="group.index" class="image-group"> | ||
| 187 | - <view class="image-group-title">{{ group.carName}}第 {{ group.index }} 趟</view> | ||
| 188 | - <u-upload width="180" height="130" :fileList="group.images" name="3" multiple :maxCount="20" | ||
| 189 | - :previewFullImage="true" :isReadOnly="true"></u-upload> | ||
| 190 | - </view> | ||
| 191 | - </view> | ||
| 192 | - </view> | 183 | + <view class="order-detail-container-header-item"> |
| 184 | + <text class=" order-detail-container-header-title">装车照片:</text> | ||
| 185 | + | ||
| 186 | + <view class="order-detail-container-header-content" style="flex-direction: column;"> | ||
| 187 | + <view v-for="group in putOnImagesGrouped" :key="group.index" class="image-group"> | ||
| 188 | + <view class="image-group-header"> | ||
| 189 | + <view class="image-group-title">{{ group.carName}}第 {{ group.index }} 趟</view> | ||
| 190 | + <!-- 根据group.index与真实发车数比较显示状态 --> | ||
| 191 | + <view class="car-status" :class="{ | ||
| 192 | + 'in-transit': group.index < dataGram.garCarInfoList.length, | ||
| 193 | + 'completed': group.index >= dataGram.garCarInfoList.length | ||
| 194 | + }"> | ||
| 195 | + {{ group.index < dataGram.garCarInfoList.length ? '运输中' : '已运完' }} | ||
| 196 | + </view> | ||
| 197 | + </view> | ||
| 198 | + <u-upload width="180" height="130" :fileList="group.images" name="3" multiple :maxCount="20" | ||
| 199 | + :previewFullImage="true" :isReadOnly="true"></u-upload> | ||
| 200 | + </view> | ||
| 201 | + </view> | ||
| 202 | + </view> | ||
| 193 | <!-- <view class="order-detail-container-header-item"> | 203 | <!-- <view class="order-detail-container-header-item"> |
| 194 | <text class=" order-detail-container-header-title">卸车照片:</text> | 204 | <text class=" order-detail-container-header-title">卸车照片:</text> |
| 195 | <view class="order-detail-container-header-content"> | 205 | <view class="order-detail-container-header-content"> |
| @@ -437,7 +447,7 @@ | @@ -437,7 +447,7 @@ | ||
| 437 | putOnImages.value = res.data.data.putOnImages.map(item => { | 447 | putOnImages.value = res.data.data.putOnImages.map(item => { |
| 438 | let processedItem = item; | 448 | let processedItem = item; |
| 439 | let carName = ''; | 449 | let carName = ''; |
| 440 | - | 450 | + |
| 441 | // 提取name后面的字符串作为carName并从item中移除 | 451 | // 提取name后面的字符串作为carName并从item中移除 |
| 442 | if (item.includes('name')) { | 452 | if (item.includes('name')) { |
| 443 | const nameIndex = item.indexOf('name'); | 453 | const nameIndex = item.indexOf('name'); |
| @@ -445,7 +455,7 @@ | @@ -445,7 +455,7 @@ | ||
| 445 | 455 | ||
| 446 | processedItem = item.substring(0, nameIndex); | 456 | processedItem = item.substring(0, nameIndex); |
| 447 | } | 457 | } |
| 448 | - | 458 | + |
| 449 | // 保持原有逻辑不变,但添加carName到返回对象 | 459 | // 保持原有逻辑不变,但添加carName到返回对象 |
| 450 | const newItem = processedItem.substring(0, processedItem.length - 6); | 460 | const newItem = processedItem.substring(0, processedItem.length - 6); |
| 451 | const newIndex = processedItem.substring(processedItem.length - 6); | 461 | const newIndex = processedItem.substring(processedItem.length - 6); |
| @@ -477,7 +487,7 @@ | @@ -477,7 +487,7 @@ | ||
| 477 | putOnImagesGrouped.value = Object.keys(newGroupedImages).map(key => ({ | 487 | putOnImagesGrouped.value = Object.keys(newGroupedImages).map(key => ({ |
| 478 | index: key, | 488 | index: key, |
| 479 | images: newGroupedImages[key], | 489 | images: newGroupedImages[key], |
| 480 | - carName: newGroupedImages[key] && newGroupedImages[key].length > 0 ? newGroupedImages[key][0].carName : '' | 490 | + carName: newGroupedImages[key] && newGroupedImages[key].length > 0 ? newGroupedImages[key][0].carName : '' |
| 481 | })); | 491 | })); |
| 482 | console.log('putOnImagesGrouped.value:', putOnImagesGrouped.value); | 492 | console.log('putOnImagesGrouped.value:', putOnImagesGrouped.value); |
| 483 | putDownImages.value = res.data.data.putDownImages.map(item => { | 493 | putDownImages.value = res.data.data.putDownImages.map(item => { |
| @@ -1034,4 +1044,27 @@ const handleDriverDispatchConfirm = (val) => { | @@ -1034,4 +1044,27 @@ const handleDriverDispatchConfirm = (val) => { | ||
| 1034 | display: flex; | 1044 | display: flex; |
| 1035 | flex-wrap: wrap; | 1045 | flex-wrap: wrap; |
| 1036 | } | 1046 | } |
| 1047 | + .image-group-header { | ||
| 1048 | + display: flex; | ||
| 1049 | + justify-content: space-between; | ||
| 1050 | + align-items: center; | ||
| 1051 | + margin-bottom: 10rpx; | ||
| 1052 | + } | ||
| 1053 | + | ||
| 1054 | + .car-status { | ||
| 1055 | + padding: 4rpx 12rpx; | ||
| 1056 | + border-radius: 6rpx; | ||
| 1057 | + font-size: 24rpx; | ||
| 1058 | + font-weight: bold; | ||
| 1059 | + | ||
| 1060 | + &.in-transit { | ||
| 1061 | + background-color: #fff7e6; | ||
| 1062 | + color: #ff9900; | ||
| 1063 | + } | ||
| 1064 | + | ||
| 1065 | + &.completed { | ||
| 1066 | + background-color: #e6f7ff; | ||
| 1067 | + color: #19a97c; | ||
| 1068 | + } | ||
| 1069 | + } | ||
| 1037 | </style> | 1070 | </style> |
| 1038 | \ No newline at end of file | 1071 | \ No newline at end of file |
garbage-removal/src/pages/order/order-driver/index.vue
| @@ -37,7 +37,7 @@ import swiperListItem from './swiper-list-item/index.vue'; | @@ -37,7 +37,7 @@ import swiperListItem from './swiper-list-item/index.vue'; | ||
| 37 | import { queryOrderList } from "@/apis/order.js"; | 37 | import { queryOrderList } from "@/apis/order.js"; |
| 38 | 38 | ||
| 39 | // 初始化订单类型列表,添加count属性 | 39 | // 初始化订单类型列表,添加count属性 |
| 40 | -const list = ref([, { name: '清运中', count: 0 }, { name: '全部', count: 0 }, { name: '已完成', count: 0 }]) | 40 | +const list = ref([{ name: '待清运', count: 0 }, { name: '清运中', count: 0 }, { name: '全部', count: 0 }, { name: '已完成', count: 0 }]) |
| 41 | const current = ref(0); | 41 | const current = ref(0); |
| 42 | const swiperCurrent = ref(0) | 42 | const swiperCurrent = ref(0) |
| 43 | const uTabsElement = ref() | 43 | const uTabsElement = ref() |