Преглед на файлове

文字描述显示不全功能优化

songxy преди 6 месеца
родител
ревизия
e7ac9772dc

+ 139 - 126
client_h5/src/pages/asset/index.vue

@@ -1,107 +1,112 @@
-
 <template>
   <flow-form :data="formData" @submit="submitNextActivity">
-        <card title="基础信息">
-          <van-form required="auto" :readonly="formRead">
-            <van-cell-group inset>
-              <van-field
-                v-model="formData.userNickname"
-                name="申请人"
-                label="申请人"
-                placeholder="申请人"
-                readonly 
-              />
-              <van-field
-                v-model="formData.deptName"
-                name="所在部门"
-                label="所在部门"
-                placeholder="所在部门"
-                readonly 
-              />
-              <van-field
-                v-model="formData.applyTime"
-                name="申请时间"
-                label="申请时间"
-                placeholder="申请时间"
-                readonly 
-              />
-              <van-field
-                v-model="formData.procureNo"
-                name="采购单号"
-                label="采购单号"
-                placeholder="采购单号"
-                readonly 
-              />
-              <van-field
-                v-model="formData.projectName"
-                name="项目名称"
-                label="项目名称"
-                placeholder="项目名称"
-                readonly 
-              />
-              <van-field
-                v-model="formData.projectXmbh"
-                name="项目编号"
-                label="项目编号"
-                placeholder="项目编号"
-                readonly 
+    <card title="基础信息">
+      <van-form required="auto" :readonly="formRead">
+        <van-cell-group inset>
+          <van-field
+            v-model="formData.userNickname"
+            name="申请人"
+            label="申请人"
+            placeholder="申请人"
+            readonly
+          />
+          <van-field
+            v-model="formData.deptName"
+            name="所在部门"
+            label="所在部门"
+            placeholder="所在部门"
+            readonly
+          />
+          <van-field
+            v-model="formData.applyTime"
+            name="申请时间"
+            label="申请时间"
+            placeholder="申请时间"
+            readonly
+          />
+          <van-field
+            v-model="formData.procureNo"
+            name="采购单号"
+            label="采购单号"
+            placeholder="采购单号"
+            readonly
+          />
+          <van-field
+            v-model="formData.projectName"
+            type="textarea"
+            rows="1"
+            autosize
+            name="项目名称"
+            label="项目名称"
+            placeholder="项目名称"
+            readonly
+          />
+          <van-field
+            v-model="formData.projectXmbh"
+            name="项目编号"
+            label="项目编号"
+            placeholder="项目编号"
+            readonly
+          />
+          <van-field
+            v-model="formData.projectZrbm"
+            name="项目责任部门"
+            label="项目责任部门"
+            placeholder="项目责任部门"
+            readonly
+          />
+          <van-field
+            v-model="formData.totalAmount"
+            name="采购总金额(元)"
+            label="采购总金额(元)"
+            placeholder="采购总金额(元)"
+            readonly
+          />
+          <van-field
+            v-model="formData.procureReason"
+            name="采购清单说明"
+            label="采购清单说明"
+            placeholder="采购清单说明"
+            type="textarea"
+            rows="3"
+            autosize
+            readonly
+          />
+        </van-cell-group>
+      </van-form>
+    </card>
+    <card title="采购详情">
+      <template #default>
+        <div v-for="(item, index) in formData.detailList" :key="index">
+          <van-swipe-cell :disabled="formRead">
+            <card-cell>
+              <van-cell
+                title="采购时间"
+                :value="moment(item.procureTime).format('YYYY-MM-DD')"
               />
