Commit ff65dc6ca5723f810c101e28c4a66db4fd6a0df0

Authored by 刘淇
1 parent c7df828a

快速工单 样式优化

pages-sub/daily/maintain-manage/add-record.vue
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 class="form-item" 13 class="form-item"
14 > 14 >
15 <up-textarea 15 <up-textarea
16 - v-model="inspectForm.remark"  
17 - placeholder="请输入巡查描述" 16 + v-model.trim="inspectForm.remark"
  17 + placeholder="请输入养护描述"
18 maxlength="200" 18 maxlength="200"
19 count 19 count
20 ></up-textarea> 20 ></up-textarea>
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 label="上传图片" 25 label="上传图片"
26 prop="images" 26 prop="images"
27 required 27 required
28 - border-bottom 28 +
29 class="form-item" 29 class="form-item"
30 > 30 >
31 <up-upload 31 <up-upload
@@ -41,27 +41,27 @@ @@ -41,27 +41,27 @@
41 ></up-upload> 41 ></up-upload>
42 </up-form-item> 42 </up-form-item>
43 43
44 - <!-- 3. 完成进度(滑块) -->  
45 - <up-form-item  
46 - label="完成进度"  
47 - prop="progress" 44 +<!-- &lt;!&ndash; 3. 完成进度(滑块) &ndash;&gt;-->
  45 +<!-- <up-form-item-->
  46 +<!-- label="完成进度"-->
  47 +<!-- prop="progress"-->
48 48
49 - class="form-item"  
50 - >  
51 - <view class="progress-wrap">  
52 - <up-slider  
53 - v-model="inspectForm.progress"  
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>  
63 - </view>  
64 - </up-form-item> 49 +<!-- class="form-item"-->
  50 +<!-- >-->
  51 +<!-- <view class="progress-wrap">-->
  52 +<!-- <up-slider-->
  53 +<!-- v-model="inspectForm.progress"-->
  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>-->
  63 +<!-- </view>-->
  64 +<!-- </up-form-item>-->
