Commit 54955fb582f4618968f35ceaa79d98b142270ca7

Authored by 刘淇
1 parent 67af4c8e

巡查和养护 。 失效状态的判断

... ... @@ -50,6 +50,35 @@ page {
50 50  
51 51 // 卡片列表样式
52 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 82 .common-card-title {
54 83  
55 84 }
... ...
api/patrol-manage/patrol-plan.js
... ... @@ -26,7 +26,7 @@ export const inspectioDetailByPlanno = (params) => {
26 26 };
27 27  
28 28 /**
29   - * 巡查计划完成详情
  29 + * 巡查计划创建
30 30 * @returns {Promise}
31 31 */
32 32 export const inspectionCreate = (data) => {
... ...
pages-sub/daily/maintain-manage/finish-plan-detail.vue
... ... @@ -71,7 +71,7 @@
71 71 <view style="min-width: 200rpx">巡查描述</view>
72 72 </template>
73 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 75 </template>
76 76 </up-cell>
77 77  
... ...
pages-sub/daily/maintain-manage/index.vue
... ... @@ -138,7 +138,7 @@
138 138  
139 139 <view class="u-body-item u-flex common-item-center common-justify-between">
140 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 142 <up-button
143 143 type="primary"
144 144 size="mini"
... ... @@ -330,6 +330,7 @@ onShow(()=&gt;{
330 330 <style scoped lang="scss">
331 331 // 吸顶区域样式
332 332 .sticky-wrap {
  333 + margin-top: -10rpx;
333 334 background-color: #fff;
334 335 padding-bottom: 10rpx;
335 336 border-bottom: 1px solid #eee;
... ...
pages-sub/daily/maintain-manage/road-detail-list.vue
... ... @@ -53,12 +53,12 @@
53 53 >
54 54 <!-- 自定义标题区域 -->
55 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 62 </template>
63 63  
64 64 <template #body>
... ... @@ -83,12 +83,34 @@
83 83 @click="submitRecord(item)"
84 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 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 114 </view>
93 115 </view>
94 116  
... ... @@ -138,7 +160,7 @@ const getUrlParams = (options) =&gt; {
138 160 }
139 161 if (options?.finish_state) {
140 162 finishState.value = options.finish_state
141   - activeStatus.value = options.finish_state
  163 + // activeStatus.value = options.finish_state
142 164 console.log('从URL获取的finish_state:', finishState.value)
143 165 }
144 166 }
... ... @@ -174,7 +196,7 @@ const queryList = async (pageNo, pageSize) =&gt; {
174 196 pageNo: pageNo,
175 197 pageSize: pageSize,
176 198 roadId: roadId.value,
177   - finishState: finishState.value || activeStatus.value,
  199 + finishState: activeStatus.value,
178 200 planName: searchValue.value.trim()
179 201 }
180 202 console.log('请求参数:', paramsData)
... ... @@ -206,6 +228,7 @@ onShow(() =&gt; {
206 228 }
207 229 // 顶部吸顶区域样式
208 230 .sticky-header {
  231 + margin-top: -10rpx;
209 232 background-color: #ffffff;
210 233 padding-bottom: 10rpx;
211 234 border-bottom: 1px solid #eee;
... ... @@ -215,21 +238,6 @@ onShow(() =&gt; {
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 243 </style>
236 244 \ No newline at end of file
... ...
pages-sub/daily/patrol-manage/add-patrol-record.vue
... ... @@ -268,7 +268,7 @@ export default {
268 268 "inspectionState": this.inspectForm.isWorkOrder,
269 269 "transState": this.inspectForm.isWorkOrder==1?'1':'2',
270 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 72 <view style="min-width: 200rpx">巡查描述</view>
73 73 </template>
74 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 76 </template>
77 77 </up-cell>
78 78  
... ...
pages-sub/daily/patrol-manage/pending-plan-detail.vue
... ... @@ -11,10 +11,13 @@
11 11 <!-- 自定义标题区域 -->
12 12 <template #head>
13 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 21 </view>
19 22 </template>
20 23  
... ... @@ -35,10 +38,10 @@
35 38 <view class="u-body-item-title">计划完成次数: {{ item.planNum || 0 }}</view>
36 39 <view class="u-line-1">
37 40 <up-button
38   - v-if="item.finishState === '3'"
  41 + v-if="item.finishState ==3"
39 42 type="primary"
40 43 size="mini"
41   - @click="gotoFinishPlanDetail(item)"
  44 + @click=""
42 45 class="submit-record-btn"
43 46 :disabled="true"
44 47 >
... ... @@ -46,7 +49,7 @@
46 49 </up-button>
47 50  
48 51 <up-button
49   - v-if="item.finishState !== '3' && item.planFinishNum>0"
  52 + v-if="item.finishState !== 3 && item.planFinishNum > 0"
50 53 type="primary"
51 54 size="mini"
52 55 @click="gotoFinishPlanDetail(item)"
... ... @@ -130,8 +133,6 @@ const getPlanDetail = async () =&gt; {
130 133 const gotoFinishPlanDetail = (i) => {
131 134 uni.navigateTo({
132 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 = () =&gt; {
144 145  
145 146 <style scoped lang="scss">
146 147  
  148 +
147 149 </style>
148 150 \ No newline at end of file
... ...
pages.json
... ... @@ -47,7 +47,7 @@
47 47 {
48 48 "path": "patrol-manage/finish-plan-detail",
49 49 "style": {
50   - "navigationBarTitleText": "已完成计划明细",
  50 + "navigationBarTitleText": "已完成详情",
51 51 "enablePullDownRefresh": false
52 52 }
53 53 },
... ...
pages/mine/index.vue
... ... @@ -80,7 +80,7 @@ const confirmLogout = async () =&gt; {
80 80  
81 81 if (res.confirm) {
82 82 await userStore.logout()
83   - uni.showToast({ title: '退出登录成功', type: 'success' })
  83 + // uni.showToast({ title: '退出登录成功', type: 'success' })
84 84 }
85 85 } catch (error) {
86 86 console.error('退出登录失败:', error)
... ...