-              <van-field
-                v-model="formData.projectZrbm"
-                name="项目责任部门"
-                label="项目责任部门"
-                placeholder="项目责任部门"
-                readonly 
-              />
-               <van-field
-                v-model="formData.totalAmount"
-                name="采购总金额(元)"
-                label="采购总金额(元)"
-                placeholder="采购总金额(元)"
-                readonly
-              />
-              <van-field
-                v-model="formData.procureReason"
-                name="采购清单说明"
-                label="采购清单说明"
-                placeholder="采购清单说明"
-                type="textarea"
-                rows="3"
-                autosize
-                readonly
-              />
-            </van-cell-group>
-          </van-form>
-        </card>
-        <card title="采购详情">
-            <template #default>
-              <div v-for="(item,index) in formData.detailList" :key="index">
-                <van-swipe-cell :disabled="formRead">
-                  <card-cell>
-                    <van-cell title="采购时间" :value="moment(item.procureTime).format('YYYY-MM-DD')" />
-                    <van-cell title="资产名称" :value="item.assetName" />
-                    <van-cell title="资产类型" :value="item.assetType" />
-                    <van-cell title="资产型号" :value="item.assetModel" />
-                    <van-cell title="保管人" :value="item.custodianName" />
-                    <van-cell title="金额(元)" :value="item.amount" />
-                    <van-cell title="备注" :value="item.bz1" />
-                  </card-cell>
-                </van-swipe-cell> 
-              </div>
-            </template>
-        </card>
+              <van-cell title="资产名称" :value="item.assetName" />
+              <van-cell title="资产类型" :value="item.assetType" />
+              <van-cell title="资产型号" :value="item.assetModel" />
+              <van-cell title="保管人" :value="item.custodianName" />
+              <van-cell title="金额(元)" :value="item.amount" />
+              <van-cell title="备注" :value="item.bz1" />
+            </card-cell>
+          </van-swipe-cell>
+        </div>
+      </template>
+    </card>
   </flow-form>
 </template>
 
 <script setup lang="ts">
-import { useRoute } from 'vue-router';
-import { FlowDTO, getNextActivity } from '@/service/flow';
-import reqest from "@/utils/request";
-import FlowForm from '@/components/flowForm.vue';
-import Card from '@/components/card.vue';
-import CardCell from '@/components/cardCell.vue';
+import { useRoute } from 'vue-router'
+import { FlowDTO, getNextActivity } from '@/service/flow'
+import reqest from '@/utils/request'
+import FlowForm from '@/components/flowForm.vue'
+import Card from '@/components/card.vue'
+import CardCell from '@/components/cardCell.vue'
 import moment from 'moment'
