Parcourir la source

feat: 客户合同表头

qiny il y a 1 an
Parent
commit
a88acae4d9

+ 60 - 6
client/src/views/OaSystem/marketCenter/khxqPage/CustomerContract.vue

@@ -1,10 +1,25 @@
 <template>
   <div class="titleBox">
-    <span> 合同总金额:0 万元 </span>
-    <span> 已开票金额:0 万元</span>
-    <span> 已回款:0 万元 </span>
-    <span> 应收账款:0 万元 </span>
-    <span> 合同余额:0 万元 </span>
+    <div>
+      <span> 合同总金额:{{ contractAmount.amount }} </span>
+      <span>|</span>
+    </div>
+    <div>
+      <!-- <img class="icon" :src="getAssetURL('xmzx/xmzcz')" alt="" /> -->
+      <span> 已开票金额:{{ contractAmount.invoicedCount }}</span>
+    </div>
+    <div>
+      <!-- <img class="icon" :src="getAssetURL('xmzx/xmzlr')" alt="" /> -->
+      <span> 已回款:{{ contractAmount.receivedCount }} </span>
+    </div>
+    <div>
+      <!-- <img class="icon" :src="getAssetURL('xmzx/xmzcb')" alt="" /> -->
+      <span> 应收账款:{{ contractAmount.receivableCount }} </span>
+    </div>
+    <div>
+      <!-- <img class="icon" :src="getAssetURL('xmzx/xmzcz')" alt="" /> -->
+      <span> 合同余额:{{ contractAmount.contractBalance }} </span>
+    </div>
   </div>
   <div class="tableBox">
     <div class="table" ref="tableRef">
@@ -71,7 +86,7 @@
 <script lang="ts" setup>
 import request from '@/config/axios'
 import { openFlow } from '@/utils/flow'
-
+import { getAssetURL } from '@/utils/auth'
 /**
  * @description 客户合同
  */
@@ -83,6 +98,7 @@ const pageNo = ref(1)
 onMounted(async () => {
   tableHeight.value = tableRef.value.clientHeight
   await getDataSource()
+  await getMoney()
 })
 // 获取合同分页数据
 const { currentRoute } = useRouter()
@@ -141,11 +157,49 @@ const getFlowUrl = async (instanceId) => {
   // console.log('getFlowUrl', result)
   return result
 }
