Commit ec13a95cf64f1b3f3696d3f42b2292f4ee210d9d

Authored by 刘淇
1 parent fb13622a

未完成明细 列表

api/maintain-manage/maintain-manage.js
1 1  
2   -
3   -
4 2 import { post, get } from '@/common/utils/request';
5 3  
6   -
7 4 /**
8 5 * 道路汇总
9 6 * @returns {Promise}
... ... @@ -49,8 +46,8 @@ export const notFinish = (data) => {
49 46 * 计划详情
50 47 * @returns {Promise}
51 48 */
52   -export const detailList = (data) => {
53   - return post('/app-api/app/garden/maintain-plan-commit/page',data);
  49 +export const detailList = (params) => {
  50 + return get('/app-api/app/garden/maintain-plan-commit/page',params);
54 51 };
55 52  
56 53  
... ...
pages-sub/daily/maintain-manage/index.vue
... ... @@ -63,10 +63,10 @@
63 63 <up-card
64 64 :border="false"
65 65 :foot-border-top="false"
66   - head-border-bottom="false"
  66 + :head-border-bottom="false"
67 67 v-for="(item,index) in currentList"
68 68 :key="`${item.planNo}_${index}`"
69   - :show-header="false"
  69 + :show-head="false"
70 70 >
71 71 <template #body>
72 72 <view class="card-body">
... ... @@ -171,9 +171,9 @@
171 171 </template>
172 172  
173 173 <script setup>
174   -import { ref, computed, onMounted } from 'vue'
175   -import { onLoad } from '@dcloudio/uni-app'
176   -import { roadPage, getRoadDetails, planTypePage } from "@/api/maintain-manage/maintain-manage";
  174 +import { ref, computed } from 'vue'
  175 +import { onLoad, onShow } from '@dcloudio/uni-app'
  176 +import { roadPage, planTypePage } from "@/api/maintain-manage/maintain-manage";
177 177 import { timeFormat } from '@/uni_modules/uview-plus';
178 178  
179 179 // 初始化响应式数据
... ... @@ -312,17 +312,14 @@ const submitRecord = (item) =&gt; {
312 312 onLoad(() => {
313 313 // 先处理字典数据
314 314 handleDictData()
  315 +})
  316 +onShow(()=>{
315 317 // 初始化分页数据
316 318 pagingRef.value?.reload()
317 319 })
318 320 </script>
319 321  
320 322 <style scoped lang="scss">
321   -.main-container {
322   - min-height: 100vh;
323   - background-color: #f8f8f8;
324   -}
325   -
326 323 // 吸顶区域样式
327 324 .sticky-wrap {
328 325 background-color: #fff;
... ... @@ -334,70 +331,5 @@ onLoad(() =&gt; {
334 331 }
335 332 }
336 333  
337   -// 内容区域样式
338   -.content-wrap {
339   - padding:200rpx 20rpx 20rpx;
340   - box-sizing: border-box;
341   -}
342   -
343   -// 卡片列表样式
344   -.card-list {
345   - display: flex;
346   - flex-direction: column;
347   - gap: 20rpx;
348   -}
349   -
350   -// 卡片项样式
351   -.card-item {
352   - background-color: #fff;
353   - border-radius: 12rpx;
354   - padding: 20rpx;
355   - box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
356   -
357   - .card-content {
358   - flex: 1;
359   - display: flex;
360   - flex-direction: column;
361   - gap: 12rpx;
362   -
363   - .card-text {
364   - font-size: 28rpx;
365   - color: #333;
366   - line-height: 1.4;
367   - width: 100%;
368   - display: flex;
369   - align-items: center;
370   - justify-content: space-between; // 让文本和按钮两端对齐
371   -
372   - &.font-bold {
373   - font-weight: 600;
374   - font-size: 30rpx;
375   - }
376   -
377   - .field-name {
378   - color: #999;
379   - display: inline-block;
380   - margin-right: 15rpx;
381   - flex-shrink: 0;
382   - }
383   - }
384   - }
385   -}
386   -
387   -// 行内操作按钮样式
388   -.inline-action {
389   - font-size: 26rpx;
390   - color: #1989fa;
391   - padding: 4rpx 12rpx;
392   - border-radius: 4rpx;
393   - background-color: #f0f8ff;
394   - white-space: nowrap;
395   - float: right;
396   - &.submit-btn {
397   - background-color: #1989fa;
398   - color: #fff;
399   - }
400   -}
401   -
402 334  
403 335 </style>
404 336 \ No newline at end of file
... ...
pages-sub/daily/maintain-manage/pending-plan-detail.vue
1 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   -
  2 + <view class="page-container">
  3 + <!-- 计划详情卡片区域(复用目标卡片结构) -->
  4 + <view class="common-card-list">
  5 + <up-card
  6 + :border="false"
  7 + :foot-border-top="false"
  8 + v-for="(i, index) in planInfo"
  9 + :key="`${i.planNo}_${index}`"
  10 + >
  11 + <!-- 自定义标题区域(计划名称) -->
  12 + <template #head>
  13 + <view class="card-header">
  14 + <view class="common-card-title u-line-1">{{ i.planName || '无计划名称' }}</view>
  15 + </view>
  16 + </template>
  17 +
  18 + <!-- 卡片主体内容(原详情项) -->
  19 + <template #body>
  20 + <view class="card-body">
  21 + <!-- 计划编码 -->
  22 + <view class="u-body-item u-flex">
  23 + <view class="u-body-item-title">计划编码:</view>
  24 + <view class="u-line-1 u-body-value">{{ i.planNo || '-' }}</view>
  25 + </view>
  26 +
  27 + <!-- 养护周期 -->
  28 + <view class="u-body-item u-flex">
  29 + <view class="u-body-item-title">养护周期:</view>
  30 + <view class="u-line-1 u-body-value">
  31 + {{ i.rate || '-' }} {{ uni.$dict.getDictLabel('cycle_id_type', i.cycleId) }}
  32 + </view>
  33 + </view>
  34 +
  35 +<!-- &lt;!&ndash; 计划完成次数 &ndash;&gt;-->
  36 +<!-- <view class="u-body-item u-flex">-->
  37 +<!-- <view class="u-body-item-title">计划完成次数:</view>-->
  38 +<!-- <view class="u-line-1 u-body-value">{{ i.planNum || 0 }} 次</view>-->
  39 +<!-- </view>-->
  40 +
  41 + <!-- 已完成次数 + 查看记录按钮 -->
  42 + <view class="u-body-item u-flex common-item-center common-justify-between">
  43 + <view class="u-body-item-title">已完成比例: {{ i.finishPercent || 0 }} %</view>
  44 + <view class="u-line-1">
  45 + <up-button
  46 + type="primary"
  47 + size="mini"
  48 + @click="gotoFinishPlanDetail(i)"
  49 + class="submit-record-btn"
  50 + :style="{ width: '80px', height: '28px', fontSize: '14px', borderRadius: 4 }"
  51 + >
  52 + 查看记录
  53 + </up-button>
  54 + </view>
  55 + </view>
  56 +
  57 + <!-- 计划有效期 -->
  58 + <view class="u-body-item u-flex">
  59 + <view class="u-body-item-title">计划有效期:</view>
  60 + <view class="u-line-1 u-body-value">
  61 + {{ timeFormat(i.beginTime, 'yyyy-mm-dd') || '-' }} 至
  62 + {{ timeFormat(i.endTime, 'yyyy-mm-dd') || '-' }}
  63 + </view>
  64 + </view>
  65 + </view>
  66 + </template>
  67 + </up-card>
  68 +
  69 + <!-- 底部新增记录按钮 -->
  70 + <view class="fixed-bottom-btn-wrap" v-if="finishState==1">
38 71 <up-button
39 72 type="primary"
40   - size="mini"
41   - @click="gotoFinishPlanDetail(i)"
42   - :style="{ width: '80px', height: '28px', fontSize: '14px', borderRadius: 4 }"
  73 + size="default"
  74 + @click="addNewRecord"
  75 + :style="{ width: '100%', height: '88rpx', fontSize: '32rpx', borderRadius: 0 }"
43 76 >
44   - 查看记录
  77 + 新增记录
45 78 </up-button>
46 79 </view>
47   -
48   - <!-- 计划有效期行 -->
49   - <view class="detail-item">
50   - <text class="label">计划有效期:</text>
51   - <!-- <text class="value up-line-1">{{ planInfo && planInfo.validTime ? planInfo.validTime : '-' }}</text>-->
52   - <text class="value up-line-1">{{ timeFormat(i.beginTime, 'yyyy-mm-dd') }} 至
53   - {{ timeFormat(i.endTime, 'yyyy-mm-dd') }}
54   - </text>
55   - </view>
56   - </view>
57   -
58   - <!-- 底部新增记录按钮 status=3-->
59   - <view class="fixed-bottom-btn-wrap" v-if="finishState==1">
60   - <up-button
61   - type="primary"
62   - size="default"
63   - @click="addNewRecord"
64   - :style="{ width: '100%', height: '88rpx', fontSize: '32rpx', borderRadius: 0 }"
65   - >
66   - 新增记录
67   - </up-button>
68 80 </view>
69 81 </view>
70 82 </template>
... ... @@ -75,22 +87,21 @@ import { ref } from &#39;vue&#39;;
75 87 import { onLoad, onShow } from '@dcloudio/uni-app';
76 88 import { notFinish } from "@/api/maintain-manage/maintain-manage";
77 89  
78   -// 响应式数据定义
  90 +// 响应式数据定义(逻辑完全保留)
79 91 const planInfo = ref([]);
80 92 const batchNo = ref('')
81 93 const planNo = ref('')
82 94 const finishState = ref('')
83 95 const planTypeId = ref('')
84 96  
85   -
86   -
87   -// 页面加载接收参数
  97 +// 页面加载接收参数(逻辑完全保留)
88 98 onLoad((options) => {
89 99 planNo.value = options.planNo;
90   - finishState.value = options.status
  100 + finishState.value = options.finishState
91 101 planTypeId.value = options.planTypeId
92 102 });
93   -// 页面显示时请求数据
  103 +
  104 +// 页面显示时请求数据(逻辑完全保留)
94 105 onShow(() => {
95 106 if (!planNo.value) {
96 107 uni.showToast({
... ... @@ -101,76 +112,38 @@ onShow(() =&gt; {
101 112 }
102 113 getPlanDetail();
103 114 });
  115 +
  116 +// 获取计划详情(逻辑完全保留)
104 117 const getPlanDetail = async () => {
105 118 const queryData = {
106 119 planNo: planNo.value,
107   - planTypeId:planTypeId.value
  120 + planTypeId: planTypeId.value
108 121 }
109 122 console.log(queryData)
110 123 const planInfoRes = await notFinish(queryData)
111 124 planInfo.value = planInfoRes
112 125 console.log(planInfoRes)
113 126 };
114   -// 跳转到已完成计划明细
  127 +
  128 +// 跳转到已完成计划明细(逻辑完全保留)
115 129 const gotoFinishPlanDetail = (i) => {
116 130 uni.navigateTo({
117   - // url: `/pages-sub/daily/maintain-manage/finish-plan-detail?planNo=${i.planNo}`
  131 + url: `/pages-sub/daily/maintain-manage/finish-plan-detail?planNo=${i.planNo}`
118 132 });
119 133 };
120   -// 新增记录
  134 +
  135 +// 新增记录(逻辑完全保留)
121 136 const addNewRecord = () => {
122 137 uni.navigateTo({
123   - url: `/pages-sub/daily/maintain-manage/add-record/index?planNo=${planInfo.value[0].planNo}&batchNo=${batchNo.value}`,
  138 + url: `/pages-sub/daily/maintain-manage/add-record?planNo=${planInfo.value[0].planNo}&batchNo=${batchNo.value}`,
124 139 });
125 140 };
126 141 </script>
127 142  
128 143 <style scoped lang="scss">
129   -.pending-plan-detail {
130   -
131   -}
132   -
133   -.detail-card {
134   - padding: 20rpx;
135   - background-color: #fff;
136   - margin-bottom: 20px;
137   -}
138   -
139   -.detail-item {
140   - display: flex;
141   - align-items: center;
142   - font-size: 28rpx;
143   - line-height: 1.8;
144   - padding: 10rpx 0;
145   - border-bottom: 1px solid #f5f5f5;
  144 +.page-container {
146 145  
147   - &:last-child {
148   - border-bottom: none;
149   - }
150   -}
151   -
152   -.flex-between {
153   - display: flex;
154   - justify-content: space-between;
155   - align-items: center;
156   -
157   - .left-wrap {
158   - display: flex;
159   - align-items: center;
160   - flex: 1; // 占满剩余空间,按钮靠右
161   - }
162   -}
163   -
164   -.label {
165   - color: #999;
166   - width: 200rpx;
167   - flex-shrink: 0;
168 146 }
169 147  
170   -.value {
171   - color: #333;
172   - flex: 1;
173   - word-break: break-all;
174   -}
175 148  
176 149 </style>
177 150 \ No newline at end of file
... ...
pages-sub/daily/patrol-manage/pending-plan-detail/index.vue
... ... @@ -112,6 +112,8 @@ const getPlanDetail = async () =&gt; {
112 112 const gotoFinishPlanDetail = (i) => {
113 113 uni.navigateTo({
114 114 url: `/pages-sub/daily/patrol-manage/finish-plan-detail/index?planNo=${i.planNo}`
  115 +
  116 +
115 117 });
116 118 };
117 119 // 新增记录
... ...