-const route = useRoute();
+const route = useRoute()
 interface FormDataType {
   instanceId: string
   id: string
@@ -115,12 +120,12 @@ interface FormDataType {
   projectZrbm: string
   procureReason: string
   detailList: {
-    procureTime: string,
-    assetName: string,
-    assetModel: string,
-    assetType: string,
-    amount: string,
-    bz1: string,
+    procureTime: string
+    assetName: string
+    assetModel: string
+    assetType: string
+    amount: string
+    bz1: string
     custodianName: string
   }[]
 }
@@ -136,51 +141,59 @@ const formData = ref<FormDataType>({
   totalAmount: '',
   projectZrbm: '',
   procureReason: '',
-  detailList: []
+  detailList: [],
 })
 const formRead = ref(false)
-const { activityInstanceId, participant,flowInstanceId,read } = route.query as {
-  activityInstanceId: string;
-  participant: string;
-  flowInstanceId: string;
-  read: string;
-};
+const { activityInstanceId, participant, flowInstanceId, read } =
+  route.query as {
+    activityInstanceId: string
+    participant: string
+    flowInstanceId: string
+    read: string
+  }
 const activityData: FlowDTO = {
   activityInstanceId,
   participantId: participant,
-  flowOpinion: ''
+  flowOpinion: '',
 }
 const submitNextActivity = async (NextActivity: () => Promise<any>) => {
-  NextActivity();
-};
+  NextActivity()
+}
 const jsonToFormData = (json: any): FormData | null => {
   const keys: string[] = Object.keys(json)
-  if (keys.length > 0) { 
-    const formData = new FormData();
-    keys.forEach((key) => { 
-      formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
-    });
-    return formData;
+  if (keys.length > 0) {
+    const formData = new FormData()
+    keys.forEach((key) => {
+      formData.append(
+        key,
+        json[key] instanceof Object ? JSON.stringify(json[key]) : json[key]
+      )
+    })
+    return formData
   }
-  return null;
+  return null
 }
 
 /** 初始化表单数据 */
-const initFormData= async () => {
-  const result = await reqest.get(`/business/AssetProcure/mobileAdd?flowInstanceId=${flowInstanceId}`)
+const initFormData = async () => {
+  const result = await reqest.get(
+    `/business/AssetProcure/mobileAdd?flowInstanceId=${flowInstanceId}`
+  )
   formData.value = result.data
-  formData.value.applyTime=moment(formData.value.applyTime).format('YYYY-MM-DD')
+  formData.value.applyTime = moment(formData.value.applyTime).format(
+    'YYYY-MM-DD'
+  )
 }
 
 /** 初始化 */
 onMounted(() => {
   initFormData()
-  if(read==='1'){
-    formRead.value=true
+  if (read === '1') {
+    formRead.value = true
   }
 })
 </script>
 
 <style lang="scss" scoped>
-@import "./index.scss";
-</style>
+@import './index.scss';
+</style>

+ 105 - 99
client_h5/src/pages/officialSealOuter/index.vue

@@ -1,85 +1,88 @@
 <template>
   <flow-form :data="formData" @submit="submitNextActivity">
     <card title="基础信息" style="height: auto">
-      <van-form  ref="form">
+      <van-form ref="form">
         <van-cell-group inset>
           <van-field
-              v-model="formData.userNickname"
-              name="申请人"
-              label="申请人"
-              placeholder="申请人"
-              readonly
+            v-model="formData.userNickname"
+            name="申请人"
+            label="申请人"
+            placeholder="申请人"
+            readonly
           />
           <van-field
-              v-model="formData.deptName"
-              name="所在部门"
-              label="所在部门"
-              placeholder="所在部门"
-              readonly
+            v-model="formData.deptName"
+            name="所在部门"
+            label="所在部门"
+            placeholder="所在部门"
+            readonly
           />
           <van-field
-              v-model="formData.createTimeC"
-              name="申请时间"
-              label="申请时间"
-              placeholder="申请时间"
-              readonly
+            v-model="formData.createTimeC"
+            name="申请时间"
+            label="申请时间"
+            placeholder="申请时间"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealOuterApplyNo"
-              name="申请单号"
-              label="申请单号"
-              placeholder="申请单号"
-              readonly
+            v-model="formData.officialSealOuterApplyNo"
+            name="申请单号"
+            label="申请单号"
+            placeholder="申请单号"
+            readonly
           />
 
           <van-field
-              v-model="formData.officialSealApplyReason"
-              name="申请事由"
-              label="申请事由"
-              placeholder="申请事由"
-              readonly
+            v-model="formData.officialSealApplyReason"
+            type="textarea"
+            rows="1"
+            autosize
+            name="申请事由"
+            label="申请事由"
+            placeholder="申请事由"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealUseTypeText"
-              name="用章类型"
-              label="用章类型"
-              placeholder="用章类型"
-              readonly
+            v-model="formData.officialSealUseTypeText"
+            name="用章类型"
+            label="用章类型"
+            placeholder="用章类型"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealNameText"
-              name="公章名称"
-              label="公章名称"
-              placeholder="公章名称"
-              readonly
+            v-model="formData.officialSealNameText"
+            name="公章名称"
+            label="公章名称"
+            placeholder="公章名称"
+            readonly
           />
           <van-field
-              v-model="formData.planOuterDate"
-              name="外带时间"
-              label="外带时间"
-              placeholder="外带时间"
-              readonly
+            v-model="formData.planOuterDate"
+            name="外带时间"
+            label="外带时间"
+            placeholder="外带时间"
+            readonly
           />
           <van-field
-              v-model="formData.planReturnDate"
-              name="预计归还时间"
-              label="预计归还时间"
-              placeholder="预计归还时间"
-              readonly
+            v-model="formData.planReturnDate"
+            name="预计归还时间"
+            label="预计归还时间"
+            placeholder="预计归还时间"
+            readonly
           />
           <van-field
-              v-model="formData.realOuterDate"
-              name="实际借出时间"
-              label="实际借出时间"
-              placeholder="实际借出时间"
-              readonly
+            v-model="formData.realOuterDate"
+            name="实际借出时间"
+            label="实际借出时间"
+            placeholder="实际借出时间"
+            readonly
           />
           <van-field
-              v-model="formData.realReturnDate"
-              name="实际归还时间"
-              label="实际归还时间"
-              placeholder="实际归还时间"
-              readonly
+            v-model="formData.realReturnDate"
+            name="实际归还时间"
+            label="实际归还时间"
+            placeholder="实际归还时间"
+            readonly
           />
         </van-cell-group>
       </van-form>
@@ -88,76 +91,79 @@
 </template>
 
 <script setup lang="ts">
-import {useRoute} from 'vue-router';
-import {FlowDTO, getNextActivity} from '@/service/flow';
-import reqest from "@/utils/request";
-import DateTimeRange from '@/components/dateTimeRange.vue';
-import FlowForm from '@/components/flowForm.vue';
-import Card from '@/components/card.vue';
-import CardCell from '@/components/cardCell.vue';
-import {Checkbox, CheckboxGroup} from 'vant';
-import {DICT_TYPE, getDictLabel} from "@/utils/dict";
+import { useRoute } from 'vue-router'
+import { FlowDTO } from '@/service/flow'
+import reqest from '@/utils/request'
+import FlowForm from '@/components/flowForm.vue'
+import Card from '@/components/card.vue'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 
+const route = useRoute()
+const form = ref(null)
 
-const route = useRoute();
-const form = ref(null);
-
-interface FormDataType {
-}
+interface FormDataType {}
 
 const formData = ref<FormDataType>({})
 
-const {activityInstanceId, participant, flowInstanceId, read} = route.query as {
-  activityInstanceId: string;
-  participant: string;
-  flowInstanceId: string;
-  read: string;
-};
+const { activityInstanceId, participant, flowInstanceId, read } =
+  route.query as {
+    activityInstanceId: string
+    participant: string
+    flowInstanceId: string
+    read: string
+  }
 const activityData: FlowDTO = {
   activityInstanceId,
   participantId: participant,
-  flowOpinion: ''
+  flowOpinion: '',
 }
 const submitNextActivity = async (NextActivity: () => Promise<any>) => {
-  NextActivity();
-};
+  NextActivity()
+}
 
 const jsonToFormData = (json: any): FormData | null => {
   const keys: string[] = Object.keys(json)
   if (keys.length > 0) {
-    const formData = new FormData();
+    const formData = new FormData()
     keys.forEach((key) => {
-      formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
-    });
-    return formData;
+      formData.append(
+        key,
+        json[key] instanceof Object ? JSON.stringify(json[key]) : json[key]
+      )
+    })
+    return formData
   }
-  return null;
+  return null
 }
 
