Commit 2e2b95d37d97ede62b86047b9339ec4046d26307
1 parent
eaaa8665
修改接口路径 和命名
Showing
10 changed files
with
294 additions
and
124 deletions
api/regional-order-manage/regional-order-manage.js
| 1 | +import { post, get, put } from '@/common/utils/request'; | |
| 2 | + | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * 获得审批详情 流程节点 | |
| 6 | + * @returns {Promise} | |
| 7 | + */ | |
| 8 | +export const getApprovalDetail = (params) => { | |
| 9 | + return get('/app-api/bpm/garden/workorder/getApprovalDetail',params); | |
| 10 | +}; | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 获得园林养护员列表、共同处理人也调用此接口 | |
| 16 | + * @returns {Promise} | |
| 17 | + */ | |
| 18 | +export const getYlWorkersPage = (params) => { | |
| 19 | + return get('/app-api/bpm/garden/workorder/getYlWorkersPage',params); | |
| 20 | +}; | |
| 21 | + | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 我发起的列表-工单详情 | |
| 25 | + * @returns {Promise} | |
| 26 | + */ | |
| 27 | +export const getMyTaskDetail = (params) => { | |
| 28 | + return get('/app-api/bpm/garden/workorder/getMyTaskDetail',params); | |
| 29 | +}; | |
| 30 | + | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * 已办列表-工单详情 | |
| 34 | + * @returns {Promise} | |
| 35 | + */ | |
| 36 | +export const getDoneTaskDetail = (params) => { | |
| 37 | + return get('/app-api/bpm/garden/workorder/getDoneTaskDetail',params); | |
| 38 | +}; | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * 待办列表-工单详情 | |
| 42 | + * @returns {Promise} | |
| 43 | + */ | |
| 44 | +export const getTodoTaskDetail = (params) => { | |
| 45 | + return get('/app-api/bpm/garden/workorder/getTodoTaskDetail',params); | |
| 46 | +}; | |
| 47 | + | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * 我发起的列表 | |
| 51 | + * @returns {Promise} | |
| 52 | + */ | |
| 53 | +export const myBuzSimplePage = (params) => { | |
| 54 | + return get('/app-api/bpm/garden/workorder/myBuzSimplePage',params); | |
| 55 | +}; | |
| 56 | + | |
| 57 | +/** | |
| 58 | + * 已办汇总 | |
| 59 | + * @returns {Promise} | |
| 60 | + */ | |
| 61 | +export const doneBuzSimplePage = (params) => { | |
| 62 | + return get('/app-api/bpm/garden/workorder/doneBuzSimplePage',params); | |
| 63 | +}; | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | +/** | |
| 68 | + * 待办汇总 | |
| 69 | + * @returns {Promise} | |
| 70 | + */ | |
| 71 | +export const todoBuzSimplePage = (params) => { | |
| 72 | + return get('/app-api/bpm/garden/workorder/todoBuzSimplePage',params); | |
| 73 | +}; | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | +/** | |
| 79 | + * 问题工单创建 大区经理 | |
| 80 | + * @returns {Promise} | |
| 81 | + */ | |
| 82 | +export const daquWorkorderCreate = (data) => { | |
| 83 | + return post('/app-api/bpm/regionmgr/workorder/create',data); | |
| 84 | + | |
| 85 | +}; | |
| 86 | + | |
| 87 | +/** | |
| 88 | + * app端统一审批入口 -- 大区经理 | |
| 89 | + * @returns {Promise} | |
| 90 | + */ | |
| 91 | +export const daquUniversalApproval = (params) => { | |
| 92 | + return post('/app-api/bpm/regionmgr/workorder/universalApproval',params); | |
| 93 | +}; | |
| 94 | + | |
| 95 | + | |
| 96 | +/** | |
| 97 | + * 问题工单创建 全域巡查员 | |
| 98 | + * @returns {Promise} | |
| 99 | + */ | |
| 100 | +export const qyWorkorderCreate = (data) => { | |
| 101 | + return post('/app-api/bpm/universal/workorder/create',data); | |
| 102 | +}; | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | +/** | |
| 107 | + * app端统一审批入口 大区经理 对全域巡查员 单子 回退 分配和 全域巡查员 。 | |
| 108 | + * @returns {Promise} | |
| 109 | + */ | |
| 110 | +export const qyUniversalApproval = (params) => { | |
| 111 | + return post('/app-api/bpm/universal/workorder/universalApproval',params); | |
| 112 | +}; | |
| 113 | + | |
| 114 | +/** | |
| 115 | + * 问题工单创建 全域督察员创建工单 | |
| 116 | + * @returns {Promise} | |
| 117 | + */ | |
| 118 | +export const dcyWorkorderCreate = (data) => { | |
| 119 | + return post('/app-api/bpm/inspector/workorder/create',data); | |
| 120 | +}; | |
| 121 | + | |
| 122 | + | |
| 123 | +/** | |
| 124 | + * 问题工单创建 全域督察员发起审批入口 ,大区经理对督察员的单子 回退 分配 | |
| 125 | + * @returns {Promise} | |
| 126 | + */ | |
| 127 | +export const dcyUniversalApproval = (data) => { | |
| 128 | + return post('/app-api/bpm/inspector/workorder/universalApproval',data); | |
| 129 | +}; | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | ... | ... |
api/work-order-manage/work-order-manage.js
| ... | ... | @@ -107,58 +107,6 @@ export const workorderCreate = (data) => { |
| 107 | 107 | }; |
| 108 | 108 | |
| 109 | 109 | |
| 110 | -/** | |
| 111 | - * 问题工单创建 大区经理 ai经理 | |
| 112 | - * @returns {Promise} | |
| 113 | - */ | |
| 114 | -export const regionmgrWorkorderCreate = (data) => { | |
| 115 | - return post('/app-api/bpm/regionmgr/workorder/create',data); | |
| 116 | -}; | |
| 117 | - | |
| 118 | -/** | |
| 119 | - * 问题工单创建 全域巡查员 | |
| 120 | - * @returns {Promise} | |
| 121 | - */ | |
| 122 | -export const qyWorkorderCreate = (data) => { | |
| 123 | - return post('/app-api/bpm/universal/workorder/create',data); | |
| 124 | -}; | |
| 125 | - | |
| 126 | -/** | |
| 127 | - * app端统一审批入口 -- 大区经理 ai经理 | |
| 128 | - * @returns {Promise} | |
| 129 | - */ | |
| 130 | -export const regionmgrUniversalApproval = (params) => { | |
| 131 | - return post('/app-api/bpm/regionmgr/workorder/universalApproval',params); | |
| 132 | -}; | |
| 133 | - | |
| 134 | - | |
| 135 | -/** | |
| 136 | - * app端统一审批入口 大区经理 回退 分配和 全域巡查员 。 | |
| 137 | - * @returns {Promise} | |
| 138 | - */ | |
| 139 | -export const qyUniversalApproval = (params) => { | |
| 140 | - return post('/app-api/bpm/universal/workorder/universalApproval',params); | |
| 141 | -}; | |
| 142 | - | |
| 143 | -/** | |
| 144 | - * 问题工单创建 全域督察员创建工单 | |
| 145 | - * @returns {Promise} | |
| 146 | - */ | |
| 147 | -export const inspectorWorkorderCreate = (data) => { | |
| 148 | - return post('/app-api/bpm/inspector/workorder/create',data); | |
| 149 | -}; | |
| 150 | - | |
| 151 | - | |
| 152 | -/** | |
| 153 | - * 问题工单创建 全域督察员发起审批入口 | |
| 154 | - * @returns {Promise} | |
| 155 | - */ | |
| 156 | -export const inspectorUniversalApproval = (data) => { | |
| 157 | - return post('/app-api/bpm/inspector/workorder/universalApproval',data); | |
| 158 | -}; | |
| 159 | - | |
| 160 | - | |
| 161 | - | |
| 162 | 110 | |
| 163 | 111 | |
| 164 | 112 | ... | ... |
common/utils/common.js
| ... | ... | @@ -50,6 +50,17 @@ export const nextStepMap = { |
| 50 | 50 | backShow: true, |
| 51 | 51 | renewShow: false |
| 52 | 52 | }, |
| 53 | + | |
| 54 | + | |
| 55 | + shRegionManager: { | |
| 56 | + name: '督察员单子大区经理分配', | |
| 57 | + btnText: '分配', | |
| 58 | + operateTypePass: 60, // 大区经理分配:60 | |
| 59 | + operateTypeNoPass: 70, // 大区经理退回:70 | |
| 60 | + // operateTypeRenew: 100, //巡查员重新发起:100 | |
| 61 | + backShow: true, | |
| 62 | + renewShow: false | |
| 63 | + }, | |
| 53 | 64 | } |
| 54 | 65 | |
| 55 | 66 | |
| ... | ... | @@ -67,6 +78,8 @@ export const buzStatusMap = { |
| 67 | 78 | "240" : '验收不通过', |
| 68 | 79 | '90' : '退回', |
| 69 | 80 | '80' : '分配', |
| 81 | + '70': '退回', | |
| 82 | + '60': '分配', | |
| 70 | 83 | } |
| 71 | 84 | |
| 72 | 85 | ... | ... |
pages-sub/problem/regional-order-manage/add-order.vue
| ... | ... | @@ -203,10 +203,13 @@ import { ref, reactive } from 'vue' |
| 203 | 203 | import { onReady, onShow, onLoad } from '@dcloudio/uni-app'; |
| 204 | 204 | import { useUploadImgs } from '@/common/utils/useUploadImgs' |
| 205 | 205 | import { getRoadListByLatLng } from '@/api/common' |
| 206 | -import { regionmgrUniversalApproval, regionmgrWorkorderCreate, inspectorWorkorderCreate } from '@/api/work-order-manage/work-order-manage' | |
| 206 | +import { daquUniversalApproval, qyUniversalApproval, | |
| 207 | + dcyUniversalApproval, daquWorkorderCreate, | |
| 208 | + dcyWorkorderCreate } from '@/api/regional-order-manage/regional-order-manage' | |
| 207 | 209 | import { timeFormat } from '@/uni_modules/uview-plus' |
| 208 | 210 | import { nextStepMap } from '@/common/utils/common' |
| 209 | 211 | import { useUserStore } from '@/pinia/user'; |
| 212 | +import { qyWorkorderCreate } from "../../../api/regional-order-manage/regional-order-manage"; | |
| 210 | 213 | |
| 211 | 214 | // ========== 状态管理 ========== |
| 212 | 215 | const userStore = useUserStore(); |
| ... | ... | @@ -330,6 +333,7 @@ onLoad((options) => { |
| 330 | 333 | |
| 331 | 334 | try { |
| 332 | 335 | const orderData = uni.getStorageSync(tempKey); |
| 336 | + console.log(orderData) | |
| 333 | 337 | if (orderData && typeof orderData === 'object') { |
| 334 | 338 | renewOrderData.value = orderData; |
| 335 | 339 | echoOrderData(renewOrderData.value); |
| ... | ... | @@ -562,11 +566,19 @@ const submitWorkOrder = async () => { |
| 562 | 566 | return; |
| 563 | 567 | } |
| 564 | 568 | |
| 565 | - | |
| 566 | - | |
| 567 | 569 | const commonSubmitData = { |
| 568 | 570 | roadId: workOrderForm.roadId, |
| 569 | 571 | roadName: workOrderForm.roadName, |
| 572 | + | |
| 573 | + // roadId: 550, | |
| 574 | + // roadName:'东明胡同(三海)', | |
| 575 | + | |
| 576 | + // roadId: 551, | |
| 577 | + // roadName:'地安门西大街51号', | |
| 578 | + // | |
| 579 | + // roadId: 553, | |
| 580 | + // roadName:'什刹海前海南沿', | |
| 581 | + | |
| 570 | 582 | problemsImgs: problemImgs.getSuccessImgUrls(), |
| 571 | 583 | remark: workOrderForm.problemDesc.trim(), |
| 572 | 584 | latLonType: 2, |
| ... | ... | @@ -594,15 +606,34 @@ const submitWorkOrder = async () => { |
| 594 | 606 | reason: '重新提交工单', |
| 595 | 607 | ...commonSubmitData |
| 596 | 608 | } |
| 597 | - res = await regionmgrUniversalApproval(renewSubmitData) | |
| 609 | + | |
| 610 | + if( userStore.userInfo.roles.includes('regional_manager')){ // 大区经理 | |
| 611 | + res = await daquUniversalApproval(renewSubmitData) | |
| 612 | + } | |
| 613 | + | |
| 614 | + if( userStore.userInfo.roles.includes('Inspector_global')){ // 督察员 | |
| 615 | + res = await dcyUniversalApproval(renewSubmitData) | |
| 616 | + } | |
| 617 | + | |
| 618 | + if( userStore.userInfo.roles.includes('patrol_global')){ // 全域巡查员 | |
| 619 | + res = await qyUniversalApproval(renewSubmitData) | |
| 620 | + } | |
| 621 | + | |
| 598 | 622 | } else { |
| 599 | 623 | |
| 600 | - if( userStore.userInfo.roles.includes('team_leader_yl')){ // 督察员 | |
| 601 | - res = await inspectorWorkorderCreate(commonSubmitData) | |
| 602 | - }else{ | |
| 603 | - res = await regionmgrWorkorderCreate(commonSubmitData) | |
| 624 | + if( userStore.userInfo.roles.includes('regional_manager')){ // 大区经理 | |
| 625 | + res = await daquWorkorderCreate(commonSubmitData) | |
| 626 | + } | |
| 627 | + | |
| 628 | + if( userStore.userInfo.roles.includes('Inspector_global')){ // 督察员 | |
| 629 | + res = await dcyWorkorderCreate(commonSubmitData) | |
| 630 | + } | |
| 631 | + | |
| 632 | + if( userStore.userInfo.roles.includes('patrol_global')){ // 全域巡查员 | |
| 633 | + res = await qyWorkorderCreate(commonSubmitData) | |
| 604 | 634 | } |
| 605 | 635 | |
| 636 | + | |
| 606 | 637 | } |
| 607 | 638 | |
| 608 | 639 | uni.hideLoading() | ... | ... |
pages-sub/problem/regional-order-manage/add-patrol-order.vue
| ... | ... | @@ -103,7 +103,7 @@ |
| 103 | 103 | import { ref, reactive } from 'vue' |
| 104 | 104 | import { onReady, onShow, onLoad } from '@dcloudio/uni-app'; |
| 105 | 105 | import { useUploadImgs } from '@/common/utils/useUploadImgs' |
| 106 | -import { qyUniversalApproval, qyWorkorderCreate } from '@/api/work-order-manage/work-order-manage' | |
| 106 | +import { qyUniversalApproval, qyWorkorderCreate } from '@/api/regional-order-manage/regional-order-manage' | |
| 107 | 107 | import { timeFormat } from '@/uni_modules/uview-plus' |
| 108 | 108 | import { nextStepMap } from '@/common/utils/common' |
| 109 | 109 | import { useUserStore } from '@/pinia/user'; | ... | ... |
pages-sub/problem/regional-order-manage/distribution-order.vue
| ... | ... | @@ -197,7 +197,7 @@ import { ref, reactive } from 'vue' |
| 197 | 197 | import { onReady, onShow, onLoad } from '@dcloudio/uni-app'; |
| 198 | 198 | import { useUploadImgs } from '@/common/utils/useUploadImgs' |
| 199 | 199 | import { getRoadListByLatLng } from '@/api/common' |
| 200 | -import { regionmgrUniversalApproval, regionmgrWorkorderCreate, qyUniversalApproval } from '@/api/work-order-manage/work-order-manage' | |
| 200 | +import { daquUniversalApproval, daquWorkorderCreate, qyUniversalApproval } from '@/api/regional-order-manage/regional-order-manage' | |
| 201 | 201 | import { timeFormat } from '@/uni_modules/uview-plus' |
| 202 | 202 | import { nextStepMap } from '@/common/utils/common' |
| 203 | 203 | import { useUserStore } from '@/pinia/user'; |
| ... | ... | @@ -338,7 +338,7 @@ onLoad((options) => { |
| 338 | 338 | setTimeout(() => uni.navigateBack(), 1000); |
| 339 | 339 | return; |
| 340 | 340 | } finally { |
| 341 | - // uni.removeStorageSync(tempKey); // 调试完 打开 | |
| 341 | + uni.removeStorageSync(tempKey); // 调试完 打开 | |
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | }); | ... | ... |
pages-sub/problem/regional-order-manage/index.vue
| ... | ... | @@ -94,7 +94,7 @@ |
| 94 | 94 | </view> |
| 95 | 95 | <view class="u-body-item u-flex"> |
| 96 | 96 | <view class="u-body-item-title">工单状态:</view> |
| 97 | - <view class="u-line-1 u-body-value">{{buzStatusMap[item.buzStatus] }}</view> | |
| 97 | + <view class="u-line-1 u-body-value">{{ buzStatusMap[item.buzStatus] }}</view> | |
| 98 | 98 | </view> |
| 99 | 99 | <view class="u-body-item u-flex"> |
| 100 | 100 | <view class="u-body-item-title">提交时间:</view> |
| ... | ... | @@ -150,7 +150,8 @@ |
| 150 | 150 | </view> |
| 151 | 151 | |
| 152 | 152 | <view class="u-body-item u-flex common-justify-between common-item-center"> |
| 153 | - <view class="u-body-item-title">紧急程度:{{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }} | |
| 153 | + <view class="u-body-item-title"> | |
| 154 | + 紧急程度:{{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }} | |
| 154 | 155 | </view> |
| 155 | 156 | <view class=" "> |
| 156 | 157 | <up-button type="primary" size="mini" @click="handleDetail(item)">工单详情</up-button> |
| ... | ... | @@ -158,7 +159,7 @@ |
| 158 | 159 | </view> |
| 159 | 160 | <view class="u-body-item u-flex"> |
| 160 | 161 | <view class="u-body-item-title">工单状态:</view> |
| 161 | - <view class="u-line-1 u-body-value">{{buzStatusMap[item.buzStatus] }}</view> | |
| 162 | + <view class="u-line-1 u-body-value">{{ buzStatusMap[item.buzStatus] }}</view> | |
| 162 | 163 | </view> |
| 163 | 164 | <view class="u-body-item u-flex"> |
| 164 | 165 | <view class="u-body-item-title">提交时间:</view> |
| ... | ... | @@ -171,11 +172,11 @@ |
| 171 | 172 | </z-paging> |
| 172 | 173 | |
| 173 | 174 | <!-- 底部新增工单按钮(仅巡查员显示) --> |
| 174 | -<!-- <view v-if="isInspector" class="fixed-bottom-btn-wrap">--> | |
| 175 | -<!-- <up-button type="primary" size="large" @click="handleAddOrder">--> | |
| 176 | -<!-- 新增工单--> | |
| 177 | -<!-- </up-button>--> | |
| 178 | -<!-- </view>--> | |
| 175 | + <!-- <view v-if="isInspector" class="fixed-bottom-btn-wrap">--> | |
| 176 | + <!-- <up-button type="primary" size="large" @click="handleAddOrder">--> | |
| 177 | + <!-- 新增工单--> | |
| 178 | + <!-- </up-button>--> | |
| 179 | + <!-- </view>--> | |
| 179 | 180 | |
| 180 | 181 | <view class="fixed-bottom-btn-wrap" v-if="isInspector"> |
| 181 | 182 | <up-button type="primary" size="large" @click="handleAddOrder"> |
| ... | ... | @@ -283,14 +284,15 @@ import { |
| 283 | 284 | todoBuzSimplePage, |
| 284 | 285 | doneBuzSimplePage, |
| 285 | 286 | universalApproval, |
| 286 | - qyUniversalApproval | |
| 287 | -} from '@/api/work-order-manage/work-order-manage' | |
| 287 | + qyUniversalApproval, | |
| 288 | + daquUniversalApproval, | |
| 289 | + dcyUniversalApproval | |
| 290 | +} from '@/api/regional-order-manage/regional-order-manage' | |
| 288 | 291 | // 从用户store获取角色信息 |
| 289 | 292 | import { useUserStore } from '@/pinia/user'; |
| 290 | 293 | import { nextStepMap, buzStatusMap } from '@/common/utils/common' |
| 291 | 294 | // 引入图片上传组合式函数(与参考页面一致) |
| 292 | 295 | import { useUploadImgs } from '@/common/utils/useUploadImgs' |
| 293 | - | |
| 294 | 296 | // ========== 状态管理 ========== |
| 295 | 297 | const userStore = useUserStore(); |
| 296 | 298 | // 标签页切换 |
| ... | ... | @@ -325,7 +327,6 @@ const isInspector = computed(() => { |
| 325 | 327 | const rejectModalShow = ref(false); // 回退modal显示开关 |
| 326 | 328 | const rejectReason = ref(''); // 回退原因 |
| 327 | 329 | const currentRejectItem = ref(null); // 当前回退工单 |
| 328 | - | |
| 329 | 330 | // 回退图片上传配置(与参考页面风格一致) |
| 330 | 331 | const rejectImgs = useUploadImgs({ |
| 331 | 332 | maxCount: 3, // 最多上传3张 |
| ... | ... | @@ -334,14 +335,11 @@ const rejectImgs = useUploadImgs({ |
| 334 | 335 | formRef: null, // 该弹窗无表单校验 |
| 335 | 336 | fieldName: 'rejectImgs' // 自定义字段名 |
| 336 | 337 | }) |
| 337 | - | |
| 338 | - | |
| 339 | 338 | // ========== 验收弹窗相关状态(含图片上传) ========== |
| 340 | 339 | const acceptModalShow = ref(false); // 验收弹窗显示开关 |
| 341 | 340 | const acceptRadioValue = ref('0'); // 单选框值,默认0(通过) |
| 342 | 341 | const acceptReason = ref(''); // 验收原因 |
| 343 | 342 | const currentAcceptItem = ref(null); // 当前验收的工单项 |
| 344 | - | |
| 345 | 343 | // 验收图片上传配置(独立实例,参考回退弹窗) |
| 346 | 344 | const acceptImgs = useUploadImgs({ |
| 347 | 345 | maxCount: 3, // 最多上传3张,与回退弹窗一致 |
| ... | ... | @@ -350,7 +348,6 @@ const acceptImgs = useUploadImgs({ |
| 350 | 348 | formRef: null, // 验收弹窗无表单校验 |
| 351 | 349 | fieldName: 'acceptImgs' // 自定义字段名,区分回退图片 |
| 352 | 350 | }) |
| 353 | - | |
| 354 | 351 | // 分页查询列表 |
| 355 | 352 | const queryList = async (pageNo, pageSize) => { |
| 356 | 353 | try { |
| ... | ... | @@ -379,7 +376,6 @@ const queryList = async (pageNo, pageSize) => { |
| 379 | 376 | uni.showToast({title: '加载失败,请重试', icon: 'none'}); |
| 380 | 377 | } |
| 381 | 378 | }; |
| 382 | - | |
| 383 | 379 | // ========== 事件处理 ========== |
| 384 | 380 | // 标签页切换 |
| 385 | 381 | const handleTabChange = (item) => { |
| ... | ... | @@ -414,24 +410,19 @@ const handleDetail = (item) => { |
| 414 | 410 | } |
| 415 | 411 | }); |
| 416 | 412 | }; |
| 417 | - | |
| 418 | 413 | // 生成临时key |
| 419 | 414 | const generateTempKey = () => { |
| 420 | 415 | return 'renew_order_' + Date.now() + '_' + Math.floor(Math.random() * 10000); |
| 421 | 416 | }; |
| 422 | - | |
| 423 | 417 | // 待办-重新提交工单(改造后:大数据存本地,仅传唯一标识) |
| 424 | 418 | const handleRenew = (item) => { |
| 425 | - // 校验工单有效性 | |
| 426 | - if (!item || !item.id) { | |
| 427 | - uni.showToast({title: '工单信息异常,无法重新提交', icon: 'none'}); | |
| 428 | - return; | |
| 429 | - } | |
| 430 | 419 | |
| 431 | 420 | // 1. 生成唯一临时标识 |
| 432 | 421 | const tempKey = generateTempKey(); |
| 433 | 422 | // 2. 将完整工单数据存入本地临时存储(同步存储,确保数据立即生效) |
| 434 | 423 | try { |
| 424 | + console.log(item) | |
| 425 | + console.log('123') | |
| 435 | 426 | uni.setStorageSync(tempKey, item); |
| 436 | 427 | } catch (error) { |
| 437 | 428 | console.error('存储工单数据失败:', error); |
| ... | ... | @@ -439,12 +430,26 @@ const handleRenew = (item) => { |
| 439 | 430 | return; |
| 440 | 431 | } |
| 441 | 432 | |
| 442 | - // 3. URL 仅传递「唯一标识」和「重新提交标记」(数据量极小,无长度问题) | |
| 443 | - uni.navigateTo({ | |
| 444 | - url: `/pages-sub/problem/regional-order-manage/add-patrol-order?isRenew=1&tempKey=${tempKey}` | |
| 445 | - }); | |
| 433 | + if (userStore.userInfo?.roles.includes('patrol_global')) { // 全域巡查员 | |
| 434 | + uni.navigateTo({ | |
| 435 | + url: `/pages-sub/problem/regional-order-manage/add-patrol-order?isRenew=1&tempKey=${tempKey}` | |
| 436 | + }); | |
| 437 | + } | |
| 438 | + if (userStore.userInfo?.roles.includes('regional_manager')) { // 大区经理 | |
| 439 | + uni.navigateTo({ | |
| 440 | + url: `/pages-sub/problem/regional-order-manage/add-order?isRenew=1&tempKey=${tempKey}` | |
| 441 | + }); | |
| 442 | + } | |
| 443 | + if (userStore.userInfo?.roles.includes('Inspector_global')) { // 督察员 | |
| 444 | + uni.navigateTo({ | |
| 445 | + url: `/pages-sub/problem/regional-order-manage/add-order?isRenew=1&tempKey=${tempKey}` | |
| 446 | + }); | |
| 447 | + } | |
| 448 | + // // 3. URL 仅传递「唯一标识」和「重新提交标记」(数据量极小,无长度问题) | |
| 449 | + // uni.navigateTo({ | |
| 450 | + // url: `/pages-sub/problem/regional-order-manage/add-patrol-order?isRenew=1&tempKey=${tempKey}` | |
| 451 | + // }); | |
| 446 | 452 | }; |
| 447 | - | |
| 448 | 453 | // 待办-处理工单 |
| 449 | 454 | const handleProcess = async (item) => { |
| 450 | 455 | console.log(nextStepMap[item.taskKey].name) |
| ... | ... | @@ -465,10 +470,29 @@ const handleProcess = async (item) => { |
| 465 | 470 | url: `/pages-sub/problem/regional-order-manage/distribution-order?tempKey=${tempKey}` |
| 466 | 471 | }) |
| 467 | 472 | } |
| 473 | + if (nextStepMap[item.taskKey]?.name == '督察员单子大区经理分配') { | |
| 474 | + let postData = { | |
| 475 | + "taskKey":item.taskKey, | |
| 476 | + "taskId": item.taskId, | |
| 477 | + "operateType":60, | |
| 478 | + "workerDataId":item.id, | |
| 479 | + "agree":0, | |
| 480 | + "reason":item.remark, | |
| 481 | + "roadId":item.roadId, | |
| 482 | + "roadName":item.roadName, | |
| 483 | + "pressingType":item.pressingType, | |
| 484 | + "orderName":item.orderName, | |
| 485 | + "expectedFinishDate": item.expectedFinishDate, | |
| 486 | + "busiLine":item.busiLine, | |
| 487 | + } | |
| 488 | + const res = await dcyUniversalApproval(postData); | |
| 489 | + uni.showToast({title: '分配成功', icon: 'success', duration: 1000}); | |
| 490 | + paging.value?.reload(); // 刷新列表 | |
| 491 | + } | |
| 492 | + | |
| 468 | 493 | if (nextStepMap[item.taskKey]?.name == '养护员待实施') { |
| 469 | 494 | // ① 生成唯一临时key(和重新提交工单逻辑一致,避免冲突) |
| 470 | 495 | const tempKey = `maintain_order_${Date.now()}_${Math.floor(Math.random() * 10000)}`; |
| 471 | - | |
| 472 | 496 | // ② 存储完整item到本地缓存(同步存储,确保立即生效) |
| 473 | 497 | try { |
| 474 | 498 | uni.setStorageSync(tempKey, item); |
| ... | ... | @@ -477,7 +501,6 @@ const handleProcess = async (item) => { |
| 477 | 501 | uni.showToast({title: '数据存储异常,无法跳转', icon: 'none'}); |
| 478 | 502 | return; |
| 479 | 503 | } |
| 480 | - | |
| 481 | 504 | // ③ URL仅传递临时key(可选:携带必要简单参数,方便目标页面快速使用) |
| 482 | 505 | uni.navigateTo({ |
| 483 | 506 | url: `/pages-sub/problem/regional-order-manage/add-maintain-order?tempKey=${tempKey}` |
| ... | ... | @@ -497,7 +520,6 @@ const handleProcess = async (item) => { |
| 497 | 520 | acceptRadioValue.value = '0'; // 重置默认选中“通过” |
| 498 | 521 | acceptModalShow.value = true; // 显示验收弹窗 |
| 499 | 522 | } |
| 500 | - | |
| 501 | 523 | // 发起人确认 |
| 502 | 524 | if (nextStepMap[item.taskKey]?.name == '发起人确认') { |
| 503 | 525 | console.log(item) |
| ... | ... | @@ -510,7 +532,7 @@ const handleProcess = async (item) => { |
| 510 | 532 | const requestData = { |
| 511 | 533 | "returnImgs": rejectImgs.getSuccessImgUrls(), // 改造后:获取上传成功的图片URL |
| 512 | 534 | "workerDataId": item.id, |
| 513 | - "taskKey":'ylInspectorStart', | |
| 535 | + "taskKey": 'ylInspectorStart', | |
| 514 | 536 | "taskId": item.taskId, |
| 515 | 537 | "operateType": 200, |
| 516 | 538 | "agree": 1, |
| ... | ... | @@ -532,7 +554,6 @@ const handleProcess = async (item) => { |
| 532 | 554 | uni.showToast({title: '处理失败,请重试', icon: 'none'}); |
| 533 | 555 | } |
| 534 | 556 | }; |
| 535 | - | |
| 536 | 557 | // 待办-回退工单(打开回退modal) |
| 537 | 558 | const handleReject = (item) => { |
| 538 | 559 | console.log('123213') |
| ... | ... | @@ -546,14 +567,12 @@ const handleReject = (item) => { |
| 546 | 567 | rejectImgs.clearImgs(); // 改造后:使用组合式函数的清空方法 |
| 547 | 568 | rejectModalShow.value = true; // 显示回退modal |
| 548 | 569 | }; |
| 549 | - | |
| 550 | 570 | // 回退modal - 取消按钮 |
| 551 | 571 | const handleRejectModalCancel = () => { |
| 552 | 572 | rejectModalShow.value = false; |
| 553 | 573 | rejectReason.value = ''; |
| 554 | 574 | rejectImgs.clearImgs(); // 改造后:使用组合式函数的清空方法 |
| 555 | 575 | }; |
| 556 | - | |
| 557 | 576 | // 确认回退工单 |
| 558 | 577 | const confirmReject = async () => { |
| 559 | 578 | // 严格校验回退原因(去除首尾空格) |
| ... | ... | @@ -564,26 +583,32 @@ const confirmReject = async () => { |
| 564 | 583 | } |
| 565 | 584 | // 校验当前工单有效性 |
| 566 | 585 | if (!currentRejectItem.value || !currentRejectItem.value.id) { |
| 567 | - uni.showToast({title: '工单信息异常,无法提交', icon: 'none', duration:1000}); | |
| 586 | + uni.showToast({title: '工单信息异常,无法提交', icon: 'none', duration: 1000}); | |
| 568 | 587 | rejectModalShow.value = false; |
| 569 | 588 | return; |
| 570 | 589 | } |
| 571 | 590 | try { |
| 572 | 591 | // 显示加载中,防止重复提交 |
| 573 | 592 | uni.showLoading({title: '提交中...', mask: true}); |
| 574 | - | |
| 575 | 593 | // 构建请求参数 |
| 576 | 594 | const requestData = { |
| 577 | 595 | "returnImgs": rejectImgs.getSuccessImgUrls(), // 改造后:获取上传成功的图片URL数组 |
| 578 | 596 | "workerDataId": currentRejectItem.value.id, |
| 579 | 597 | "taskKey": currentRejectItem.value.taskKey, |
| 580 | 598 | "taskId": currentRejectItem.value.taskId, |
| 599 | + | |
| 581 | 600 | "operateType": nextStepMap[currentRejectItem.value.taskKey].operateTypeNoPass, |
| 582 | 601 | "agree": 1, |
| 583 | 602 | "reason": rejectReasonTrim |
| 584 | 603 | }; |
| 585 | 604 | // 调用回退工单接口 |
| 586 | - const res = await qyUniversalApproval(requestData); | |
| 605 | + if(currentRejectItem.value.taskKey=='shRegionManager'){ // 对督察员单子 回退 | |
| 606 | + const res = await dcyUniversalApproval(requestData); | |
| 607 | + } | |
| 608 | + if(currentRejectItem.value.taskKey=='regionManager'){ // 对全域巡查员单子 回退 | |
| 609 | + const res = await qyUniversalApproval(requestData); | |
| 610 | + } | |
| 611 | + // 对大区经理单子 回退 | |
| 587 | 612 | uni.showToast({title: '回退成功', icon: 'success', duration: 1000}); |
| 588 | 613 | rejectModalShow.value = false; |
| 589 | 614 | paging.value?.reload(); // 刷新列表 |
| ... | ... | @@ -595,30 +620,28 @@ const confirmReject = async () => { |
| 595 | 620 | uni.hideLoading(); |
| 596 | 621 | } |
| 597 | 622 | }; |
| 598 | - | |
| 599 | 623 | // 新增工单 |
| 600 | 624 | const handleAddOrder = () => { |
| 601 | 625 | // patrol_global 全域巡查员 |
| 602 | 626 | // regional_manager 大区经理 |
| 603 | - console.log(userStore.userInfo?.roles.includes('team_leader_yl')) | |
| 604 | - if(userStore.userInfo?.roles.includes('patrol_global')){ | |
| 627 | + console.log(userStore.userInfo?.roles.includes('Inspector_global')) | |
| 628 | + console.log(userStore.userInfo?.roles) | |
| 629 | + if (userStore.userInfo?.roles.includes('patrol_global')) { // 全域巡查员 | |
| 605 | 630 | uni.navigateTo({ |
| 606 | 631 | url: '/pages-sub/problem/regional-order-manage/add-patrol-order' |
| 607 | 632 | }); |
| 608 | 633 | } |
| 609 | - if(userStore.userInfo?.roles.includes('regional_manager')){ | |
| 634 | + if (userStore.userInfo?.roles.includes('regional_manager')) { | |
| 610 | 635 | uni.navigateTo({ |
| 611 | 636 | url: '/pages-sub/problem/regional-order-manage/add-order' |
| 612 | 637 | }); |
| 613 | 638 | } |
| 614 | - | |
| 615 | - if(userStore.userInfo?.roles.includes('team_leader_yl')){ | |
| 639 | + if (userStore.userInfo?.roles.includes('Inspector_global')) { // 督察员 | |
| 616 | 640 | uni.navigateTo({ |
| 617 | 641 | url: '/pages-sub/problem/regional-order-manage/add-order' |
| 618 | 642 | }); |
| 619 | 643 | } |
| 620 | 644 | }; |
| 621 | - | |
| 622 | 645 | // 验收弹窗 - 取消按钮(清空状态) |
| 623 | 646 | const handleAcceptModalCancel = () => { |
| 624 | 647 | acceptModalShow.value = false; |
| ... | ... | @@ -626,7 +649,6 @@ const handleAcceptModalCancel = () => { |
| 626 | 649 | acceptRadioValue.value = '0'; // 重置单选框为“通过” |
| 627 | 650 | acceptImgs.clearImgs(); // 清空验收图片 |
| 628 | 651 | }; |
| 629 | - | |
| 630 | 652 | // 验收弹窗 - 确定按钮(含returnImgs传参) |
| 631 | 653 | const handleAcceptModalConfirm = async () => { |
| 632 | 654 | // 1. 校验验收原因是否为空 |
| ... | ... | @@ -642,9 +664,11 @@ const handleAcceptModalConfirm = async () => { |
| 642 | 664 | try { |
| 643 | 665 | // 3. 构建请求参数(含returnImgs) |
| 644 | 666 | console.log(currentAcceptItem.value) |
| 645 | - let postData = {} | |
| 646 | - if (currentAcceptItem.value?.taskKey == 'ylTeamLeaderConfirm') { // 养护组长验收 | |
| 647 | - postData = { | |
| 667 | + console.log( userStore.userInfo.roles) | |
| 668 | + console.log( userStore.userInfo.roles.includes('Inspector_global')) | |
| 669 | + // | |
| 670 | + if( userStore.userInfo.roles.includes('regional_manager')){ // 大区经理验收 | |
| 671 | + let postData = { | |
| 648 | 672 | "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 |
| 649 | 673 | "taskKey": currentAcceptItem.value.taskKey, |
| 650 | 674 | "workerDataId": currentAcceptItem.value.id, |
| ... | ... | @@ -652,9 +676,11 @@ const handleAcceptModalConfirm = async () => { |
| 652 | 676 | "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass, |
| 653 | 677 | "reason": acceptReason.value.trim() |
| 654 | 678 | } |
| 679 | + await daquUniversalApproval(postData); | |
| 655 | 680 | } |
| 656 | - if (currentAcceptItem.value?.taskKey == 'ylInspector') { // 全域巡查员验收 | |
| 657 | - postData = { | |
| 681 | + // | |
| 682 | + if( userStore.userInfo.roles.includes('patrol_global')){ // 全域巡查员验收 | |
| 683 | + let postData = { | |
| 658 | 684 | "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 |
| 659 | 685 | "taskKey": currentAcceptItem.value.taskKey, |
| 660 | 686 | "taskId": currentAcceptItem.value.taskId, |
| ... | ... | @@ -663,8 +689,22 @@ const handleAcceptModalConfirm = async () => { |
| 663 | 689 | "reason": acceptReason.value.trim(), |
| 664 | 690 | "agree": acceptRadioValue.value |
| 665 | 691 | } |
| 692 | + await qyUniversalApproval(postData); | |
| 666 | 693 | } |
| 667 | - const acceptRes = await universalApproval(postData); | |
| 694 | + // | |
| 695 | + if( userStore.userInfo.roles.includes('Inspector_global')){ // 督察员验收 | |
| 696 | + let postData = { | |
| 697 | + "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 | |
| 698 | + "taskKey": currentAcceptItem.value.taskKey, | |
| 699 | + "taskId": currentAcceptItem.value.taskId, | |
| 700 | + "workerDataId": currentAcceptItem.value.id, | |
| 701 | + "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass, | |
| 702 | + "reason": acceptReason.value.trim(), | |
| 703 | + "agree": acceptRadioValue.value | |
| 704 | + } | |
| 705 | + await dcyUniversalApproval(postData); | |
| 706 | + } | |
| 707 | + | |
| 668 | 708 | // 4. 操作成功处理 |
| 669 | 709 | uni.showToast({title: '提交成功', icon: 'success', duration: 1000}); |
| 670 | 710 | handleAcceptModalCancel(); // 清空状态 |
| ... | ... | @@ -675,7 +715,6 @@ const handleAcceptModalConfirm = async () => { |
| 675 | 715 | uni.showToast({title: '验收提交失败,请重试', icon: 'none', duration: 1000}); |
| 676 | 716 | } |
| 677 | 717 | }; |
| 678 | - | |
| 679 | 718 | // 页面初始化 |
| 680 | 719 | onLoad(() => { |
| 681 | 720 | // 初始化加载列表 | ... | ... |
pages-sub/problem/regional-order-manage/order-detail.vue
| ... | ... | @@ -369,9 +369,10 @@ import { |
| 369 | 369 | getDoneTaskDetail, |
| 370 | 370 | getTodoTaskDetail, |
| 371 | 371 | getApprovalDetail, |
| 372 | - regionmgrUniversalApproval, | |
| 373 | - qyUniversalApproval | |
| 374 | -} from '@/api/work-order-manage/work-order-manage'; | |
| 372 | + daquUniversalApproval, | |
| 373 | + qyUniversalApproval, | |
| 374 | + dcyUniversalApproval | |
| 375 | +} from '@/api/regional-order-manage/regional-order-manage'; | |
| 375 | 376 | import {nextStepMap, buzStatusMap, calculateFormatTimeDiff} from '@/common/utils/common' |
| 376 | 377 | // 引入图片上传组合式函数 |
| 377 | 378 | import {useUploadImgs} from '@/common/utils/useUploadImgs' |
| ... | ... | @@ -825,7 +826,7 @@ const handleAcceptModalConfirm = async () => { |
| 825 | 826 | "agree": acceptRadioValue.value |
| 826 | 827 | } |
| 827 | 828 | } |
| 828 | - const acceptRes = await regionmgrUniversalApproval(postData); | |
| 829 | + const acceptRes = await daquUniversalApproval(postData); | |
| 829 | 830 | // 4. 操作成功处理 |
| 830 | 831 | |
| 831 | 832 | handleAcceptModalCancel(); // 清空状态 | ... | ... |
pages-sub/problem/work-order-manage/index.vue
| ... | ... | @@ -554,7 +554,7 @@ const confirmReject = async () => { |
| 554 | 554 | try { |
| 555 | 555 | // 显示加载中,防止重复提交 |
| 556 | 556 | uni.showLoading({title: '提交中...', mask: true}); |
| 557 | - | |
| 557 | + console.log( currentRejectItem.value.roadId) | |
| 558 | 558 | // 构建请求参数 |
| 559 | 559 | const requestData = { |
| 560 | 560 | "returnImgs": rejectImgs.getSuccessImgUrls(), // 改造后:获取上传成功的图片URL数组 |
| ... | ... | @@ -563,7 +563,8 @@ const confirmReject = async () => { |
| 563 | 563 | "taskId": currentRejectItem.value.taskId, |
| 564 | 564 | "operateType": nextStepMap[currentRejectItem.value.taskKey].operateTypeNoPass, |
| 565 | 565 | "agree": 1, |
| 566 | - "reason": rejectReasonTrim | |
| 566 | + "reason": rejectReasonTrim, | |
| 567 | + "roadId": currentRejectItem.value.roadId, // 给督察员回退的 要加上 | |
| 567 | 568 | }; |
| 568 | 569 | // 调用回退工单接口 |
| 569 | 570 | const res = await universalApproval(requestData); | ... | ... |
pages/workbench/index.vue
| ... | ... | @@ -118,7 +118,7 @@ onShow(async () => { |
| 118 | 118 | setTimeout(() => { |
| 119 | 119 | // 使用reLaunch跳转,清空页面栈,避免返回当前菜单页 |
| 120 | 120 | uni.reLaunch({ |
| 121 | - url: '/pages/login/login', // 替换为你的实际登录页路径 | |
| 121 | + url: '/pages/login/index', // 替换为你的实际登录页路径 | |
| 122 | 122 | fail: (err) => { |
| 123 | 123 | console.error('跳转登录页失败:', err); |
| 124 | 124 | uni.showToast({ title: '跳转登录页异常', icon: 'none' }); | ... | ... |