Commit b10b29b6ad540c2d71c03dfee3ff9c7325c5d6bf

Authored by 刘淇
1 parent 6dcd0ffd

lineWidth="65" 优化样式

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