+// 查询合同金额
+const contractAmount = ref({
+  amount: '0 万元', // 总金额
+  invoicedCount: '0 万元', // 已开票金额
+  receivedCount: '0 万元', // 已回款金额
+  receivableCount: '0 万元', // 应收账款
+  contractBalance: '0 万元' // 合同余额
+})
+const getMoney = async () => {
+  const result: any = await request.get(
+    {
+      url: '/contract/list/calc',
+      params: {
+        clientId: currentRoute.value.query.id
+      }
+    },
+    '/business'
+  )
+  console.log('result', result)
+  contractAmount.value = {
+    amount: result.amount ? unitConversion(result.amount) : '0 万元',
+    invoicedCount: result.invoiceAmount ? unitConversion(result.invoiceAmount) : '0 万元',
+    receivedCount: result.returnAmount ? unitConversion(result.returnAmount) : '0 万元',
+    receivableCount: result.receivableAmount ? unitConversion(result.receivableAmount) : '0 万元',
+    contractBalance: result.balance ? unitConversion(result.balance) : '0 万元'
+  }
+}
+const unitConversion = (count: number): string => {
+  if (count && count >= 10000) {
+    const valueInBillion = count / 10000
+    return valueInBillion.toFixed(2) + ' 万元'
+  } else {
+    return `${count ?? 0} 元`
+  }
+}
 </script>
 
 <style scoped lang="scss">
 .titleBox {
   line-height: 60px;
+  display: flex;
+  justify-content: left;
+  align-items: center;
   span {
     margin-right: 30px;
     font-weight: bold;

+ 2 - 0
client_h5/.gitignore

@@ -22,3 +22,5 @@ dist-ssr
 *.njsproj
 *.sln
 *.sw?
+
+.history

+ 81 - 67
client_h5/src/pages/home/index.vue

@@ -1,87 +1,97 @@
 <script setup lang="ts">
-import { useUserStoreWithOut } from '@/stores/modules/user';
-import { getAssetsURI } from '@/utils/common';
+import { useUserStoreWithOut } from "@/stores/modules/user";
+import { getAssetsURI } from "@/utils/common";
 
 const userStore = useUserStoreWithOut();
 
 interface MenuItem {
-  title: string
-  corner?: number
-  path?: string
-  icon: string
+  title: string;
+  corner?: number;
+  path?: string;
+  icon: string;
 }
 const navMenus: MenuItem[] = [
   {
-    title: '办件中心',
+    title: "办件中心",
     corner: 0,
-    path: 'http://10.10.10.7:18080/workflow/HandlerCaseCenter/mobileIndex',
-    icon: '../assets/images/bjzx_icon.png'
-  },{
-    title: '日志填写',
+    path: "http://10.10.10.7:18080/workflow/HandlerCaseCenter/mobileIndex",
+    icon: "../assets/images/bjzx_icon.png",
+  },
+  {
+    title: "日志填写",
     corner: 0,
-    icon: '../assets/images/rztx_icon.png'
-  },{
-    title: '我的日志',
+    icon: "../assets/images/rztx_icon.png",
+    path: "daily",
+  },
+  {
+    title: "我的日志",
     corner: 0,
-    icon: '../assets/images/wdrz_icon.png'
-  },{
-    title: '我的消息',
+    icon: "../assets/images/wdrz_icon.png",
+  },
+  {
+    title: "我的消息",
     corner: 0,
-    icon: '../assets/images/wdxx_icon.png'
-  }
-]
+    icon: "../assets/images/wdxx_icon.png",
+  },
+];
 
 const processMenus: MenuItem[] = [
   {
-    title: '请假申请',
+    title: "请假申请",
     corner: 0,
-    icon: '../assets/images/qjsq_icon.png'
-  },{
-    title: '出差申请',
+    icon: "../assets/images/qjsq_icon.png",
+  },
+  {
+    title: "出差申请",
     corner: 0,
-    icon: '../assets/images/ccsq_icon.png'
-  },{
-    title: '考情说明条',
+    icon: "../assets/images/ccsq_icon.png",
+  },
+  {
+    title: "考情说明条",
     corner: 0,
-    icon: '../assets/images/kqsmt_icon.png'
-  },{
-    title: '借款申请',
+    icon: "../assets/images/kqsmt_icon.png",
+  },
+  {
+    title: "借款申请",
     corner: 0,
-    icon: '../assets/images/jksq_icon.png'
-  }
-]
+    icon: "../assets/images/jksq_icon.png",
+  },
+];
 
 const personMenus: MenuItem[] = [
   {
-    title: '我的考勤',
+    title: "我的考勤",
     corner: 0,
-    icon: '../assets/images/wdkq_icon.png'
-  },{
-    title: '我的资产',
+    icon: "../assets/images/wdkq_icon.png",
+  },
+  {
+    title: "我的资产",
     corner: 0,
-    icon: '../assets/images/wdzc_icon.png'
-  },{
-    title: '学习中心',
+    icon: "../assets/images/wdzc_icon.png",
+  },
+  {
+    title: "学习中心",
     corner: 0,
-    icon: '../assets/images/xxzx_icon.png'
-  },{
-    title: '通知公告',
+    icon: "../assets/images/xxzx_icon.png",
+  },
+  {
+    title: "通知公告",
     corner: 0,
-    icon: '../assets/images/tzgg_icon.png'
-  }
-]
+    icon: "../assets/images/tzgg_icon.png",
+  },
+];
 const toPageHandle = (path: string) => {
-  window.location.href = path
-}
-dd.biz.util.openLink({
-				    url: "http://10.10.10.7:18080/business/Leave/mobileIndex?flowInstanceId=018f147231570a0767908f0ef011044f&activityInstanceId=018f147231750a0767908f0ef0110451&_fm=018c1f6407720947d2f88c1f64060001&participant=018f147231840a0767908f0ef0110453&userId=91507848-736f-4327-887e-22aec122d5c7&first=1&status=1&child=0",
-				    onSuccess:function(){
-	console.log("跳转成功")
-},
-				    onFail: function(err){
-	console.error("跳转错误:"+err)
-}
-				}) 
+  window.location.href = path;
+};
+// dd.biz.util.openLink({
+// 				    url: "http://10.10.10.7:18080/business/Leave/mobileIndex?flowInstanceId=018f147231570a0767908f0ef011044f&activityInstanceId=018f147231750a0767908f0ef0110451&_fm=018c1f6407720947d2f88c1f64060001&participant=018f147231840a0767908f0ef0110453&userId=91507848-736f-4327-887e-22aec122d5c7&first=1&status=1&child=0",
+// 				    onSuccess:function(){
+// 	console.log("跳转成功")
+// },
+// 				    onFail: function(err){
+// 	console.error("跳转错误:"+err)
+// }
+// 				})
 </script>
 
 <template>