-
 function formatDate(timestamp: number) {
-  const date = new Date(timestamp);
-  const year = date.getFullYear();
-  let month = (1 + date.getMonth()).toString();
-  month = month.length > 1 ? month : '0' + month;
-  let day = date.getDate().toString();
-  day = day.length > 1 ? day : '0' + day;
-  return `${year}-${month}-${day}`;
+  const date = new Date(timestamp)
+  const year = date.getFullYear()
+  let month = (1 + date.getMonth()).toString()
+  month = month.length > 1 ? month : '0' + month
+  let day = date.getDate().toString()
+  day = day.length > 1 ? day : '0' + day
+  return `${year}-${month}-${day}`
 }
 
-
 /** 初始化表单数据 */
 const initFormData = async () => {
-  const result = await reqest.get(`/business/officialSealOuter/mobileAdd?flowInstanceId=${flowInstanceId}`)
+  const result = await reqest.get(
+    `/business/officialSealOuter/mobileAdd?flowInstanceId=${flowInstanceId}`
+  )
   formData.value = result.data
   formData.value.createTimeC = formatDate(formData.value.createTime)
 
-
-  formData.value.officialSealUseTypeText = getDictLabel(DICT_TYPE.WF_SEAL_TYPE, formData.value.officialSealUseType);
-  formData.value.officialSealNameText = getDictLabel(DICT_TYPE.WF_SEAL_NAME, formData.value.officialSealName);
+  formData.value.officialSealUseTypeText = getDictLabel(
+    DICT_TYPE.WF_SEAL_TYPE,
+    formData.value.officialSealUseType
+  )
+  formData.value.officialSealNameText = getDictLabel(
+    DICT_TYPE.WF_SEAL_NAME,
+    formData.value.officialSealName
+  )
 }
 
