Sfoglia il codice sorgente

办件中心功能优化

songxy 1 anno fa
parent
commit
5b2608fc77

+ 1 - 0
client_h5/index.html

@@ -7,6 +7,7 @@
     <script src='https://cdn.bootcss.com/vConsole/3.3.2/vconsole.min.js'></script>
     <script type="text/javascript">
       window.vConsole = new window.VConsole()
+      window.locationBaseUrl = "/html_h5"
     </script>
     <title></title>
   </head>

+ 18 - 6
client_h5/src/components/flowForm.vue

@@ -85,8 +85,8 @@
         <slot></slot>
       </template>
     </div>
-    <div class="fixed-btn">
-      <van-button round block type="primary" @click="submitHandle">
+    <div class="fixed-btn" v-if="isSubmitVisabled">
+      <van-button :disabled="isSubmitDisabled" round block type="primary" @click="submitHandle">
           转件
       </van-button>
     </div>
@@ -103,6 +103,8 @@ import { getTemplateOpinionListByFlowInstanceId, getOpinionListByFlowInstanceId
 defineOptions({
   name: 'FlowForm'
 })
+const isSubmitVisabled = ref<boolean>(true)
+const isSubmitDisabled = ref<boolean>(false)
 const userInfo = JSON.parse(localStorage.getItem('_userInfo') as string);
 const currentUserName = userInfo ? userInfo['nickname'] ?? '' : ''
 defineProps<{
@@ -116,10 +118,14 @@ const tabs = ref<{
   title?: string
 }[]>([{}])
 const currentActive = ref<string>('基础信息')
-const { flowInstanceId, activityInstanceId, participant } = route.query as {
+const { flowInstanceId, activityInstanceId, participant, _o } = route.query as {
   flowInstanceId: string
   activityInstanceId: string
   participant: string
+  _o: string
+}
+if (_o && _o == 'v') {
+  isSubmitVisabled.value = false
 }
 const currentOpinion = ref({
   id: '',
@@ -161,6 +167,12 @@ getTemplateOpinionListByFlowInstanceId(flowInstanceId).then((tResult) => {
             tItem['opinions'].push(oItem);
             oList.splice(j, 1)
             j--;
+          } else {
+            if (j === oList.length - 1) {
+              tList.splice(i, 1)
+              i--;
+              continue;
+            }
           }
         }
       }
@@ -177,6 +189,7 @@ const activityData: FlowDTO = {
 const router = useRouter();
 const submitHandle = async (): Promise<any> => {
   emit('submit', async () => {
+    isSubmitDisabled.value = true;
     //工作流转件
     activityData.activityInstanceId = activityInstanceId;
     activityData.participantId = participant;
@@ -188,12 +201,11 @@ const submitHandle = async (): Promise<any> => {
         message: '转件成功',
         position: 'top',
         onClose() {
-            router.back();
+          isSubmitDisabled.value = false;
+          router.back();
         }
       });
     }
-    console.log("转件-----------------------")
-    console.log(result);
     return result;
   });
 }

+ 8 - 1
client_h5/src/pages/handleCenter/index.vue

@@ -231,8 +231,15 @@ const confirmHandle = () => {
 /**
  * 流程办理或查看
  */
+const router = useRouter();
 const toPageHandle = (path: string) => {
-  window.location.href = path;
+  if (path) {
+    //@ts-ignore
+    const arr = path.split(window?.locationBaseUrl)
+    if (arr.length > 1) {
+      router.push(arr[1])
+    }
+  }
 };
 const clickHandler = (item: any, isView: boolean) => {
   const sendData = {

+ 5 - 1
client_h5/src/pages/home/index.vue

@@ -114,7 +114,11 @@ const toProcessHandle = (item: ProcessMenuItem): void => {
     templateId: item.instanceId,
   }).then((result: any) => {
     if (typeof result === "string") {
-      location.href=result
+      //@ts-ignore
+      const arr = result.split(window?.locationBaseUrl)
+      if (arr.length > 1) {
+        router.push(arr[1])
+      }
     }
   });
 };