Commit ff65dc6ca5723f810c101e28c4a66db4fd6a0df0

Authored by 刘淇
1 parent c7df828a

快速工单 样式优化

pages-sub/daily/maintain-manage/add-record.vue
... ... @@ -13,8 +13,8 @@
13 13 class="form-item"
14 14 >
15 15 <up-textarea
16   - v-model="inspectForm.remark"
17   - placeholder="请输入巡查描述"
  16 + v-model.trim="inspectForm.remark"
  17 + placeholder="请输入养护描述"
18 18 maxlength="200"
19 19 count
20 20 ></up-textarea>
... ... @@ -25,7 +25,7 @@
25 25 label="上传图片"
26 26 prop="images"
27 27 required
28   - border-bottom
  28 +
29 29 class="form-item"
30 30 >
31 31 <up-upload
... ... @@ -41,27 +41,27 @@
41 41 ></up-upload>
42 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 65 </up-form>
66 66 </view>
67 67  
... ... @@ -94,7 +94,7 @@ export default {
94 94 initProgress: 0,
95 95 inspectForm: {
96 96 remark: '',
97   - progress: 0
  97 + // progress: 0
98 98 },
99 99 paramsOptins: {},
100 100 inspectFormRules: {
... ... @@ -144,10 +144,10 @@ export default {
144 144 onLoad(option) {
145 145 console.log('页面参数:', option)
146 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 151 console.log('初始进度值:', this.initProgress)
152 152 },
153 153 onReady() {
... ... @@ -278,18 +278,18 @@ export default {
278 278 * 提交巡查表单
279 279 */
280 280 async submitInspect() {
281   - console.log('当前完成进度:', this.inspectForm.progress)
  281 + // console.log('当前完成进度:', this.inspectForm.progress)
282 282 try {
283 283 await this.$refs.inspectFormRef.validate()
284 284 console.log('图片列表:', this.imagesList)
285 285  
286 286 const submitData = {
287   - totalFinishPercent: this.inspectForm.progress,
  287 + totalFinishPercent: 100,
288 288 "planNo": this.paramsOptins.planNo,
289 289 "imgHost": "1",
290 290 "beginImg": this.getImgUrlList(this.imagesList),
291 291 "commonUserList": [],
292   - "remark": this.inspectForm.remark
  292 + "remark": this.inspectForm.remark.trim()
293 293 }
294 294  
295 295 uni.showLoading({ title: '提交中...' })
... ...
pages-sub/daily/maintain-manage/pending-plan-detail.vue
... ... @@ -40,7 +40,7 @@
40 40  
41 41 <!-- 已完成次数 + 查看记录按钮 -->
42 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 44 <view class="u-line-1">
45 45 <up-button
46 46 type="primary"
... ...
pages-sub/daily/maintain-manage/road-detail-list.vue
... ... @@ -114,10 +114,10 @@
114 114 </view>
115 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 122 <view class="u-body-item u-flex">
123 123 <view class="u-body-item-title">计划有效期:</view>
... ...
pages-sub/daily/patrol-manage/index.vue
... ... @@ -61,6 +61,8 @@
61 61 <view class="u-line-1 u-body-value">{{ item.roadName || '-' }}</view>
62 62 </view>
63 63  
  64 +
  65 +
64 66 <view class="u-body-item u-flex">
65 67 <view class="u-body-item-title">所属街道:</view>
66 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 5 label-position="left"
6 6 :model="workOrderForm"
7 7 ref="workOrderFormRef"
8   - labelWidth="160rpx"
  8 + labelWidth="190rpx"
9 9 >
10 10 <!-- 1. 工单位置(地图选择) -->
11 11 <up-form-item
... ... @@ -34,14 +34,14 @@
34 34 >
35 35 <up-input
36 36 v-model="workOrderForm.roadName"
37   - disabled
  37 + readonly
38 38 disabled-color="#ffffff"
39 39 placeholder="请先选择工单位置"
40 40 border="none"
41   - :placeholder-style="workOrderForm.workLocation ? '' : 'color:#999;'"
  41 +
42 42 ></up-input>
43 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 45 </template>
46 46 </up-form-item>
47 47  
... ... @@ -68,7 +68,7 @@
68 68 <!-- 新增:紧急程度选择 -->
69 69 <up-form-item
70 70 label="紧急程度"
71   - prop="pressingType"
  71 + prop="pressingTypeName"
72 72 border-bottom
73 73 required
74 74 @click="handleActionSheetOpen('pressingType'); hideKeyboard()"
... ... @@ -93,7 +93,7 @@
93 93 >
94 94 <up-textarea
95 95 placeholder="请输入情况描述(最多200字)"
96   - v-model="workOrderForm.problemDesc"
  96 + v-model.trim="workOrderForm.problemDesc"
97 97 count
98 98 maxlength="200"
99 99 rows="4"
... ... @@ -117,11 +117,11 @@
117 117 <!-- 完成时间 -->
118 118 <up-form-item
119 119 label="希望完成时间"
120   - prop="finishTime"
  120 + prop="finishDate"
121 121 @click="show=true;hideKeyboard()"
122 122 >
123 123 <up-input
124   - v-model="workOrderForm.finishTime"
  124 + v-model="workOrderForm.finishDate"
125 125 border="none"
126 126 readonly
127 127 placeholder="点击选择时间"
... ... @@ -154,11 +154,11 @@
154 154 <!-- 完成时间选择器 -->
155 155 <up-datetime-picker
156 156 :show="show"
157   - v-model="finishTime"
  157 + v-model="finishDate"
158 158 mode="datetime"
159 159 :min-date="new Date()"
160 160 @cancel="show = false"
161   - @confirm="finishTimeConfirm"
  161 + @confirm="finishDateConfirm"
162 162 ></up-datetime-picker>
163 163 </view>
164 164 </template>
... ... @@ -168,7 +168,7 @@ import { ref, reactive, watch } from &#39;vue&#39;
168 168 import { onReady, onShow } from '@dcloudio/uni-app';
169 169 import { useUploadImgs } from '@/common/utils/useUploadImgs' // 引入改造后的上传逻辑
170 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 172 import { timeFormat } from '@/uni_modules/uview-plus'
173 173  
174 174 // ========== 表单Ref ==========
... ... @@ -199,7 +199,7 @@ const currentActionSheetData = reactive({
199 199 })
200 200 // 完成时间选择器控制
201 201 const show = ref(false)
202   -const finishTime = ref(Date.now())
  202 +const finishDate = ref(Date.now())
203 203  
204 204 // ========== 下拉列表数据 ==========
205 205 const roadNameList = ref([])
... ... @@ -212,12 +212,12 @@ const workOrderForm = reactive({
212 212 roadName: '', // 道路名称
213 213 workLocation: '', // 工单位置
214 214 orderName: '', // 工单名称
215   - pressingType: 0, // 紧急程度值(提交接口用)
  215 + pressingType: '', // 紧急程度值(提交接口用)
216 216 pressingTypeName: '', // 紧急程度名称(显示用)
217 217 problemDesc: '', // 情况描述
218 218 lat: 0, // 纬度
219 219 lon: 0, // 经度
220   - finishTime: '', // 完成时间
  220 + finishDate: '', // 完成时间
221 221 })
222 222  
223 223 // ========== 表单校验规则 ==========
... ... @@ -231,8 +231,8 @@ const workOrderFormRules = reactive({
231 231 orderName: [
232 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 237 problemDesc: [
238 238 { type: 'string', required: true, message: '请输入情况描述', trigger: ['change', 'blur'] },
... ... @@ -324,7 +324,8 @@ const handleActionSheetSelect = (e) =&gt; {
324 324 workOrderFormRef.value?.validateField('orderName')
325 325 break
326 326 case 'pressingType':
327   - workOrderForm.pressingType = Number(e.value)
  327 + console.log(e)
  328 + workOrderForm.pressingType =e.value
328 329 workOrderForm.pressingTypeName = e.name
329 330 workOrderFormRef.value?.validateField('pressingType')
330 331 break
... ... @@ -393,9 +394,9 @@ const chooseWorkLocation = () =&gt; {
393 394 /**
394 395 * 完成时间确认
395 396 */
396   -const finishTimeConfirm = (e) => {
  397 +const finishDateConfirm = (e) => {
397 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 400 show.value = false
400 401 }
401 402  
... ... @@ -418,17 +419,16 @@ const submitWorkOrder = async () =&gt; {
418 419 roadId: workOrderForm.roadId,
419 420 roadName: workOrderForm.roadName,
420 421 imgs: problemImgs.getSuccessImgUrls(), // 复用上传逻辑的URL获取方法
421   - remark: workOrderForm.problemDesc,
  422 + remark: workOrderForm.problemDesc.trim(),
422 423 latLonType: 2,
423 424 lat: workOrderForm.lat,
424 425 lon: workOrderForm.lon,
425 426 lonLatAddress: workOrderForm.workLocation,
426 427 pressingType: workOrderForm.pressingType,
427 428 orderName: workOrderForm.orderName,
428   - finishTime: workOrderForm.finishTime,
  429 + finishDate: workOrderForm.finishDate,
429 430 sourceId: 1,
430 431 sourceName: '园林',
431   - thirdWorkNo: '',
432 432 busiLine: 'yl'
433 433 }
434 434  
... ... @@ -436,7 +436,7 @@ const submitWorkOrder = async () =&gt; {
436 436 uni.showLoading({ title: '提交中...' })
437 437  
438 438 // 调用提交接口
439   - const res = await createQuick(submitData)
  439 + const res = await workorderCreate(submitData)
440 440  
441 441 uni.hideLoading()
442 442 uni.showToast({
... ... @@ -448,7 +448,7 @@ const submitWorkOrder = async () =&gt; {
448 448 // 延迟跳转
449 449 setTimeout(() => {
450 450 uni.redirectTo({
451   - url: '/pages-sub/daily/quick-order/index'
  451 + url: '/pages-sub/problem/work-order-manage/index'
452 452 })
453 453 }, 1000)
454 454 } catch (error) {
... ...
pages-sub/problem/work-order-manage/index.vue
... ... @@ -11,13 +11,13 @@
11 11 inactive-color="#666"
12 12 font-size="30rpx"
13 13  
14   - @change="handleTabChange"
  14 + @click="handleTabChange"
15 15 />
16 16  
17 17 <!-- 第二行:下拉框 + 搜索框 -->
18 18 <view class="search-header">
19 19 <!-- 左侧下拉框 -->
20   - <view class="select-wrap">
  20 + <view class="select-wrap common-text-color">
21 21 <up-select
22 22 v-model:current="selectedSortValue"
23 23 :options="sortOptions"
... ... @@ -55,15 +55,13 @@
55 55  
56 56 >
57 57 <template #empty>
58   - <view class="empty-view" style="padding: 100rpx 0; text-align: center; color: #999;">
59   - 暂无工单数据
60   - </view>
  58 + <empty-view />
61 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 63 <up-card
66   - v-if="activeTab === 0"
  64 + v-if="activeTab == 1"
67 65 :border="false"
68 66 :foot-border-top="false"
69 67 v-for="(item, index) in orderList"
... ... @@ -89,10 +87,10 @@
89 87 <view class="u-body-item-title">情况描述:</view>
90 88 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view>
91 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 91 <view class="u-body-item-title">紧急程度:</view>
94 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 94 </view>
97 95 </view>
98 96 <view class="u-body-item u-flex">
... ... @@ -109,9 +107,9 @@
109 107 </template>
110 108 </up-card>
111 109  
112   - <!-- 已办工单卡片 -->
  110 + <!-- 已办工单卡片和我发起的 -->
113 111 <up-card
114   - v-if="activeTab === 1"
  112 + v-if="activeTab == 2||activeTab == 0"
115 113 :border="false"
116 114 :foot-border-top="false"
117 115 v-for="(item, index) in orderList"
... ... @@ -137,14 +135,13 @@
137 135 <view class="u-body-item-title">情况描述:</view>
138 136 <view class="u-line-1 u-body-value">{{ item.remark || '无' }}</view>
139 137 </view>
  138 +
  139 +
140 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 144 </view>
146   - </view>
147   - <up-button type="info" size="mini" @click="handleDetail(item)">工单详情</up-button>
148 145 </view>
149 146 <view class="u-body-item u-flex">
150 147 <view class="u-body-item-title">提交时间:</view>
... ... @@ -196,16 +193,21 @@
196 193 </template>
197 194  
198 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 198 import { timeFormat } from '@/uni_modules/uview-plus';
  199 +import { myBuzSimplePage, todoBuzSimplePage, doneBuzSimplePage } from '@/api/work-order-manage/work-order-manage'
201 200 // 假设从用户store获取角色信息
202 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 206 const userStore = useUserStore();
206 207 // 标签页切换
207   -const activeTab = ref(0); // 0-待办 1-已办
  208 +const activeTab = ref(0); // 0-我发起的 1-待办 2-已办
208 209 const tabList = ref([
  210 + { name: '我发起的任务' },
209 211 { name: '待办' },
210 212 { name: '已办' }
211 213 ]);
... ... @@ -225,7 +227,7 @@ const orderList = ref([]);
225 227 // 角色控制(巡查员显示新增按钮)
226 228 const isInspector = computed(() => {
227 229 // 假设用户角色字段为role,巡查员标识为inspector
228   - return userStore.userInfo.roles === 'yl_inspector';
  230 + return userStore.userInfo.roles.includes('yl_inspector')
229 231 });
230 232 // 回退弹窗相关
231 233 const rejectPopupShow = ref(false);
... ... @@ -235,28 +237,8 @@ const currentRejectItem = ref(null);
235 237 // 上传地址(根据实际接口配置)
236 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 244 const queryList = async (pageNo, pageSize) => {
... ... @@ -269,12 +251,15 @@ const queryList = async (pageNo, pageSize) =&gt; {
269 251 };
270 252  
271 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 265 // 适配z-paging分页
... ... @@ -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 279 paging.value?.reload(); // 切换标签页刷新列表
294 280 };
295 281  
... ... @@ -308,8 +294,9 @@ const handleSearch = (val) =&gt; {
308 294  
309 295 // 工单详情
310 296 const handleDetail = (item) => {
  297 + // 0-我发起的 1-待办 2-已办
311 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 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 374 const handleAfterRead = (file) => {
... ... @@ -406,7 +381,7 @@ const handleDeleteFile = (index) =&gt; {
406 381 };
407 382  
408 383 // 页面初始化
409   -onMounted(() => {
  384 +onShow(() => {
410 385 // 初始化加载列表
411 386 paging.value?.reload();
412 387 });
... ... @@ -415,13 +390,12 @@ onMounted(() =&gt; {
415 390 <style scoped lang="scss">
416 391 .page-container {
417 392 min-height: 100vh;
418   - background-color: #f8f8f8;
419 393 }
420 394  
421 395 // 顶部固定区域
422 396 .header-wrap {
423 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 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 428 </style>
548 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 272 \ No newline at end of file
... ...
pages.json
... ... @@ -129,6 +129,11 @@
129 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 139 "path": "problem-allot/index",
... ...