-
 /** 初始化 */
 onMounted(() => {
   initFormData()
@@ -165,7 +171,7 @@ onMounted(() => {
 </script>
 
 <style lang="scss" scoped>
-@import "./index.scss";
+@import './index.scss';
 
 ::v-deep .van-field__label {
   width: auto;

+ 85 - 79
client_h5/src/pages/officialSealUse/index.vue

@@ -1,57 +1,60 @@
 <template>
   <flow-form :data="formData" @submit="submitNextActivity">
     <card title="基础信息" style="height: auto">
-      <van-form  ref="form">
+      <van-form ref="form">
         <van-cell-group inset>
           <van-field
-              v-model="formData.userNickname"
-              name="申请人"
-              label="申请人"
-              placeholder="申请人"
-              readonly
+            v-model="formData.userNickname"
+            name="申请人"
+            label="申请人"
+            placeholder="申请人"
+            readonly
           />
           <van-field
-              v-model="formData.deptName"
-              name="所在部门"
-              label="所在部门"
-              placeholder="所在部门"
-              readonly
+            v-model="formData.deptName"
+            name="所在部门"
+            label="所在部门"
+            placeholder="所在部门"
+            readonly
           />
           <van-field
-              v-model="formData.createTimeC"
-              name="申请时间"
-              label="申请时间"
-              placeholder="申请时间"
-              readonly
+            v-model="formData.createTimeC"
+            name="申请时间"
+            label="申请时间"
+            placeholder="申请时间"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealApplyNo"
-              name="申请单号"
-              label="申请单号"
-              placeholder="申请单号"
-              readonly
+            v-model="formData.officialSealApplyNo"
+            name="申请单号"
+            label="申请单号"
+            placeholder="申请单号"
+            readonly
           />
 
           <van-field
-              v-model="formData.officialSealApplyReason"
-              name="申请事由"
-              label="申请事由"
-              placeholder="申请事由"
-              readonly
+            v-model="formData.officialSealApplyReason"
+            type="textarea"
+            rows="1"
+            autosize
+            name="申请事由"
+            label="申请事由"
+            placeholder="申请事由"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealUseTypeText"
-              name="用章类型"
-              label="用章类型"
-              placeholder="用章类型"
-              readonly
+            v-model="formData.officialSealUseTypeText"
+            name="用章类型"
+            label="用章类型"
+            placeholder="用章类型"
+            readonly
           />
           <van-field
-              v-model="formData.officialSealNameText"
-              name="公章名称"
-              label="公章名称"
-              placeholder="公章名称"
-              readonly
+            v-model="formData.officialSealNameText"
+            name="公章名称"
+            label="公章名称"
+            placeholder="公章名称"
+            readonly
           />
         </van-cell-group>
       </van-form>
@@ -60,76 +63,79 @@
 </template>
 
 <script setup lang="ts">
-import {useRoute} from 'vue-router';
-import {FlowDTO, getNextActivity} from '@/service/flow';
-import reqest from "@/utils/request";
-import DateTimeRange from '@/components/dateTimeRange.vue';
-import FlowForm from '@/components/flowForm.vue';
-import Card from '@/components/card.vue';
-import CardCell from '@/components/cardCell.vue';
-import {Checkbox, CheckboxGroup} from 'vant';
-import {DICT_TYPE, getDictLabel} from "@/utils/dict";
+import { useRoute } from 'vue-router'
+import { FlowDTO } from '@/service/flow'
+import reqest from '@/utils/request'
+import FlowForm from '@/components/flowForm.vue'
+import Card from '@/components/card.vue'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 
+const route = useRoute()
+const form = ref(null)
 
-const route = useRoute();
-const form = ref(null);
-
-interface FormDataType {
-}
+interface FormDataType {}
 
 const formData = ref<FormDataType>({})
 
-const {activityInstanceId, participant, flowInstanceId, read} = route.query as {
-  activityInstanceId: string;
-  participant: string;
-  flowInstanceId: string;
-  read: string;
-};
+const { activityInstanceId, participant, flowInstanceId, read } =
+  route.query as {
+    activityInstanceId: string
+    participant: string
+    flowInstanceId: string
+    read: string
+  }
 const activityData: FlowDTO = {
   activityInstanceId,
   participantId: participant,
-  flowOpinion: ''
+  flowOpinion: '',
 }
 const submitNextActivity = async (NextActivity: () => Promise<any>) => {
-  NextActivity();
-};
+  NextActivity()
+}
 
 const jsonToFormData = (json: any): FormData | null => {
   const keys: string[] = Object.keys(json)
   if (keys.length > 0) {
-    const formData = new FormData();
+    const formData = new FormData()
     keys.forEach((key) => {
-      formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
-    });
-    return formData;
+      formData.append(
+        key,
+        json[key] instanceof Object ? JSON.stringify(json[key]) : json[key]
+      )
+    })
+    return formData
   }
-  return null;
+  return null
 }
 
-
 function formatDate(timestamp: number) {
-  const date = new Date(timestamp);
-  const year = date.getFullYear();
-  let month = (1 + date.getMonth()).toString();
-  month = month.length > 1 ? month : '0' + month;
-  let day = date.getDate().toString();
-  day = day.length > 1 ? day : '0' + day;
-  return `${year}-${month}-${day}`;
+  const date = new Date(timestamp)
+  const year = date.getFullYear()
+  let month = (1 + date.getMonth()).toString()
+  month = month.length > 1 ? month : '0' + month
+  let day = date.getDate().toString()
+  day = day.length > 1 ? day : '0' + day
+  return `${year}-${month}-${day}`
 }
 
-
 /** 初始化表单数据 */
 const initFormData = async () => {
-  const result = await reqest.get(`/business/officialSealUse/mobileAdd?flowInstanceId=${flowInstanceId}`)
+  const result = await reqest.get(
+    `/business/officialSealUse/mobileAdd?flowInstanceId=${flowInstanceId}`
+  )
   formData.value = result.data
   formData.value.createTimeC = formatDate(formData.value.createTime)
 
-
-  formData.value.officialSealUseTypeText = getDictLabel(DICT_TYPE.WF_SEAL_TYPE, formData.value.officialSealUseType);
-  formData.value.officialSealNameText = getDictLabel(DICT_TYPE.WF_SEAL_NAME, formData.value.officialSealName);
+  formData.value.officialSealUseTypeText = getDictLabel(
+    DICT_TYPE.WF_SEAL_TYPE,
+    formData.value.officialSealUseType
+  )
+  formData.value.officialSealNameText = getDictLabel(
+    DICT_TYPE.WF_SEAL_NAME,
+    formData.value.officialSealName
+  )
 }
 
-
 /** 初始化 */
 onMounted(() => {
   initFormData()
@@ -137,7 +143,7 @@ onMounted(() => {
 </script>
 
 <style lang="scss" scoped>
-@import "./index.scss";
+@import './index.scss';
 
 ::v-deep .van-field__label {
   width: auto;

+ 72 - 70
client_h5/src/pages/usemoney/index.vue

@@ -1,4 +1,3 @@
-
 <template>
   <flow-form :data="formData" @submit="submitNextActivity">
     <card title="基础信息">
@@ -36,6 +35,9 @@
             v-model="formData.projectName"
             name="项目名称"
             label="项目名称"
+            type="textarea"
+            rows="1"
+            autosize
             placeholder="项目名称"
             readonly
           />
@@ -187,110 +189,110 @@
 </template>
 
 <script setup lang="ts">
-import { useRoute } from "vue-router";
-import { FlowDTO, getNextActivity } from "@/service/flow";
-import reqest from "@/utils/request";
-import FlowForm from "@/components/flowForm.vue";
-import Card from "@/components/card.vue";
-import CardCell from "@/components/cardCell.vue";
-import moment from "moment";
-const route = useRoute();
+import { useRoute } from 'vue-router'
+import { FlowDTO, getNextActivity } from '@/service/flow'
+import reqest from '@/utils/request'
+import FlowForm from '@/components/flowForm.vue'
+import Card from '@/components/card.vue'
+import CardCell from '@/components/cardCell.vue'
+import moment from 'moment'
+const route = useRoute()
 interface FormDataType {
-  instanceId: string;
-  id: string;
-  leaveHours: number | null;
-  userNickname: string;
-  deptName: string;
-  applyTime: string;
-  leaveNo: string;
-  leaveType: number | null;
-  leaveTypeText: string;
-  leaveDays: string;
-  leaveReason: string;
+  instanceId: string
+  id: string
+  leaveHours: number | null
+  userNickname: string
+  deptName: string
+  applyTime: string
+  leaveNo: string
+  leaveType: number | null
+  leaveTypeText: string
+  leaveDays: string
+  leaveReason: string
   detailList: {
-    amount: string;
-    costTypeName: string;
-    costContent: string;
-    remark: string;
-  }[];
+    amount: string
+    costTypeName: string
+    costContent: string
+    remark: string
+  }[]
 }
 const formData = ref<FormDataType>({
-  instanceId: "",
-  id: "",
+  instanceId: '',
+  id: '',
   leaveHours: null,
-  userNickname: "",
-  deptName: "",
-  applyTime: "",
-  leaveNo: "",
+  userNickname: '',
+  deptName: '',
+  applyTime: '',
+  leaveNo: '',
   leaveType: null,
-  leaveTypeText: "",
-  leaveDays: "",
-  leaveReason: "",
+  leaveTypeText: '',
+  leaveDays: '',
+  leaveReason: '',
   detailList: [],
-});
-const formRead = ref(false);
+})
+const formRead = ref(false)
 const { activityInstanceId, participant, flowInstanceId, read } =
   route.query as {
-    activityInstanceId: string;
-    participant: string;
-    flowInstanceId: string;
-    read: string;
-  };
+    activityInstanceId: string
+    participant: string
+    flowInstanceId: string
+    read: string
+  }
 const activityData: FlowDTO = {
   activityInstanceId,
   participantId: participant,
-  flowOpinion: "",
-};
+  flowOpinion: '',
+}
 const submitNextActivity = async (NextActivity: () => Promise<any>) => {
-  NextActivity();
-};
+  NextActivity()
+}
 const jsonToFormData = (json: any): FormData | null => {
-  const keys: string[] = Object.keys(json);
+  const keys: string[] = Object.keys(json)
   if (keys.length > 0) {
-    const formData = new FormData();
+    const formData = new FormData()
     keys.forEach((key) => {
       formData.append(
         key,
         json[key] instanceof Object ? JSON.stringify(json[key]) : json[key]
-      );
-    });
-    return formData;
+      )
+    })
+    return formData
   }
