Commit b0e2f1a9a61d35f68dde9920da8582b6d4fb1041
1 parent
df24e712
快速工单和巡查计划样式优化
Showing
12 changed files
with
397 additions
and
702 deletions
common/config/env.js
| @@ -3,6 +3,8 @@ const env = { | @@ -3,6 +3,8 @@ const env = { | ||
| 3 | // 开发环境 | 3 | // 开发环境 |
| 4 | development: { | 4 | development: { |
| 5 | baseUrl: 'https://test.jichengshanshui.com.cn:28302', | 5 | baseUrl: 'https://test.jichengshanshui.com.cn:28302', |
| 6 | + // https://test.jichengshanshui.com.cn:28302 | ||
| 7 | + | ||
| 6 | uploadUrl: 'https://test.jichengshanshui.com.cn:28302', | 8 | uploadUrl: 'https://test.jichengshanshui.com.cn:28302', |
| 7 | // baseApi:'admin-api', | 9 | // baseApi:'admin-api', |
| 8 | // appApi:'app-api' | 10 | // appApi:'app-api' |
pages-sub/daily/maintain-manage/add-record.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page-container"> | 2 | <view class="page-container"> |
| 3 | - <!-- 核心:将所有 up-form-item 包裹在同一个 up-form 内 --> | ||
| 4 | <view class="inspect-form-content commonPageLRpadding"> | 3 | <view class="inspect-form-content commonPageLRpadding"> |
| 5 | <up-form | 4 | <up-form |
| 6 | label-position="left" | 5 | label-position="left" |
| @@ -42,32 +41,27 @@ | @@ -42,32 +41,27 @@ | ||
| 42 | ></up-upload> | 41 | ></up-upload> |
| 43 | </up-form-item> | 42 | </up-form-item> |
| 44 | 43 | ||
| 45 | - <!-- 3. 完成进度(滑块)- 核心修改:min绑定initProgress --> | 44 | + <!-- 3. 完成进度(滑块) --> |
| 46 | <up-form-item | 45 | <up-form-item |
| 47 | label="完成进度" | 46 | label="完成进度" |
| 48 | prop="progress" | 47 | prop="progress" |
| 49 | - required | 48 | + |
| 50 | class="form-item" | 49 | class="form-item" |
| 51 | > | 50 | > |
| 52 | <view class="progress-wrap"> | 51 | <view class="progress-wrap"> |
| 53 | <up-slider | 52 | <up-slider |
| 54 | v-model="inspectForm.progress" | 53 | v-model="inspectForm.progress" |
| 55 | - :min="0" | ||
| 56 | - :max="100" | ||
| 57 | - active-color="#1989fa" | ||
| 58 | - inactive-color="#e5e5e5" | ||
| 59 | - block-size="24" | ||
| 60 | - class="progress-slider" | ||
| 61 | - @change="handleProgressChange" | 54 | + :min="initProgress" |
| 55 | + :max="100" | ||
| 56 | + active-color="#1989fa" | ||
| 57 | + inactive-color="#e5e5e5" | ||
| 58 | + block-size="24" | ||
| 59 | + :showValue="true" | ||
| 60 | + class="progress-slider" | ||
| 61 | + @changing="handleProgressChange" | ||
| 62 | ></up-slider> | 62 | ></up-slider> |
| 63 | - <view class="progress-value">{{ inspectForm.progress }}%</view> | ||
| 64 | - <!-- 优化提示文案:动态显示初始进度值 --> | ||
| 65 | - <view class="progress-tips" v-if="inspectForm.progress <= initProgress"> | ||
| 66 | - 进度不能低于或等于{{ initProgress }}%,请调整 | ||
| 67 | - </view> | ||
| 68 | </view> | 63 | </view> |
| 69 | </up-form-item> | 64 | </up-form-item> |
| 70 | - | ||
| 71 | </up-form> | 65 | </up-form> |
| 72 | </view> | 66 | </view> |
| 73 | 67 | ||
| @@ -86,28 +80,23 @@ | @@ -86,28 +80,23 @@ | ||
| 86 | <script setup lang="ts"> | 80 | <script setup lang="ts"> |
| 87 | import { ref } from 'vue' | 81 | import { ref } from 'vue' |
| 88 | import type { UniFormRef } from '@/uni_modules/uview-plus/types' | 82 | import type { UniFormRef } from '@/uni_modules/uview-plus/types' |
| 89 | -// 定义ref供选项式API使用 | ||
| 90 | const inspectFormRef = ref<UniFormRef>(null) | 83 | const inspectFormRef = ref<UniFormRef>(null) |
| 91 | </script> | 84 | </script> |
| 92 | 85 | ||
| 93 | <script lang="ts"> | 86 | <script lang="ts"> |
| 94 | -import { uploadImages } from '@/common/utils/upload'; | ||
| 95 | -import { maintainCreate } from "@/api/maintain-manage/maintain-manage"; | 87 | +import { uploadImages } from '@/common/utils/upload' |
| 88 | +import { maintainCreate } from "@/api/maintain-manage/maintain-manage" | ||
| 96 | 89 | ||
| 97 | export default { | 90 | export default { |
| 98 | data() { | 91 | data() { |
| 99 | return { | 92 | return { |
| 100 | - // 图片列表 | ||
| 101 | imagesList: [], | 93 | imagesList: [], |
| 102 | - // 从URL获取的初始进度值 | ||
| 103 | initProgress: 0, | 94 | initProgress: 0, |
| 104 | - // 巡查表单数据 | ||
| 105 | inspectForm: { | 95 | inspectForm: { |
| 106 | - remark: '', // 巡查描述 | ||
| 107 | - progress: 0 // 完成进度(0-100) | 96 | + remark: '', |
| 97 | + progress: 0 | ||
| 108 | }, | 98 | }, |
| 109 | - paramsOptins: {}, // 接受参数 | ||
| 110 | - // 表单校验规则 | 99 | + paramsOptins: {}, |
| 111 | inspectFormRules: { | 100 | inspectFormRules: { |
| 112 | images: [ | 101 | images: [ |
| 113 | { | 102 | { |
| @@ -115,10 +104,8 @@ export default { | @@ -115,10 +104,8 @@ export default { | ||
| 115 | message: '请上传图片', | 104 | message: '请上传图片', |
| 116 | trigger: 'change', | 105 | trigger: 'change', |
| 117 | validator: (rule, value, callback) => { | 106 | validator: (rule, value, callback) => { |
| 118 | - // 自定义校验规则:检查是否有成功上传的图片 | ||
| 119 | const hasSuccessImg = this.imagesList.some(item => item.status === 'success') | 107 | const hasSuccessImg = this.imagesList.some(item => item.status === 'success') |
| 120 | const imgCount = this.imagesList.filter(item => item.status === 'success').length | 108 | const imgCount = this.imagesList.filter(item => item.status === 'success').length |
| 121 | - | ||
| 122 | if (!hasSuccessImg || imgCount < 1) { | 109 | if (!hasSuccessImg || imgCount < 1) { |
| 123 | callback(new Error('最少需要上传1张图片')) | 110 | callback(new Error('最少需要上传1张图片')) |
| 124 | } else if (imgCount > 3) { | 111 | } else if (imgCount > 3) { |
| @@ -129,55 +116,71 @@ export default { | @@ -129,55 +116,71 @@ export default { | ||
| 129 | } | 116 | } |
| 130 | } | 117 | } |
| 131 | ], | 118 | ], |
| 132 | - progress: [ | ||
| 133 | - { | ||
| 134 | - type: 'number', | ||
| 135 | - required: true, | ||
| 136 | - message: '请设置完成进度', | ||
| 137 | - trigger: ['change'], | ||
| 138 | - validator: (rule, value, callback) => { | ||
| 139 | - // 自定义校验:进度必须大于初始进度值(兜底校验) | ||
| 140 | - if (value <= this.initProgress) { | ||
| 141 | - callback(new Error(`完成进度必须大于${this.initProgress}%`)) | ||
| 142 | - } else { | ||
| 143 | - callback() | ||
| 144 | - } | ||
| 145 | - } | ||
| 146 | - } | ||
| 147 | - ] | 119 | + // progress: [ |
| 120 | + // { | ||
| 121 | + // | ||
| 122 | + // required: true, | ||
| 123 | + // message: '请设置完成进度', | ||
| 124 | + // trigger: ['change'], | ||
| 125 | + // validator: (rule, value, callback) => { | ||
| 126 | + // // 第一步:校验是否为空/0 | ||
| 127 | + // if (!value && value !== 0) { | ||
| 128 | + // callback(new Error('请设置完成进度')) | ||
| 129 | + // } | ||
| 130 | + // // 第二步:校验是否大于初始进度 | ||
| 131 | + // else if (value <= this.initProgress) { | ||
| 132 | + // callback(new Error(`完成进度必须大于${this.initProgress}%`)) | ||
| 133 | + // } | ||
| 134 | + // // 校验通过 | ||
| 135 | + // else { | ||
| 136 | + // callback() | ||
| 137 | + // } | ||
| 138 | + // } | ||
| 139 | + // } | ||
| 140 | + // ] | ||
| 148 | } | 141 | } |
| 149 | } | 142 | } |
| 150 | }, | 143 | }, |
| 151 | onLoad(option) { | 144 | onLoad(option) { |
| 152 | console.log('页面参数:', option) | 145 | console.log('页面参数:', option) |
| 153 | this.paramsOptins = option | 146 | this.paramsOptins = option |
| 154 | - | ||
| 155 | - // 从URL参数中获取进度值,默认0 | ||
| 156 | - this.initProgress = option.finishPercent ? Number(option.finishPercent) : 0 | ||
| 157 | - // 设置表单初始进度值(若初始进度>0,默认设为初始进度+1,避免刚进入就提示) | ||
| 158 | - this.inspectForm.progress = this.initProgress + 1 || 1 | ||
| 159 | - | 147 | + // 初始化初始进度 |
| 148 | + this.initProgress = option.finishPercent ? Number(option.finishPercent)+1 : 0 | ||
| 149 | + // 关键修复:初始进度值设为 初始进度+1,避免刚进入就触发校验失败 | ||
| 150 | + this.inspectForm.progress = this.initProgress | ||
| 160 | console.log('初始进度值:', this.initProgress) | 151 | console.log('初始进度值:', this.initProgress) |
| 161 | }, | 152 | }, |
| 162 | onReady() { | 153 | onReady() { |
| 163 | - // 兼容微信小程序,通过setRules设置校验规则 | ||
| 164 | this.$refs.inspectFormRef.setRules(this.inspectFormRules) | 154 | this.$refs.inspectFormRef.setRules(this.inspectFormRules) |
| 165 | console.log('巡查表单规则初始化完成') | 155 | console.log('巡查表单规则初始化完成') |
| 166 | }, | 156 | }, |
| 167 | methods: { | 157 | methods: { |
| 168 | /** | 158 | /** |
| 169 | - * 新增:进度滑块拖动后校验(兜底,防止手动修改值) | 159 | + * 进度滑块变化处理 - 核心优化:实时触发校验 + 状态更新 |
| 170 | */ | 160 | */ |
| 171 | - handleProgressChange(val) { | ||
| 172 | - // 若拖动后值<=初始进度,强制重置为初始进度+1 | ||
| 173 | - if (val <= this.initProgress) { | ||
| 174 | - this.inspectForm.progress = this.initProgress + 1 | ||
| 175 | - uni.showToast({ | ||
| 176 | - title: `进度不能低于${this.initProgress}%`, | ||
| 177 | - icon: 'none', | ||
| 178 | - duration: 1500 | ||
| 179 | - }) | ||
| 180 | - } | 161 | + handleProgressChange(value) { |
| 162 | + // // 1. 强制修正非法值(兜底) | ||
| 163 | + // console.log(value) | ||
| 164 | + // if (value <= this.initProgress) { | ||
| 165 | + // console.log('123') | ||
| 166 | + // this.inspectForm.progress = this.initProgress + 1 | ||
| 167 | + // uni.showToast({ | ||
| 168 | + // title: `进度不能低于${this.initProgress}%`, | ||
| 169 | + // icon: 'none', | ||
| 170 | + // duration: 1500 | ||
| 171 | + // }) | ||
| 172 | + // } | ||
| 173 | + // | ||
| 174 | + // // 2. 关键:手动触发progress字段的校验,实时更新提示状态 | ||
| 175 | + // this.$nextTick(async () => { | ||
| 176 | + // try { | ||
| 177 | + // // 触发单个字段校验 | ||
| 178 | + // await this.$refs.inspectFormRef.validateField('progress') | ||
| 179 | + // } catch (err) { | ||
| 180 | + // // 校验失败时uView会自动显示提示,此处无需额外处理 | ||
| 181 | + // console.log('进度校验失败:', err) | ||
| 182 | + // } | ||
| 183 | + // }) | ||
| 181 | }, | 184 | }, |
| 182 | 185 | ||
| 183 | /** | 186 | /** |
| @@ -186,7 +189,6 @@ export default { | @@ -186,7 +189,6 @@ export default { | ||
| 186 | deleteImg(event) { | 189 | deleteImg(event) { |
| 187 | console.log('删除图片事件:', event) | 190 | console.log('删除图片事件:', event) |
| 188 | this.imagesList.splice(event.index, 1) | 191 | this.imagesList.splice(event.index, 1) |
| 189 | - // 删除图片后重新校验图片字段 | ||
| 190 | this.$refs.inspectFormRef.validateField('images') | 192 | this.$refs.inspectFormRef.validateField('images') |
| 191 | uni.showToast({ title: '图片删除成功', icon: 'success' }) | 193 | uni.showToast({ title: '图片删除成功', icon: 'success' }) |
| 192 | }, | 194 | }, |
| @@ -198,7 +200,6 @@ export default { | @@ -198,7 +200,6 @@ export default { | ||
| 198 | console.log('上传图片事件:', event) | 200 | console.log('上传图片事件:', event) |
| 199 | const fileList = Array.isArray(event.file) ? event.file : [event.file] | 201 | const fileList = Array.isArray(event.file) ? event.file : [event.file] |
| 200 | const targetImgList = this.imagesList | 202 | const targetImgList = this.imagesList |
| 201 | - | ||
| 202 | const filePaths = fileList.map(item => item.url) | 203 | const filePaths = fileList.map(item => item.url) |
| 203 | const tempItems = fileList.map(item => ({ | 204 | const tempItems = fileList.map(item => ({ |
| 204 | ...item, | 205 | ...item, |
| @@ -242,7 +243,6 @@ export default { | @@ -242,7 +243,6 @@ export default { | ||
| 242 | uni.showToast({ title: `成功上传${fileList.length}张图片`, icon: 'success' }) | 243 | uni.showToast({ title: `成功上传${fileList.length}张图片`, icon: 'success' }) |
| 243 | } | 244 | } |
| 244 | 245 | ||
| 245 | - // 上传完成后重新校验图片字段 | ||
| 246 | this.$refs.inspectFormRef.validateField('images') | 246 | this.$refs.inspectFormRef.validateField('images') |
| 247 | } catch (err) { | 247 | } catch (err) { |
| 248 | console.error('图片上传失败:', err) | 248 | console.error('图片上传失败:', err) |
| @@ -256,8 +256,6 @@ export default { | @@ -256,8 +256,6 @@ export default { | ||
| 256 | } | 256 | } |
| 257 | } | 257 | } |
| 258 | uni.showToast({ title: '图片上传失败,请重试', icon: 'none' }) | 258 | uni.showToast({ title: '图片上传失败,请重试', icon: 'none' }) |
| 259 | - | ||
| 260 | - // 上传失败后重新校验图片字段 | ||
| 261 | this.$refs.inspectFormRef.validateField('images') | 259 | this.$refs.inspectFormRef.validateField('images') |
| 262 | } | 260 | } |
| 263 | }, | 261 | }, |
| @@ -282,38 +280,28 @@ export default { | @@ -282,38 +280,28 @@ export default { | ||
| 282 | async submitInspect() { | 280 | async submitInspect() { |
| 283 | console.log('当前完成进度:', this.inspectForm.progress) | 281 | console.log('当前完成进度:', this.inspectForm.progress) |
| 284 | try { | 282 | try { |
| 285 | - // 先执行表单校验 | ||
| 286 | await this.$refs.inspectFormRef.validate() | 283 | await this.$refs.inspectFormRef.validate() |
| 287 | console.log('图片列表:', this.imagesList) | 284 | console.log('图片列表:', this.imagesList) |
| 288 | 285 | ||
| 289 | - // 构造提交数据 | ||
| 290 | const submitData = { | 286 | const submitData = { |
| 291 | - // "batchNo": this.paramsOptins.batchNo, | ||
| 292 | - totalFinishPercent:this.inspectForm.progress, | 287 | + totalFinishPercent: this.inspectForm.progress, |
| 293 | "planNo": this.paramsOptins.planNo, | 288 | "planNo": this.paramsOptins.planNo, |
| 294 | "imgHost": "1", | 289 | "imgHost": "1", |
| 295 | "beginImg": this.getImgUrlList(this.imagesList), | 290 | "beginImg": this.getImgUrlList(this.imagesList), |
| 296 | - "commonUserList":[], | ||
| 297 | - // "userId": '', | ||
| 298 | - // "userName": '', | ||
| 299 | - "remark": this.inspectForm.remark // 备注中记录进度 | 291 | + "commonUserList": [], |
| 292 | + "remark": this.inspectForm.remark | ||
| 300 | } | 293 | } |
| 301 | 294 | ||
| 302 | - // 显示加载中 | ||
| 303 | uni.showLoading({ title: '提交中...' }) | 295 | uni.showLoading({ title: '提交中...' }) |
| 304 | - | ||
| 305 | await maintainCreate(submitData) | 296 | await maintainCreate(submitData) |
| 306 | - | ||
| 307 | uni.hideLoading() | 297 | uni.hideLoading() |
| 298 | + | ||
| 308 | uni.showToast({ | 299 | uni.showToast({ |
| 309 | title: '提交成功', | 300 | title: '提交成功', |
| 310 | icon: 'success', | 301 | icon: 'success', |
| 311 | duration: 1000 | 302 | duration: 1000 |
| 312 | }) | 303 | }) |
| 313 | - // uni.navigateTo({ | ||
| 314 | - // url: `/pages-sub/daily/maintain-manage/add-record?finishState=${item.finishState}&planNo=${item.planNo}&finishPercent=${item.finishPercent}` | ||
| 315 | - // }) | ||
| 316 | - // 延迟跳转(等待提示框显示完成) | 304 | + |
| 317 | setTimeout(() => { | 305 | setTimeout(() => { |
| 318 | uni.redirectTo({ | 306 | uni.redirectTo({ |
| 319 | url: '/pages-sub/daily/maintain-manage/index' | 307 | url: '/pages-sub/daily/maintain-manage/index' |
| @@ -321,14 +309,8 @@ export default { | @@ -321,14 +309,8 @@ export default { | ||
| 321 | }, 1000) | 309 | }, 1000) |
| 322 | 310 | ||
| 323 | } catch (error) { | 311 | } catch (error) { |
| 324 | - // 隐藏加载框 | ||
| 325 | uni.hideLoading() | 312 | uni.hideLoading() |
| 326 | - | ||
| 327 | - // 区分是表单校验失败还是接口调用失败 | ||
| 328 | - if (Array.isArray(error)) { | ||
| 329 | - // 表单校验失败 - 静默处理(uView会自动提示) | ||
| 330 | - } else { | ||
| 331 | - // 接口调用失败 | 313 | + if (!Array.isArray(error)) { |
| 332 | console.error('巡查表单提交失败:', error) | 314 | console.error('巡查表单提交失败:', error) |
| 333 | uni.showToast({ | 315 | uni.showToast({ |
| 334 | title: '提交失败,请重试', | 316 | title: '提交失败,请重试', |
| @@ -343,36 +325,13 @@ export default { | @@ -343,36 +325,13 @@ export default { | ||
| 343 | </script> | 325 | </script> |
| 344 | 326 | ||
| 345 | <style lang="scss" scoped> | 327 | <style lang="scss" scoped> |
| 346 | - | ||
| 347 | - | ||
| 348 | -// 巡查表单内容容器 | ||
| 349 | .inspect-form-content { | 328 | .inspect-form-content { |
| 350 | background: #fff; | 329 | background: #fff; |
| 351 | padding: 20rpx; | 330 | padding: 20rpx; |
| 352 | margin-bottom: 20rpx; | 331 | margin-bottom: 20rpx; |
| 353 | } | 332 | } |
| 354 | 333 | ||
| 355 | -// 进度滑块样式 | ||
| 356 | .progress-wrap { | 334 | .progress-wrap { |
| 357 | - width: 100%; | ||
| 358 | - | ||
| 359 | - .progress-slider { | ||
| 360 | - margin: 20rpx 0; | ||
| 361 | - } | ||
| 362 | - | ||
| 363 | - .progress-value { | ||
| 364 | - text-align: right; | ||
| 365 | - font-size: 28rpx; | ||
| 366 | - color: #333; | ||
| 367 | - margin-bottom: 10rpx; | ||
| 368 | - } | ||
| 369 | - | ||
| 370 | - .progress-tips { | ||
| 371 | - font-size: 24rpx; | ||
| 372 | - color: #ff4d4f; | ||
| 373 | - margin-top: 10rpx; | ||
| 374 | - } | 335 | + width: 83%; |
| 375 | } | 336 | } |
| 376 | - | ||
| 377 | - | ||
| 378 | </style> | 337 | </style> |
| 379 | \ No newline at end of file | 338 | \ No newline at end of file |
pages-sub/daily/maintain-manage/finish-plan-detail.vue
| @@ -10,8 +10,6 @@ | @@ -10,8 +10,6 @@ | ||
| 10 | 10 | ||
| 11 | <!-- 内容容器 --> | 11 | <!-- 内容容器 --> |
| 12 | <view v-else class="content-wrap"> | 12 | <view v-else class="content-wrap"> |
| 13 | - | ||
| 14 | - | ||
| 15 | <template v-for="(i, index) in orderDetail" :key="index"> | 13 | <template v-for="(i, index) in orderDetail" :key="index"> |
| 16 | <!-- 工单详情内容 --> | 14 | <!-- 工单详情内容 --> |
| 17 | <up-cell-group :border="false" inset style="margin: 20rpx;"> | 15 | <up-cell-group :border="false" inset style="margin: 20rpx;"> |
| @@ -42,13 +40,13 @@ | @@ -42,13 +40,13 @@ | ||
| 42 | <!-- 4. 情况描述 --> | 40 | <!-- 4. 情况描述 --> |
| 43 | <up-cell | 41 | <up-cell |
| 44 | title="计划有效期" | 42 | title="计划有效期" |
| 45 | - :value="`${timeFormat(i.beginTime,'yy-mm-dd hh:MM:ss')} 至 ${timeFormat(i. endTime,'yy-mm-dd hh:MM:ss')}`" | 43 | + :value="`${timeFormat(i.beginTime,'yyyy-mm-dd')} 至 ${timeFormat(i. endTime,'yyyy-mm-dd')}`" |
| 46 | class="up-line-1" | 44 | class="up-line-1" |
| 47 | align="middle" | 45 | align="middle" |
| 48 | ></up-cell> | 46 | ></up-cell> |
| 49 | 47 | ||
| 50 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> | 48 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> |
| 51 | - <up-cell title="照片" > | 49 | + <up-cell title="照片"> |
| 52 | <template #value> | 50 | <template #value> |
| 53 | <view class="cell-content-wrap"> | 51 | <view class="cell-content-wrap"> |
| 54 | 52 | ||
| @@ -71,15 +69,15 @@ | @@ -71,15 +69,15 @@ | ||
| 71 | :value="i.remark || '--'" | 69 | :value="i.remark || '--'" |
| 72 | class="up-line-1" | 70 | class="up-line-1" |
| 73 | align="middle" | 71 | align="middle" |
| 74 | - :border="false" | 72 | + |
| 75 | ></up-cell> | 73 | ></up-cell> |
| 76 | 74 | ||
| 77 | <up-cell | 75 | <up-cell |
| 78 | title="提交时间" | 76 | title="提交时间" |
| 79 | - :value="timeFormat(i.finishTime,'yy-mm-dd hh:MM:ss') || '--'" | 77 | + :value="timeFormat(i.finishTime,'yyyy-mm-dd hh:MM:ss') || '--'" |
| 80 | class="up-line-1" | 78 | class="up-line-1" |
| 81 | align="middle" | 79 | align="middle" |
| 82 | - :border="false" | 80 | + |
| 83 | ></up-cell> | 81 | ></up-cell> |
| 84 | 82 | ||
| 85 | 83 | ||
| @@ -99,34 +97,35 @@ | @@ -99,34 +97,35 @@ | ||
| 99 | </template> | 97 | </template> |
| 100 | 98 | ||
| 101 | <script setup lang="ts"> | 99 | <script setup lang="ts"> |
| 102 | -import { ref, reactive } from 'vue'; | ||
| 103 | -import { detailList } from "@/api/maintain-manage/maintain-manage"; | ||
| 104 | -import { onLoad, onShow } from '@dcloudio/uni-app'; | ||
| 105 | -import { timeFormat } from '@/uni_modules/uview-plus'; | ||
| 106 | - | 100 | +import {ref} from 'vue'; |
| 101 | +import {detailList} from "@/api/maintain-manage/maintain-manage"; | ||
| 102 | +import {onLoad} from '@dcloudio/uni-app'; | ||
| 103 | +import {timeFormat} from '@/uni_modules/uview-plus'; | ||
| 107 | // 状态管理 | 104 | // 状态管理 |
| 108 | const loading = ref(true); | 105 | const loading = ref(true); |
| 109 | const orderDetail = ref([]); | 106 | const orderDetail = ref([]); |
| 110 | 107 | ||
| 111 | 108 | ||
| 112 | - | ||
| 113 | /** | 109 | /** |
| 114 | * 获取工单详情 | 110 | * 获取工单详情 |
| 115 | */ | 111 | */ |
| 116 | -const getOrderDetail = async (planNo: string) => { | 112 | +const getOrderDetail = async (plan_no: string) => { |
| 117 | try { | 113 | try { |
| 118 | loading.value = true; | 114 | loading.value = true; |
| 119 | - const res = await detailList({ planNo }); | 115 | + const res = await detailList({plan_no}); |
| 120 | console.log('接口返回:', res); | 116 | console.log('接口返回:', res); |
| 121 | // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 | 117 | // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 |
| 122 | - orderDetail.value = { | ||
| 123 | - ...res, | ||
| 124 | - problemImgsList: Array.isArray(res.problemImgsList) ? res.problemImgsList : [], | ||
| 125 | - completeImgsList: Array.isArray(res.completeImgsList) ? res.completeImgsList : [] | ||
| 126 | - }; | 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; | ||
| 127 | } catch (error) { | 126 | } catch (error) { |
| 128 | console.error('获取工单详情失败:', error); | 127 | console.error('获取工单详情失败:', error); |
| 129 | - uni.showToast({ title: '加载失败,请重试', icon: 'none' }); | 128 | + uni.showToast({title: '加载失败,请重试', icon: 'none'}); |
| 130 | } finally { | 129 | } finally { |
| 131 | loading.value = false; | 130 | loading.value = false; |
| 132 | } | 131 | } |
| @@ -134,86 +133,24 @@ const getOrderDetail = async (planNo: string) => { | @@ -134,86 +133,24 @@ const getOrderDetail = async (planNo: string) => { | ||
| 134 | 133 | ||
| 135 | // 页面加载 | 134 | // 页面加载 |
| 136 | onLoad((options) => { | 135 | onLoad((options) => { |
| 137 | - const { planNo } = options; | 136 | + const {planNo} = options; |
| 138 | if (planNo) { | 137 | if (planNo) { |
| 139 | getOrderDetail(planNo); | 138 | getOrderDetail(planNo); |
| 140 | } else { | 139 | } else { |
| 141 | loading.value = false; | 140 | loading.value = false; |
| 142 | - uni.showToast({ title: '缺少工单ID', icon: 'none' }); | 141 | + uni.showToast({title: '缺少工单ID', icon: 'none'}); |
| 143 | } | 142 | } |
| 144 | }); | 143 | }); |
| 145 | </script> | 144 | </script> |
| 146 | 145 | ||
| 147 | <style scoped lang="scss"> | 146 | <style scoped lang="scss"> |
| 148 | -// 页面基础样式 | ||
| 149 | -.u-page { | ||
| 150 | - min-height: 100vh; | ||
| 151 | - background-color: #f5f5f5; | ||
| 152 | - box-sizing: border-box; | ||
| 153 | -} | ||
| 154 | 147 | ||
| 155 | // 内容容器 | 148 | // 内容容器 |
| 156 | .content-wrap { | 149 | .content-wrap { |
| 157 | background: #fff; | 150 | background: #fff; |
| 158 | width: 100%; | 151 | width: 100%; |
| 159 | box-sizing: border-box; | 152 | box-sizing: border-box; |
| 160 | - overflow-y: auto; | ||
| 161 | - min-height: calc(100vh - 40rpx); | ||
| 162 | -} | ||
| 163 | - | ||
| 164 | - | ||
| 165 | - | ||
| 166 | -// 空文本样式 | ||
| 167 | -.empty-text { | ||
| 168 | - color: #999; | ||
| 169 | - font-size: 28rpx; | ||
| 170 | - line-height: 80rpx; | ||
| 171 | - display: block; | ||
| 172 | - text-align: left; | ||
| 173 | -} | ||
| 174 | - | ||
| 175 | -// 优化uview组件样式 | ||
| 176 | -:deep(.up-cell-group) { | ||
| 177 | - --u-cell-group-background-color: #fff; | ||
| 178 | - --u-cell-group-border-radius: 12rpx; | ||
| 179 | - --u-cell-group-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); | ||
| 180 | -} | ||
| 181 | - | ||
| 182 | -:deep(.up-cell) { | ||
| 183 | - --u-cell-title-font-size: 28rpx; | ||
| 184 | - --u-cell-value-font-size: 28rpx; | ||
| 185 | - --u-cell-title-color: #666; | ||
| 186 | - --u-cell-value-color: #333; | ||
| 187 | - --u-cell-padding: 20rpx 15rpx; | ||
| 188 | - --u-cell-border-color: #f5f5f5; | ||
| 189 | -} | ||
| 190 | - | ||
| 191 | -// 相册样式优化(关键:适配图片展示) | ||
| 192 | -:deep(.up-album) { | ||
| 193 | - width: 100%; | ||
| 194 | - box-sizing: border-box; | ||
| 195 | -} | ||
| 196 | - | ||
| 197 | -:deep(.up-album__list) { | ||
| 198 | - display: flex; | ||
| 199 | - flex-wrap: wrap; | ||
| 200 | - padding: 0; | ||
| 201 | - margin: 0; | ||
| 202 | -} | ||
| 203 | - | ||
| 204 | -:deep(.up-album__item) { | ||
| 205 | - width: calc(33.333% - 10rpx); | ||
| 206 | - height: 200rpx; // 固定图片高度,避免变形 | ||
| 207 | - margin: 5rpx; | ||
| 208 | - border-radius: 8rpx; | ||
| 209 | - overflow: hidden; | ||
| 210 | - background-color: #f8f8f8; | ||
| 211 | -} | ||
| 212 | - | ||
| 213 | -:deep(.up-album__image) { | ||
| 214 | - width: 100%; | ||
| 215 | - height: 100%; | ||
| 216 | - object-fit: cover; // 图片裁剪填充,避免拉伸 | 153 | + margin-bottom: 20rpx; |
| 217 | } | 154 | } |
| 218 | 155 | ||
| 219 | 156 |
pages-sub/daily/maintain-manage/pending-plan-detail.vue
| @@ -119,7 +119,8 @@ onShow(() => { | @@ -119,7 +119,8 @@ onShow(() => { | ||
| 119 | const getPlanDetail = async () => { | 119 | const getPlanDetail = async () => { |
| 120 | const queryData = { | 120 | const queryData = { |
| 121 | planNo: planNo.value, | 121 | planNo: planNo.value, |
| 122 | - planTypeId: planTypeId.value | 122 | + planTypeId: planTypeId.value, |
| 123 | + finishState:finishState.value | ||
| 123 | } | 124 | } |
| 124 | console.log(queryData) | 125 | console.log(queryData) |
| 125 | const planInfoRes = await notFinish(queryData) | 126 | const planInfoRes = await notFinish(queryData) |
pages-sub/daily/maintain-manage/road-detail-list.vue
| @@ -50,12 +50,14 @@ | @@ -50,12 +50,14 @@ | ||
| 50 | :foot-border-top="false" | 50 | :foot-border-top="false" |
| 51 | v-for="(item,index) in planList" | 51 | v-for="(item,index) in planList" |
| 52 | :key="`${item.planNo}_${index}`" | 52 | :key="`${item.planNo}_${index}`" |
| 53 | - | ||
| 54 | > | 53 | > |
| 55 | <!-- 自定义标题区域 --> | 54 | <!-- 自定义标题区域 --> |
| 56 | <template #head> | 55 | <template #head> |
| 57 | <view class="card-header"> | 56 | <view class="card-header"> |
| 58 | <view class="common-card-title u-line-1">{{ item.planName || '无计划名称' }}</view> | 57 | <view class="common-card-title u-line-1">{{ item.planName || '无计划名称' }}</view> |
| 58 | + <!-- 已失效标识 --> | ||
| 59 | + <up-text type="error" v-if="item.finishState === '3'" text="错误" class="invalid-tag"></up-text> | ||
| 60 | +<!-- <view v-if="item.finishState === '3'" class="invalid-tag">已失效</view>--> | ||
| 59 | </view> | 61 | </view> |
| 60 | </template> | 62 | </template> |
| 61 | 63 | ||
| @@ -80,8 +82,12 @@ | @@ -80,8 +82,12 @@ | ||
| 80 | size="mini" | 82 | size="mini" |
| 81 | @click="submitRecord(item)" | 83 | @click="submitRecord(item)" |
| 82 | class="submit-record-btn" | 84 | class="submit-record-btn" |
| 85 | + | ||
| 86 | + :disabled="item.finishState === '3'" | ||
| 87 | + :class="{ 'disabled-btn': item.finishState === '3' }" | ||
| 83 | > | 88 | > |
| 84 | - 提交记录 | 89 | + |
| 90 | + {{ item.finishState === '3' ? '补交记录' : '提交记录' }} | ||
| 85 | </up-button> | 91 | </up-button> |
| 86 | </view> | 92 | </view> |
| 87 | </view> | 93 | </view> |
| @@ -120,7 +126,6 @@ const activeStatus = ref('1') | @@ -120,7 +126,6 @@ const activeStatus = ref('1') | ||
| 120 | const searchValue = ref('') | 126 | const searchValue = ref('') |
| 121 | const planList = ref([]) | 127 | const planList = ref([]) |
| 122 | const pagingRef = ref(null) | 128 | const pagingRef = ref(null) |
| 123 | -const loading = ref(false) | ||
| 124 | const roadId = ref('') | 129 | const roadId = ref('') |
| 125 | const finishState = ref('') | 130 | const finishState = ref('') |
| 126 | // 搜索占位符 | 131 | // 搜索占位符 |
| @@ -148,6 +153,10 @@ const handleSearch = () => { | @@ -148,6 +153,10 @@ const handleSearch = () => { | ||
| 148 | pagingRef.value?.reload() | 153 | pagingRef.value?.reload() |
| 149 | } | 154 | } |
| 150 | const submitRecord = (item) => { | 155 | const submitRecord = (item) => { |
| 156 | + // 已失效状态下直接返回,不执行跳转 | ||
| 157 | + if (item.finishState === '3') { | ||
| 158 | + return | ||
| 159 | + } | ||
| 151 | console.log('提交记录:', item.finishPercent) | 160 | console.log('提交记录:', item.finishPercent) |
| 152 | if (item.finishPercent == 0) { | 161 | if (item.finishPercent == 0) { |
| 153 | uni.navigateTo({ | 162 | uni.navigateTo({ |
| @@ -161,7 +170,6 @@ const submitRecord = (item) => { | @@ -161,7 +170,6 @@ const submitRecord = (item) => { | ||
| 161 | } | 170 | } |
| 162 | const queryList = async (pageNo, pageSize) => { | 171 | const queryList = async (pageNo, pageSize) => { |
| 163 | try { | 172 | try { |
| 164 | - loading.value = true | ||
| 165 | const paramsData = { | 173 | const paramsData = { |
| 166 | pageNo: pageNo, | 174 | pageNo: pageNo, |
| 167 | pageSize: pageSize, | 175 | pageSize: pageSize, |
| @@ -174,12 +182,10 @@ const queryList = async (pageNo, pageSize) => { | @@ -174,12 +182,10 @@ const queryList = async (pageNo, pageSize) => { | ||
| 174 | console.log(res) | 182 | console.log(res) |
| 175 | const listData = res?.list || res || [] | 183 | const listData = res?.list || res || [] |
| 176 | pagingRef.value?.complete(listData) | 184 | pagingRef.value?.complete(listData) |
| 177 | - loading.value = false | ||
| 178 | } catch (error) { | 185 | } catch (error) { |
| 179 | console.error('请求失败:', error) | 186 | console.error('请求失败:', error) |
| 180 | uni.showToast({title: '加载失败,请重试', icon: 'none'}) | 187 | uni.showToast({title: '加载失败,请重试', icon: 'none'}) |
| 181 | pagingRef.value?.complete(false) | 188 | pagingRef.value?.complete(false) |
| 182 | - loading.value = false | ||
| 183 | } | 189 | } |
| 184 | } | 190 | } |
| 185 | // ========== 生命周期 ========== | 191 | // ========== 生命周期 ========== |
| @@ -187,9 +193,10 @@ onLoad((options) => { | @@ -187,9 +193,10 @@ onLoad((options) => { | ||
| 187 | getUrlParams(options) | 193 | getUrlParams(options) |
| 188 | }) | 194 | }) |
| 189 | onShow(() => { | 195 | onShow(() => { |
| 190 | - if (roadId.value) { | ||
| 191 | - pagingRef.value?.reload() | ||
| 192 | - } | 196 | + // if (roadId.value) { |
| 197 | + // pagingRef.value?.reload() | ||
| 198 | + // } | ||
| 199 | + pagingRef.value?.reload() | ||
| 193 | }) | 200 | }) |
| 194 | 201 | ||
| 195 | </script> | 202 | </script> |
| @@ -197,7 +204,6 @@ onShow(() => { | @@ -197,7 +204,6 @@ onShow(() => { | ||
| 197 | <style scoped lang="scss"> | 204 | <style scoped lang="scss"> |
| 198 | .page-container { | 205 | .page-container { |
| 199 | } | 206 | } |
| 200 | - | ||
| 201 | // 顶部吸顶区域样式 | 207 | // 顶部吸顶区域样式 |
| 202 | .sticky-header { | 208 | .sticky-header { |
| 203 | background-color: #ffffff; | 209 | background-color: #ffffff; |
| @@ -209,6 +215,21 @@ onShow(() => { | @@ -209,6 +215,21 @@ onShow(() => { | ||
| 209 | } | 215 | } |
| 210 | } | 216 | } |
| 211 | 217 | ||
| 218 | +// 卡片头部样式 | ||
| 219 | +.card-header { | ||
| 220 | + display: flex; | ||
| 221 | + justify-content: space-between; | ||
| 222 | + align-items: center; | ||
| 223 | +} | ||
| 224 | + | ||
| 225 | +// 禁用按钮样式 | ||
| 226 | +.disabled-btn { | ||
| 227 | + background-color: #c0c4cc !important; | ||
| 228 | + border-color: #c0c4cc !important; | ||
| 229 | + color: #fff !important; | ||
| 230 | + pointer-events: none; // 防止点击 | ||
| 231 | + opacity: 0.7; | ||
| 232 | +} | ||
| 212 | 233 | ||
| 213 | 234 | ||
| 214 | </style> | 235 | </style> |
| 215 | \ No newline at end of file | 236 | \ No newline at end of file |
pages-sub/daily/patrol-manage/add-patrol-record/index.vue renamed to pages-sub/daily/patrol-manage/add-patrol-record.vue
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | del-color="#ff4d4f" | 40 | del-color="#ff4d4f" |
| 41 | class="upload-wrap" | 41 | class="upload-wrap" |
| 42 | ></up-upload> | 42 | ></up-upload> |
| 43 | -<!-- <view class="tips">(最少1张,最多3张)</view>--> | 43 | + <!-- <view class="tips">(最少1张,最多3张)</view>--> |
| 44 | </up-form-item> | 44 | </up-form-item> |
| 45 | 45 | ||
| 46 | <!-- 3. 转为工单(单选框) --> | 46 | <!-- 3. 转为工单(单选框) --> |
| @@ -286,7 +286,7 @@ export default { | @@ -286,7 +286,7 @@ export default { | ||
| 286 | // // 延迟跳转(等待提示框显示完成) | 286 | // // 延迟跳转(等待提示框显示完成) |
| 287 | setTimeout(() => { | 287 | setTimeout(() => { |
| 288 | uni.redirectTo({ | 288 | uni.redirectTo({ |
| 289 | - url: '/pages-sub/patrol-manage/patrol-plan/index' | 289 | + url: '/pages-sub/daily/patrol-manage/index' |
| 290 | }) | 290 | }) |
| 291 | }, 1000) | 291 | }, 1000) |
| 292 | 292 |
pages-sub/daily/patrol-manage/finish-plan-detail/index.vue renamed to pages-sub/daily/patrol-manage/finish-plan-detail.vue
| 1 | <template> | 1 | <template> |
| 2 | - <view class="u-page"> | 2 | + <view class="page-container"> |
| 3 | <!-- 页面级加载组件 --> | 3 | <!-- 页面级加载组件 --> |
| 4 | <up-loading-page | 4 | <up-loading-page |
| 5 | v-if="loading" | 5 | v-if="loading" |
| @@ -10,24 +10,25 @@ | @@ -10,24 +10,25 @@ | ||
| 10 | 10 | ||
| 11 | <!-- 内容容器 --> | 11 | <!-- 内容容器 --> |
| 12 | <view v-else class="content-wrap"> | 12 | <view v-else class="content-wrap"> |
| 13 | - | ||
| 14 | - | ||
| 15 | <template v-for="(i, index) in orderDetail" :key="index"> | 13 | <template v-for="(i, index) in orderDetail" :key="index"> |
| 16 | <!-- 工单详情内容 --> | 14 | <!-- 工单详情内容 --> |
| 17 | - <up-cell-group :border="false" inset style="margin: 20rpx;"> | ||
| 18 | - <!-- 1. 工单编号 --> | 15 | + <up-cell-group :border="false" inset > |
| 16 | + <!-- 1. 工单名称 --> | ||
| 19 | <up-cell | 17 | <up-cell |
| 20 | - :title="i.planName" | ||
| 21 | - | ||
| 22 | - class="up-line-1" | ||
| 23 | align="middle" | 18 | align="middle" |
| 24 | - ></up-cell> | 19 | + > |
| 20 | + <template #title> | ||
| 21 | + <view class="up-line-1">{{i.planName || '--'}}</view> | ||
| 22 | + </template> | ||
| 23 | +<!-- <template #value>--> | ||
| 24 | +<!-- <view class="up-line-1">{{orderDetail.planName || '--'}}</view>--> | ||
| 25 | +<!-- </template>--> | ||
| 26 | + </up-cell> | ||
| 25 | 27 | ||
| 26 | <!-- 2. 工单位置 --> | 28 | <!-- 2. 工单位置 --> |
| 27 | <up-cell | 29 | <up-cell |
| 28 | title="计划编码" | 30 | title="计划编码" |
| 29 | :value="i.planNo || '--'" | 31 | :value="i.planNo || '--'" |
| 30 | - class="up-line-1" | ||
| 31 | align="middle" | 32 | align="middle" |
| 32 | ></up-cell> | 33 | ></up-cell> |
| 33 | 34 | ||
| @@ -35,20 +36,18 @@ | @@ -35,20 +36,18 @@ | ||
| 35 | <up-cell | 36 | <up-cell |
| 36 | title="养护周期" | 37 | title="养护周期" |
| 37 | :value="`${i.rate}${uni.$dict.getDictLabel('cycle_id_type', i.cycleId)}`" | 38 | :value="`${i.rate}${uni.$dict.getDictLabel('cycle_id_type', i.cycleId)}`" |
| 38 | - class="up-line-1" | ||
| 39 | align="middle" | 39 | align="middle" |
| 40 | ></up-cell> | 40 | ></up-cell> |
| 41 | 41 | ||
| 42 | <!-- 4. 情况描述 --> | 42 | <!-- 4. 情况描述 --> |
| 43 | <up-cell | 43 | <up-cell |
| 44 | title="计划有效期" | 44 | title="计划有效期" |
| 45 | - :value="`${timeFormat(i.beginTime,'yy-mm-dd hh:MM:ss')} 至 ${timeFormat(i. endTime,'yy-mm-dd hh:MM:ss')}`" | ||
| 46 | - class="up-line-1" | 45 | + :value="`${timeFormat(i.beginTime,'yyyy-mm-dd')} 至 ${timeFormat(i. endTime,'yyyy-mm-dd')}`" |
| 47 | align="middle" | 46 | align="middle" |
| 48 | ></up-cell> | 47 | ></up-cell> |
| 49 | 48 | ||
| 50 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> | 49 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> |
| 51 | - <up-cell title="照片" > | 50 | + <up-cell title="照片"> |
| 52 | <template #value> | 51 | <template #value> |
| 53 | <view class="cell-content-wrap"> | 52 | <view class="cell-content-wrap"> |
| 54 | 53 | ||
| @@ -67,26 +66,26 @@ | @@ -67,26 +66,26 @@ | ||
| 67 | 66 | ||
| 68 | <!-- 7. 处理结果 --> | 67 | <!-- 7. 处理结果 --> |
| 69 | <up-cell | 68 | <up-cell |
| 70 | - title="巡查描述" | ||
| 71 | - :value="i.remark || '--'" | ||
| 72 | - class="up-line-1" | ||
| 73 | align="middle" | 69 | align="middle" |
| 74 | - :border="false" | ||
| 75 | - ></up-cell> | 70 | + > |
| 71 | + <template #title> | ||
| 72 | + <view style="min-width: 200rpx">巡查描述</view> | ||
| 73 | + </template> | ||
| 74 | + <template #value> | ||
| 75 | + <view class="up-line-1">{{i.remark || '--'}}</view> | ||
| 76 | + </template> | ||
| 77 | + </up-cell> | ||
| 76 | 78 | ||
| 77 | <up-cell | 79 | <up-cell |
| 78 | title="提交时间" | 80 | title="提交时间" |
| 79 | - :value="timeFormat(i.finishTime,'yy-mm-dd hh:MM:ss') || '--'" | ||
| 80 | - class="up-line-1" | 81 | + :value="timeFormat(i.finishTime,'yyyy-mm-dd hh:MM:ss') || '--'" |
| 81 | align="middle" | 82 | align="middle" |
| 82 | - :border="false" | ||
| 83 | - ></up-cell> | ||
| 84 | 83 | ||
| 84 | + ></up-cell> | ||
| 85 | 85 | ||
| 86 | <up-cell | 86 | <up-cell |
| 87 | title="提交人" | 87 | title="提交人" |
| 88 | :value="i.userName || '--'" | 88 | :value="i.userName || '--'" |
| 89 | - class="up-line-1" | ||
| 90 | align="middle" | 89 | align="middle" |
| 91 | :border="false" | 90 | :border="false" |
| 92 | ></up-cell> | 91 | ></up-cell> |
| @@ -99,10 +98,10 @@ | @@ -99,10 +98,10 @@ | ||
| 99 | </template> | 98 | </template> |
| 100 | 99 | ||
| 101 | <script setup lang="ts"> | 100 | <script setup lang="ts"> |
| 102 | -import { ref, reactive } from 'vue'; | ||
| 103 | -import { inspectioDetailByPlanno } from "@/api/patrol-manage/patrol-plan"; | ||
| 104 | -import { onLoad, onShow } from '@dcloudio/uni-app'; | ||
| 105 | -import { timeFormat } from '@/uni_modules/uview-plus'; | 101 | +import {ref} from 'vue'; |
| 102 | +import {inspectioDetailByPlanno} from "@/api/patrol-manage/patrol-plan"; | ||
| 103 | +import {onLoad} from '@dcloudio/uni-app'; | ||
| 104 | +import {timeFormat} from '@/uni_modules/uview-plus'; | ||
| 106 | // 状态管理 | 105 | // 状态管理 |
| 107 | const loading = ref(true); | 106 | const loading = ref(true); |
| 108 | const orderDetail = ref([]); | 107 | const orderDetail = ref([]); |
| @@ -114,17 +113,13 @@ const orderDetail = ref([]); | @@ -114,17 +113,13 @@ const orderDetail = ref([]); | ||
| 114 | const getOrderDetail = async (plan_no: string) => { | 113 | const getOrderDetail = async (plan_no: string) => { |
| 115 | try { | 114 | try { |
| 116 | loading.value = true; | 115 | loading.value = true; |
| 117 | - const res = await inspectioDetailByPlanno({ plan_no }); | 116 | + const res = await inspectioDetailByPlanno({plan_no}); |
| 118 | console.log('接口返回:', res); | 117 | console.log('接口返回:', res); |
| 119 | - // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 | ||
| 120 | - orderDetail.value = { | ||
| 121 | - ...res, | ||
| 122 | - problemImgsList: Array.isArray(res.problemImgsList) ? res.problemImgsList : [], | ||
| 123 | - completeImgsList: Array.isArray(res.completeImgsList) ? res.completeImgsList : [] | ||
| 124 | - }; | 118 | + |
| 119 | + orderDetail.value = res; | ||
| 125 | } catch (error) { | 120 | } catch (error) { |
| 126 | console.error('获取工单详情失败:', error); | 121 | console.error('获取工单详情失败:', error); |
| 127 | - uni.showToast({ title: '加载失败,请重试', icon: 'none' }); | 122 | + uni.showToast({title: '加载失败,请重试', icon: 'none'}); |
| 128 | } finally { | 123 | } finally { |
| 129 | loading.value = false; | 124 | loading.value = false; |
| 130 | } | 125 | } |
| @@ -132,86 +127,24 @@ const getOrderDetail = async (plan_no: string) => { | @@ -132,86 +127,24 @@ const getOrderDetail = async (plan_no: string) => { | ||
| 132 | 127 | ||
| 133 | // 页面加载 | 128 | // 页面加载 |
| 134 | onLoad((options) => { | 129 | onLoad((options) => { |
| 135 | - const { planNo } = options; | 130 | + const {planNo} = options; |
| 136 | if (planNo) { | 131 | if (planNo) { |
| 137 | getOrderDetail(planNo); | 132 | getOrderDetail(planNo); |
| 138 | } else { | 133 | } else { |
| 139 | loading.value = false; | 134 | loading.value = false; |
| 140 | - uni.showToast({ title: '缺少工单ID', icon: 'none' }); | 135 | + uni.showToast({title: '缺少工单ID', icon: 'none'}); |
| 141 | } | 136 | } |
| 142 | }); | 137 | }); |
| 143 | </script> | 138 | </script> |
| 144 | 139 | ||
| 145 | <style scoped lang="scss"> | 140 | <style scoped lang="scss"> |
| 146 | -// 页面基础样式 | ||
| 147 | -.u-page { | ||
| 148 | - min-height: 100vh; | ||
| 149 | - background-color: #f5f5f5; | ||
| 150 | - box-sizing: border-box; | ||
| 151 | -} | ||
| 152 | 141 | ||
| 153 | // 内容容器 | 142 | // 内容容器 |
| 154 | .content-wrap { | 143 | .content-wrap { |
| 155 | background: #fff; | 144 | background: #fff; |
| 156 | width: 100%; | 145 | width: 100%; |
| 157 | box-sizing: border-box; | 146 | box-sizing: border-box; |
| 158 | - overflow-y: auto; | ||
| 159 | - min-height: calc(100vh - 40rpx); | ||
| 160 | -} | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | -// 空文本样式 | ||
| 165 | -.empty-text { | ||
| 166 | - color: #999; | ||
| 167 | - font-size: 28rpx; | ||
| 168 | - line-height: 80rpx; | ||
| 169 | - display: block; | ||
| 170 | - text-align: left; | ||
| 171 | -} | ||
| 172 | - | ||
| 173 | -// 优化uview组件样式 | ||
| 174 | -:deep(.up-cell-group) { | ||
| 175 | - --u-cell-group-background-color: #fff; | ||
| 176 | - --u-cell-group-border-radius: 12rpx; | ||
| 177 | - --u-cell-group-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); | ||
| 178 | -} | ||
| 179 | - | ||
| 180 | -:deep(.up-cell) { | ||
| 181 | - --u-cell-title-font-size: 28rpx; | ||
| 182 | - --u-cell-value-font-size: 28rpx; | ||
| 183 | - --u-cell-title-color: #666; | ||
| 184 | - --u-cell-value-color: #333; | ||
| 185 | - --u-cell-padding: 20rpx 15rpx; | ||
| 186 | - --u-cell-border-color: #f5f5f5; | ||
| 187 | -} | ||
| 188 | - | ||
| 189 | -// 相册样式优化(关键:适配图片展示) | ||
| 190 | -:deep(.up-album) { | ||
| 191 | - width: 100%; | ||
| 192 | - box-sizing: border-box; | ||
| 193 | -} | ||
| 194 | - | ||
| 195 | -:deep(.up-album__list) { | ||
| 196 | - display: flex; | ||
| 197 | - flex-wrap: wrap; | ||
| 198 | - padding: 0; | ||
| 199 | - margin: 0; | ||
| 200 | -} | ||
| 201 | - | ||
| 202 | -:deep(.up-album__item) { | ||
| 203 | - width: calc(33.333% - 10rpx); | ||
| 204 | - height: 200rpx; // 固定图片高度,避免变形 | ||
| 205 | - margin: 5rpx; | ||
| 206 | - border-radius: 8rpx; | ||
| 207 | - overflow: hidden; | ||
| 208 | - background-color: #f8f8f8; | ||
| 209 | -} | ||
| 210 | - | ||
| 211 | -:deep(.up-album__image) { | ||
| 212 | - width: 100%; | ||
| 213 | - height: 100%; | ||
| 214 | - object-fit: cover; // 图片裁剪填充,避免拉伸 | 147 | + margin-bottom: 20rpx; |
| 215 | } | 148 | } |
| 216 | 149 | ||
| 217 | 150 |
pages-sub/daily/patrol-manage/patrol-plan/index.vue renamed to pages-sub/daily/patrol-manage/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page-container"> | 2 | <view class="page-container"> |
| 3 | <!-- 顶部固定区域:Tabs + 搜索框 --> | 3 | <!-- 顶部固定区域:Tabs + 搜索框 --> |
| 4 | - <view class="top-fixed"> | 4 | + <up-sticky> |
| 5 | + <view class="sticky-header"> | ||
| 5 | <u-tabs | 6 | <u-tabs |
| 6 | :list="tabList" | 7 | :list="tabList" |
| 7 | :is-scroll="false" | 8 | :is-scroll="false" |
| @@ -31,50 +32,69 @@ | @@ -31,50 +32,69 @@ | ||
| 31 | style="margin: 20rpx 20rpx 0" | 32 | style="margin: 20rpx 20rpx 0" |
| 32 | ></up-search> | 33 | ></up-search> |
| 33 | </view> | 34 | </view> |
| 34 | - | 35 | + </up-sticky> |
| 35 | 36 | ||
| 36 | <z-paging | 37 | <z-paging |
| 37 | - ref="paging" | 38 | + ref="pagingRef" |
| 38 | v-model="planList" | 39 | v-model="planList" |
| 39 | @query="queryList" | 40 | @query="queryList" |
| 40 | - | 41 | + :auto-show-system-loading="true" |
| 41 | > | 42 | > |
| 42 | <template #empty> | 43 | <template #empty> |
| 43 | <empty-view/> | 44 | <empty-view/> |
| 44 | </template> | 45 | </template> |
| 45 | <!-- 计划卡片列表 --> | 46 | <!-- 计划卡片列表 --> |
| 46 | - <view class="card-list"> | 47 | + <view class="common-card-list" style="padding-top: 94px;"> |
| 48 | + | ||
| 49 | + <up-card | ||
| 50 | + :border="false" | ||
| 51 | + :foot-border-top="false" | ||
| 52 | + :head-border-bottom="false" | ||
| 53 | + v-for="(item,index) in planList" | ||
| 54 | + :key="`${item.batchNo}_${index}`" | ||
| 55 | + :show-head="false" | ||
| 56 | + > | ||
| 57 | + <template #body> | ||
| 58 | + <view class="card-body"> | ||
| 59 | + <view class="u-body-item u-flex"> | ||
| 60 | + <view class="u-body-item-title">道路名称:</view> | ||
| 61 | + <view class="u-line-1 u-body-value">{{ item.roadName || '-' }}</view> | ||
| 62 | + </view> | ||
| 47 | 63 | ||
| 48 | - <view class="plan-card" v-for="(item, index) in planList" :key="item.batchNo"> | ||
| 49 | - <view class="card-content"> | ||
| 50 | - <view class="row-item"> | ||
| 51 | - <text class="label">道路名称:</text> | ||
| 52 | - <text class="value up-line-1">{{ item.roadName }}</text> | ||
| 53 | - </view> | ||
| 54 | - <view class="row-item"> | ||
| 55 | - <text class="label">所属街道:</text> | ||
| 56 | - <text class="value up-line-1">{{ item.streetName }}</text> | ||
| 57 | - </view> | ||
| 58 | - <view class="row-item flex-between"> | ||
| 59 | - <view> | ||
| 60 | - <text class="label">养护级别:</text> | ||
| 61 | - <text class="value">{{uni.$dict.getDictLabel('conserve_level', item.levelId)}}</text> | 64 | + <view class="u-body-item u-flex"> |
| 65 | + <view class="u-body-item-title">所属街道:</view> | ||
| 66 | + <view class="u-line-1 u-body-value">{{ item.streetName }} | ||
| 67 | + </view> | ||
| 62 | </view> | 68 | </view> |
| 63 | - <text class="detail-btn" @click="gotoDetail(item)">计划明细</text> | ||
| 64 | - </view> | ||
| 65 | - <view class="row-item"> | ||
| 66 | - <text class="label">计划类型:</text> | ||
| 67 | 69 | ||
| 68 | - <text class="value up-line-1"> {{uni.$dict.getDictLabel('inspection_maintain_type', item.planTypeId)}}</text> | ||
| 69 | - </view> | ||
| 70 | - <view class="row-item"> | ||
| 71 | - <text class="label">计划时间:</text> | ||
| 72 | -<!-- <text class="value up-line-1">{{ formatPlanTime(item.beginTime, item.endTime) }}</text>--> | ||
| 73 | - <text class="value up-line-1">{{ timeFormat(item.beginTime,'yyyy-mm-dd')}} 至 {{ timeFormat(item.endTime,'yyyy-mm-dd')}} </text> | 70 | + <view class="u-body-item u-flex common-item-center common-justify-between"> |
| 71 | + <view class="u-body-item-title">养护级别: {{uni.$dict.getDictLabel('conserve_level', item.levelId) || '-'}}</view> | ||
| 72 | + <view class="u-line-1"> | ||
| 73 | + <up-button | ||
| 74 | + type="primary" | ||
| 75 | + size="mini" | ||
| 76 | + @click="gotoDetail(item)" | ||
| 77 | + class="submit-record-btn" | ||
| 78 | + > | ||
| 79 | + 计划明细 | ||
| 80 | + </up-button> | ||
| 81 | + </view> | ||
| 82 | + </view> | ||
| 74 | 83 | ||
| 84 | + <view class="u-body-item u-flex"> | ||
| 85 | + <view class="u-body-item-title">计划类型:</view> | ||
| 86 | + <view class="u-line-1 u-body-value">{{uni.$dict.getDictLabel('inspection_maintain_type', item.planTypeId)}}</view> | ||
| 87 | + </view> | ||
| 88 | + | ||
| 89 | + <view class="u-body-item u-flex"> | ||
| 90 | + <view class="u-body-item-title">计划时间:</view> | ||
| 91 | + <view class="u-line-1 u-body-value">{{ timeFormat(item.beginTime, 'yyyy-mm-dd') || '-' }} 至 | ||
| 92 | + {{ timeFormat(item.endTime, 'yyyy-mm-dd') || '-' }} | ||
| 93 | + </view> | ||
| 94 | + </view> | ||
| 75 | </view> | 95 | </view> |
| 76 | - </view> | ||
| 77 | - </view> | 96 | + </template> |
| 97 | + </up-card> | ||
| 78 | </view> | 98 | </view> |
| 79 | 99 | ||
| 80 | </z-paging> | 100 | </z-paging> |
| @@ -92,16 +112,15 @@ const tabList = ref([ | @@ -92,16 +112,15 @@ const tabList = ref([ | ||
| 92 | {name: '已失效', id: '3'}, | 112 | {name: '已失效', id: '3'}, |
| 93 | {name: '已完成', id: '2'} | 113 | {name: '已完成', id: '2'} |
| 94 | ]); | 114 | ]); |
| 95 | - | 115 | +const pagingRef = ref(null) |
| 96 | const activeTab = ref('1'); | 116 | const activeTab = ref('1'); |
| 97 | // 搜索相关 | 117 | // 搜索相关 |
| 98 | const searchValue = ref(''); | 118 | const searchValue = ref(''); |
| 99 | // 分页相关 | 119 | // 分页相关 |
| 100 | -const pageNo = ref(1); | ||
| 101 | -const pageSize = ref(10); | 120 | +// const pageNo = ref(1); |
| 121 | +// const pageSize = ref(10); | ||
| 102 | 122 | ||
| 103 | const planList = ref([]); | 123 | const planList = ref([]); |
| 104 | -const paging = ref(null); | ||
| 105 | 124 | ||
| 106 | 125 | ||
| 107 | // Tab切换 | 126 | // Tab切换 |
| @@ -110,17 +129,17 @@ const handleTabChange = (val) => { | @@ -110,17 +129,17 @@ const handleTabChange = (val) => { | ||
| 110 | console.log(activeTab.value) | 129 | console.log(activeTab.value) |
| 111 | activeTab.value = val.id | 130 | activeTab.value = val.id |
| 112 | searchValue.value = '' | 131 | searchValue.value = '' |
| 113 | - paging.value.reload() | 132 | + pagingRef.value.reload() |
| 114 | }; | 133 | }; |
| 115 | // 搜索/清空搜索 | 134 | // 搜索/清空搜索 |
| 116 | const handleSearch = () => { | 135 | const handleSearch = () => { |
| 117 | // searchValue.value = ''; | 136 | // searchValue.value = ''; |
| 118 | console.log(searchValue.value) | 137 | console.log(searchValue.value) |
| 119 | - paging.value.reload() | 138 | + pagingRef.value.reload() |
| 120 | }; | 139 | }; |
| 121 | const handleSearchClear = () => { | 140 | const handleSearchClear = () => { |
| 122 | // searchValue.value = '' | 141 | // searchValue.value = '' |
| 123 | - paging.value.reload() | 142 | + pagingRef.value.reload() |
| 124 | }; | 143 | }; |
| 125 | // 加载数据 | 144 | // 加载数据 |
| 126 | const queryList = async (pageNo, pageSize) => { | 145 | const queryList = async (pageNo, pageSize) => { |
| @@ -134,97 +153,42 @@ const queryList = async (pageNo, pageSize) => { | @@ -134,97 +153,42 @@ const queryList = async (pageNo, pageSize) => { | ||
| 134 | console.log('请求参数:', params); | 153 | console.log('请求参数:', params); |
| 135 | const res = await inspectionPlanPage(params); | 154 | const res = await inspectionPlanPage(params); |
| 136 | console.log('接口返回:', res); | 155 | console.log('接口返回:', res); |
| 137 | - paging.value.complete(res.list); | 156 | + pagingRef.value.complete(res.list); |
| 138 | } catch (error) { | 157 | } catch (error) { |
| 139 | console.error('加载失败:', error); | 158 | console.error('加载失败:', error); |
| 140 | // 修复点4:加载失败调用complete(false) | 159 | // 修复点4:加载失败调用complete(false) |
| 141 | - paging.value?.complete(false); | 160 | + pagingRef.value?.complete(false); |
| 142 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); | 161 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); |
| 143 | } | 162 | } |
| 144 | }; | 163 | }; |
| 145 | // 跳转明细 | 164 | // 跳转明细 |
| 146 | const gotoDetail = (item) => { | 165 | const gotoDetail = (item) => { |
| 147 | uni.navigateTo({ | 166 | uni.navigateTo({ |
| 148 | - url: `/pages-sub/daily/patrol-manage/pending-plan-detail/index?batchNo=${item.batchNo}&status=${activeTab.value}` | 167 | + url: `/pages-sub/daily/patrol-manage/pending-plan-detail?batchNo=${item.batchNo}&status=${activeTab.value}` |
| 149 | }); | 168 | }); |
| 150 | }; | 169 | }; |
| 151 | // 修复点5:优化页面生命周期逻辑 | 170 | // 修复点5:优化页面生命周期逻辑 |
| 152 | onLoad(() => { | 171 | onLoad(() => { |
| 153 | - // auto=true时,z-paging会自动触发query,此处可省略手动调用;若需强制初始化,可加: | ||
| 154 | - // paging.value?.triggerQuery(); | 172 | + // auto=true时,z-pagingRef会自动触发query,此处可省略手动调用;若需强制初始化,可加: |
| 173 | + // pagingRef.value?.triggerQuery(); | ||
| 155 | }); | 174 | }); |
| 156 | // 仅在页面从明细页返回时,若有数据则刷新当前tab数据(避免干扰上拉加载) | 175 | // 仅在页面从明细页返回时,若有数据则刷新当前tab数据(避免干扰上拉加载) |
| 157 | onShow(() => { | 176 | onShow(() => { |
| 177 | + pagingRef.value?.reload() | ||
| 158 | }); | 178 | }); |
| 159 | </script> | 179 | </script> |
| 160 | 180 | ||
| 161 | <style scoped lang="scss"> | 181 | <style scoped lang="scss"> |
| 162 | -/* 样式保持不变,仅补充z-paging容器高度 */ | ||
| 163 | .page-container { | 182 | .page-container { |
| 164 | - min-height: 100vh; | ||
| 165 | - background-color: #f8f8f8; | ||
| 166 | -} | ||
| 167 | - | ||
| 168 | -.top-fixed { | ||
| 169 | - position: fixed; | ||
| 170 | - top: 0; | ||
| 171 | - left: 0; | ||
| 172 | - right: 0; | ||
| 173 | - z-index: 999; | ||
| 174 | - background-color: #fff; | ||
| 175 | - padding-bottom: 10rpx; | ||
| 176 | - box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); | ||
| 177 | -} | ||
| 178 | 183 | ||
| 179 | -/* 修复:确保列表容器不被顶部遮挡,且z-paging能识别滚动区域 */ | ||
| 180 | -.card-list { | ||
| 181 | - padding: 170rpx 20rpx 20rpx; | ||
| 182 | - /* 关键:给z-paging足够的滚动空间 */ | ||
| 183 | -} | ||
| 184 | - | ||
| 185 | -.plan-card { | ||
| 186 | - background-color: #fff; | ||
| 187 | - border-radius: 12rpx; | ||
| 188 | - padding: 20rpx; | ||
| 189 | - margin-bottom: 15rpx; | ||
| 190 | - box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03); | ||
| 191 | -} | ||
| 192 | - | ||
| 193 | -.card-content { | ||
| 194 | - display: flex; | ||
| 195 | - flex-direction: column; | ||
| 196 | - gap: 12rpx; | ||
| 197 | -} | ||
| 198 | - | ||
| 199 | -.row-item { | ||
| 200 | - display: flex; | ||
| 201 | - align-items: center; | ||
| 202 | - font-size: 28rpx; | ||
| 203 | - line-height: 1.5; | ||
| 204 | -} | ||
| 205 | - | ||
| 206 | -.flex-between { | ||
| 207 | - display: flex; | ||
| 208 | - justify-content: space-between; | ||
| 209 | - align-items: center; | ||
| 210 | -} | ||
| 211 | - | ||
| 212 | -.label { | ||
| 213 | - color: #999; | ||
| 214 | - width: 140rpx; | ||
| 215 | - flex-shrink: 0; | ||
| 216 | -} | ||
| 217 | - | ||
| 218 | -.value { | ||
| 219 | - color: #333; | ||
| 220 | - flex: 1; | ||
| 221 | } | 184 | } |
| 185 | +.sticky-header { | ||
| 186 | + background-color: #ffffff; | ||
| 187 | + padding-bottom: 10rpx; | ||
| 188 | + border-bottom: 1px solid #eee; | ||
| 222 | 189 | ||
| 223 | -.detail-btn { | ||
| 224 | - color: #1989fa; | ||
| 225 | - font-size: 26rpx; | ||
| 226 | - padding: 0 10rpx; | 190 | + .search-input { |
| 191 | + margin: 20rpx 20rpx 10rpx !important; | ||
| 192 | + } | ||
| 227 | } | 193 | } |
| 228 | - | ||
| 229 | - | ||
| 230 | </style> | 194 | </style> |
| 231 | \ No newline at end of file | 195 | \ No newline at end of file |
pages-sub/daily/patrol-manage/pending-plan-detail/index.vue renamed to pages-sub/daily/patrol-manage/pending-plan-detail.vue
| 1 | <template> | 1 | <template> |
| 2 | - <view class="pending-plan-detail"> | ||
| 3 | - <!-- 计划详情卡片 --> | ||
| 4 | - <view class="detail-card" v-for="i in planInfo" :key="i.planNo"> | ||
| 5 | - <!-- 标题行 --> | ||
| 6 | - <view class="detail-item"> | ||
| 7 | - <text class="label">计划名称:</text> | ||
| 8 | - <text class="value up-line-1">{{ i.planName || '-' }}</text> | ||
| 9 | - </view> | ||
| 10 | - | ||
| 11 | - <!-- 计划编码行 --> | ||
| 12 | - <view class="detail-item"> | ||
| 13 | - <text class="label">计划编码:</text> | ||
| 14 | - <text class="value up-line-1">{{ i.planNo || '-' }}</text> | ||
| 15 | - </view> | ||
| 16 | - | ||
| 17 | - <!-- 养护周期行 --> | ||
| 18 | - <view class="detail-item"> | ||
| 19 | - <text class="label">养护周期:</text> | ||
| 20 | - <text class="value up-line-1">{{ i.rate || '-' }} {{ uni.$dict.getDictLabel('cycle_id_type', i.cycleId) }} | ||
| 21 | - </text> | ||
| 22 | - </view> | ||
| 23 | - <!-- cycle_id_type--> | ||
| 24 | - <!-- 计划完成次数行 --> | ||
| 25 | - <view class="detail-item"> | ||
| 26 | - <text class="label">计划完成次数:</text> | ||
| 27 | - <text class="value up-line-1">{{ i.planNum || 0 }} 次</text> | ||
| 28 | - </view> | ||
| 29 | - | ||
| 30 | - <!-- 已完成次数行 + 查看记录按钮 --> | ||
| 31 | - <view class="detail-item flex-between"> | ||
| 32 | - <view class="left-wrap"> | ||
| 33 | - <text class="label">已完成次数:</text> | ||
| 34 | - <text class="value up-line-1">{{ planInfo.i || 0 }} 次</text> | ||
| 35 | - </view> | ||
| 36 | - <!-- 查看记录按钮(限制宽度+紧凑样式) --> | ||
| 37 | - | ||
| 38 | - <up-button | ||
| 39 | - v-if="i.planFinishNum>0" | ||
| 40 | - type="primary" | ||
| 41 | - size="mini" | ||
| 42 | - @click="gotoFinishPlanDetail(i)" | ||
| 43 | - :style="{ width: '80px', height: '28px', fontSize: '14px', borderRadius: 4 }" | ||
| 44 | - > | ||
| 45 | - 查看记录 | ||
| 46 | - </up-button> | ||
| 47 | - </view> | ||
| 48 | - | ||
| 49 | - <!-- 计划有效期行 --> | ||
| 50 | - <view class="detail-item"> | ||
| 51 | - <text class="label">计划有效期:</text> | ||
| 52 | - <!-- <text class="value up-line-1">{{ planInfo && planInfo.validTime ? planInfo.validTime : '-' }}</text>--> | ||
| 53 | - <text class="value up-line-1">{{ timeFormat(i.beginTime, 'yyyy-mm-dd') }} 至 | ||
| 54 | - {{ timeFormat(i.endTime, 'yyyy-mm-dd') }} | ||
| 55 | - </text> | ||
| 56 | - </view> | 2 | + <view class="page-container"> |
| 3 | + | ||
| 4 | + <view class="common-card-list" style=" "> | ||
| 5 | + <up-card | ||
| 6 | + :border="false" | ||
| 7 | + :foot-border-top="false" | ||
| 8 | + v-for="(item,index) in planInfo" | ||
| 9 | + :key="`${item.planNo}_${index}`" | ||
| 10 | + > | ||
| 11 | + <!-- 自定义标题区域 --> | ||
| 12 | + <template #head> | ||
| 13 | + <view class="card-header"> | ||
| 14 | + <view class="common-card-title u-line-1">{{ item.planName || '无计划名称' }}</view> | ||
| 15 | + <!-- 已失效标识 --> | ||
| 16 | + <up-text type="error" v-if="item.finishState === '3'" text="错误" class="invalid-tag">已失效</up-text> | ||
| 17 | + <!-- <view v-if="item.finishState === '3'" class="invalid-tag">已失效</view>--> | ||
| 18 | + </view> | ||
| 19 | + </template> | ||
| 20 | + | ||
| 21 | + <template #body> | ||
| 22 | + <view class="card-body"> | ||
| 23 | + <view class="u-body-item u-flex"> | ||
| 24 | + <view class="u-body-item-title">计划编码:</view> | ||
| 25 | + <view class="u-line-1 u-body-value">{{ item.planNo || '-' }}</view> | ||
| 26 | + </view> | ||
| 27 | + <view class="u-body-item u-flex"> | ||
| 28 | + <view class="u-body-item-title">养护周期:</view> | ||
| 29 | + <view class="u-line-1 u-body-value">{{ item.rate || '-' }} | ||
| 30 | + {{ uni.$dict.getDictLabel('cycle_id_type', item.cycleId) }} | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | + | ||
| 34 | + <view class="u-body-item u-flex common-item-center common-justify-between"> | ||
| 35 | + <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view> | ||
| 36 | + <view class="u-line-1"> | ||
| 37 | + <up-button | ||
| 38 | + v-if="item.finishState === '3'" | ||
| 39 | + type="primary" | ||
| 40 | + size="mini" | ||
| 41 | + @click="gotoFinishPlanDetail(item)" | ||
| 42 | + class="submit-record-btn" | ||
| 43 | + :disabled="true" | ||
| 44 | + > | ||
| 45 | + 补交记录 | ||
| 46 | + </up-button> | ||
| 47 | + | ||
| 48 | + <up-button | ||
| 49 | + v-if="item.finishState !== '3' && item.planFinishNum>0" | ||
| 50 | + type="primary" | ||
| 51 | + size="mini" | ||
| 52 | + @click="gotoFinishPlanDetail(item)" | ||
| 53 | + class="submit-record-btn" | ||
| 54 | + > | ||
| 55 | + 提交记录 | ||
| 56 | + </up-button> | ||
| 57 | + </view> | ||
| 58 | + </view> | ||
| 59 | + | ||
| 60 | + <view class="u-body-item u-flex"> | ||
| 61 | + <view class="u-body-item-title">已完成次数:</view> | ||
| 62 | + <view class="u-line-1 u-body-value">{{ item.planFinishNum || 0 }}</view> | ||
| 63 | + </view> | ||
| 64 | + | ||
| 65 | + <view class="u-body-item u-flex"> | ||
| 66 | + <view class="u-body-item-title">计划有效期:</view> | ||
| 67 | + <view class="u-line-1 u-body-value">{{ timeFormat(item.beginTime, 'yyyy-mm-dd') || '-' }} 至 | ||
| 68 | + {{ timeFormat(item.endTime, 'yyyy-mm-dd') || '-' }} | ||
| 69 | + </view> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | + </template> | ||
| 73 | + </up-card> | ||
| 57 | </view> | 74 | </view> |
| 58 | 75 | ||
| 76 | + | ||
| 59 | <!-- 底部新增记录按钮 status=3--> | 77 | <!-- 底部新增记录按钮 status=3--> |
| 60 | <view class="fixed-bottom-btn-wrap" v-if="finishState==1"> | 78 | <view class="fixed-bottom-btn-wrap" v-if="finishState==1"> |
| 61 | <up-button | 79 | <up-button |
| @@ -111,7 +129,7 @@ const getPlanDetail = async () => { | @@ -111,7 +129,7 @@ const getPlanDetail = async () => { | ||
| 111 | // 跳转到已完成计划明细 | 129 | // 跳转到已完成计划明细 |
| 112 | const gotoFinishPlanDetail = (i) => { | 130 | const gotoFinishPlanDetail = (i) => { |
| 113 | uni.navigateTo({ | 131 | uni.navigateTo({ |
| 114 | - url: `/pages-sub/daily/patrol-manage/finish-plan-detail/index?planNo=${i.planNo}` | 132 | + url: `/pages-sub/daily/patrol-manage/finish-plan-detail?planNo=${i.planNo}` |
| 115 | 133 | ||
| 116 | 134 | ||
| 117 | }); | 135 | }); |
| @@ -119,57 +137,11 @@ const gotoFinishPlanDetail = (i) => { | @@ -119,57 +137,11 @@ const gotoFinishPlanDetail = (i) => { | ||
| 119 | // 新增记录 | 137 | // 新增记录 |
| 120 | const addNewRecord = () => { | 138 | const addNewRecord = () => { |
| 121 | uni.navigateTo({ | 139 | uni.navigateTo({ |
| 122 | - url: `/pages-sub/daily/patrol-manage/add-patrol-record/index?planNo=${planInfo.value[0].planNo}&batchNo=${batchNo.value}`, | 140 | + url: `/pages-sub/daily/patrol-manage/add-patrol-record?planNo=${planInfo.value[0].planNo}&batchNo=${batchNo.value}`, |
| 123 | }); | 141 | }); |
| 124 | }; | 142 | }; |
| 125 | </script> | 143 | </script> |
| 126 | 144 | ||
| 127 | <style scoped lang="scss"> | 145 | <style scoped lang="scss"> |
| 128 | -.pending-plan-detail { | ||
| 129 | - | ||
| 130 | -} | ||
| 131 | - | ||
| 132 | -.detail-card { | ||
| 133 | - padding: 20rpx; | ||
| 134 | - background-color: #fff; | ||
| 135 | - margin-bottom: 20px; | ||
| 136 | -} | ||
| 137 | - | ||
| 138 | -.detail-item { | ||
| 139 | - display: flex; | ||
| 140 | - align-items: center; | ||
| 141 | - font-size: 28rpx; | ||
| 142 | - line-height: 1.8; | ||
| 143 | - padding: 10rpx 0; | ||
| 144 | - border-bottom: 1px solid #f5f5f5; | ||
| 145 | - | ||
| 146 | - &:last-child { | ||
| 147 | - border-bottom: none; | ||
| 148 | - } | ||
| 149 | -} | ||
| 150 | - | ||
| 151 | -.flex-between { | ||
| 152 | - display: flex; | ||
| 153 | - justify-content: space-between; | ||
| 154 | - align-items: center; | ||
| 155 | - | ||
| 156 | - .left-wrap { | ||
| 157 | - display: flex; | ||
| 158 | - align-items: center; | ||
| 159 | - flex: 1; // 占满剩余空间,按钮靠右 | ||
| 160 | - } | ||
| 161 | -} | ||
| 162 | - | ||
| 163 | -.label { | ||
| 164 | - color: #999; | ||
| 165 | - width: 200rpx; | ||
| 166 | - flex-shrink: 0; | ||
| 167 | -} | ||
| 168 | - | ||
| 169 | -.value { | ||
| 170 | - color: #333; | ||
| 171 | - flex: 1; | ||
| 172 | - word-break: break-all; | ||
| 173 | -} | ||
| 174 | 146 | ||
| 175 | </style> | 147 | </style> |
| 176 | \ No newline at end of file | 148 | \ No newline at end of file |
pages-sub/daily/quick-order/index.vue
| 1 | <template> | 1 | <template> |
| 2 | - <view class="u-page"> | 2 | + <view class="page-container"> |
| 3 | <!-- 顶部固定搜索栏 --> | 3 | <!-- 顶部固定搜索栏 --> |
| 4 | <up-sticky> | 4 | <up-sticky> |
| 5 | <view class="search-header"> | 5 | <view class="search-header"> |
| @@ -37,36 +37,62 @@ | @@ -37,36 +37,62 @@ | ||
| 37 | ref="paging" | 37 | ref="paging" |
| 38 | v-model="orderList" | 38 | v-model="orderList" |
| 39 | @query="queryList" | 39 | @query="queryList" |
| 40 | - :top="100" | ||
| 41 | - :bottom="120" | 40 | + :auto-show-system-loading="true" |
| 42 | > | 41 | > |
| 43 | <template #empty> | 42 | <template #empty> |
| 44 | <empty-view/> | 43 | <empty-view/> |
| 45 | </template> | 44 | </template> |
| 46 | 45 | ||
| 47 | - <!-- 修复:新增列表容器,配置顶部内边距 --> | ||
| 48 | - <view class="order-list"> | ||
| 49 | - <view class="order-card" v-for="item in orderList" :key="item.orderNo"> | ||
| 50 | - <view class="order-item up-line-1">工单编号:{{ item.orderNo }}</view> | ||
| 51 | - <view class="order-item up-line-1">工单位置:{{ item.roadName || '未填写' }}</view> | ||
| 52 | - <view class="order-item up-line-1">工单名称:{{ item.orderName || '未填写' }}</view> | ||
| 53 | - <view class="order-item up-line-1">情况描述:{{ item.remark || '无' }}</view> | ||
| 54 | - <view class="order-footer"> | ||
| 55 | - <view class="submit-time up-line-1">提交时间:{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view> | ||
| 56 | - <up-button | ||
| 57 | - type="primary" | ||
| 58 | - size="mini" | ||
| 59 | - @click="handleDetail(item)" | ||
| 60 | - :style="{ width: '80px', height: '28px', fontSize: '14px', borderRadius: 4 }" | ||
| 61 | - > | ||
| 62 | - 工单详情 | ||
| 63 | - </up-button> | ||
| 64 | - </view> | ||
| 65 | - </view> | 46 | + <view class="common-card-list" style=" padding-top: 100rpx;"> |
| 47 | + <up-card | ||
| 48 | + :border="false" | ||
| 49 | + :foot-border-top="false" | ||
| 50 | + v-for="(item,index) in orderList" | ||
| 51 | + :key="`${item.orderNo}_${index}`" | ||
| 52 | + :show-head="false" | ||
| 53 | + > | ||
| 54 | + | ||
| 55 | + <template #body> | ||
| 56 | + <view class="card-body"> | ||
| 57 | + <view class="u-body-item u-flex"> | ||
| 58 | + <view class="u-body-item-title">工单编号:</view> | ||
| 59 | + <view class="u-line-1 u-body-value">{{ item.orderNo || '-' }}</view> | ||
| 60 | + </view> | ||
| 61 | + <view class="u-body-item u-flex"> | ||
| 62 | + <view class="u-body-item-title">工单位置:</view> | ||
| 63 | + <view class="u-line-1 u-body-value">{{ item.roadName || '-' }}</view> | ||
| 64 | + </view> | ||
| 65 | + | ||
| 66 | + <view class="u-body-item u-flex "> | ||
| 67 | + <view class="u-body-item-title">工单名称:</view> | ||
| 68 | + <view class="u-line-1 u-body-value"> {{ item.orderName || '未填写' }}</view> | ||
| 69 | + </view> | ||
| 70 | + | ||
| 71 | + <view class="u-body-item u-flex"> | ||
| 72 | + <view class="u-body-item-title">情况描述:</view> | ||
| 73 | + <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view> | ||
| 74 | + </view> | ||
| 75 | + | ||
| 76 | + <view class="u-body-item u-flex common-item-center common-justify-between"> | ||
| 77 | + <view class="u-body-item-title u-body-value">提交时间:{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view> | ||
| 78 | + <view class=""> | ||
| 79 | + <up-button | ||
| 80 | + type="primary" | ||
| 81 | + size="mini" | ||
| 82 | + @click="handleDetail(item)" | ||
| 83 | + | ||
| 84 | + > | ||
| 85 | + 工单详情 | ||
| 86 | + </up-button> | ||
| 87 | + </view> | ||
| 88 | + | ||
| 89 | + </view> | ||
| 90 | + </view> | ||
| 91 | + </template> | ||
| 92 | + </up-card> | ||
| 66 | </view> | 93 | </view> |
| 67 | </z-paging> | 94 | </z-paging> |
| 68 | 95 | ||
| 69 | - <!-- 修复:补充底部按钮样式层级 --> | ||
| 70 | <view class="fixed-bottom-btn-wrap"> | 96 | <view class="fixed-bottom-btn-wrap"> |
| 71 | <up-button type="primary" size="large" @click="handleAddOrder"> | 97 | <up-button type="primary" size="large" @click="handleAddOrder"> |
| 72 | 新增工单 | 98 | 新增工单 |
| @@ -76,12 +102,9 @@ | @@ -76,12 +102,9 @@ | ||
| 76 | </template> | 102 | </template> |
| 77 | 103 | ||
| 78 | <script setup> | 104 | <script setup> |
| 79 | -import { ref, computed } from 'vue'; | 105 | +import { ref } from 'vue'; |
| 80 | import { workorderPage } from "@/api/quick-order/quick-order"; | 106 | import { workorderPage } from "@/api/quick-order/quick-order"; |
| 81 | import { timeFormat } from '@/uni_modules/uview-plus'; | 107 | import { timeFormat } from '@/uni_modules/uview-plus'; |
| 82 | -// ========== 修复1:声明所有核心响应式变量 ========== | ||
| 83 | -// 顶部/底部高度(rpx) | ||
| 84 | -// 排序相关:适配up-select的格式 | ||
| 85 | const selectedSortValue = ref(1); | 108 | const selectedSortValue = ref(1); |
| 86 | // 1 位置 2 工单名称 3 情况描述 4 工单编号 | 109 | // 1 位置 2 工单名称 3 情况描述 4 工单编号 |
| 87 | const sortOptions = ref([ | 110 | const sortOptions = ref([ |
| @@ -91,16 +114,13 @@ const sortOptions = ref([ | @@ -91,16 +114,13 @@ const sortOptions = ref([ | ||
| 91 | {name: '编号', id: 4}, | 114 | {name: '编号', id: 4}, |
| 92 | ]); | 115 | ]); |
| 93 | // 分页相关(核心:声明orderList) | 116 | // 分页相关(核心:声明orderList) |
| 94 | -const pageNo = ref(1); | ||
| 95 | -const pageSize = ref(10); | ||
| 96 | const paging = ref(null); | 117 | const paging = ref(null); |
| 97 | const orderList = ref([]); // 修复:新增列表变量 | 118 | const orderList = ref([]); // 修复:新增列表变量 |
| 98 | // 搜索相关 | 119 | // 搜索相关 |
| 99 | const searchValue = ref(''); | 120 | const searchValue = ref(''); |
| 100 | -// ========== 修复3:适配z-paging回调参数 ========== | 121 | +// ========== 适配z-paging回调参数 ========== |
| 101 | const queryList = async (pageNo, pageSize) => { | 122 | const queryList = async (pageNo, pageSize) => { |
| 102 | try { | 123 | try { |
| 103 | - // 修复:z-paging的query回调参数是对象 {pageNo, pageSize} | ||
| 104 | const apiParams = { | 124 | const apiParams = { |
| 105 | searchContent: searchValue.value.trim() || '', | 125 | searchContent: searchValue.value.trim() || '', |
| 106 | pageNo: pageNo, | 126 | pageNo: pageNo, |
| @@ -143,8 +163,6 @@ const handleAddOrder = () => { | @@ -143,8 +163,6 @@ const handleAddOrder = () => { | ||
| 143 | </script> | 163 | </script> |
| 144 | 164 | ||
| 145 | <style scoped lang="scss"> | 165 | <style scoped lang="scss"> |
| 146 | - | ||
| 147 | - | ||
| 148 | // 顶部搜索栏 | 166 | // 顶部搜索栏 |
| 149 | .search-header { | 167 | .search-header { |
| 150 | display: flex; | 168 | display: flex; |
| @@ -168,48 +186,10 @@ const handleAddOrder = () => { | @@ -168,48 +186,10 @@ const handleAddOrder = () => { | ||
| 168 | font-size: 28rpx; | 186 | font-size: 28rpx; |
| 169 | } | 187 | } |
| 170 | } | 188 | } |
| 171 | - | ||
| 172 | .search-input-wrap { | 189 | .search-input-wrap { |
| 173 | flex: 3; | 190 | flex: 3; |
| 174 | } | 191 | } |
| 175 | } | 192 | } |
| 176 | 193 | ||
| 177 | -// 修复:列表容器样式(核心) | ||
| 178 | -.order-list { | ||
| 179 | - padding: 120rpx 20rpx 20rpx; // 顶部内边距避开搜索栏 | ||
| 180 | - box-sizing: border-box; | ||
| 181 | -} | ||
| 182 | - | ||
| 183 | -// 工单卡片样式 | ||
| 184 | -.order-card { | ||
| 185 | - background-color: #fff; | ||
| 186 | - border-radius: 12rpx; | ||
| 187 | - padding: 24rpx; | ||
| 188 | - margin-bottom: 20rpx; | ||
| 189 | - box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); | ||
| 190 | - | ||
| 191 | - .order-item { | ||
| 192 | - font-size: 28rpx; | ||
| 193 | - color: #333; | ||
| 194 | - line-height: 48rpx; | ||
| 195 | - margin-bottom: 8rpx; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - .order-footer { | ||
| 199 | - display: flex; | ||
| 200 | - justify-content: space-between; | ||
| 201 | - align-items: center; | ||
| 202 | - | ||
| 203 | - .submit-time { | ||
| 204 | - flex: 1; | ||
| 205 | - overflow: hidden; | ||
| 206 | - text-overflow: ellipsis; | ||
| 207 | - white-space: nowrap; | ||
| 208 | - font-size: 26rpx; | ||
| 209 | - color: #666; | ||
| 210 | - } | ||
| 211 | - | ||
| 212 | - } | ||
| 213 | -} | ||
| 214 | 194 | ||
| 215 | </style> | 195 | </style> |
| 216 | \ No newline at end of file | 196 | \ No newline at end of file |
pages-sub/daily/quick-order/order-detail.vue
| 1 | <template> | 1 | <template> |
| 2 | - <view class="u-page"> | 2 | + <view class="page-container"> |
| 3 | <!-- 页面级加载组件 --> | 3 | <!-- 页面级加载组件 --> |
| 4 | <up-loading-page | 4 | <up-loading-page |
| 5 | v-if="loading" | 5 | v-if="loading" |
| @@ -11,14 +11,12 @@ | @@ -11,14 +11,12 @@ | ||
| 11 | <!-- 内容容器 --> | 11 | <!-- 内容容器 --> |
| 12 | <view v-else class="content-wrap"> | 12 | <view v-else class="content-wrap"> |
| 13 | <!-- 空状态 --> | 13 | <!-- 空状态 --> |
| 14 | - <view v-if="!Object.keys(orderDetail).length" class="empty-wrap"> | ||
| 15 | - <text class="empty-icon">📄</text> | ||
| 16 | - <text class="empty-text">暂无工单详情</text> | ||
| 17 | - <text class="empty-subtext">请检查工单ID是否正确</text> | 14 | + <view v-if="!Object.keys(orderDetail).length" > |
| 15 | + <empty-view /> | ||
| 18 | </view> | 16 | </view> |
| 19 | 17 | ||
| 20 | <!-- 工单详情内容 --> | 18 | <!-- 工单详情内容 --> |
| 21 | - <up-cell-group :border="false" inset style="margin: 20rpx;" v-else> | 19 | + <up-cell-group :border="false" inset v-else> |
| 22 | <!-- 1. 工单编号 --> | 20 | <!-- 1. 工单编号 --> |
| 23 | <up-cell | 21 | <up-cell |
| 24 | title="工单编号" | 22 | title="工单编号" |
| @@ -29,11 +27,16 @@ | @@ -29,11 +27,16 @@ | ||
| 29 | 27 | ||
| 30 | <!-- 2. 工单位置 --> | 28 | <!-- 2. 工单位置 --> |
| 31 | <up-cell | 29 | <up-cell |
| 32 | - title="工单位置" | ||
| 33 | - :value="orderDetail.roadName || '--'" | ||
| 34 | - class="up-line-1" | ||
| 35 | align="middle" | 30 | align="middle" |
| 36 | - ></up-cell> | 31 | + > |
| 32 | + <template #title> | ||
| 33 | + <view style="min-width: 200rpx">工单位置</view> | ||
| 34 | + </template> | ||
| 35 | + <template #value> | ||
| 36 | + <view class="up-line-1">{{orderDetail.roadName || '--'}}</view> | ||
| 37 | + </template> | ||
| 38 | + | ||
| 39 | + </up-cell> | ||
| 37 | 40 | ||
| 38 | <!-- 3. 工单名称 --> | 41 | <!-- 3. 工单名称 --> |
| 39 | <up-cell | 42 | <up-cell |
| @@ -45,11 +48,15 @@ | @@ -45,11 +48,15 @@ | ||
| 45 | 48 | ||
| 46 | <!-- 4. 情况描述 --> | 49 | <!-- 4. 情况描述 --> |
| 47 | <up-cell | 50 | <up-cell |
| 48 | - title="情况描述" | ||
| 49 | - :value="orderDetail.remark || '--'" | ||
| 50 | - class="up-line-1" | ||
| 51 | align="middle" | 51 | align="middle" |
| 52 | - ></up-cell> | 52 | + > |
| 53 | + <template #title> | ||
| 54 | + <view style="min-width: 200rpx">情况描述</view> | ||
| 55 | + </template> | ||
| 56 | + <template #value> | ||
| 57 | + <view class="up-line-1">{{orderDetail.remark || '--'}}</view> | ||
| 58 | + </template> | ||
| 59 | + </up-cell> | ||
| 53 | 60 | ||
| 54 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> | 61 | <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> |
| 55 | <up-cell title="问题照片" > | 62 | <up-cell title="问题照片" > |
| @@ -87,12 +94,16 @@ | @@ -87,12 +94,16 @@ | ||
| 87 | 94 | ||
| 88 | <!-- 7. 处理结果 --> | 95 | <!-- 7. 处理结果 --> |
| 89 | <up-cell | 96 | <up-cell |
| 90 | - title="处理结果" | ||
| 91 | - :value="orderDetail.handleResult || '--'" | ||
| 92 | - class="up-line-1" | ||
| 93 | align="middle" | 97 | align="middle" |
| 94 | :border="false" | 98 | :border="false" |
| 95 | - ></up-cell> | 99 | + > |
| 100 | + <template #title> | ||
| 101 | + <view style="min-width: 200rpx">处理结果</view> | ||
| 102 | + </template> | ||
| 103 | + <template #value> | ||
| 104 | + <view class="up-line-1">{{orderDetail.handleResult || '--'}}</view> | ||
| 105 | + </template> | ||
| 106 | + </up-cell> | ||
| 96 | </up-cell-group> | 107 | </up-cell-group> |
| 97 | </view> | 108 | </view> |
| 98 | </view> | 109 | </view> |
| @@ -102,6 +113,7 @@ | @@ -102,6 +113,7 @@ | ||
| 102 | import { ref, reactive } from 'vue'; | 113 | import { ref, reactive } from 'vue'; |
| 103 | import { inspectionPlanDetail } from "@/api/quick-order/quick-order"; | 114 | import { inspectionPlanDetail } from "@/api/quick-order/quick-order"; |
| 104 | import { onLoad, onShow } from '@dcloudio/uni-app'; | 115 | import { onLoad, onShow } from '@dcloudio/uni-app'; |
| 116 | +import EmptyView from "../../../components/empty-view/empty-view.vue"; | ||
| 105 | 117 | ||
| 106 | // 状态管理 | 118 | // 状态管理 |
| 107 | const loading = ref(true); | 119 | const loading = ref(true); |
| @@ -145,9 +157,7 @@ onLoad((options) => { | @@ -145,9 +157,7 @@ onLoad((options) => { | ||
| 145 | <style scoped lang="scss"> | 157 | <style scoped lang="scss"> |
| 146 | // 页面基础样式 | 158 | // 页面基础样式 |
| 147 | .u-page { | 159 | .u-page { |
| 148 | - min-height: 100vh; | ||
| 149 | - background-color: #f5f5f5; | ||
| 150 | - box-sizing: border-box; | 160 | + |
| 151 | } | 161 | } |
| 152 | 162 | ||
| 153 | // 内容容器 | 163 | // 内容容器 |
| @@ -155,93 +165,9 @@ onLoad((options) => { | @@ -155,93 +165,9 @@ onLoad((options) => { | ||
| 155 | background: #fff; | 165 | background: #fff; |
| 156 | width: 100%; | 166 | width: 100%; |
| 157 | box-sizing: border-box; | 167 | box-sizing: border-box; |
| 158 | - overflow-y: auto; | ||
| 159 | - min-height: calc(100vh - 40rpx); | ||
| 160 | -} | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | -// 空文本样式 | ||
| 165 | -.empty-text { | ||
| 166 | - color: #999; | ||
| 167 | - font-size: 28rpx; | ||
| 168 | - line-height: 80rpx; | ||
| 169 | - display: block; | ||
| 170 | - text-align: left; | ||
| 171 | -} | ||
| 172 | - | ||
| 173 | -// 优化uview组件样式 | ||
| 174 | -:deep(.up-cell-group) { | ||
| 175 | - --u-cell-group-background-color: #fff; | ||
| 176 | - --u-cell-group-border-radius: 12rpx; | ||
| 177 | - --u-cell-group-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); | ||
| 178 | -} | ||
| 179 | - | ||
| 180 | -:deep(.up-cell) { | ||
| 181 | - --u-cell-title-font-size: 28rpx; | ||
| 182 | - --u-cell-value-font-size: 28rpx; | ||
| 183 | - --u-cell-title-color: #666; | ||
| 184 | - --u-cell-value-color: #333; | ||
| 185 | - --u-cell-padding: 20rpx 15rpx; | ||
| 186 | - --u-cell-border-color: #f5f5f5; | ||
| 187 | -} | ||
| 188 | - | ||
| 189 | -// 相册样式优化(关键:适配图片展示) | ||
| 190 | -:deep(.up-album) { | ||
| 191 | - width: 100%; | ||
| 192 | - box-sizing: border-box; | ||
| 193 | } | 168 | } |
| 194 | 169 | ||
| 195 | -:deep(.up-album__list) { | ||
| 196 | - display: flex; | ||
| 197 | - flex-wrap: wrap; | ||
| 198 | - padding: 0; | ||
| 199 | - margin: 0; | ||
| 200 | -} | ||
| 201 | 170 | ||
| 202 | -:deep(.up-album__item) { | ||
| 203 | - width: calc(33.333% - 10rpx); | ||
| 204 | - height: 200rpx; // 固定图片高度,避免变形 | ||
| 205 | - margin: 5rpx; | ||
| 206 | - border-radius: 8rpx; | ||
| 207 | - overflow: hidden; | ||
| 208 | - background-color: #f8f8f8; | ||
| 209 | -} | ||
| 210 | 171 | ||
| 211 | -:deep(.up-album__image) { | ||
| 212 | - width: 100%; | ||
| 213 | - height: 100%; | ||
| 214 | - object-fit: cover; // 图片裁剪填充,避免拉伸 | ||
| 215 | -} | ||
| 216 | - | ||
| 217 | -// 原生空状态样式 | ||
| 218 | -.empty-wrap { | ||
| 219 | - margin-top: 200rpx; | ||
| 220 | - text-align: center; | ||
| 221 | -} | ||
| 222 | - | ||
| 223 | -.empty-icon { | ||
| 224 | - font-size: 80rpx; | ||
| 225 | - display: block; | ||
| 226 | - margin-bottom: 20rpx; | ||
| 227 | - color: #ddd; | ||
| 228 | -} | ||
| 229 | 172 | ||
| 230 | -.empty-text { | ||
| 231 | - font-size: 28rpx; | ||
| 232 | - color: #999; | ||
| 233 | - display: block; | ||
| 234 | -} | ||
| 235 | - | ||
| 236 | -.empty-subtext { | ||
| 237 | - font-size: 24rpx; | ||
| 238 | - color: #ccc; | ||
| 239 | - margin-top: 10rpx; | ||
| 240 | - display: block; | ||
| 241 | -} | ||
| 242 | - | ||
| 243 | -// 加载组件样式 | ||
| 244 | -:deep(.up-loading-page) { | ||
| 245 | - margin-top: 100rpx; | ||
| 246 | -} | ||
| 247 | </style> | 173 | </style> |
| 248 | \ No newline at end of file | 174 | \ No newline at end of file |
pages.json
| @@ -31,13 +31,13 @@ | @@ -31,13 +31,13 @@ | ||
| 31 | "root": "pages-sub/daily", | 31 | "root": "pages-sub/daily", |
| 32 | "pages": [ | 32 | "pages": [ |
| 33 | { | 33 | { |
| 34 | - "path": "patrol-manage/patrol-plan/index", | 34 | + "path": "patrol-manage/index", |
| 35 | "style": { | 35 | "style": { |
| 36 | "navigationBarTitleText": "巡查计划" | 36 | "navigationBarTitleText": "巡查计划" |
| 37 | } | 37 | } |
| 38 | }, | 38 | }, |
| 39 | { | 39 | { |
| 40 | - "path": "patrol-manage/pending-plan-detail/index", | 40 | + "path": "patrol-manage/pending-plan-detail", |
| 41 | "style": { | 41 | "style": { |
| 42 | "navigationBarTitleText": "计划明细", | 42 | "navigationBarTitleText": "计划明细", |
| 43 | "enablePullDownRefresh": false | 43 | "enablePullDownRefresh": false |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | }, | 45 | }, |
| 46 | 46 | ||
| 47 | { | 47 | { |
| 48 | - "path": "patrol-manage/finish-plan-detail/index", | 48 | + "path": "patrol-manage/finish-plan-detail", |
| 49 | "style": { | 49 | "style": { |
| 50 | "navigationBarTitleText": "已完成计划明细", | 50 | "navigationBarTitleText": "已完成计划明细", |
| 51 | "enablePullDownRefresh": false | 51 | "enablePullDownRefresh": false |
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | }, | 53 | }, |
| 54 | 54 | ||
| 55 | { | 55 | { |
| 56 | - "path": "patrol-manage/add-patrol-record/index", | 56 | + "path": "patrol-manage/add-patrol-record", |
| 57 | "style": { | 57 | "style": { |
| 58 | "navigationBarTitleText": "添加巡查记录", | 58 | "navigationBarTitleText": "添加巡查记录", |
| 59 | "enablePullDownRefresh": false | 59 | "enablePullDownRefresh": false |