Commit 54955fb582f4618968f35ceaa79d98b142270ca7
1 parent
67af4c8e
巡查和养护 。 失效状态的判断
Showing
10 changed files
with
81 additions
and
41 deletions
App.vue
| @@ -50,6 +50,35 @@ page { | @@ -50,6 +50,35 @@ page { | ||
| 50 | 50 | ||
| 51 | // 卡片列表样式 | 51 | // 卡片列表样式 |
| 52 | .common-card-list { | 52 | .common-card-list { |
| 53 | + .card-header{ | ||
| 54 | + display: flex; | ||
| 55 | + align-items: center; | ||
| 56 | + justify-content: space-between; | ||
| 57 | + width: 100%; | ||
| 58 | + .common-name{ | ||
| 59 | + flex: 1; // 占满剩余空间,挤压标签到右侧 | ||
| 60 | + font-size: 28rpx; | ||
| 61 | + font-weight: 500; | ||
| 62 | + color: #333; | ||
| 63 | + // 关键:单行文本溢出省略 | ||
| 64 | + white-space: nowrap; | ||
| 65 | + overflow: hidden; | ||
| 66 | + text-overflow: ellipsis; | ||
| 67 | + // 与标签保持间距 | ||
| 68 | + margin-right: 16rpx; | ||
| 69 | + } | ||
| 70 | + // 已失效标签样式 | ||
| 71 | + .common-invalid-tag { | ||
| 72 | + color: #f56c6c; | ||
| 73 | + font-size: 24rpx; | ||
| 74 | + flex-shrink: 0; // 禁止标签被压缩 | ||
| 75 | + } | ||
| 76 | + .common-finish-tag{ | ||
| 77 | + color: #5ac725; | ||
| 78 | + font-size: 24rpx; | ||
| 79 | + flex-shrink: 0; // 禁止标签被压缩 | ||
| 80 | + } | ||
| 81 | + } | ||
| 53 | .common-card-title { | 82 | .common-card-title { |
| 54 | 83 | ||
| 55 | } | 84 | } |
api/patrol-manage/patrol-plan.js
| @@ -26,7 +26,7 @@ export const inspectioDetailByPlanno = (params) => { | @@ -26,7 +26,7 @@ export const inspectioDetailByPlanno = (params) => { | ||
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | - * 巡查计划完成详情 | 29 | + * 巡查计划创建 |
| 30 | * @returns {Promise} | 30 | * @returns {Promise} |
| 31 | */ | 31 | */ |
| 32 | export const inspectionCreate = (data) => { | 32 | export const inspectionCreate = (data) => { |
pages-sub/daily/maintain-manage/finish-plan-detail.vue
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | <view style="min-width: 200rpx">巡查描述</view> | 71 | <view style="min-width: 200rpx">巡查描述</view> |
| 72 | </template> | 72 | </template> |
| 73 | <template #value> | 73 | <template #value> |
| 74 | - <view class="up-line-1">{{i.remark || '--'}}</view> | 74 | + <view class="up-line-1" style="color: #606266">{{i.remark || '--'}}</view> |
| 75 | </template> | 75 | </template> |
| 76 | </up-cell> | 76 | </up-cell> |
| 77 | 77 |
pages-sub/daily/maintain-manage/index.vue
| @@ -138,7 +138,7 @@ | @@ -138,7 +138,7 @@ | ||
| 138 | 138 | ||
| 139 | <view class="u-body-item u-flex common-item-center common-justify-between"> | 139 | <view class="u-body-item u-flex common-item-center common-justify-between"> |
| 140 | <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view> | 140 | <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view> |
| 141 | - <view class="u-line-1"> | 141 | + <view class="u-line-1" v-if="item.finishState!==3"> |
| 142 | <up-button | 142 | <up-button |
| 143 | type="primary" | 143 | type="primary" |
| 144 | size="mini" | 144 | size="mini" |
| @@ -330,6 +330,7 @@ onShow(()=>{ | @@ -330,6 +330,7 @@ onShow(()=>{ | ||
| 330 | <style scoped lang="scss"> | 330 | <style scoped lang="scss"> |
| 331 | // 吸顶区域样式 | 331 | // 吸顶区域样式 |
| 332 | .sticky-wrap { | 332 | .sticky-wrap { |
| 333 | + margin-top: -10rpx; | ||
| 333 | background-color: #fff; | 334 | background-color: #fff; |
| 334 | padding-bottom: 10rpx; | 335 | padding-bottom: 10rpx; |
| 335 | border-bottom: 1px solid #eee; | 336 | border-bottom: 1px solid #eee; |
pages-sub/daily/maintain-manage/road-detail-list.vue
| @@ -53,12 +53,12 @@ | @@ -53,12 +53,12 @@ | ||
| 53 | > | 53 | > |
| 54 | <!-- 自定义标题区域 --> | 54 | <!-- 自定义标题区域 --> |
| 55 | <template #head> | 55 | <template #head> |
| 56 | - <view class="card-header"> | ||
| 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>--> | ||
| 61 | - </view> | 56 | + <view class="card-header"> |
| 57 | + <view class="common-card-title common-name">{{ item.planName || '无计划名称' }}{{ item.planName || '无计划名称' }}</view> | ||
| 58 | + <!-- 已失效标识 --> | ||
| 59 | + <view v-show="item.finishState == 3 " class="common-invalid-tag">已失效</view> | ||
| 60 | + <view v-show="item.finishState == 2 " class="common-finish-tag">已完成</view> | ||
| 61 | + </view> | ||
| 62 | </template> | 62 | </template> |
| 63 | 63 | ||
| 64 | <template #body> | 64 | <template #body> |
| @@ -83,12 +83,34 @@ | @@ -83,12 +83,34 @@ | ||
| 83 | @click="submitRecord(item)" | 83 | @click="submitRecord(item)" |
| 84 | class="submit-record-btn" | 84 | class="submit-record-btn" |
| 85 | 85 | ||
| 86 | - :disabled="item.finishState === '3'" | ||
| 87 | - :class="{ 'disabled-btn': item.finishState === '3' }" | 86 | + :disabled="item.finishState == 3" |
| 87 | + | ||
| 88 | > | 88 | > |
| 89 | 89 | ||
| 90 | - {{ item.finishState === '3' ? '补交记录' : '提交记录' }} | 90 | + {{ item.finishState ==3 ? '补交记录' : '提交记录' }} |
| 91 | </up-button> | 91 | </up-button> |
| 92 | + | ||
| 93 | +<!-- :class="{ 'disabled-btn': item.finishState ==3 }"--> | ||
| 94 | +<!-- <up-button--> | ||
| 95 | +<!-- v-if="item.finishState ==3"--> | ||
| 96 | +<!-- type="primary"--> | ||
| 97 | +<!-- size="mini"--> | ||
| 98 | +<!-- @click=""--> | ||
| 99 | +<!-- class="submit-record-btn"--> | ||
| 100 | +<!-- :disabled="true"--> | ||
| 101 | +<!-- >--> | ||
| 102 | +<!-- 补交记录--> | ||
| 103 | +<!-- </up-button>--> | ||
| 104 | + | ||
| 105 | +<!-- <up-button--> | ||
| 106 | +<!-- v-if="item.finishState !== '3' && item.planFinishNum>0"--> | ||
| 107 | +<!-- type="primary"--> | ||
| 108 | +<!-- size="mini"--> | ||
| 109 | +<!-- @click="gotoFinishPlanDetail(item)"--> | ||
| 110 | +<!-- class="submit-record-btn"--> | ||
| 111 | +<!-- >--> | ||
| 112 | +<!-- 提交记录--> | ||
| 113 | +<!-- </up-button>--> | ||
| 92 | </view> | 114 | </view> |
| 93 | </view> | 115 | </view> |
| 94 | 116 | ||
| @@ -138,7 +160,7 @@ const getUrlParams = (options) => { | @@ -138,7 +160,7 @@ const getUrlParams = (options) => { | ||
| 138 | } | 160 | } |
| 139 | if (options?.finish_state) { | 161 | if (options?.finish_state) { |
| 140 | finishState.value = options.finish_state | 162 | finishState.value = options.finish_state |
| 141 | - activeStatus.value = options.finish_state | 163 | + // activeStatus.value = options.finish_state |
| 142 | console.log('从URL获取的finish_state:', finishState.value) | 164 | console.log('从URL获取的finish_state:', finishState.value) |
| 143 | } | 165 | } |
| 144 | } | 166 | } |
| @@ -174,7 +196,7 @@ const queryList = async (pageNo, pageSize) => { | @@ -174,7 +196,7 @@ const queryList = async (pageNo, pageSize) => { | ||
| 174 | pageNo: pageNo, | 196 | pageNo: pageNo, |
| 175 | pageSize: pageSize, | 197 | pageSize: pageSize, |
| 176 | roadId: roadId.value, | 198 | roadId: roadId.value, |
| 177 | - finishState: finishState.value || activeStatus.value, | 199 | + finishState: activeStatus.value, |
| 178 | planName: searchValue.value.trim() | 200 | planName: searchValue.value.trim() |
| 179 | } | 201 | } |
| 180 | console.log('请求参数:', paramsData) | 202 | console.log('请求参数:', paramsData) |
| @@ -206,6 +228,7 @@ onShow(() => { | @@ -206,6 +228,7 @@ onShow(() => { | ||
| 206 | } | 228 | } |
| 207 | // 顶部吸顶区域样式 | 229 | // 顶部吸顶区域样式 |
| 208 | .sticky-header { | 230 | .sticky-header { |
| 231 | + margin-top: -10rpx; | ||
| 209 | background-color: #ffffff; | 232 | background-color: #ffffff; |
| 210 | padding-bottom: 10rpx; | 233 | padding-bottom: 10rpx; |
| 211 | border-bottom: 1px solid #eee; | 234 | border-bottom: 1px solid #eee; |
| @@ -215,21 +238,6 @@ onShow(() => { | @@ -215,21 +238,6 @@ onShow(() => { | ||
| 215 | } | 238 | } |
| 216 | } | 239 | } |
| 217 | 240 | ||
| 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 | -} | ||
| 233 | 241 | ||
| 234 | 242 | ||
| 235 | </style> | 243 | </style> |
| 236 | \ No newline at end of file | 244 | \ No newline at end of file |
pages-sub/daily/patrol-manage/add-patrol-record.vue
| @@ -268,7 +268,7 @@ export default { | @@ -268,7 +268,7 @@ export default { | ||
| 268 | "inspectionState": this.inspectForm.isWorkOrder, | 268 | "inspectionState": this.inspectForm.isWorkOrder, |
| 269 | "transState": this.inspectForm.isWorkOrder==1?'1':'2', | 269 | "transState": this.inspectForm.isWorkOrder==1?'1':'2', |
| 270 | "transWorkNo": "default'", | 270 | "transWorkNo": "default'", |
| 271 | - "remark": this.inspectForm.isWorkOrder | 271 | + "remark": this.inspectForm.content |
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | // 显示加载中 | 274 | // 显示加载中 |
pages-sub/daily/patrol-manage/finish-plan-detail.vue
| @@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
| 72 | <view style="min-width: 200rpx">巡查描述</view> | 72 | <view style="min-width: 200rpx">巡查描述</view> |
| 73 | </template> | 73 | </template> |
| 74 | <template #value> | 74 | <template #value> |
| 75 | - <view class="up-line-1">{{i.remark || '--'}}</view> | 75 | + <view class="up-line-1" style="color: #606266">{{i.remark || '--'}}</view> |
| 76 | </template> | 76 | </template> |
| 77 | </up-cell> | 77 | </up-cell> |
| 78 | 78 |
pages-sub/daily/patrol-manage/pending-plan-detail.vue
| @@ -11,10 +11,13 @@ | @@ -11,10 +11,13 @@ | ||
| 11 | <!-- 自定义标题区域 --> | 11 | <!-- 自定义标题区域 --> |
| 12 | <template #head> | 12 | <template #head> |
| 13 | <view class="card-header"> | 13 | <view class="card-header"> |
| 14 | - <view class="common-card-title u-line-1">{{ item.planName || '无计划名称' }}</view> | 14 | + <view class="common-card-title common-name">{{ item.planName || '无计划名称' }}{{ |
| 15 | + item.planName || '无计划名称' | ||
| 16 | + }} | ||
| 17 | + </view> | ||
| 15 | <!-- 已失效标识 --> | 18 | <!-- 已失效标识 --> |
| 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>--> | 19 | + <view v-show="item.finishState == 3 " class="common-invalid-tag">已失效</view> |
| 20 | + <view v-show="item.finishState == 2 " class="common-finish-tag">已完成</view> | ||
| 18 | </view> | 21 | </view> |
| 19 | </template> | 22 | </template> |
| 20 | 23 | ||
| @@ -35,10 +38,10 @@ | @@ -35,10 +38,10 @@ | ||
| 35 | <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view> | 38 | <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view> |
| 36 | <view class="u-line-1"> | 39 | <view class="u-line-1"> |
| 37 | <up-button | 40 | <up-button |
| 38 | - v-if="item.finishState === '3'" | 41 | + v-if="item.finishState ==3" |
| 39 | type="primary" | 42 | type="primary" |
| 40 | size="mini" | 43 | size="mini" |
| 41 | - @click="gotoFinishPlanDetail(item)" | 44 | + @click="" |
| 42 | class="submit-record-btn" | 45 | class="submit-record-btn" |
| 43 | :disabled="true" | 46 | :disabled="true" |
| 44 | > | 47 | > |
| @@ -46,7 +49,7 @@ | @@ -46,7 +49,7 @@ | ||
| 46 | </up-button> | 49 | </up-button> |
| 47 | 50 | ||
| 48 | <up-button | 51 | <up-button |
| 49 | - v-if="item.finishState !== '3' && item.planFinishNum>0" | 52 | + v-if="item.finishState !== 3 && item.planFinishNum > 0" |
| 50 | type="primary" | 53 | type="primary" |
| 51 | size="mini" | 54 | size="mini" |
| 52 | @click="gotoFinishPlanDetail(item)" | 55 | @click="gotoFinishPlanDetail(item)" |
| @@ -130,8 +133,6 @@ const getPlanDetail = async () => { | @@ -130,8 +133,6 @@ const getPlanDetail = async () => { | ||
| 130 | const gotoFinishPlanDetail = (i) => { | 133 | const gotoFinishPlanDetail = (i) => { |
| 131 | uni.navigateTo({ | 134 | uni.navigateTo({ |
| 132 | url: `/pages-sub/daily/patrol-manage/finish-plan-detail?planNo=${i.planNo}` | 135 | url: `/pages-sub/daily/patrol-manage/finish-plan-detail?planNo=${i.planNo}` |
| 133 | - | ||
| 134 | - | ||
| 135 | }); | 136 | }); |
| 136 | }; | 137 | }; |
| 137 | // 新增记录 | 138 | // 新增记录 |
| @@ -144,4 +145,5 @@ const addNewRecord = () => { | @@ -144,4 +145,5 @@ const addNewRecord = () => { | ||
| 144 | 145 | ||
| 145 | <style scoped lang="scss"> | 146 | <style scoped lang="scss"> |
| 146 | 147 | ||
| 148 | + | ||
| 147 | </style> | 149 | </style> |
| 148 | \ No newline at end of file | 150 | \ No newline at end of file |
pages.json
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | { | 47 | { |
| 48 | "path": "patrol-manage/finish-plan-detail", | 48 | "path": "patrol-manage/finish-plan-detail", |
| 49 | "style": { | 49 | "style": { |
| 50 | - "navigationBarTitleText": "已完成计划明细", | 50 | + "navigationBarTitleText": "已完成详情", |
| 51 | "enablePullDownRefresh": false | 51 | "enablePullDownRefresh": false |
| 52 | } | 52 | } |
| 53 | }, | 53 | }, |
pages/mine/index.vue
| @@ -80,7 +80,7 @@ const confirmLogout = async () => { | @@ -80,7 +80,7 @@ const confirmLogout = async () => { | ||
| 80 | 80 | ||
| 81 | if (res.confirm) { | 81 | if (res.confirm) { |
| 82 | await userStore.logout() | 82 | await userStore.logout() |
| 83 | - uni.showToast({ title: '退出登录成功', type: 'success' }) | 83 | + // uni.showToast({ title: '退出登录成功', type: 'success' }) |
| 84 | } | 84 | } |
| 85 | } catch (error) { | 85 | } catch (error) { |
| 86 | console.error('退出登录失败:', error) | 86 | console.error('退出登录失败:', error) |