-  return null;
-};
+  return null
+}
 
 /** 初始化表单数据 */
 const initFormData = async () => {
   const result = await reqest.get(
     `/business/UseMoney/mobileAdd?flowInstanceId=${flowInstanceId}`
-  );
-  formData.value = result.data;
+  )
+  formData.value = result.data
   formData.value.applyTime = moment(formData.value.applyTime).format(
-    "YYYY-MM-DD"
-  );
-  formData.value.agreedPayTime = formData.value.agreedPayTime ? moment(formData.value.agreedPayTime).format(
-    "YYYY-MM-DD"
-  ) : '';
+    'YYYY-MM-DD'
+  )
+  formData.value.agreedPayTime = formData.value.agreedPayTime
+    ? moment(formData.value.agreedPayTime).format('YYYY-MM-DD')
+    : ''
   if (formData.value.paymentMethod == 1) {
-    formData.value.paymentMethod = "银行";
+    formData.value.paymentMethod = '银行'
   } else if (formData.value.paymentMethod == 2) {
-    formData.value.paymentMethod = "现金";
+    formData.value.paymentMethod = '现金'
   } else if (formData.value.paymentMethod == 3) {
-    formData.value.paymentMethod = "挂账";
+    formData.value.paymentMethod = '挂账'
   } else {
-    formData.value.paymentMethod = "";
+    formData.value.paymentMethod = ''
   }
