Bläddra i källkod

获取进度数据

duy 7 månader sedan
förälder
incheckning
b0bf8dd75d
2 ändrade filer med 58 tillägg och 23 borttagningar
  1. 8 0
      src/api/modules/datav/projectdata.js
  2. 50 23
      src/views/home/datav.vue

+ 8 - 0
src/api/modules/datav/projectdata.js

@@ -17,5 +17,13 @@ export default {
             params: form,
         }, false)
     },
+    //数据看板-进度数据
+    async schedulestStat(form) {
+        return HcApi({
+            url: '/api/blade-attach/project/data-schedule-stat',
+            method: 'get',
+            params: form,
+        }, false)
+    },
 
 }

+ 50 - 23
src/views/home/datav.vue

@@ -208,9 +208,9 @@
                                         <div class="content relative ml-[12px] h-[52px] flex-1">
                                             <div class="name mb-[10px] text-center text-[16px]">一季度</div>
                                             <div class="data text-center text-[24px]">
-                                                <span class="num font-bold">130</span>
+                                                <span class="num font-bold">{{ scheduleStat?.oneFinished || 0 }}</span>
                                                 <span class="line">/</span>
-                                                <span class="red font-bold">60</span>
+                                                <span class="red font-bold">{{ scheduleStat?.oneUnFinished || 0 }}</span>
                                             </div>
                                         </div>
                                     </div>
@@ -221,9 +221,9 @@
                                         <div class="content relative ml-[12px] h-[52px] flex-1">
                                             <div class="name mb-[10px] text-center text-[16px]">二季度</div>
                                             <div class="data text-center text-[24px]">
-                                                <span class="num font-bold">130</span>
+                                                <span class="num font-bold">{{ scheduleStat?.twoFinished || 0 }}</span>
                                                 <span class="line">/</span>
-                                                <span class="red font-bold">60</span>
+                                                <span class="red font-bold">{{ scheduleStat?.twoUnFinished || 0 }}</span>
                                             </div>
                                         </div>
                                     </div>
@@ -234,9 +234,9 @@
                                         <div class="content relative ml-[12px] h-[52px] flex-1">
                                             <div class="name mb-[10px] text-center text-[16px]">三季度</div>
                                             <div class="data text-center text-[24px]">
-                                                <span class="num font-bold">130</span>
+                                                <span class="num font-bold">{{ scheduleStat?.threeFinished || 0 }}</span>
                                                 <span class="line">/</span>
-                                                <span class="red font-bold">60</span>
+                                                <span class="red font-bold">{{ scheduleStat?.threeUnFinished || 0 }}</span>
                                             </div>
                                         </div>
                                     </div>
@@ -247,9 +247,9 @@
                                         <div class="content relative ml-[12px] h-[52px] flex-1">
                                             <div class="name mb-[10px] text-center text-[16px]">四季度</div>
                                             <div class="data text-center text-[24px]">
-                                                <span class="num font-bold">130</span>
+                                                <span class="num font-bold">{{ scheduleStat?.fourFinished || 0 }}</span>
                                                 <span class="line">/</span>
-                                                <span class="red font-bold">60</span>
+                                                <span class="red font-bold">{{ scheduleStat?.fourUnFinished || 0 }}</span>
                                             </div>
                                         </div>
                                     </div>
@@ -259,14 +259,14 @@
                         <div class="hc-datav-divider" />
                         <div v-if="searchForm.projectScheduleType !== '3'" class="hc-datav-table relative">
                             <HcDatavTable :column="tableColumn2" :datas="tableData2">
-                                <template #key3="{ row }">
-                                    <span style="color: #D8A70F;" class="font-bold">{{ row.key3 }}</span>
+                                <template #projectTotal="{ row }">
+                                    <span style="color: #D8A70F;" class="font-bold">{{ row.projectTotal }}</span>
                                 </template>
-                                <template #key4="{ row }">
-                                    <span style="color: #0BD70E;" class="font-bold">{{ row.key4 }}</span>
+                                <template #finishedTotal="{ row }">
+                                    <span style="color: #0BD70E;" class="font-bold">{{ row.finishedTotal }}</span>
                                 </template>
-                                <template #key5="{ row }">
-                                    <span style="color: #FF0000;" class="font-bold">{{ row.key5 }}</span>
+                                <template #unFinishedTotal="{ row }">
+                                    <span style="color: #FF0000;" class="font-bold">{{ row.unFinishedTotal }}</span>
                                 </template>
                             </HcDatavTable>
                         </div>
@@ -393,6 +393,7 @@ const pageTypeChange = () => {
 const searchChange = ()=>{
     getDataProjectStat()
     getDataInvestStat()
+    getScheduleStat()
 }
 //获取项目统计
 const projectStat = ref({
@@ -454,6 +455,37 @@ const getDataInvestStat = async ()=>{
         tableData1.value = []
     }
 }
+//获取进度数据
+const scheduleStat = ref({
+    oneFinished:0,
+    oneUnFinished:0,
+    twoFinished:0,
+    twoUnFinished:0,
+    threeFinished:0,
+    threeUnFinished:0,
+    fourFinished:0,
+    fourUnFinished:0,
+})
+const getScheduleStat = async ()=>{
+    const { error, code, data } = await projectApi.schedulestStat(searchForm.value)
+    //处理数据
+    if (!error && code === 200) {
+        scheduleStat.value = getObjValue(data)
+        tableData2.value = getArrValue(data['list'])
+    } else {
+        scheduleStat.value = {
+            oneFinished:0,
+            oneUnFinished:0,
+            twoFinished:0,
+            twoUnFinished:0,
+            threeFinished:0,
+            threeUnFinished:0,
+            fourFinished:0,
+            fourUnFinished:0,
+        }
+        tableData2.value = []
+    }
+}
 //表格1
 const tableColumn1 = [
     { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
@@ -495,16 +527,11 @@ const lagRowClick = (row) => {
 
 //表格2
 const tableColumn2 = [
-    { key: 'key1', name: '项目阶段' }, { key: 'key2', name: '项目类型' },
-    { key: 'key3', name: '项目数' }, { key: 'key4', name: '已完成项目数' },
-    { key: 'key5', name: '未完成项目数' },
+    { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
+    { key: 'projectTotal', name: '项目数' }, { key: 'finishedTotal', name: '已完成项目数' },
+    { key: 'unFinishedTotal', name: '未完成项目数' },
 ]
-const tableData2 = ref([
-    { key1: '在建项目', key2: '铁路', key3: '12', key4: '12', key5: 12, key6: 12 },
-    { key1: '在建项目', key2: '民航', key3: '12', key4: '12', key5: 12, key6: 12 },
-    { key1: '在建项目', key2: 'xx', key3: '12', key4: '12', key5: 12, key6: 12 },
-    { key1: '在建项目', key2: 'xx', key3: '12', key4: '12', key5: 12, key6: 12 },
-])
+const tableData2 = ref([])
 
 //滞后表格2
 const lagColumn2 = [