Pārlūkot izejas kodu

后台接口对接

songxy 1 gadu atpakaļ
vecāks
revīzija
e2894e6a1d

+ 9 - 5
client/src/views/OaSystem/home/components/CardItemThree.vue

@@ -22,22 +22,25 @@
 
 <script setup lang="ts">
 import request from '@/config/axios'
+
 interface SignInterface {
   icon: string
   title: string
   value: number
   unit: string
 }
+const currentYear = new Date().getFullYear()
 const signs = ref<SignInterface[]>([
-  { icon: '签', title: '2024年度签约', value: 0, unit: '万元' },
-  { icon: '回', title: '2024年度回款', value: 0, unit: '万元' },
-  { icon: '净', title: '2024年度净合同额', value: 0, unit: '万元' },
-  { icon: '拓', title: '2024年度新开拓', value: 0, unit: '万元' },
+  { icon: '签', title: `${currentYear}年度签约`, value: 0, unit: '万元' },
+  { icon: '回', title: `${currentYear}年度回款`, value: 0, unit: '万元' },
+  { icon: '净', title: `${currentYear}年度净合同额`, value: 0, unit: '万元' },
+  { icon: '拓', title: `${currentYear}年度新开拓`, value: 0, unit: '万元' },
   { icon: '分包', title: '待支付', value: 0, unit: '万元' },
   { icon: '外包', title: '待支付', value: 0, unit: '万元' }
 ])
 const currentIndex = ref<number>(0)
 const $emit = defineEmits<{
+  (e: 'init', data: any): void
   (e: 'click', v: SignInterface): void
 }>()
 const clickHandle = (item: SignInterface, index: number): void => {
@@ -50,7 +53,7 @@ const queryContractInfo = async (): Promise<void> => {
     {
       url: urlApi,
       data: {
-        year: 2024
+        year: currentYear
       }
     },
     'business'
@@ -61,6 +64,7 @@ const queryContractInfo = async (): Promise<void> => {
   signs.value[3].value = result.newAmount ?? 0
   signs.value[4].value = result.subToPay ?? 0
   signs.value[5].value = result.outToPay ?? 0
+  $emit('init', result)
 }
 queryContractInfo()
 </script>

+ 4 - 3
client/src/views/OaSystem/home/components/PersonInfo.vue

@@ -87,8 +87,9 @@ const queryStaffStatistic = async (): Promise<void> => {
     girlStaffNum.value = result.sexStatistic.girlStaffNum ?? 0
   }
   if (result.degreeStatistic) {
-    degreeStatistic.ordinaryCollegeStaffNum = result.ordinaryCollegeStaffNum ?? 0
-    degreeStatistic.firstClassCollegeStaffNum = result.firstClassCollegeStaffNum ?? 0
+    degreeStatistic.ordinaryCollegeStaffNum = result.degreeStatistic.ordinaryCollegeStaffNum ?? 0
+    degreeStatistic.firstClassCollegeStaffNum =
+      result.degreeStatistic.firstClassCollegeStaffNum ?? 0
     degreeStatistic.list[0].value = result.degreeStatistic.doctorStaffNum
     degreeStatistic.list[1].value = result.degreeStatistic.masterStaffNum
     degreeStatistic.list[2].value = result.degreeStatistic.undergraduateStaffNum
@@ -108,7 +109,7 @@ const queryStaffStatistic = async (): Promise<void> => {
     staffStatistic.list[3].value = result.ageStatistic.thirtyFiveToFortyStaffNum
     staffStatistic.list[4].value = result.ageStatistic.overFortyStaffNum
   }
-  switchListData(0)
+  switchListData()
 }
 queryStaffStatistic()
 

+ 76 - 4
client/src/views/OaSystem/home/homeLeader.vue

@@ -45,18 +45,20 @@
     </div>
     <div class="card-item-common card-flex-col">
       <CardTitle title="合同信息" />
-      <CardItemThree />
+      <CardItemThree @init="initData" />
       <CardTitle title="成本情况">
         <template #rightTitle>
-          <span style="font-size: 12px; color: #8b969c"> 单位:元 </span>
+          <span style="font-size: 12px; color: #8b969c"> 单位:元 </span>
         </template>
       </CardTitle>
-      <div style="flex: 1"> <LineChart /></div>
+      <div style="flex: 1"> <MyEchart :options="options" /></div>
     </div>
   </div>
 </template>
 <script setup lang="ts">
 import { useRouter } from 'vue-router'
+import { EChartsOption } from 'echarts'
+import * as echarts from 'echarts'
 import CompanyNews from './components/CompanyNews.vue'
 import CardTitle from './components/CardTitle.vue'
 import CardItemSeven from './components/CardItemSeven.vue'
@@ -64,7 +66,7 @@ import HandleEvents from './components/HandleEvents.vue'
 import CardItemThree from './components/CardItemThree.vue'
 import ProjectInfo from './components/ProjectInfo.vue'
 import PersonInfo from './components/PersonInfo.vue'
-import LineChart from './components/LineChart.vue'
+import MyEchart from '@/components/Echart/src/Echart.vue'
 import CardItemSeven3 from './components/CardItemSeven3.vue'
 
 import { ref } from 'vue'
@@ -100,4 +102,74 @@ const toNewPageHandle = (path: string | null = null) => {
     router.push({ path: path })
   }
 }
+
+/**
+ * 折线图
+ */
+const chartData = ref([
+  { value: 0, name: '差旅费用' },
+  { value: 0, name: '报销成本' },
+  { value: 0, name: '用款成本' }
+])
+
+const xAxisData = ['差旅费用', '报销成本', '用款成本']
+
+const options = reactive<EChartsOption>({
+  grid: {
+    left: '10%',
+    right: '0%',
+    bottom: '16%',
+    top: '10%'
+  },
+  xAxis: {
+    data: xAxisData,
+    axisLine: {
+      show: false
+    },
+    axisTick: {
+      show: false
+    }
+  },
+  yAxis: {
+    splitLine: {
+      show: true,
+      lineStyle: {
+        type: 'dashed',
+        color: '#E3E3E3'
+      }
+    },
+    axisLine: {
+      lineStyle: {
+        color: '#666'
+      }
+    }
+  },
+  series: [
+    {
+      name: 'bar',
+      type: 'bar',
+      barWidth: 20,
+      label: {
+        show: true,
+        position: 'top'
+      },
+      itemStyle: {
+        normal: {
+          barBorderRadius: 10,
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            { offset: 0, color: '#7BB5FA' },
+            { offset: 1, color: '#448ADC' }
+          ])
+        }
+      },
+      data: chartData.value
+    }
+  ]
+})
+const initData = (result) => {
+  chartData.value[0]['value'] = result.travelCost
+  chartData.value[1]['value'] = result.reimbursementCost
+  chartData.value[2]['value'] = result.paymentCost
+  // options['series'][0]['data'] = chartData
+}
 </script>

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectDetail/projectDetail.vue

@@ -220,7 +220,7 @@ const signContract = ref<{
   contractId: string
   instanceId: string
   isvalid: number //判断有没有作废 0 已作废 1 未作废
-  flowStatus: number
+  flowStatus: number //0|null 未开始 1 进行中 90 已完成
 }>({
   exist: false,
   contractId: '',