@@ -89,15 +99,19 @@ dd.biz.util.openLink({
     <div class="header">
       <div class="nav">
         <div class="login_info">
-          <img src="@/assets/images/user_log.jpg">
+          <img src="@/assets/images/user_log.jpg" />
           <span>{{ userStore.userInfo.nickname }}</span>
         </div>
       </div>
       <ul>
-        <li v-for="(item,index) in navMenus" :key="index" @click="toPageHandle(item.path as string)">
+        <li
+          v-for="(item, index) in navMenus"
+          :key="index"
+          @click="toPageHandle(item.path as string)"
+        >
           <img :src="getAssetsURI(item['icon'])" />
-          <p class="title">{{ item['title'] }}</p>
-          <span class="corner">{{ item['corner'] }}</span>
+          <p class="title">{{ item["title"] }}</p>
+          <span class="corner">{{ item["corner"] }}</span>
         </li>
       </ul>
     </div>
@@ -105,8 +119,8 @@ dd.biz.util.openLink({
       <div class="card">
         <p class="card_title">常用流程</p>
         <ul>
-          <li v-for="(item,index) in processMenus" :key="index">
-            <span class="title">{{ item['title'] }}</span>
+          <li v-for="(item, index) in processMenus" :key="index">
+            <span class="title">{{ item["title"] }}</span>
             <img :src="getAssetsURI(item['icon'])" />
           </li>
         </ul>
@@ -114,10 +128,10 @@ dd.biz.util.openLink({
       <div class="item">
         <p class="card_title">个人中心</p>
         <ul>
-          <li v-for="(item,index) in personMenus" :key="index">
+          <li v-for="(item, index) in personMenus" :key="index">
             <img :src="getAssetsURI(item['icon'])" />
-            <span class="title">{{ item['title'] }}</span>
-            <span class="corner">{{ item['corner'] }}</span>
+            <span class="title">{{ item["title"] }}</span>
+            <span class="corner">{{ item["corner"] }}</span>
           </li>
         </ul>
       </div>
@@ -126,5 +140,5 @@ dd.biz.util.openLink({
 </template>
 
 <style scoped>
-@import './index.scss';
+@import "./index.scss";
 </style>

+ 20 - 12
client_h5/src/router/routes.ts

@@ -1,19 +1,27 @@
-import type { RouteRecordRaw } from 'vue-router'
+import type { RouteRecordRaw } from "vue-router";
 
-const routes:RouteRecordRaw[] = [
+const routes: RouteRecordRaw[] = [
   {
     path: "/",
-    redirect: 'home',
+    redirect: "home",
     children: [
       {
-        path: 'home',
-        name: 'Homoe',
+        path: "home",
+        name: "Homoe",
         meta: {
-          title: '首页'
+          title: "首页",
         },
-        component:  () => import('@/pages/home/index.vue'),
-      }
-    ] as RouteRecordRaw[]
-  }
-] as RouteRecordRaw[]
-export default routes;
+        component: () => import("@/pages/home/index.vue"),
+      },
+      {
+        path: "daily",
+        name: "Daily",
+        meta: {
+          title: "日报填写",
+        },
+        component: () => import("@/pages/logs/Daily/index.vue"),
+      },
+    ] as RouteRecordRaw[],
+  },
+] as RouteRecordRaw[];
+export default routes;