Commit 83673de2cda877afc1ae9044bd8944e98e6aff3e

Authored by 刘淇
1 parent 6bce1057

ai 大区经理 优化添加结束功能

common/utils/common.js
@@ -25,7 +25,7 @@ export const nextStepMap = { @@ -25,7 +25,7 @@ export const nextStepMap = {
25 }, 25 },
26 ylInspector: { 26 ylInspector: {
27 name: '巡查员验收', 27 name: '巡查员验收',
28 - // btnText: '验收', 28 + btnText: '验收',
29 ysShow:true, 29 ysShow:true,
30 operateTypePass: 140, //巡查员验收通过: 140 30 operateTypePass: 140, //巡查员验收通过: 140
31 operateTypeNoPass: 240, // 巡查员验收不通过:240 31 operateTypeNoPass: 240, // 巡查员验收不通过:240
@@ -70,7 +70,8 @@ export const nextStepMap = { @@ -70,7 +70,8 @@ export const nextStepMap = {
70 ylAiInspectorStart: { 70 ylAiInspectorStart: {
71 name: 'AI工单派发人员', 71 name: 'AI工单派发人员',
72 ysShow:false, 72 ysShow:false,
73 - btnText: '', 73 + btnText: '结束工单',
  74 + // operateTypePass: 200, //巡查员结束工单:200
74 operateTypePass: 40, // 大区经理分配:40 75 operateTypePass: 40, // 大区经理分配:40
75 operateTypeNoPass: 50, // 大区经理退回:50 76 operateTypeNoPass: 50, // 大区经理退回:50
76 backShow: false, 77 backShow: false,
manifest.json
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 }, 54 },
55 /* 小程序特有相关 */ 55 /* 小程序特有相关 */
56 "mp-weixin" : { 56 "mp-weixin" : {
57 - "appid" : "wx64368a9b9e799172", 57 + "appid" : "wxcb4cd34066b97d82",
58 "setting" : { 58 "setting" : {
59 "urlCheck" : false 59 "urlCheck" : false
60 }, 60 },
pages-sub/problem/ai-manage/index.vue
@@ -95,16 +95,13 @@ @@ -95,16 +95,13 @@
95 <view class="u-line-1 u-body-value">{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view> 95 <view class="u-line-1 u-body-value">{{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
96 </view> 96 </view>
97 <!-- 操作按钮行 --> 97 <!-- 操作按钮行 -->
98 - <view class="u-body-item u-flex common-justify-between common-item-center mt-20"> 98 + <view class="u-body-item u-flex u-body-item-btn-wrap common-justify-between common-item-center mt-20">
99 <!-- <up-button type="warning" size="mini" @click="handleReject(item)" v-show="nextStepMap[item.taskKey].backShow">回退</up-button>--> 99 <!-- <up-button type="warning" size="mini" @click="handleReject(item)" v-show="nextStepMap[item.taskKey].backShow">回退</up-button>-->
100 <!-- <up-button type="success" size="mini" @click="handleRenew(item)" v-show="nextStepMap[item.taskKey].renewShow">重新提交</up-button>--> 100 <!-- <up-button type="success" size="mini" @click="handleRenew(item)" v-show="nextStepMap[item.taskKey].renewShow">重新提交</up-button>-->
101 -<!-- <up-button type="primary" size="mini" @click="handleProcess(item)">{{ nextStepMap[item.taskKey].btnText }}</up-button>-->  
102 - <up-button type="primary" size="mini" @click="handleProcess(item)" v-show="nextStepMap[item.taskKey].ysShow">验收</up-button> 101 + <up-button type="primary" size="large" @click="handleProcess(item)">{{ nextStepMap[item.taskKey].btnText }}</up-button>
  102 +<!-- <up-button type="primary" size="large" @click="handleProcess(item)" v-show="nextStepMap[item.taskKey].ysShow">验收</up-button>-->
103 103
104 -  
105 -  
106 -  
107 - <up-button type="info" size="mini" @click="handleDetail(item)">详情</up-button> 104 + <up-button type="info" size="large" @click="handleDetail(item)">详情</up-button>
108 </view> 105 </view>
109 </view> 106 </view>
110 </template> 107 </template>
@@ -122,6 +119,9 @@ @@ -122,6 +119,9 @@
122 > 119 >
123 <template #body> 120 <template #body>
124 <view class="card-body"> 121 <view class="card-body">
  122 + <view class="common-custom-btn " style="--btn-top: 130px;" @click="handleDetail(item)">
  123 + 工单详情
  124 + </view>
125 <view class="u-body-item u-flex"> 125 <view class="u-body-item u-flex">
126 <view class="u-body-item-title">工单编号:</view> 126 <view class="u-body-item-title">工单编号:</view>
127 <view class="u-line-1 u-body-value">{{ item.orderNo || '-' }}</view> 127 <view class="u-line-1 u-body-value">{{ item.orderNo || '-' }}</view>
@@ -142,9 +142,9 @@ @@ -142,9 +142,9 @@
142 <view class="u-body-item-title"> 142 <view class="u-body-item-title">
143 紧急程度:{{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }} 143 紧急程度:{{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }}
144 </view> 144 </view>
145 - <view>  
146 - <up-button type="primary" size="mini" @click="handleDetail(item)">工单详情</up-button>  
147 - </view> 145 +<!-- <view>-->
  146 +<!-- <up-button type="primary" size="mini" @click="handleDetail(item)">工单详情</up-button>-->
  147 +<!-- </view>-->
148 </view> 148 </view>
149 <view class="u-body-item u-flex"> 149 <view class="u-body-item u-flex">
150 <view class="u-body-item-title">工单状态:</view> 150 <view class="u-body-item-title">工单状态:</view>
@@ -447,7 +447,7 @@ const handleRenew = (item) =&gt; { @@ -447,7 +447,7 @@ const handleRenew = (item) =&gt; {
447 const handleProcess = async (item) => { 447 const handleProcess = async (item) => {
448 if (!item) return uni.showToast({title: '工单信息异常', icon: 'none'}); 448 if (!item) return uni.showToast({title: '工单信息异常', icon: 'none'});
449 const stepName = nextStepMap[item.taskKey]?.name; 449 const stepName = nextStepMap[item.taskKey]?.name;
450 - 450 + console.log(stepName)
451 try { 451 try {
452 // 大区经理分配 452 // 大区经理分配
453 if (stepName === '大区经理分配') { 453 if (stepName === '大区经理分配') {
@@ -486,6 +486,23 @@ const handleProcess = async (item) =&gt; { @@ -486,6 +486,23 @@ const handleProcess = async (item) =&gt; {
486 } 486 }
487 }); 487 });
488 } 488 }
  489 + else if (stepName === 'AI工单派发人员') {
  490 + uni.showModal({
  491 + title: "结束工单",
  492 + content: "请确定是否结束工单?",
  493 + success: async (res) => {
  494 + if (res.confirm) {
  495 + const requestData = {
  496 + workerDataId: item.id, taskKey: 'ylInspectorStart', taskId: item.taskId,
  497 + operateType: 200, agree: 1, reason: 'AI工单派发人员结束工单'
  498 + };
  499 + await callApprovalApi(requestData, item.taskKey);
  500 + uni.showToast({title: '结束成功', icon: 'success'});
  501 + refreshOrderList();
  502 + }
  503 + }
  504 + });
  505 + }
489 } catch (error) { 506 } catch (error) {
490 console.error('处理工单失败:', error); 507 console.error('处理工单失败:', error);
491 uni.showToast({title: '处理失败,请重试', icon: 'none'}); 508 uni.showToast({title: '处理失败,请重试', icon: 'none'});
@@ -576,7 +593,10 @@ const handleAcceptModalConfirm = async () =&gt; { @@ -576,7 +593,10 @@ const handleAcceptModalConfirm = async () =&gt; {
576 }; 593 };
577 594
578 // ========== 页面生命周期 ========== 595 // ========== 页面生命周期 ==========
579 -onLoad(() => { 596 +// onLoad(() => {
  597 +// refreshOrderList();
  598 +// });
  599 +onShow(() => {
580 refreshOrderList(); 600 refreshOrderList();
581 }); 601 });
582 </script> 602 </script>
@@ -621,6 +641,11 @@ onLoad(() =&gt; { @@ -621,6 +641,11 @@ onLoad(() =&gt; {
621 box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); 641 box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
622 } 642 }
623 643
  644 +.u-body-item-btn-wrap :deep(.u-button--large){
  645 + height: 28px;
  646 +}
  647 +
  648 +
624 // 弹窗公共样式 649 // 弹窗公共样式
625 .reject-modal-content, .accept-modal-content { 650 .reject-modal-content, .accept-modal-content {
626 width: 100%; 651 width: 100%;
pages-sub/problem/regional-order-manage/order-detail.vue
@@ -426,6 +426,7 @@ const callApprovalApi = async (params: any, taskKey: string) =&gt; { @@ -426,6 +426,7 @@ const callApprovalApi = async (params: any, taskKey: string) =&gt; {
426 if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); 426 if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params);
427 if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); 427 if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params);
428 if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); 428 if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params);
  429 + if (USER_ROLES.includes('AI_dispatcher')) return await aiUniversalApproval(params);
429 // if (USER_ROLES.includes('AI_dispatcher')) return await aiUniversalApproval(params); 430 // if (USER_ROLES.includes('AI_dispatcher')) return await aiUniversalApproval(params);
430 throw new Error('未匹配到对应的审批接口,请检查角色或工单taskKey'); 431 throw new Error('未匹配到对应的审批接口,请检查角色或工单taskKey');
431 }; 432 };
@@ -786,6 +787,25 @@ const handleProcess = async (item: any) =&gt; { @@ -786,6 +787,25 @@ const handleProcess = async (item: any) =&gt; {
786 }, 787 },
787 }); 788 });
788 } 789 }
  790 + else if (stepName === 'AI工单派发人员') {
  791 + uni.showModal({
  792 + title: "结束工单",
  793 + content: "请确定是否结束工单?",
  794 + success: async (res) => {
  795 + if (res.confirm) {
  796 + const requestData = {
  797 + workerDataId: item.id, taskKey: 'ylInspectorStart', taskId: item.taskId,
  798 + operateType: 200, agree: 1, reason: 'AI工单派发人员结束工单'
  799 + };
  800 + await callApprovalApi(requestData, item.taskKey);
  801 + uni.showToast({title: '结束成功', icon: 'success'});
  802 + eventChannel.value.emit('needRefresh');
  803 + uni.navigateBack({ delta: 1 });
  804 + }
  805 + }
  806 + });
  807 + }
  808 +
789 } catch (error: any) { 809 } catch (error: any) {
790 console.error('处理工单失败:', error); 810 console.error('处理工单失败:', error);
791 showToast(error.msg || error.message || '处理失败,请重试'); 811 showToast(error.msg || error.message || '处理失败,请重试');
pages/login/index.vue
@@ -320,6 +320,12 @@ onMounted(() =&gt; { @@ -320,6 +320,12 @@ onMounted(() =&gt; {
320 </script> 320 </script>
321 321
322 <style scoped lang="scss"> 322 <style scoped lang="scss">
  323 +.page-container{
  324 + height:100vh;
  325 + background: url("https://img.jichengshanshui.com.cn:28207/appimg/loginbg.jpg") no-repeat;
  326 + background-position: bottom center;
  327 + background-size: 100% 240px;
  328 +}
323 .top-title { 329 .top-title {
324 background: url("https://img.jichengshanshui.com.cn:28207/appimg/bg.jpg") no-repeat; 330 background: url("https://img.jichengshanshui.com.cn:28207/appimg/bg.jpg") no-repeat;
325 background-size: 100% 100%; 331 background-size: 100% 100%;
@@ -407,6 +413,6 @@ onMounted(() =&gt; { @@ -407,6 +413,6 @@ onMounted(() =&gt; {
407 font-size: 12px; 413 font-size: 12px;
408 color: #999; 414 color: #999;
409 position: fixed; 415 position: fixed;
410 - bottom: 100px; 416 + bottom: 60px;
411 } 417 }
412 </style> 418 </style>
413 \ No newline at end of file 419 \ No newline at end of file