Commit b10b29b6ad540c2d71c03dfee3ff9c7325c5d6bf
1 parent
6dcd0ffd
lineWidth="65" 优化样式
Showing
4 changed files
with
25 additions
and
30 deletions
pages-sub/daily/patrol-manage/pending-plan-detail.vue
| 1 | 1 | <template> |
| 2 | 2 | <view class="page-container"> |
| 3 | - | |
| 4 | 3 | <view class="page-body"> |
| 5 | - <view class="plan-card-wrap" v-for="(item,index) in planInfo" :key="`${item.planNo}_${index}`"> | |
| 6 | - | |
| 7 | - <!-- 计划名称 --> | |
| 8 | - <view class="form-card form-card--title"> | |
| 9 | - <view class="card-title">{{ item.planName || '无计划名称' }}</view> | |
| 10 | - </view> | |
| 4 | + <!-- 只渲染一次标题卡片,取倒序后第一条数据 --> | |
| 5 | + <view class="form-card form-card--title" v-if="reversedPlanInfo.length"> | |
| 6 | + <view class="card-title">{{ reversedPlanInfo[0].planName || '无计划名称' }}</view> | |
| 7 | + </view> | |
| 11 | 8 | |
| 9 | + <!-- 倒叙循环计划信息卡片 --> | |
| 10 | + <view class="plan-card-wrap" v-for="(item,index) in reversedPlanInfo" :key="`${item.planNo}_${index}`"> | |
| 12 | 11 | <!-- 计划信息 --> |
| 13 | 12 | <view class="form-card"> |
| 14 | 13 | <view class="sec-head"> |
| 15 | 14 | <view class="sec-bar"></view> |
| 16 | 15 | <view class="sec-title">计划信息</view> |
| 17 | 16 | </view> |
| 18 | - | |
| 19 | 17 | <view class="u-body-item u-flex"> |
| 20 | 18 | <view class="u-body-item-title">计划编码:</view> |
| 21 | 19 | <view class="u-line-1 u-body-value">{{ item.planNo || '-' }}</view> |
| ... | ... | @@ -26,24 +24,20 @@ |
| 26 | 24 | {{ uni.$dict.getDictLabel('cycle_id_type', item.cycleId) }} |
| 27 | 25 | </view> |
| 28 | 26 | </view> |
| 29 | - | |
| 30 | 27 | <view class="u-body-item u-flex"> |
| 31 | 28 | <view class="u-body-item-title">计划完成次数:</view> |
| 32 | 29 | <view class="u-line-1 u-body-value">{{ item.planNum || 0 }}</view> |
| 33 | 30 | </view> |
| 34 | - | |
| 35 | 31 | <view class="u-body-item u-flex"> |
| 36 | 32 | <view class="u-body-item-title">已完成次数:</view> |
| 37 | 33 | <view class="u-line-1 u-body-value">{{ item.planFinishNum || 0 }}</view> |
| 38 | 34 | </view> |
| 39 | - | |
| 40 | 35 | <view class="u-body-item u-flex"> |
| 41 | 36 | <view class="u-body-item-title">计划有效期:</view> |
| 42 | 37 | <view class="u-line-1 u-body-value">{{ timeFormat(item.beginTime, 'yyyy-mm-dd') || '-' }} 至 |
| 43 | 38 | {{ timeFormat(item.endTime, 'yyyy-mm-dd') || '-' }} |
| 44 | 39 | </view> |
| 45 | 40 | </view> |
| 46 | - | |
| 47 | 41 | <!-- 底部操作区(分隔线 + 右对齐按钮) --> |
| 48 | 42 | <view class="card-action-row" v-if="item.finishState == 3 || item.planFinishNum > 0"> |
| 49 | 43 | <view class="mini-btn mini-btn--primary is-disabled" v-if="item.finishState == 3"> |
| ... | ... | @@ -57,8 +51,6 @@ |
| 57 | 51 | </view> |
| 58 | 52 | </view> |
| 59 | 53 | </view> |
| 60 | - | |
| 61 | - | |
| 62 | 54 | <!-- 底部新增记录按钮 status=3--> |
| 63 | 55 | <view class="fixed-bottom-btn-wrap" v-if="finishState==1"> |
| 64 | 56 | <up-button |
| ... | ... | @@ -74,21 +66,28 @@ |
| 74 | 66 | |
| 75 | 67 | <script setup> |
| 76 | 68 | import { timeFormat } from '@/uni_modules/uview-plus'; |
| 77 | -import { ref } from 'vue'; | |
| 69 | +import { ref, computed } from 'vue'; | |
| 78 | 70 | import { onLoad, onShow } from '@dcloudio/uni-app'; |
| 79 | 71 | import { inspectionPlanDetail } from "@/api/patrol-manage/patrol-plan"; |
| 72 | + | |
| 80 | 73 | // 响应式数据定义 |
| 81 | 74 | const planInfo = ref([]); |
| 82 | 75 | const batchNo = ref('') |
| 83 | 76 | const planNo = ref('') |
| 84 | 77 | const finishState = ref('') |
| 78 | + | |
| 79 | +// 计算属性:数组拷贝后倒序,不修改原数组 | |
| 80 | +const reversedPlanInfo = computed(() => { | |
| 81 | + return [...planInfo.value].reverse() | |
| 82 | +}) | |
| 83 | + | |
| 85 | 84 | // 页面加载接收参数 |
| 86 | 85 | onLoad((options) => { |
| 87 | 86 | console.log('计划ID:', options.batchNo); |
| 88 | 87 | batchNo.value = options.batchNo; |
| 89 | - // planNo.value = options.planNo; | |
| 90 | 88 | finishState.value = options.status |
| 91 | 89 | }); |
| 90 | + | |
| 92 | 91 | // 页面显示时请求数据 |
| 93 | 92 | onShow(() => { |
| 94 | 93 | if (!batchNo.value) { |
| ... | ... | @@ -100,6 +99,7 @@ onShow(() => { |
| 100 | 99 | } |
| 101 | 100 | getPlanDetail(batchNo.value); |
| 102 | 101 | }); |
| 102 | + | |
| 103 | 103 | const getPlanDetail = async () => { |
| 104 | 104 | const queryData = { |
| 105 | 105 | batchNo: batchNo.value, |
| ... | ... | @@ -110,16 +110,19 @@ const getPlanDetail = async () => { |
| 110 | 110 | planInfo.value = planInfoRes |
| 111 | 111 | console.log(planInfoRes) |
| 112 | 112 | }; |
| 113 | + | |
| 113 | 114 | // 跳转到已完成计划明细 |
| 114 | 115 | const gotoFinishPlanDetail = (i) => { |
| 115 | 116 | uni.navigateTo({ |
| 116 | 117 | url: `/pages-sub/daily/patrol-manage/finish-plan-detail?planNo=${i.planNo}` |
| 117 | 118 | }); |
| 118 | 119 | }; |
| 119 | -// 新增记录 | |
| 120 | + | |
| 121 | +// 新增记录,取倒序后的第一条 | |
| 120 | 122 | const addNewRecord = () => { |
| 123 | + const firstItem = reversedPlanInfo.value[0] | |
| 121 | 124 | uni.navigateTo({ |
| 122 | - url: `/pages-sub/daily/patrol-manage/add-patrol-record?planNo=${planInfo.value[0].planNo}&batchNo=${batchNo.value}`, | |
| 125 | + url: `/pages-sub/daily/patrol-manage/add-patrol-record?planNo=${firstItem.planNo}&batchNo=${batchNo.value}`, | |
| 123 | 126 | }); |
| 124 | 127 | }; |
| 125 | 128 | </script> |
| ... | ... | @@ -132,11 +135,9 @@ const addNewRecord = () => { |
| 132 | 135 | background-color: #F4F6FA; |
| 133 | 136 | box-sizing: border-box; |
| 134 | 137 | } |
| 135 | - | |
| 136 | 138 | .page-body { |
| 137 | 139 | padding: 0 24rpx; |
| 138 | 140 | } |
| 139 | - | |
| 140 | 141 | // 白色卡片:8px 圆角 + 卡片阴影(设计稿 .card) |
| 141 | 142 | .form-card { |
| 142 | 143 | margin-top: 24rpx; |
| ... | ... | @@ -145,7 +146,6 @@ const addNewRecord = () => { |
| 145 | 146 | border-radius: 16rpx; |
| 146 | 147 | box-shadow: 0 4rpx 16rpx rgba(17, 24, 39, 0.06); |
| 147 | 148 | } |
| 148 | - | |
| 149 | 149 | // 区块标题:蓝色竖条 + 标题文字 |
| 150 | 150 | .sec-head { |
| 151 | 151 | display: flex; |
| ... | ... | @@ -153,20 +153,17 @@ const addNewRecord = () => { |
| 153 | 153 | gap: 12rpx; |
| 154 | 154 | padding: 20rpx 0 8rpx; |
| 155 | 155 | } |
| 156 | - | |
| 157 | 156 | .sec-bar { |
| 158 | 157 | width: 6rpx; |
| 159 | 158 | height: 28rpx; |
| 160 | 159 | background-color: #2563EB; |
| 161 | 160 | border-radius: 3rpx; |
| 162 | 161 | } |
| 163 | - | |
| 164 | 162 | .sec-title { |
| 165 | 163 | font-size: 30rpx; |
| 166 | 164 | font-weight: 500; |
| 167 | 165 | color: #1F2937; |
| 168 | 166 | } |
| 169 | - | |
| 170 | 167 | /* 计划名称卡片 */ |
| 171 | 168 | .form-card--title { |
| 172 | 169 | padding: 28rpx 24rpx; |
| ... | ... | @@ -177,22 +174,18 @@ const addNewRecord = () => { |
| 177 | 174 | color: #1F2937; |
| 178 | 175 | line-height: 1.4; |
| 179 | 176 | } |
| 180 | - | |
| 181 | 177 | /* 信息行 */ |
| 182 | 178 | .form-card .u-body-item { |
| 183 | 179 | margin-bottom: 12rpx; |
| 184 | - | |
| 185 | 180 | &:last-of-type { |
| 186 | 181 | margin-bottom: 0; |
| 187 | 182 | } |
| 188 | 183 | } |
| 189 | - | |
| 190 | 184 | /* 禁用态按钮 */ |
| 191 | 185 | .mini-btn.is-disabled { |
| 192 | 186 | background-color: #93B4F5 !important; |
| 193 | 187 | opacity: 0.7; |
| 194 | 188 | } |
| 195 | - | |
| 196 | 189 | /* 底部提交栏 */ |
| 197 | 190 | .fixed-bottom-btn-wrap { |
| 198 | 191 | position: fixed; |
| ... | ... | @@ -211,4 +204,4 @@ const addNewRecord = () => { |
| 211 | 204 | border-radius: 16rpx !important; |
| 212 | 205 | font-size: 30rpx !important; |
| 213 | 206 | } |
| 214 | -</style> | |
| 215 | 207 | \ No newline at end of file |
| 208 | +</style> | ... | ... |
pages-sub/problem/regional-order-manage/order-detail.vue
pages-sub/problem/work-order-manage/index.vue
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | <empty-view/> |
| 58 | 58 | </template> |
| 59 | 59 | |
| 60 | - <view class="common-card-list" style="padding-top: 216rpx;padding-bottom: calc(120rpx + env(safe-area-inset-bottom))"> | |
| 60 | + <view class="common-card-list" style="padding-top: 190rpx;padding-bottom: calc(120rpx + env(safe-area-inset-bottom))"> | |
| 61 | 61 | <!-- 待办工单卡片 --> |
| 62 | 62 | <up-card |
| 63 | 63 | v-if="activeTab == 0" | ... | ... |