-};
+}
 
 /** 初始化 */
 onMounted(() => {
-  initFormData();
-  if (read === "1") {
-    formRead.value = true;
+  initFormData()
+  if (read === '1') {
+    formRead.value = true
   }
-});
+})
 </script>
 
 <style lang="scss" scoped>
-@import "./index.scss";
-</style>
+@import './index.scss';
+</style>

+ 10 - 10
client_h5/src/router/index.ts

@@ -1,4 +1,4 @@
-import type {App} from 'vue';
+import type { App } from 'vue'
 import type { RouteRecordRaw } from 'vue-router'
 import { createRouter, createWebHistory } from 'vue-router'
 import { showDialog, closeDialog } from 'vant'
@@ -10,27 +10,27 @@ const router = createRouter({
   history: createWebHistory('/html_h5'),
   strict: true,
   routes: routes as RouteRecordRaw[],
-  scrollBehavior: () => ({ left: 0, top: 0 })
+  scrollBehavior: () => ({ left: 0, top: 0 }),
 })
 // 路由加载前
 router.beforeEach((to, from, next) => {
-  next()
-  return
+  // next()
+  // return
   getUserInfoPromise(true).then((isLogin) => {
-    next(); 
+    next()
     if (!isLogin) {
       showDialog({
         message: '很抱歉,用户未登录,请先重新加载!',
         confirmButtonText: '重新加载',
-        beforeClose: function(action) {
+        beforeClose: function (action) {
           if (action === 'confirm') {
             closeDialog()
-            localStorage.clear();
+            localStorage.clear()
             getUserInfoPromise(false).then((isLoginHttp) => {
               if (isLoginHttp) {
                 window.location.reload()
-               }
-             })
+              }
+            })
           }
         },
       })
@@ -41,4 +41,4 @@ const setupRouter = (app: App<Element>): void => {
   app.use(router)
 }
 
-export default setupRouter;
+export default setupRouter