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 | 1 | <template> |
| 2 | - <view class="page-container"> | |
| 2 | + <view class="page-container" style="padding-bottom: 20px;"> | |
| 3 | 3 | <!-- 页面级加载组件 --> |
| 4 | 4 | <up-loading-page |
| 5 | 5 | v-if="loading" |
| ... | ... | @@ -9,23 +9,28 @@ |
| 9 | 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 | 18 | <up-cell |
| 18 | - :title="i.planName" | |
| 19 | - | |
| 20 | - class="up-line-1" | |
| 21 | 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 | 30 | <!-- 2. 工单位置 --> |
| 25 | 31 | <up-cell |
| 26 | 32 | title="计划编码" |
| 27 | 33 | :value="i.planNo || '--'" |
| 28 | - class="up-line-1" | |
| 29 | 34 | align="middle" |
| 30 | 35 | ></up-cell> |
| 31 | 36 | |
| ... | ... | @@ -33,7 +38,6 @@ |
| 33 | 38 | <up-cell |
| 34 | 39 | title="养护周期" |
| 35 | 40 | :value="`${i.rate}${uni.$dict.getDictLabel('cycle_id_type', i.cycleId)}`" |
| 36 | - class="up-line-1" | |
| 37 | 41 | align="middle" |
| 38 | 42 | ></up-cell> |
| 39 | 43 | |
| ... | ... | @@ -41,7 +45,6 @@ |
| 41 | 45 | <up-cell |
| 42 | 46 | title="计划有效期" |
| 43 | 47 | :value="`${timeFormat(i.beginTime,'yyyy-mm-dd')} 至 ${timeFormat(i. endTime,'yyyy-mm-dd')}`" |
| 44 | - class="up-line-1" | |
| 45 | 48 | align="middle" |
| 46 | 49 | ></up-cell> |
| 47 | 50 | |
| ... | ... | @@ -49,14 +52,11 @@ |
| 49 | 52 | <up-cell title="照片"> |
| 50 | 53 | <template #value> |
| 51 | 54 | <view class="cell-content-wrap"> |
| 52 | - | |
| 53 | - <!-- 修复1:正确判断problemImgsList,补充空数组默认值 --> | |
| 54 | 55 | <up-album |
| 55 | - v-if="!!i.imgList?.length" | |
| 56 | - :urls="i.imgList || []" | |
| 56 | + v-if="!!i.beginImgList?.length" | |
| 57 | + :urls="i.beginImgList || []" | |
| 57 | 58 | singleSize="70" |
| 58 | 59 | :preview-full-image="true" |
| 59 | - | |
| 60 | 60 | ></up-album> |
| 61 | 61 | <text v-else class="empty-text">暂无问题照片</text> |
| 62 | 62 | </view> |
| ... | ... | @@ -65,34 +65,32 @@ |
| 65 | 65 | |
| 66 | 66 | <!-- 7. 处理结果 --> |
| 67 | 67 | <up-cell |
| 68 | - title="巡查描述" | |
| 69 | - :value="i.remark || '--'" | |
| 70 | - class="up-line-1" | |
| 71 | 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 | 78 | <up-cell |
| 76 | 79 | title="提交时间" |
| 77 | 80 | :value="timeFormat(i.finishTime,'yyyy-mm-dd hh:MM:ss') || '--'" |
| 78 | - class="up-line-1" | |
| 79 | 81 | align="middle" |
| 80 | - | |
| 81 | 82 | ></up-cell> |
| 82 | 83 | |
| 83 | 84 | |
| 84 | 85 | <up-cell |
| 85 | 86 | title="提交人" |
| 86 | 87 | :value="i.userName || '--'" |
| 87 | - class="up-line-1" | |
| 88 | 88 | align="middle" |
| 89 | 89 | :border="false" |
| 90 | 90 | ></up-cell> |
| 91 | 91 | </up-cell-group> |
| 92 | - </template> | |
| 93 | - | |
| 94 | - | |
| 95 | 92 | </view> |
| 93 | + </template> | |
| 96 | 94 | </view> |
| 97 | 95 | </template> |
| 98 | 96 | |
| ... | ... | @@ -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 | 111 | try { |
| 114 | 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 | 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 | 122 | } catch (error) { |
| 127 | 123 | console.error('获取工单详情失败:', error); |
| 128 | 124 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); | ... | ... |
pages-sub/daily/patrol-manage/finish-plan-detail.vue
| ... | ... | @@ -9,8 +9,8 @@ |
| 9 | 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 | 15 | <up-cell-group :border="false" inset > |
| 16 | 16 | <!-- 1. 工单名称 --> | ... | ... |