Procházet zdrojové kódy

项目统计修改

duy před 7 měsíci
rodič
revize
9780234620
1 změnil soubory, kde provedl 27 přidání a 37 odebrání
  1. 27 37
      src/views/home/datav.vue

+ 27 - 37
src/views/home/datav.vue

@@ -15,12 +15,12 @@
                         <HcDatavSelect v-model="searchForm.year" :datas="yearArr" />
                         <HcDatavSelect v-model="pageType" :datas="pageTypeArr" :clearable="false" @change="pageTypeChange" />
                         <template v-if="pageType === '1'">
-                            <HcDatavSelect v-model="searchForm.month" :datas="monthArr" placeholder="选择月份" />
-                            <HcDatavSelect v-model="searchForm.projectScheduleType" :datas="lagArr" />
-                            <HcDatavSelect v-if="searchForm.projectScheduleType === '3'" v-model="searchForm.scale" :datas="levelArr" placeholder="滞后等级" />
+                            <HcDatavSelect v-model="searchForm.month" :datas="monthArr" placeholder="选择月份" @change="searchChange" />
+                            <HcDatavSelect v-model="searchForm.projectScheduleType" :datas="lagArr" @change="searchChange" />
+                            <HcDatavSelect v-if="searchForm.projectScheduleType === '3'" v-model="searchForm.projectScheduleGrade" :datas="levelArr" placeholder="滞后等级" @change="searchChange" />
                         </template>
-                        <HcDatavSelect v-model="searchForm.projectStage" :datas="stageArr" placeholder="项目阶段" />
-                        <HcDatavSelect v-if="pageType === '1'" v-model="searchForm.type" :datas="typeArr" placeholder="项目类型" />
+                        <HcDatavSelect v-model="searchForm.projectStage" :datas="stageArr" placeholder="项目阶段" @change="searchChange" />
+                        <HcDatavSelect v-if="pageType === '1'" v-model="searchForm.projectType" :datas="typeArr" placeholder="项目类型" @change="searchChange" />
                         <HcDatavSelect v-else v-model="searchForm.quarter" :datas="quarterArr" placeholder="选择季度" />
                     </div>
                     <div class="date flex-1">截止时间:2024年04月08日</div>
@@ -142,14 +142,14 @@
                         <div class="hc-datav-divider" />
                         <div v-if="searchForm.projectScheduleType !== '3'" class="hc-datav-table relative">
                             <HcDatavTable :column="tableColumn1" :datas="tableData1" is-current @row-click="tableRowClick">
-                                <template #key3="{ row }">
-                                    <span style="color: #06A3FF;" class="font-bold">{{ row.key3 }}</span>
+                                <template #planAllMoney="{ row }">
+                                    <span style="color: #06A3FF;" class="font-bold">{{ row.planAllMoney }}</span>
                                 </template>
-                                <template #key4="{ row }">
-                                    <span style="color: #10C90F;" class="font-bold">{{ row.key4 }}</span>
+                                <template #currentMoney="{ row }">
+                                    <span style="color: #10C90F;" class="font-bold">{{ row.currentMoney }}</span>
                                 </template>
-                                <template #key5="{ row }">
-                                    <span style="color: #D7A70D;" class="font-bold">{{ row.key5 }}</span>
+                                <template #unFinishedMoney="{ row }">
+                                    <span style="color: #D7A70D;" class="font-bold">{{ row.unFinishedMoney }}</span>
                                 </template>
                             </HcDatavTable>
                         </div>
@@ -311,7 +311,7 @@ import HcDatavSelect from './modules/select.vue'
 import HcDatavCard from './modules/card.vue'
 import HcDatavTable from './modules/table.vue'
 import HcDatavCharts from './modules/charts.vue'
-import { getObjValue, isNullES } from 'js-fast-way'
+import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import { getDictionaryData } from '~src/utils/tools'
 import projectApi from '~api/datav/projectdata'
 
@@ -343,8 +343,7 @@ onMounted(() => {
     monthArr.value = newMonthArr
     getProType()
     getProStation()
-    getDataProjectStat()
-    // getDataInvestStat()
+    searchChange()
 })
 
 //关闭引导提示
@@ -355,12 +354,12 @@ const tourFinishClose = () => {
 
 //搜索表单
 const pageType = ref('1')
-const searchForm = ref({ year: '2024', month: 0, scale: null, projectStage: null, projectType: null, projectScheduleType:null })
+const searchForm = ref({ year: '2024', month: 0, projectScheduleGrade: null, projectStage: null, projectType: null, projectScheduleType:null })
 const yearArr = [{ id: '2024', name: '2024年' }, { id: '2023', name: '2023年' }, { id: '2022', name: '2022年' }]
 const pageTypeArr = [{ id: '1', name: '项目数据看板' }, { id: '2', name: '工作要点' }]
 const monthArr = ref([])
-const lagArr = [{ id: '1', name: '超进度项目' }, { id: '2', name: '常规项目' }, { id: '3', name: '滞后项目' }, { id: '0', name: '所有' }]
-const levelArr = [{ id: '1', name: '一级' }, { id: '2', name: '二级' }, { id: '3', name: '三级' }, { id: '0', name: '所有' }]
+const lagArr = [{ id: '1', name: '超进度项目' }, { id: '2', name: '常规项目' }, { id: '3', name: '滞后项目' }, { id: '-1', name: '所有' }]
+const levelArr = [{ id: '1', name: '一级' }, { id: '2', name: '二级' }, { id: '3', name: '三级' }, { id: '-1', name: '所有' }]
 const stageArr = ref([])
 const typeArr = ref([])
 const quarterArr = [{ id: '1', name: '一季度' }, { id: '2', name: '二季度' }, { id: '3', name: '三季度' }, { id: '4', name: '四季度' }]
@@ -389,6 +388,11 @@ const getProStation = async () => {
 //页面类型改变
 const pageTypeChange = () => {
 
+}
+//搜索条件改变1
+const searchChange = ()=>{
+    getDataProjectStat()
+    getDataInvestStat()
 }
 //获取项目统计
 const projectStat = ref({
@@ -435,6 +439,7 @@ const getDataInvestStat = async ()=>{
     //处理数据
     if (!error && code === 200) {
         investStat.value = getObjValue(data)
+        tableData1.value = getArrValue(data['list'])
     } else {
         investStat.value = {
             oneFinished:0,
@@ -446,31 +451,16 @@ const getDataInvestStat = async ()=>{
             fourFinished:0,
             fourUnFinished:0,
         }
+        tableData1.value = []
     }
 }
 //表格1
 const tableColumn1 = [
-    { key: 'key1', name: '项目阶段' }, { key: 'key2', name: '项目类型' },
-    { key: 'key3', name: '计划总投资' }, { key: 'key4', name: '实际已投资' },
-    { key: 'key5', name: '未完成投资' },
+    { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
+    { key: 'planAllMoney', name: '计划总投资' }, { key: 'currentMoney', name: '实际已投资' },
+    { key: 'unFinishedMoney', name: '未完成投资' },
 ]
-const tableData1 = ref([
-    { key1: '在建项目', key2: '铁路', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: '民航', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-    { key1: '在建项目', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
-])
+const tableData1 = ref([])
 
 //表格被点击
 const isDatavCharts = ref(true)