65 </up-form> 65 </up-form>
66 </view> 66 </view>
67 67
@@ -94,7 +94,7 @@ export default { @@ -94,7 +94,7 @@ export default {
94 initProgress: 0, 94 initProgress: 0,
95 inspectForm: { 95 inspectForm: {
96 remark: '', 96 remark: '',
97 - progress: 0 97 + // progress: 0
98 }, 98 },
99 paramsOptins: {}, 99 paramsOptins: {},
100 inspectFormRules: { 100 inspectFormRules: {
@@ -144,10 +144,10 @@ export default { @@ -144,10 +144,10 @@ export default {
144 onLoad(option) { 144 onLoad(option) {
145 console.log('页面参数:', option) 145 console.log('页面参数:', option)
146 this.paramsOptins = option 146 this.paramsOptins = option
147 - // 初始化初始进度  
148 - this.initProgress = option.finishPercent ? Number(option.finishPercent)+1 : 0  
149 - // 关键修复:初始进度值设为 初始进度+1,避免刚进入就触发校验失败  
150 - this.inspectForm.progress = this.initProgress 147 + // // 初始化初始进度
  148 + // this.initProgress = option.finishPercent ? Number(option.finishPercent)+1 : 0
  149 + // // 关键修复:初始进度值设为 初始进度+1,避免刚进入就触发校验失败
  150 + // this.inspectForm.progress = this.initProgress
151 console.log('初始进度值:', this.initProgress) 151 console.log('初始进度值:', this.initProgress)
152 }, 152 },
153 onReady() { 153 onReady() {
@@ -278,18 +278,18 @@ export default { @@ -278,18 +278,18 @@ export default {
278 * 提交巡查表单 278 * 提交巡查表单
279 */ 279 */
280 async submitInspect() { 280 async submitInspect() {
281 - console.log('当前完成进度:', this.inspectForm.progress) 281 + // console.log('当前完成进度:', this.inspectForm.progress)
282 try { 282 try {
283 await this.$refs.inspectFormRef.validate() 283 await this.$refs.inspectFormRef.validate()
284 console.log('图片列表:', this.imagesList) 284 console.log('图片列表:', this.imagesList)
285 285
286 const submitData = { 286 const submitData = {
287 - totalFinishPercent: this.inspectForm.progress, 287 + totalFinishPercent: 100,
288 "planNo": this.paramsOptins.planNo, 288 "planNo": this.paramsOptins.planNo,
289 "imgHost": "1", 289 "imgHost": "1",
290 "beginImg": this.getImgUrlList(this.imagesList), 290 "beginImg": this.getImgUrlList(this.imagesList),
291 "commonUserList": [], 291 "commonUserList": [],
292 - "remark": this.inspectForm.remark 292 + "remark": this.inspectForm.remark.trim()
293 } 293 }
294 294
295 uni.showLoading({ title: '提交中...' }) 295 uni.showLoading({ title: '提交中...' })
pages-sub/daily/maintain-manage/pending-plan-detail.vue
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 40
41 <!-- 已完成次数 + 查看记录按钮 --> 41 <!-- 已完成次数 + 查看记录按钮 -->
42 <view class="u-body-item u-flex common-item-center common-justify-between"> 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> 43 + <view class="u-body-item-title">已完成次数: {{ i.planFinishNum || 0 }} 次</view>
44 <view class="u-line-1"> 44 <view class="u-line-1">
45 <up-button 45 <up-button
46 type="primary" 46 type="primary"
pages-sub/daily/maintain-manage/road-detail-list.vue
@@ -114,10 +114,10 @@ @@ -114,10 +114,10 @@
114 </view> 114 </view>
115 </view> 115 </view>
116 116
117 - <view class="u-body-item u-flex">  
118 - <view class="u-body-item-title">已完成比例:</view>  
119 - <view class="u-line-1 u-body-value">{{ item.finishPercent || 0 }}%</view>  
120 - </view> 117 +<!-- <view class="u-body-item u-flex">-->
  118 +<!-- <view class="u-body-item-title">已完成比例:</view>-->
  119 +<!-- <view class="u-line-1 u-body-value">{{ item.finishPercent || 0 }}%</view>-->
  120 +<!-- </view>-->
121 121
122 <view class="u-body-item u-flex"> 122 <view class="u-body-item u-flex">
123 <view class="u-body-item-title">计划有效期:</view> 123 <view class="u-body-item-title">计划有效期:</view>
pages-sub/daily/patrol-manage/index.vue
@@ -61,6 +61,8 @@ @@ -61,6 +61,8 @@
61 <view class="u-line-1 u-body-value">{{ item.roadName || '-' }}</view> 61 <view class="u-line-1 u-body-value">{{ item.roadName || '-' }}</view>
62 </view> 62 </view>
63 63
  64 +
  65 +
64 <view class="u-body-item u-flex"> 66 <view class="u-body-item u-flex">
65 <view class="u-body-item-title">所属街道:</view> 67 <view class="u-body-item-title">所属街道:</view>
66 <view class="u-line-1 u-body-value">{{ item.streetName }} 68 <view class="u-line-1 u-body-value">{{ item.streetName }}
pages-sub/problem/work-order-manage/add-order.vue
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 label-position="left" 5 label-position="left"
6 :model="workOrderForm" 6 :model="workOrderForm"
7 ref="workOrderFormRef" 7 ref="workOrderFormRef"
8 - labelWidth="160rpx" 8 + labelWidth="190rpx"
9 > 9 >
10 <!-- 1. 工单位置(地图选择) --> 10 <!-- 1. 工单位置(地图选择) -->
11 <up-form-item 11 <up-form-item
@@ -34,14 +34,14 @@ @@ -34,14 +34,14 @@
34 > 34 >
35 <up-input 35 <up-input
36 v-model="workOrderForm.roadName" 36 v-model="workOrderForm.roadName"
37 - disabled 37 + readonly
38 disabled-color="#ffffff" 38 disabled-color="#ffffff"
39 placeholder="请先选择工单位置" 39 placeholder="请先选择工单位置"
40 border="none" 40 border="none"
41 - :placeholder-style="workOrderForm.workLocation ? '' : 'color:#999;'" 41 +
42 ></up-input> 42 ></up-input>
43 <template #right> 43 <template #right>
44 - <up-icon name="arrow-right" size="16" :color="workOrderForm.workLocation ? '#333' : '#999'"></up-icon> 44 + <up-icon name="arrow-right" size="16" ></up-icon>
45 </template> 45 </template>
46 </up-form-item> 46 </up-form-item>
47 47
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 <!-- 新增:紧急程度选择 --> 68 <!-- 新增:紧急程度选择 -->
69 <up-form-item 69 <up-form-item
70 label="紧急程度" 70 label="紧急程度"
71 - prop="pressingType" 71 + prop="pressingTypeName"
72 border-bottom 72 border-bottom
73 required 73 required
74 @click="handleActionSheetOpen('pressingType'); hideKeyboard()" 74 @click="handleActionSheetOpen('pressingType'); hideKeyboard()"
@@ -93,7 +93,7 @@ @@ -93,7 +93,7 @@
93 > 93 >
94 <up-textarea 94 <up-textarea
95 placeholder="请输入情况描述(最多200字)" 95 placeholder="请输入情况描述(最多200字)"
96 - v-model="workOrderForm.problemDesc" 96 + v-model.trim="workOrderForm.problemDesc"
97 count 97 count
98 maxlength="200" 98 maxlength="200"
99 rows="4" 99 rows="4"
@@ -117,11 +117,11 @@ @@ -117,11 +117,11 @@
117 <!-- 完成时间 --> 117 <!-- 完成时间 -->
118 <up-form-item 118 <up-form-item
119 label="希望完成时间" 119 label="希望完成时间"
120 - prop="finishTime" 120 + prop="finishDate"
121 @click="show=true;hideKeyboard()" 121 @click="show=true;hideKeyboard()"
122 > 122 >
123 <up-input 123 <up-input
124 - v-model="workOrderForm.finishTime" 124 + v-model="workOrderForm.finishDate"
125 border="none" 125 border="none"
126 readonly 126 readonly
127 placeholder="点击选择时间" 127 placeholder="点击选择时间"
@@ -154,11 +154,11 @@ @@ -154,11 +154,11 @@
154 <!-- 完成时间选择器 --> 154 <!-- 完成时间选择器 -->
155 <up-datetime-picker 155 <up-datetime-picker
156 :show="show" 156 :show="show"
157 - v-model="finishTime" 157 + v-model="finishDate"
158 mode="datetime" 158 mode="datetime"
159 :min-date="new Date()" 159 :min-date="new Date()"
160 @cancel="show = false" 160 @cancel="show = false"
161 - @confirm="finishTimeConfirm" 161 + @confirm="finishDateConfirm"
162 ></up-datetime-picker> 162 ></up-datetime-picker>
163 </view> 163 </view>
164 </template> 164 </template>
@@ -168,7 +168,7 @@ import { ref, reactive, watch } from &#39;vue&#39; @@ -168,7 +168,7 @@ import { ref, reactive, watch } from &#39;vue&#39;
168 import { onReady, onShow } from '@dcloudio/uni-app'; 168 import { onReady, onShow } from '@dcloudio/uni-app';
169 import { useUploadImgs } from '@/common/utils/useUploadImgs' // 引入改造后的上传逻辑 169 import { useUploadImgs } from '@/common/utils/useUploadImgs' // 引入改造后的上传逻辑
170 import { getRoadListByLatLng } from '@/api/common' 170 import { getRoadListByLatLng } from '@/api/common'
171 -import { createQuick } from '@/api/quick-order/quick-order' 171 +import { workorderCreate } from '@/api/work-order-manage/work-order-manage'
172 import { timeFormat } from '@/uni_modules/uview-plus' 172 import { timeFormat } from '@/uni_modules/uview-plus'
173 173
174 // ========== 表单Ref ========== 174 // ========== 表单Ref ==========
@@ -199,7 +199,7 @@ const currentActionSheetData = reactive({ @@ -199,7 +199,7 @@ const currentActionSheetData = reactive({
199 }) 199 })
200 // 完成时间选择器控制 200 // 完成时间选择器控制
201 const show = ref(false) 201 const show = ref(false)
202 -const finishTime = ref(Date.now()) 202 +const finishDate = ref(Date.now())
203 203
204 // ========== 下拉列表数据 ========== 204 // ========== 下拉列表数据 ==========
205 const roadNameList = ref([]) 205 const roadNameList = ref([])
@@ -212,12 +212,12 @@ const workOrderForm = reactive({ @@ -212,12 +212,12 @@ const workOrderForm = reactive({
212 roadName: '', // 道路名称 212 roadName: '', // 道路名称
213 workLocation: '', // 工单位置 213 workLocation: '', // 工单位置
214 orderName: '', // 工单名称 214 orderName: '', // 工单名称
215 - pressingType: 0, // 紧急程度值(提交接口用) 215 + pressingType: '', // 紧急程度值(提交接口用)
216 pressingTypeName: '', // 紧急程度名称(显示用) 216 pressingTypeName: '', // 紧急程度名称(显示用)
217 problemDesc: '', // 情况描述 217 problemDesc: '', // 情况描述
218 lat: 0, // 纬度 218 lat: 0, // 纬度
219 lon: 0, // 经度 219 lon: 0, // 经度
220 - finishTime: '', // 完成时间 220 + finishDate: '', // 完成时间
221 }) 221 })
222 222
223 // ========== 表单校验规则 ========== 223 // ========== 表单校验规则 ==========
@@ -231,8 +231,8 @@ const workOrderFormRules = reactive({ @@ -231,8 +231,8 @@ const workOrderFormRules = reactive({
231 orderName: [ 231 orderName: [
232 { type: 'string', required: true, message: '请选择工单名称', trigger: ['change', 'blur'] } 232 { type: 'string', required: true, message: '请选择工单名称', trigger: ['change', 'blur'] }
233 ], 233 ],
234 - pressingType: [  
235 - { type: 'number', required: true, message: '请选择紧急程度', trigger: ['change'] } 234 + pressingTypeName: [
  235 + { type: 'string', required: true, message: '请选择紧急程度', trigger: ['change'] }
236 ], 236 ],
237 problemDesc: [ 237 problemDesc: [
238 { type: 'string', required: true, message: '请输入情况描述', trigger: ['change', 'blur'] }, 238 { type: 'string', required: true, message: '请输入情况描述', trigger: ['change', 'blur'] },
@@ -324,7 +324,8 @@ const handleActionSheetSelect = (e) =&gt; { @@ -324,7 +324,8 @@ const handleActionSheetSelect = (e) =&gt; {
324 workOrderFormRef.value?.validateField('orderName') 324 workOrderFormRef.value?.validateField('orderName')
325 break 325 break
326 case 'pressingType': 326 case 'pressingType':
327 - workOrderForm.pressingType = Number(e.value) 327 + console.log(e)
  328 + workOrderForm.pressingType =e.value
328 workOrderForm.pressingTypeName = e.name 329 workOrderForm.pressingTypeName = e.name
329 workOrderFormRef.value?.validateField('pressingType') 330 workOrderFormRef.value?.validateField('pressingType')
330 break 331 break
@@ -393,9 +394,9 @@ const chooseWorkLocation = () =&gt; { @@ -393,9 +394,9 @@ const chooseWorkLocation = () =&gt; {
393 /** 394 /**
394 * 完成时间确认 395 * 完成时间确认
395 */ 396 */
396 -const finishTimeConfirm = (e) => { 397 +const finishDateConfirm = (e) => {
397 console.log('选择的完成时间:', e) 398 console.log('选择的完成时间:', e)
398 - workOrderForm.finishTime = timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss') 399 + workOrderForm.finishDate = timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss')
399 show.value = false 400 show.value = false
400 } 401 }
401 402
@@ -418,17 +419,16 @@ const submitWorkOrder = async () =&gt; { @@ -418,17 +419,16 @@ const submitWorkOrder = async () =&gt; {
418 roadId: workOrderForm.roadId, 419 roadId: workOrderForm.roadId,
419 roadName: workOrderForm.roadName, 420 roadName: workOrderForm.roadName,
420 imgs: problemImgs.getSuccessImgUrls(), // 复用上传逻辑的URL获取方法 421 imgs: problemImgs.getSuccessImgUrls(), // 复用上传逻辑的URL获取方法
421 - remark: workOrderForm.problemDesc, 422 + remark: workOrderForm.problemDesc.trim(),
422 latLonType: 2, 423 latLonType: 2,
423 lat: workOrderForm.lat, 424 lat: workOrderForm.lat,
424 lon: workOrderForm.lon, 425 lon: workOrderForm.lon,
425 lonLatAddress: workOrderForm.workLocation, 426 lonLatAddress: workOrderForm.workLocation,
426 pressingType: workOrderForm.pressingType, 427 pressingType: workOrderForm.pressingType,
427 orderName: workOrderForm.orderName, 428 orderName: workOrderForm.orderName,
428 - finishTime: workOrderForm.finishTime, 429 + finishDate: workOrderForm.finishDate,
429 sourceId: 1, 430 sourceId: 1,
430 sourceName: '园林', 431 sourceName: '园林',
431 - thirdWorkNo: '',  
432 busiLine: 'yl' 432 busiLine: 'yl'
433 } 433 }
434 434
@@ -436,7 +436,7 @@ const submitWorkOrder = async () =&gt; { @@ -436,7 +436,7 @@ const submitWorkOrder = async () =&gt; {
436 uni.showLoading({ title: '提交中...' }) 436 uni.showLoading({ title: '提交中...' })
437 437
438 // 调用提交接口 438 // 调用提交接口
439 - const res = await createQuick(submitData) 439 + const res = await workorderCreate(submitData)
440 440
441 uni.hideLoading() 441 uni.hideLoading()
442 uni.showToast({ 442 uni.showToast({
@@ -448,7 +448,7 @@ const submitWorkOrder = async () =&gt; { @@ -448,7 +448,7 @@ const submitWorkOrder = async () =&gt; {
448 // 延迟跳转 448 // 延迟跳转
449 setTimeout(() => { 449 setTimeout(() => {
450 uni.redirectTo({ 450 uni.redirectTo({
451 - url: '/pages-sub/daily/quick-order/index' 451 + url: '/pages-sub/problem/work-order-manage/index'
452 }) 452 })
453 }, 1000) 453 }, 1000)
454 } catch (error) { 454 } catch (error) {
pages-sub/problem/work-order-manage/index.vue
@@ -11,13 +11,13 @@ @@ -11,13 +11,13 @@
11 inactive-color="#666" 11 inactive-color="#666"
12 font-size="30rpx" 12 font-size="30rpx"
13 13
14 - @change="handleTabChange" 14 + @click="handleTabChange"
15 /> 15 />
16 16
17 <!-- 第二行:下拉框 + 搜索框 --> 17 <!-- 第二行:下拉框 + 搜索框 -->
18 <view class="search-header"> 18 <view class="search-header">
19 <!-- 左侧下拉框 --> 19 <!-- 左侧下拉框 -->
20 - <view class="select-wrap"> 20 + <view class="select-wrap common-text-color">
21 <up-select 21 <up-select
22 v-model:current="selectedSortValue" 22 v-model:current="selectedSortValue"
23 :options="sortOptions" 23 :options="sortOptions"
@@ -55,15 +55,13 @@ @@ -55,15 +55,13 @@
55 55
56 > 56 >
57 <template #empty> 57 <template #empty>
58 - <view class="empty-view" style="padding: 100rpx 0; text-align: center; color: #999;">  
59 - 暂无工单数据  
60 - </view> 58 + <empty-view />
61 </template> 59 </template>
62 60
63 - <view class="common-card-list" slot="top"> 61 + <view class="common-card-list" style="padding-top: 200rpx;padding-bottom: 30rpx">
64 <!-- 待办工单卡片 --> 62 <!-- 待办工单卡片 -->
65 <up-card 63 <up-card
66 - v-if="activeTab === 0" 64 + v-if="activeTab == 1"
67 :border="false" 65 :border="false"
68 :foot-border-top="false" 66 :foot-border-top="false"
69 v-for="(item, index) in orderList" 67 v-for="(item, index) in orderList"
@@ -89,10 +87,10 @@ @@ -89,10 +87,10 @@
89 <view class="u-body-item-title">情况描述:</view> 87 <view class="u-body-item-title">情况描述:</view>
90 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view> 88 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view>
91 </view> 89 </view>
92 - <view class="u-body-item u-flex"> 90 + <view class="u-body-item u-flex common-item-center common-justify-between">
93 <view class="u-body-item-title">紧急程度:</view> 91 <view class="u-body-item-title">紧急程度:</view>
94 <view class="u-line-1 u-body-value"> 92 <view class="u-line-1 u-body-value">
95 - <up-tag :type="getUrgencyType(item.urgencyLevel)">{{ item.urgencyLevel || '普通' }}</up-tag> 93 + {{uni.$dict.getDictLabel('workorder_pressing_type',item.pressingType)}}
96 </view> 94 </view>
97 </view> 95 </view>
98 <view class="u-body-item u-flex"> 96 <view class="u-body-item u-flex">
@@ -109,9 +107,9 @@ @@ -109,9 +107,9 @@
109 </template> 107 </template>
110 </up-card> 108 </up-card>
111 109
112 - <!-- 已办工单卡片 --> 110 + <!-- 已办工单卡片和我发起的 -->
113 <up-card 111 <up-card
114 - v-if="activeTab === 1" 112 + v-if="activeTab == 2||activeTab == 0"
115 :border="false" 113 :border="false"
116 :foot-border-top="false" 114 :foot-border-top="false"
117 v-for="(item, index) in orderList" 115 v-for="(item, index) in orderList"
@@ -137,14 +135,13 @@ @@ -137,14 +135,13 @@
137 <view class="u-body-item-title">情况描述:</view> 135 <view class="u-body-item-title">情况描述:</view>
138 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view> 136 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view>
139 </view> 137 </view>
  138 +
  139 +
140 <view class="u-body-item u-flex common-justify-between common-item-center"> 140 <view class="u-body-item u-flex common-justify-between common-item-center">
141 - <view class="u-flex">  
142 - <view class="u-body-item-title">紧急程度:</view>  
143 - <view class="u-line-1 u-body-value">  
144 - <up-tag :type="getUrgencyType(item.urgencyLevel)">{{ item.urgencyLevel || '普通' }}</up-tag> 141 + <view class="u-body-item-title">紧急程度: {{uni.$dict.getDictLabel('workorder_pressing_type',item.pressingType)}}</view>
  142 + <view class=" ">
  143 + <up-button type="primary" size="mini" @click="handleDetail(item)">工单详情</up-button>
145 </view> 144 </view>
146 - </view>  
147 - <up-button type="info" size="mini" @click="handleDetail(item)">工单详情</up-button>  
148 </view> 145 </view>
149 <view class="u-body-item u-flex"> 146 <view class="u-body-item u-flex">
150 <view class="u-body-item-title">提交时间:</view> 147 <view class="u-body-item-title">提交时间:</view>
@@ -196,16 +193,21 @@ @@ -196,16 +193,21 @@
196 </template> 193 </template>
197 194
198 <script setup> 195 <script setup>
199 -import { ref, computed, onMounted } from 'vue'; 196 +import { ref, computed } from 'vue';
  197 +import { onReady, onShow } from '@dcloudio/uni-app';
200 import { timeFormat } from '@/uni_modules/uview-plus'; 198 import { timeFormat } from '@/uni_modules/uview-plus';
  199 +import { myBuzSimplePage, todoBuzSimplePage, doneBuzSimplePage } from '@/api/work-order-manage/work-order-manage'
201 // 假设从用户store获取角色信息 200 // 假设从用户store获取角色信息
202 import { useUserStore } from '@/pinia/user'; 201 import { useUserStore } from '@/pinia/user';
  202 +import { getDictLabel } from "../../../common/utils/dict";
  203 +import EmptyView from "../../../components/empty-view/empty-view.vue";
203 204
204 // ========== 状态管理 ========== 205 // ========== 状态管理 ==========
205 const userStore = useUserStore(); 206 const userStore = useUserStore();
206 // 标签页切换 207 // 标签页切换
207 -const activeTab = ref(0); // 0-待办 1-已办 208 +const activeTab = ref(0); // 0-我发起的 1-待办 2-已办
208 const tabList = ref([ 209 const tabList = ref([
  210 + { name: '我发起的任务' },
209 { name: '待办' }, 211 { name: '待办' },
210 { name: '已办' } 212 { name: '已办' }
211 ]); 213 ]);
@@ -225,7 +227,7 @@ const orderList = ref([]); @@ -225,7 +227,7 @@ const orderList = ref([]);
225 // 角色控制(巡查员显示新增按钮) 227 // 角色控制(巡查员显示新增按钮)
226 const isInspector = computed(() => { 228 const isInspector = computed(() => {
227 // 假设用户角色字段为role,巡查员标识为inspector 229 // 假设用户角色字段为role,巡查员标识为inspector
228 - return userStore.userInfo.roles === 'yl_inspector'; 230 + return userStore.userInfo.roles.includes('yl_inspector')
229 }); 231 });
230 // 回退弹窗相关 232 // 回退弹窗相关
231 const rejectPopupShow = ref(false); 233 const rejectPopupShow = ref(false);
@@ -235,28 +237,8 @@ const currentRejectItem = ref(null); @@ -235,28 +237,8 @@ const currentRejectItem = ref(null);
235 // 上传地址(根据实际接口配置) 237 // 上传地址(根据实际接口配置)
236 const uploadUrl = ref('https://xxx.com/upload'); 238 const uploadUrl = ref('https://xxx.com/upload');
237 239
238 -// ========== 接口请求 ==========  
239 -// 待办工单接口  
240 -const getTodoOrderList = async (params) => {  
241 - // 替换为实际待办工单接口  
242 - const res = await uni.request({  
243 - url: '/api/order/todo',  
244 - method: 'POST',  
245 - data: params  
246 - });  
247 - return res.data;  
248 -};  
249 240
250 -// 已办工单接口  
251 -const getDoneOrderList = async (params) => {  
252 - // 替换为实际已办工单接口  
253 - const res = await uni.request({  
254 - url: '/api/order/done',  
255 - method: 'POST',  
256 - data: params  
257 - });  
258 - return res.data;  
259 -}; 241 +
260 242
261 // 分页查询列表 243 // 分页查询列表
262 const queryList = async (pageNo, pageSize) => { 244 const queryList = async (pageNo, pageSize) => {
@@ -269,12 +251,15 @@ const queryList = async (pageNo, pageSize) =&gt; { @@ -269,12 +251,15 @@ const queryList = async (pageNo, pageSize) =&gt; {
269 }; 251 };
270 252
271 let res; 253 let res;
272 - if (activeTab.value === 0) { 254 + if (activeTab.value == 0) {
  255 + // 我发起的任务
  256 + res = await myBuzSimplePage(apiParams);
  257 + } else if(activeTab.value == 1) {
273 // 待办工单 258 // 待办工单
274 - res = await getTodoOrderList(apiParams);  
275 - } else { 259 + res = await todoBuzSimplePage(apiParams);
  260 + }else {
276 // 已办工单 261 // 已办工单
277 - res = await getDoneOrderList(apiParams); 262 + res = await doneBuzSimplePage(apiParams);
278 } 263 }
279 264
280 // 适配z-paging分页 265 // 适配z-paging分页
@@ -288,8 +273,9 @@ const queryList = async (pageNo, pageSize) =&gt; { @@ -288,8 +273,9 @@ const queryList = async (pageNo, pageSize) =&gt; {
288 273
289 // ========== 事件处理 ========== 274 // ========== 事件处理 ==========
290 // 标签页切换 275 // 标签页切换
291 -const handleTabChange = (index) => {  
292 - activeTab.value = index; 276 +const handleTabChange = (item) => {
  277 + console.log(item)
  278 + activeTab.value = item.index;
293 paging.value?.reload(); // 切换标签页刷新列表 279 paging.value?.reload(); // 切换标签页刷新列表
294 }; 280 };
295 281
@@ -308,8 +294,9 @@ const handleSearch = (val) =&gt; { @@ -308,8 +294,9 @@ const handleSearch = (val) =&gt; {
308 294
309 // 工单详情 295 // 工单详情
310 const handleDetail = (item) => { 296 const handleDetail = (item) => {
  297 + // 0-我发起的 1-待办 2-已办
311 uni.navigateTo({ 298 uni.navigateTo({
312 - url: `/pages-sub/daily/quick-order/order-detail?id=${item.id}` 299 + url: `/pages-sub/problem/work-order-manage/order-detail?taskId=${item.taskId}&activeTab=${activeTab.value}`
313 }); 300 });
314 }; 301 };
315 302
@@ -381,19 +368,7 @@ const handleAddOrder = () =&gt; { @@ -381,19 +368,7 @@ const handleAddOrder = () =&gt; {
381 }); 368 });
382 }; 369 };
383 370
384 -// 紧急程度标签类型转换  
385 -const getUrgencyType = (level) => {  
386 - switch (level) {  
387 - case '紧急':  
388 - return 'danger';  
389 - case '重要':  
390 - return 'warning';  
391 - case '普通':  
392 - return 'info';  
393 - default:  
394 - return 'default';  
395 - }  
396 -}; 371 +
397 372
398 // 上传图片-读取后 373 // 上传图片-读取后
399 const handleAfterRead = (file) => { 374 const handleAfterRead = (file) => {
@@ -406,7 +381,7 @@ const handleDeleteFile = (index) =&gt; { @@ -406,7 +381,7 @@ const handleDeleteFile = (index) =&gt; {
406 }; 381 };
407 382
408 // 页面初始化 383 // 页面初始化
409 -onMounted(() => { 384 +onShow(() => {
410 // 初始化加载列表 385 // 初始化加载列表
411 paging.value?.reload(); 386 paging.value?.reload();
412 }); 387 });
@@ -415,13 +390,12 @@ onMounted(() =&gt; { @@ -415,13 +390,12 @@ onMounted(() =&gt; {
415 <style scoped lang="scss"> 390 <style scoped lang="scss">
416 .page-container { 391 .page-container {
417 min-height: 100vh; 392 min-height: 100vh;
418 - background-color: #f8f8f8;  
419 } 393 }
420 394
421 // 顶部固定区域 395 // 顶部固定区域
422 .header-wrap { 396 .header-wrap {
423 background-color: #fff; 397 background-color: #fff;
424 - box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); 398 + //box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
425 } 399 }
426 400
427 // 搜索栏样式 401 // 搜索栏样式
@@ -450,98 +424,5 @@ onMounted(() =&gt; { @@ -450,98 +424,5 @@ onMounted(() =&gt; {
450 } 424 }
451 } 425 }
452 426
453 -// 工单卡片样式  
454 -.common-card-list {  
455 - padding: 20rpx;  
456 -}  
457 -  
458 -.order-card {  
459 - margin-bottom: 20rpx;  
460 - background-color: #fff;  
461 - border-radius: 12rpx;  
462 - overflow: hidden;  
463 -}  
464 -  
465 -.card-body {  
466 - padding: 20rpx;  
467 -  
468 - .u-body-item {  
469 - margin-bottom: 16rpx;  
470 - font-size: 28rpx;  
471 -  
472 - &:last-child {  
473 - margin-bottom: 0;  
474 - }  
475 -  
476 - .u-body-item-title {  
477 - color: #666;  
478 - min-width: 120rpx;  
479 - }  
480 -  
481 - .u-body-value {  
482 - color: #333;  
483 - flex: 1;  
484 - }  
485 - }  
486 -  
487 - .mt-20 {  
488 - margin-top: 20rpx;  
489 - }  
490 -}  
491 -  
492 -// 公共flex样式  
493 -.u-flex {  
494 - display: flex;  
495 - align-items: center;  
496 -}  
497 -  
498 -.common-justify-between {  
499 - justify-content: space-between;  
500 -}  
501 427
502 -.common-item-center {  
503 - align-items: center;  
504 -}  
505 -  
506 -// 底部按钮  
507 -.fixed-bottom-btn-wrap {  
508 - position: fixed;  
509 - bottom: 0;  
510 - left: 0;  
511 - right: 0;  
512 - padding: 20rpx;  
513 - background-color: #fff;  
514 - box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);  
515 -  
516 - :deep(.u-button) {  
517 - width: 100%;  
518 - height: 88rpx;  
519 - font-size: 32rpx;  
520 - }  
521 -}  
522 -  
523 -// 回退弹窗样式  
524 -.reject-popup {  
525 - width: 680rpx;  
526 - padding: 30rpx;  
527 - background-color: #fff;  
528 - border-radius: 12rpx;  
529 -  
530 - .popup-title {  
531 - font-size: 32rpx;  
532 - font-weight: 600;  
533 - color: #333;  
534 - }  
535 -  
536 - .upload-title {  
537 - font-size: 28rpx;  
538 - color: #666;  
539 - margin-bottom: 10rpx;  
540 - }  
541 -  
542 - .popup-btn-wrap {  
543 - display: flex;  
544 - justify-content: flex-end;  
545 - }  
546 -}  
547 </style> 428 </style>
548 \ No newline at end of file 429 \ No newline at end of file
pages-sub/problem/work-order-manage/order-detail.vue 0 → 100644
  1 +<template>
  2 + <view class="page-container">
  3 + <!-- 页面级加载组件 -->
  4 + <up-loading-page
  5 + v-if="loading"
  6 + :loading="true"
  7 + title="加载中..."
  8 + color="#3c9cff"
  9 + ></up-loading-page>
  10 +
  11 + <!-- 主内容容器 -->
  12 + <view v-else class="main-content">
  13 + <!-- 顶部固定Tabs -->
  14 + <up-tabs
  15 + v-model="activeTopTab"
  16 + :list="topTabList"
  17 + :scrollable="false"
  18 + sticky
  19 + active-color="#3c9cff"
  20 + inactive-color="#666"
  21 + class="top-tabs"
  22 + @click="activeTopTabClick"
  23 + ></up-tabs>
  24 +
  25 + <!-- 顶部Tab内容区 -->
  26 + <view class="tab-content">
  27 + <!-- 1. 工单详情Tab -->
  28 + <view v-show="activeTopTab == 0" class="detail-content">
  29 + <up-cell-group :border="false" class="detail-cell-group">
  30 + <!-- 工单编号 -->
  31 + <up-cell title="工单编号" :value="orderDetail.orderNo || '--'" align="middle"></up-cell>
  32 + <!-- 工单位置 -->
  33 +
  34 + <up-cell align="middle">
  35 +
  36 + <template #title>
  37 + <view style="min-width: 200rpx">工单位置</view>
  38 + </template>
  39 + <template #value>
  40 + <view class="common-text-color up-line-1">{{ orderDetail.roadName || '--' }}</view>
  41 + </template>
  42 + </up-cell>
  43 + <!-- 工单名称 -->
  44 + <up-cell title="工单名称" :value="orderDetail.orderName || '--'" align="middle"></up-cell>
  45 + <!-- 情况描述 -->
  46 + <up-cell >
  47 + <template #title>
  48 + <view style="min-width: 200rpx">情况描述</view>
  49 + </template>
  50 + <template #value>
  51 + <view class="common-text-color up-line-1">{{ orderDetail.remark || '--' }}</view>
  52 + </template>
  53 + </up-cell>
  54 + <!-- 紧急程度 -->
  55 + <up-cell
  56 + title="紧急程度"
  57 + :value="uni.$dict.getDictLabel('workorder_pressing_type', orderDetail.pressingType) || '--'"
  58 + align="middle"
  59 + ></up-cell>
  60 +
  61 + <!-- 问题照片 -->
  62 + <up-cell title="问题照片">
  63 + <template #value>
  64 + <view class="cell-content-wrap">
  65 + <up-album
  66 + v-if="!!orderDetail.problemImgsList?.length"
  67 + :urls="orderDetail.problemImgsList.slice(0, 3)"
  68 + singleSize="70"
  69 + :preview-full-image="true"
  70 + ></up-album>
  71 + <text v-else class="empty-text">暂无问题照片</text>
  72 + </view>
  73 + </template>
  74 + </up-cell>
  75 + <!-- 希望完成时间 -->
  76 + <up-cell
  77 + title="希望完成时间"
  78 + :value="timeFormat(orderDetail.finishDate, 'yyyy-mm-dd hh:MM:ss') || '--'"
  79 + align="middle"
  80 + :border="false"
  81 + ></up-cell>
  82 + </up-cell-group>
  83 +
  84 +
  85 + <!-- 图片分类Tabs区块 -->
  86 +<!-- <view class="img-tabs-block">-->
  87 +<!-- <up-tabs-->
  88 +<!-- v-model="activeImgTab"-->
  89 +<!-- :list="imgTabList"-->
  90 +<!-- :scrollable="false"-->
  91 +<!-- active-color="#3c9cff"-->
  92 +<!-- inactive-color="#666"-->
  93 +<!-- class="img-tabs"-->
  94 +<!-- ></up-tabs>-->
  95 +
  96 +<!-- &lt;!&ndash; 图片Tab内容区 &ndash;&gt;-->
  97 +<!-- <view class="img-tab-content">-->
  98 +<!-- <up-album-->
  99 +<!-- v-if="getCurrentImgList().length"-->
  100 +<!-- :urls="getCurrentImgList().slice(0, 3)"-->
  101 +<!-- singleSize="100"-->
  102 +<!-- :preview-full-image="true"-->
  103 +<!-- class="img-album"-->
  104 +<!-- ></up-album>-->
  105 +<!-- <text v-else class="empty-img-text">暂无{{ imgTabList[activeImgTab].name }}图片</text>-->
  106 +<!-- </view>-->
  107 +<!-- </view>-->
  108 + </view>
  109 +
  110 + <!-- 2. 流程节点Tab -->
  111 + <view v-show="activeTopTab == 1" class="process-content">
  112 + <up-empty
  113 + mode="data"
  114 +
  115 + ></up-empty>
  116 + <!-- 可根据实际需求补充流程节点展示逻辑 -->
  117 + </view>
  118 + </view>
  119 + </view>
  120 + </view>
  121 +</template>
  122 +
  123 +<script setup lang="ts">
  124 +import { ref, reactive, computed } from 'vue';
  125 +import { onLoad } from '@dcloudio/uni-app';
  126 +import { timeFormat } from '@/uni_modules/uview-plus';
  127 +import { getMyTaskDetail, getDoneTaskDetail, getTodoTaskDetail } from '@/api/work-order-manage/work-order-manage';
  128 +
  129 +// 状态管理
  130 +const loading = ref(true);
  131 +const activeTopTab = ref(0); // 顶部Tab激活索引
  132 +const activeImgTab = ref(0); // 图片分类Tab激活索引
  133 +
  134 +// 顶部Tab列表
  135 +const topTabList = ref([
  136 + { name: '工单详情' },
  137 + { name: '流程节点' }
  138 +]);
  139 +
  140 +const activeTopTabClick = (item)=>{
  141 + console.log(item)
  142 + activeTopTab.value = item.index
  143 +}
  144 +
  145 +// 图片分类Tab列表(带角标配置)
  146 +const imgTabList = ref([
  147 + { name: '开始', badge: { isDot: true } },
  148 + { name: '进行中' },
  149 + { name: '结束', badge: { isDot: true } },
  150 + { name: '人员' },
  151 + { name: '材料' }
  152 +]);
  153 +
  154 +// 工单详情数据
  155 +const orderDetail = ref({});
  156 +
  157 +/**
  158 + * 获取当前激活的图片列表
  159 + */
  160 +const getCurrentImgList = computed(() => {
  161 + const tabKeyMap = ['startImgs', 'processingImgs', 'endImgs', 'personImgs', 'materialImgs'];
  162 + return orderDetail[tabKeyMap[activeImgTab.value]] || [];
  163 +});
  164 +
  165 +/**
  166 + * 获取工单详情
  167 + */
  168 +const getMyTaskDetailQuery = async (taskId) => {
  169 + try {
  170 + loading.value = true;
  171 + const res = await getMyTaskDetail({ taskId });
  172 + console.log('工单详情接口返回:', res);
  173 + orderDetail.value = res
  174 +
  175 + } catch (error) {
  176 + console.error('获取工单详情失败:', error);
  177 + uni.showToast({ title: '加载失败,请重试', icon: 'none' });
  178 + } finally {
  179 + loading.value = false;
  180 + }
  181 +};
  182 +
  183 +// 页面加载
  184 +onLoad((options) => {
  185 + console.log(options)
  186 + const { taskId, activeTab } = options;
  187 + // 0-我发起的 1-待办 2-已办
  188 + console.log(taskId)
  189 + if(activeTab==0){
  190 + getMyTaskDetailQuery(taskId);
  191 + }
  192 +
  193 +});
  194 +</script>
  195 +
  196 +<style scoped lang="scss">
  197 +// 全局样式
  198 +.page-container {
  199 + min-height: 100vh;
  200 +
  201 +}
  202 +
  203 +// 主内容容器
  204 +.main-content {
  205 + padding-bottom: 20rpx;
  206 +}
  207 +
  208 +// 顶部Tabs
  209 +.top-tabs {
  210 + //background-color: #fff;
  211 +}
  212 +
  213 +// Tab内容区
  214 +.tab-content {
  215 + padding: 16rpx;
  216 +}
  217 +
  218 +// 工单详情内容
  219 +.detail-content {
  220 + .detail-cell-group {
  221 + background-color: #fff;
  222 +
  223 + margin-bottom: 20rpx;
  224 + }
  225 +
  226 +
  227 + .cell-content-wrap {
  228 + //display: flex;
  229 + //flex-wrap: wrap;
  230 + //gap: 12rpx;
  231 + }
  232 +
  233 +
  234 +}
  235 +
  236 +// 图片分类Tabs区块
  237 +.img-tabs-block {
  238 + background-color: #fff;
  239 + border-radius: 12rpx;
  240 + padding: 16rpx;
  241 +
  242 + // 图片Tabs样式(平均分配空间)
  243 + .img-tabs {
  244 + --u-tabs-item-flex: 1; // 平均分配空间
  245 + --u-tabs-item-font-size: 26rpx;
  246 + --u-tabs-item-height: 72rpx;
  247 + margin-bottom: 16rpx;
  248 + }
  249 +
  250 + // 图片内容区
  251 + .img-tab-content {
  252 + padding: 10rpx 0;
  253 + min-height: 120rpx;
  254 + display: flex;
  255 + align-items: center;
  256 + justify-content: center;
  257 +
  258 + .img-album {
  259 + width: 100%;
  260 + }
  261 +
  262 + }
  263 +}
  264 +
  265 +// 流程节点空状态
  266 +.process-content {
  267 + .empty-process {
  268 + margin-top: 100rpx;
  269 + }
  270 +}
  271 +</style>
0 \ No newline at end of file 272 \ No newline at end of file
pages.json
@@ -129,6 +129,11 @@ @@ -129,6 +129,11 @@
129 "style": { "navigationBarTitleText": "新增工单" } 129 "style": { "navigationBarTitleText": "新增工单" }
130 }, 130 },
131 131
  132 + {
  133 + "path": "work-order-manage/order-detail",
  134 + "style": { "navigationBarTitleText": "工单详情" }
  135 + },
  136 +
132 137
133 { 138 {
134 "path": "problem-allot/index", 139 "path": "problem-allot/index",