Commit 4fa8cf1240ee3948c9e8e08feaa3ee8426820f51

Authored by 刘淇
1 parent cf0c3fb3

巡查员结束工单

common/utils/common.js
... ... @@ -40,4 +40,29 @@ export const nextStepMap = {
40 40 backShow: false,
41 41 renewShow: true
42 42 },
  43 +}
  44 +
  45 +// ylTeamLeader 养护组长退回:210
  46 +// ylTeamLeader 养护组长分配:110
  47 +// ylInspectorStart 巡查员结束工单:200
  48 +// ylInspectorStart 巡查员重新发起:100
  49 +// ylWorker 养护员退回 :220
  50 +// ylWorker 养护员实施 :120
  51 +// ylTeamLeaderConfirm 养护组长验收通过: 130
  52 +// ylTeamLeaderConfirm 养护组长验收不通过:230
  53 +// ylInspector 巡查员验收通过:140
  54 +// ylInspector 巡查员验收不通过:240
  55 +
  56 +export const buzStatusMap = {
  57 + '000' :'巡查员发起',
  58 + "210" : '养护组长退回',
  59 + "110" : '养护组长分配',
  60 + "200" : '巡查员结束工单',
  61 + "100" : '巡查员重新发起',
  62 + "220" : '养护员退回',
  63 + "120" : '养护员实施',
  64 + "130" : '养护组长验收通过',
  65 + "230" : '养护组长验收不通过',
  66 + "140" : '巡查员验收通过',
  67 + "240" : '巡查员验收不通过',
43 68 }
44 69 \ No newline at end of file
... ...
pages-sub/daily/maintain-manage/add-record.vue
... ... @@ -302,7 +302,7 @@ export default {
302 302 })
303 303  
304 304 setTimeout(() => {
305   - uni.redirectTo({
  305 + uni.reLaunch({
306 306 url: '/pages-sub/daily/maintain-manage/index'
307 307 })
308 308 }, 1000)
... ...
pages-sub/daily/patrol-manage/add-patrol-record.vue
... ... @@ -291,7 +291,7 @@ export default {
291 291  
292 292 // // 延迟跳转(等待提示框显示完成)
293 293 setTimeout(() => {
294   - uni.redirectTo({
  294 + uni.reLaunch({
295 295 url: '/pages-sub/daily/patrol-manage/index'
296 296 })
297 297 }, 1000)
... ...
pages-sub/daily/quick-order/add-order.vue
... ... @@ -476,7 +476,7 @@ export default {
476 476  
477 477 // 延迟跳转(等待提示框显示完成)
478 478 setTimeout(() => {
479   - uni.redirectTo({
  479 + uni.reLaunch({
480 480 url: '/pages-sub/daily/quick-order/index'
481 481 })
482 482 }, 1000)
... ...
pages-sub/problem/work-order-manage/add-maintain-order.vue
... ... @@ -770,7 +770,7 @@ const submitWorkOrder = async () => {
770 770  
771 771 // 延迟跳转
772 772 setTimeout(() => {
773   - uni.redirectTo({
  773 + uni.reLaunch({
774 774 url: '/pages-sub/problem/work-order-manage/index'
775 775 })
776 776 }, 1000)
... ...
pages-sub/problem/work-order-manage/add-order.vue
... ... @@ -552,7 +552,7 @@ const submitWorkOrder = async () => {
552 552  
553 553 // 延迟跳转回列表页
554 554 setTimeout(() => {
555   - uni.redirectTo({
  555 + uni.reLaunch({
556 556 url: '/pages-sub/problem/work-order-manage/index'
557 557 })
558 558 }, 1000)
... ...
pages-sub/problem/work-order-manage/index.vue
... ... @@ -92,6 +92,10 @@
92 92 </view>
93 93 </view>
94 94 <view class="u-body-item u-flex">
  95 + <view class="u-body-item-title">工单状态:</view>
  96 + <view class="u-line-1 u-body-value">{{buzStatusMap[item.buzStatus] }}</view>
  97 + </view>
  98 + <view class="u-body-item u-flex">
95 99 <view class="u-body-item-title">提交时间:</view>
96 100 <view class="u-line-1 u-body-value">{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
97 101 </view>
... ... @@ -153,6 +157,10 @@
153 157 </view>
154 158 </view>
155 159 <view class="u-body-item u-flex">
  160 + <view class="u-body-item-title">工单状态:</view>
  161 + <view class="u-line-1 u-body-value">{{buzStatusMap[item.buzStatus] }}</view>
  162 + </view>
  163 + <view class="u-body-item u-flex">
156 164 <view class="u-body-item-title">提交时间:</view>
157 165 <view class="u-line-1 u-body-value">{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
158 166 </view>
... ... @@ -189,23 +197,23 @@
189 197 maxlength="200"
190 198 class="reject-textarea"
191 199 />
192   - <!-- 上传图片(选填)- 按照参考页面改造 -->
193   - <view class="upload-wrap mt-20">
194   - <view class="upload-title">上传图片(选填)</view>
195   - <up-upload
196   - :file-list="rejectImgs.imgList"
197   - @after-read="rejectImgs.uploadImgs"
198   - @delete="rejectImgs.deleteImg"
199   - multiple
200   - :max-count="rejectImgs.uploadConfig.maxCount"
201   - :upload-text="rejectImgs.uploadConfig.uploadText"
202   - :size-type="rejectImgs.uploadConfig.sizeType"
203   - />
204   - </view>
  200 +<!-- &lt;!&ndash; 上传图片(选填)- 按照参考页面改造 &ndash;&gt;-->
  201 +<!-- <view class="upload-wrap mt-20">-->
  202 +<!-- <view class="upload-title">上传图片(选填)</view>-->
  203 +<!-- <up-upload-->
  204 +<!-- :file-list="rejectImgs.imgList"-->
  205 +<!-- @after-read="rejectImgs.uploadImgs"-->
  206 +<!-- @delete="rejectImgs.deleteImg"-->
  207 +<!-- multiple-->
  208 +<!-- :max-count="rejectImgs.uploadConfig.maxCount"-->
  209 +<!-- :upload-text="rejectImgs.uploadConfig.uploadText"-->
  210 +<!-- :size-type="rejectImgs.uploadConfig.sizeType"-->
  211 +<!-- />-->
  212 +<!-- </view>-->
205 213 </view>
206 214 </up-modal>
207 215  
208   - <!-- 养护组长验收弹窗 up-modal -->
  216 + <!-- 验收弹窗 up-modal -->
209 217 <up-modal
210 218 :show="acceptModalShow"
211 219 title="验收"
... ... @@ -252,7 +260,7 @@ import {
252 260 } from '@/api/work-order-manage/work-order-manage'
253 261 // 假设从用户store获取角色信息
254 262 import { useUserStore } from '@/pinia/user';
255   -import { nextStepMap } from '@/common/utils/common'
  263 +import { nextStepMap, buzStatusMap } from '@/common/utils/common'
256 264 // 引入图片上传组合式函数(与参考页面一致)
257 265 import { useUploadImgs } from '@/common/utils/useUploadImgs'
258 266  
... ... @@ -453,9 +461,9 @@ const handleProcess = async (item) =&gt; {
453 461 const requestData = {
454 462 "returnImgs": rejectImgs.getSuccessImgUrls(), // 改造后:获取上传成功的图片URL
455 463 "workerDataId": item.id,
456   - "taskKey": item.taskKey,
  464 + "taskKey":'ylInspectorStart',
457 465 "taskId": item.taskId,
458   - "operateType": nextStepMap[item.taskKey].operateTypeNoPass,
  466 + "operateType": 200,
459 467 "agree": 1,
460 468 "reason": '结束工单'
461 469 };
... ... @@ -546,7 +554,7 @@ const handleAddOrder = () =&gt; {
546 554 });
547 555 };
548 556  
549   -// ========== 新增:养护组长验收弹窗事件 ==========
  557 +// ========== 验收弹窗事件 ==========
550 558 // 验收弹窗 - 确定按钮(含表单校验)
551 559 const handleAcceptModalConfirm = async () => {
552 560 // 1. 校验验收原因是否为空
... ... @@ -565,19 +573,19 @@ const handleAcceptModalConfirm = async () =&gt; {
565 573 let postData = {}
566 574 if (currentAcceptItem.value?.taskKey == 'ylTeamLeaderConfirm') { // 养护组长验收
567 575 postData = {
568   - "taskKey": "ylTeamLeaderConfirm",
  576 + "taskKey": currentAcceptItem.value.taskKey, // ylTeamLeaderConfirm
569 577 "workerDataId": currentAcceptItem.value.id,
570 578 "taskId": currentAcceptItem.value.taskId,
571   - "operateType": acceptRadioValue.value == 0 ? nextStepMap['ylTeamLeaderConfirm'].operateTypePass : nextStepMap['ylTeamLeaderConfirm'].operateTypeNoPass,
  579 + "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass,
572 580 "reason": acceptReason.value.trim()
573 581 }
574 582 }
575 583 if (currentAcceptItem.value?.taskKey == 'ylInspector') { // 巡查员验收
576 584 postData = {
577   - "taskKey": "ylTeamLeaderConfirm",
  585 + "taskKey": currentAcceptItem.value.taskKey, //ylInspector
578 586 "taskId": currentAcceptItem.value.taskId,
579 587 "workerDataId": currentAcceptItem.value.id,
580   - "operateType": acceptRadioValue.value == 0 ? nextStepMap['ylTeamLeaderConfirm'].operateTypePass : nextStepMap['ylTeamLeaderConfirm'].operateTypeNoPass,
  588 + "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass,
581 589 "reason": acceptReason.value.trim(),
582 590 "agree": acceptRadioValue.value
583 591 }
... ...
pages-sub/problem/work-order-manage/order-detail.vue
... ... @@ -43,7 +43,14 @@
43 43 </up-cell>
44 44  
45 45 <!-- 工单名称 -->
46   - <up-cell title="工单名称" :value="orderDetail.orderName || '--'" align="middle"></up-cell>
  46 + <up-cell align="middle">
  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.orderName || '--' }}</view>
  52 + </template>
  53 + </up-cell>
47 54  
48 55 <!-- 情况描述 -->
49 56 <up-cell>
... ... @@ -107,6 +114,13 @@
107 114 align="middle"
108 115 :border="false"
109 116 ></up-cell>
  117 +
  118 + <up-cell
  119 + title="工单完结时间"
  120 + :value="orderDetail.finishDate === 0 ? '暂无' : timeFormat(orderDetail.finishDate, 'yyyy-mm-dd hh:MM:ss')"
  121 + align="middle"
  122 + :border="false"
  123 + ></up-cell>
110 124 </up-cell-group>
111 125  
112 126 <!-- 图片分类Tabs区块 -->
... ... @@ -117,7 +131,7 @@
117 131 <view style="min-width: 200rpx">共同处理人</view>
118 132 </template>
119 133 <template #value>
120   - <view class="common-text-color up-line-1">{{ orderDetail.coHandlersName || '--' }}</view>
  134 + <view class="common-text-color up-line-1">{{ orderDetail.coHandlersName.join(',') || '--' }}</view>
121 135 </template>
122 136 </up-cell>
123 137 </up-cell-group>
... ... @@ -158,49 +172,52 @@
158 172 inactive-color="#999"
159 173 class="vertical-steps"
160 174 >
161   - <up-steps-item
162   - v-for="(item, index) in processData.activityNodes"
163   - :key="`${item.id}_${index}`"
164   - >
165   - <!-- 唯一自定义模板:content,包含标题、描述、相册所有内容 -->
166   - <template #content>
167   - <view class="step-content-wrap">
168   - <!-- 1. 原标题内容:节点名称 + 操作人 -->
169   - <view class="step-title">
170   - {{ item.name }}
171   - <text class="operator-name">
172   - {{ item.tasks && item.tasks[0]?.assigneeUser?.nickname ? '(' + item.tasks[0].assigneeUser.nickname + ')' : '(未知操作人)' }}
173   - </text>
174   - </view>
175   -
176   - <!-- 2. 原描述内容:时间 + 处理说明(最多200字) -->
177   - <view class="step-desc">
178   - <!-- 时间行 -->
179   - <view class="time-line">
180   - 处理时间:{{ timeFormat(item.startTime, 'yyyy-mm-dd hh:MM:ss') }}
181   - <text v-if="item.endTime"> - {{ timeFormat(item.endTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
182   - <text v-else class="processing-tag">(处理中)</text>
183   - </view>
184   - <!-- 原因行 -->
185   - <view class="reason-line up-line-2" v-if="item.tasks && item.tasks[0]?.reason">
186   - 描述:{{ getLimitReason(item.tasks && item.tasks[0]?.reason) }}
  175 + <template >
  176 + <up-steps-item
  177 + v-for="(item, index) in processData.activityNodes"
  178 + :key="`${item.id}_${index}`"
  179 + >
  180 + <!-- 唯一自定义模板:content,包含标题、描述、相册所有内容 -->
  181 + <template #content>
  182 + <view class="step-content-wrap" >
  183 + <!-- 1. 原标题内容:节点名称 + 操作人 -->
  184 + <view class="step-title">
  185 + {{ item.name }}
  186 + <text class="operator-name">
  187 + {{ item.tasks && item.tasks[0]?.assigneeUser?.nickname ? '(' + item.tasks[0].assigneeUser.nickname + ')' : '(未知操作人)' }}
  188 + </text>
  189 + </view>
  190 +
  191 + <!-- 2. 原描述内容:时间 + 处理说明(最多200字) -->
  192 + <view class="step-desc">
  193 + <!-- 时间行 -->
  194 + <view class="time-line">
  195 + 处理时间:{{ timeFormat(item.startTime, 'yyyy-mm-dd hh:MM:ss') }}
  196 + <text v-if="item.endTime"> - {{ timeFormat(item.endTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
  197 + <text v-else class="processing-tag">(处理中)</text>
  198 + </view>
  199 + <!-- 原因行 -->
  200 + <view class="reason-line up-line-2" v-if="item.tasks && item.tasks[0]?.reason">
  201 + 描述:{{ getLimitReason(item.tasks && item.tasks[0]?.reason) }}
  202 + </view>
  203 + </view>
  204 +
  205 + <!-- 3. 原相册内容:预留up-album -->
  206 + <view class="step-album-wrap">
  207 + <up-album
  208 + v-if="item.tasks && item.tasks[0]?.returnImgs && item.tasks[0].returnImgs.length"
  209 + :urls="item.tasks[0].returnImgs.slice(0, 3)"
  210 + singleSize="70"
  211 + multipleSize="70"
  212 + :preview-full-image="true"
  213 + class="step-album"
  214 + ></up-album>
  215 + </view>
187 216 </view>
188   - </view>
189   -
190   - <!-- 3. 原相册内容:预留up-album -->
191   - <view class="step-album-wrap">
192   - <up-album
193   - v-if="item.tasks && item.tasks[0]?.returnImgs && item.tasks[0].returnImgs.length"
194   - :urls="item.tasks[0].returnImgs.slice(0, 3)"
195   - singleSize="70"
196   - multipleSize="70"
197   - :preview-full-image="true"
198   - class="step-album"
199   - ></up-album>
200   - </view>
201   - </view>
  217 + </template>
  218 + </up-steps-item>
202 219 </template>
203   - </up-steps-item>
  220 +
204 221 </up-steps>
205 222  
206 223 <!-- 流程节点为空时的提示 -->
... ... @@ -257,7 +274,12 @@ const activeTopTabClick = async (item: any) =&gt; {
257 274 console.log(res)
258 275 // 关键:格式化数据,补充up-steps要求的title字段
259 276 if (res && res.activityNodes && res.activityNodes.length) {
260   - const formatActivityNodes = res.activityNodes.map(node => ({
  277 + // 1. 先过滤:剔除 name 为 "结束" 的节点
  278 + const filteredActivityNodes = res.activityNodes.filter(node => {
  279 + // 返回 true 保留节点,返回 false 剔除节点
  280 + return node.name !== '结束';
  281 + });
  282 + const formatActivityNodes = filteredActivityNodes.map(node => ({
261 283 ...node,
262 284 title: node.name // 补充强制字段,满足3.3.48版本组件要求
263 285 }));
... ... @@ -367,11 +389,15 @@ const getCurrentStepIndex = () =&gt; {
367 389 const { activityNodes } = processData.value;
368 390 if (!activityNodes || !activityNodes.length) return 0;
369 391  
  392 + // item.tasks && item.tasks[0]?.assigneeUser?.nickname
370 393 // 1. 查找第一个状态为1(处理中)的节点,即为当前步骤
371   - const processingNodeIndex = activityNodes.findIndex(node => node.status === 1);
372   - if (processingNodeIndex !== -1) {
373   - return processingNodeIndex;
374   - }
  394 + // const processingNodeIndex = activityNodes.findIndex(node => node.name === '结束');
  395 + // console.log(processingNodeIndex)
  396 + // if (processingNodeIndex !== -1) {
  397 + // return activityNodes.length - 2
  398 + // }else{
  399 + // return activityNodes.length - 1
  400 + // }
375 401  
376 402 // 2. 若没有处理中的节点(全部已完成),则激活最后一个节点
377 403 return activityNodes.length - 1;
... ...