Commit a7a0b46ef13f7e62cfeeacf9c163bae5e2835d8c
1 parent
cc42bec8
记录详情优化
Showing
2 changed files
with
37 additions
and
41 deletions
pages-sub/daily/maintain-manage/finish-plan-detail.vue
| 1 | <template> | 1 | <template> |
| 2 | - <view class="page-container"> | 2 | + <view class="page-container" style="padding-bottom: 20px;"> |
| 3 | <!-- 页面级加载组件 --> | 3 | <!-- 页面级加载组件 --> |
| 4 | <up-loading-page | 4 | <up-loading-page |
| 5 | v-if="loading" | 5 | v-if="loading" |
| @@ -9,23 +9,28 @@ | @@ -9,23 +9,28 @@ | ||
| 9 | ></up-loading-page> | 9 | ></up-loading-page> |
| 10 | 10 | ||
| 11 | <!-- 内容容器 --> | 11 | <!-- 内容容器 --> |
| 12 | - <view v-else class="content-wrap"> | ||
| 13 | - <template v-for="(i, index) in orderDetail" :key="index"> | 12 | + <template v-else > |
| 13 | + <view class="content-wrap" v-for="(i, index) in orderDetail" :key="index"> | ||
| 14 | + | ||
| 14 | <!-- 工单详情内容 --> | 15 | <!-- 工单详情内容 --> |
| 15 | - <up-cell-group :border="false" inset style="margin: 20rpx;"> | ||
| 16 | - <!-- 1. 工单编号 --> | 16 | + <up-cell-group :border="false" inset> |
| 17 | + <!-- 1. 工单计划名称 --> | ||
| 17 | <up-cell | 18 | <up-cell |
| 18 | - :title="i.planName" | ||
| 19 | - | ||
| 20 | - class="up-line-1" | ||
| 21 | align="middle" | 19 | align="middle" |
| 22 | - ></up-cell> | 20 | + > |
| 21 | + | ||
| 22 | + <template #title> | ||
| 23 | + <view class="up-line-1">{{i.planName || '--'}}</view> | ||
| 24 | + </template> | ||
| 25 | +<!-- <template #value>--> | ||
| 26 | +<!-- <view class="up-line-1">{{i.remark || '--'}}</view>--> | ||
| 27 | +<!-- </template>--> | ||
| 28 | + </up-cell> | ||
| 23 | 29 | ||
| 24 | <!-- 2. 工单位置 --> | 30 | <!-- 2. 工单位置 --> |
| 25 | <up-cell | 31 | <up-cell |
| 26 | title="计划编码" | 32 | title="计划编码" |
| 27 | :value="i.planNo || '--'" | 33 | :value="i.planNo || '--'" |
| 28 | - class="up-line-1" | ||
| 29 | align="middle" | 34 | align="middle" |
| 30 | ></up-cell> | 35 | ></up-cell> |
| 31 | 36 | ||
| @@ -33,7 +38,6 @@ | @@ -33,7 +38,6 @@ | ||
| 33 | <up-cell | 38 | <up-cell |
| 34 | title="养护周期" | 39 | title="养护周期" |
| 35 | :value="`${i.rate}${uni.$dict.getDictLabel('cycle_id_type', i.cycleId)}`" | 40 | :value="`${i.rate}${uni.$dict.getDictLabel('cycle_id_type', i.cycleId)}`" |
| 36 | - class="up-line-1" | ||
| 37 | align="middle" | 41 | align="middle" |
| 38 | ></up-cell> | 42 | ></up-cell> |
| 39 | 43 | ||
| @@ -41,7 +45,6 @@ | @@ -41,7 +45,6 @@ | ||
| 41 | <up-cell | 45 | <up-cell |
| 42 | title="计划有效期" | 46 | title="计划有效期" |
| 43 | :value="`${timeFormat(i.beginTime,'yyyy-mm-dd')} 至 ${timeFormat(i. endTime,'yyyy-mm-dd')}`" | 47 | :value="`${timeFormat(i.beginTime,'yyyy-mm-dd')} 至 ${timeFormat(i. endTime,'yyyy-mm-dd')}`" |
| 44 | - class="up-line-1" | ||
| 45 | align="middle" | 48 | align="middle" |
| 46 | ></up-cell> | 49 | ></up-cell> |
| 47 | 50 | ||
| @@ -49,14 +52,11 @@ | @@ -49,14 +52,11 @@ | ||
| 49 | <up-cell title="照片"> | 52 | <up-cell title="照片"> |
| 50 | <template #value> | 53 | <template #value> |
| 51 | <view class="cell-content-wrap"> | 54 | <view class="cell-content-wrap"> |
| 52 | - | ||
| 53 | - <!-- 修复1:正确判断problemImgsList,补充空数组默认值 --> | ||
| 54 | <up-album | 55 | <up-album |
| 55 | - v-if="!!i.imgList?.length" | ||
| 56 | - :urls="i.imgList || []" | 56 | + v-if="!!i.beginImgList?.length" |
| 57 | + :urls="i.beginImgList || []" | ||
| 57 | singleSize="70" | 58 | singleSize="70" |
| 58 | :preview-full-image="true" | 59 | :preview-full-image="true" |
| 59 | - | ||
| 60 | ></up-album> | 60 | ></up-album> |
| 61 | <text v-else class="empty-text">暂无问题照片</text> | 61 | <text v-else class="empty-text">暂无问题照片</text> |
| 62 | </view> | 62 | </view> |
| @@ -65,34 +65,32 @@ | @@ -65,34 +65,32 @@ | ||
| 65 | 65 | ||
| 66 | <!-- 7. 处理结果 --> | 66 | <!-- 7. 处理结果 --> |
| 67 | <up-cell | 67 | <up-cell |
| 68 | - title="巡查描述" | ||
| 69 | - :value="i.remark || '--'" | ||
| 70 | - class="up-line-1" | ||
| 71 | align="middle" | 68 | align="middle" |
| 72 | - | ||
| 73 | - ></up-cell> | 69 | + > |
| 70 | + <template #title> | ||
| 71 | + <view style="min-width: 200rpx">巡查描述</view> | ||
| 72 | + </template> | ||
| 73 | + <template #value> | ||
| 74 | + <view class="up-line-1">{{i.remark || '--'}}</view> | ||
| 75 | + </template> | ||
| 76 | + </up-cell> | ||
| 74 | 77 | ||
| 75 | <up-cell | 78 | <up-cell |
| 76 | title="提交时间" | 79 | title="提交时间" |
| 77 | :value="timeFormat(i.finishTime,'yyyy-mm-dd hh:MM:ss') || '--'" | 80 | :value="timeFormat(i.finishTime,'yyyy-mm-dd hh:MM:ss') || '--'" |
| 78 | - class="up-line-1" | ||
| 79 | align="middle" | 81 | align="middle" |
| 80 | - | ||
| 81 | ></up-cell> | 82 | ></up-cell> |
| 82 | 83 | ||
| 83 | 84 | ||
| 84 | <up-cell | 85 | <up-cell |
| 85 | title="提交人" | 86 | title="提交人" |
| 86 | :value="i.userName || '--'" | 87 | :value="i.userName || '--'" |
| 87 | - class="up-line-1" | ||
| 88 | align="middle" | 88 | align="middle" |
| 89 | :border="false" | 89 | :border="false" |
| 90 | ></up-cell> | 90 | ></up-cell> |
| 91 | </up-cell-group> | 91 | </up-cell-group> |
| 92 | - </template> | ||
| 93 | - | ||
| 94 | - | ||
| 95 | </view> | 92 | </view> |
| 93 | + </template> | ||
| 96 | </view> | 94 | </view> |
| 97 | </template> | 95 | </template> |
| 98 | 96 | ||
| @@ -109,20 +107,18 @@ const orderDetail = ref([]); | @@ -109,20 +107,18 @@ const orderDetail = ref([]); | ||
| 109 | /** | 107 | /** |
| 110 | * 获取工单详情 | 108 | * 获取工单详情 |
| 111 | */ | 109 | */ |
| 112 | -const getOrderDetail = async (plan_no: string) => { | 110 | +const getOrderDetail = async (planNo: string) => { |
| 113 | try { | 111 | try { |
| 114 | loading.value = true; | 112 | loading.value = true; |
| 115 | - const res = await detailList({plan_no}); | 113 | + let queryData = { |
| 114 | + planNo:planNo, | ||
| 115 | + pageSize:100, | ||
| 116 | + pageNo:1, | ||
| 117 | + } | ||
| 118 | + const res = await detailList(queryData); | ||
| 116 | console.log('接口返回:', res); | 119 | console.log('接口返回:', res); |
| 117 | - // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 | ||
| 118 | - // orderDetail.value | ||
| 119 | - // orderDetail.value = { | ||
| 120 | - // ...res, | ||
| 121 | - // problemImgsList: Array.isArray(res.problemImgsList) ? res.problemImgsList : [], | ||
| 122 | - // completeImgsList: Array.isArray(res.completeImgsList) ? res.completeImgsList : [] | ||
| 123 | - // }; | ||
| 124 | - | ||
| 125 | - orderDetail.value = res; | 120 | + |
| 121 | + orderDetail.value = res.list; | ||
| 126 | } catch (error) { | 122 | } catch (error) { |
| 127 | console.error('获取工单详情失败:', error); | 123 | console.error('获取工单详情失败:', error); |
| 128 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); | 124 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); |
pages-sub/daily/patrol-manage/finish-plan-detail.vue
| @@ -9,8 +9,8 @@ | @@ -9,8 +9,8 @@ | ||
| 9 | ></up-loading-page> | 9 | ></up-loading-page> |
| 10 | 10 | ||
| 11 | <!-- 内容容器 --> | 11 | <!-- 内容容器 --> |
| 12 | - <view v-else class="content-wrap"> | ||
| 13 | - <template v-for="(i, index) in orderDetail" :key="index"> | 12 | + <view v-else class="content-wrap" v-for="(i, index) in orderDetail" :key="index"> |
| 13 | + <template > | ||
| 14 | <!-- 工单详情内容 --> | 14 | <!-- 工单详情内容 --> |
| 15 | <up-cell-group :border="false" inset > | 15 | <up-cell-group :border="false" inset > |
| 16 | <!-- 1. 工单名称 --> | 16 | <!-- 1. 工单名称 --> |