duy 1 жил өмнө
parent
commit
a1da99c317

+ 0 - 1
src/views/project/admin/list.vue

@@ -88,7 +88,6 @@
 <script setup>
 import { onMounted, ref } from 'vue'
 import HcTableList from '../modules/project-list.vue'
-import { getDictionary } from '~api/dictbiz'
 import { getArrValue } from 'js-fast-way'
 import mainApi from '~api/project/project'
 import { getDictionaryData } from '~src/utils/tools'

+ 60 - 27
src/views/project/modules/project-list.vue

@@ -32,7 +32,7 @@
                         <hc-info-table-td is-title width="30px" center>项目名称</hc-info-table-td>
                         <hc-info-table-td center>{{ rowDetail?.name }}</hc-info-table-td>
                         <hc-info-table-td is-title width="30px" center>建设规模</hc-info-table-td>
-                        <hc-info-table-td center>{{ rowDetail?.buildScale + rowDetail?.buildScaleUnit || '' }}</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.buildScaleName }}</hc-info-table-td>
                     </tr>
                     <tr>
                         <hc-info-table-td is-title width="30px" center>开 工 年</hc-info-table-td>
@@ -57,12 +57,12 @@
                             <hc-card-item class="year-detail">
                                 <template #header>
                                     <div class="flex-1 text-center text-[14px]">
-                                        <HcDropdown v-model="yearKey" :datas="yearData" />
+                                        <HcDropdown v-model="yearKey" :datas="yearData.list" text="年" :props="{ key: 'planYear', label: 'planYear' }" @change="yearChange" />
                                     </div>
                                 </template>
-                                <el-table :data="tableYearData" border class="w-full" :span-method="tableYearMethod">
-                                    <el-table-column prop="quarter" label="季度" width="100" align="center" />
-                                    <el-table-column prop="month" class-name="line" width="120" align="center">
+                                <el-table v-if="yearData.list && yearData.list.length > 0" :data="yearData.list[yearIndex].list" border class="w-full" :span-method="tableYearMethod">
+                                    <el-table-column prop="planQuarterName" label="季度" width="100" align="center" />
+                                    <el-table-column prop="planMonthName" class-name="line" width="120" align="center">
                                         <template #header>
                                             <div class="hc-table-th-line">
                                                 <span class="left">月份</span>
@@ -70,37 +70,37 @@
                                             </div>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="key1" label="计划完成投资额(亿元)" width="100" align="center" />
-                                    <el-table-column prop="key2" label="投资完成额(亿元)" width="100" align="center" />
-                                    <el-table-column prop="key3" label="投资未完成额(亿元)" width="100" align="center" />
-                                    <el-table-column prop="key4" label="全年目标" width="100" align="center" />
-                                    <el-table-column prop="key5" label="工作计划" width="100" align="center" />
-                                    <el-table-column prop="key6" label="累计进展计划" align="center" />
-                                    <el-table-column prop="key7" label="形象进度百分比(%)" width="100" align="center" />
-                                    <el-table-column prop="key8" label="工作计划进展计划" align="center" />
+                                    <el-table-column prop="planInvestMoney" label="计划完成投资额(亿元)" width="100" align="center" />
+                                    <el-table-column prop="investMoney" label="投资完成额(亿元)" width="100" align="center" />
+                                    <el-table-column prop="investUnfinishedMoney" label="投资未完成额(亿元)" width="100" align="center" />
+                                    <el-table-column prop="yearlyTarget" label="全年目标" width="100" align="center" />
+                                    <el-table-column prop="workPlan	" label="工作计划" width="100" align="center" />
+                                    <el-table-column prop="workProgressAll" label="累计进展计划" align="center" />
+                                    <el-table-column prop="planRatio" label="形象进度百分比(%)" width="100" align="center" />
+                                    <el-table-column prop="workProgress" label="工作计划进展计划" align="center" />
                                 </el-table>
                                 <hc-info-table class="mt-[-1px]">
                                     <tr>
                                         <hc-info-table-td is-title width="130px" center>该年累计完成投资(亿元)</hc-info-table-td>
-                                        <hc-info-table-td center>14.1</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex].yearFinishInvest || "-" }}</hc-info-table-td> -->
                                         <hc-info-table-td is-title width="130px" center>该年力争完成投资(亿元)</hc-info-table-td>
-                                        <hc-info-table-td center>13.2</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearlyInvest || "-" }}</hc-info-table-td> -->
                                         <hc-info-table-td is-title width="130px" center>该年累计未完成投资(亿元)</hc-info-table-td>
-                                        <hc-info-table-td center>12.3</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.yearUnfinishedInvest || "-" }}</hc-info-table-td> -->
                                     </tr>
                                 </hc-info-table>
                                 <hc-info-table class="mt-[-1px]">
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>存在问题</hc-info-table-td>
-                                        <hc-info-table-td center>-</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.questionable || '-' }}</hc-info-table-td> -->
                                         <hc-info-table-td is-title width="30px" center>工作问题</hc-info-table-td>
-                                        <hc-info-table-td center>-</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.workAdvise || '-' }}</hc-info-table-td> -->
                                     </tr>
                                     <tr>
                                         <hc-info-table-td is-title width="30px" center>填报单位</hc-info-table-td>
-                                        <hc-info-table-td center>-</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.writeUnit || '-' }}</hc-info-table-td> -->
                                         <hc-info-table-td is-title width="30px" center>联系人</hc-info-table-td>
-                                        <hc-info-table-td center>-</hc-info-table-td>
+                                        <!-- <hc-info-table-td center>{{ yearData.list[yearIndex]?.linkman || '-' }}</hc-info-table-td> -->
                                     </tr>
                                 </hc-info-table>
                             </hc-card-item>
@@ -230,7 +230,8 @@
 
 <script setup>
 import { onMounted, ref, watch } from 'vue'
-
+import mainApi from '~api/project/project'
+import { deepClone, getArrValue, getObjValue, isNullES, newDownBlob } from 'js-fast-way'
 const props = defineProps({
     isAdmin: {
         type: Boolean,
@@ -314,11 +315,35 @@ const completion = (row) => {
 //查看
 const rowDetail = ref({})
 const isDrawer = ref(false)
+const isDrawerType = ref('view')
 const examine = (row) => {
     isDrawer.value = true
-    emit('examine', row)
+    isDrawerType.value = 'view'
+    rowDetail.value = row
+    getDetailData(row.id)
+    // emit('examine', row)
 }
+const getDetailData = async (id) => {
+    const { error, code, data, msg } = await mainApi.detailMore(id)
+    if (error || code !== 200) {
+        window.$message.error(msg ?? '获取数据失败')
+        drawerCancel()
+        return
+    }
+    //处理数据
+    const res = getObjValue(data)
+    const list = getArrValue(res.list)
+    res.list = list
+    rowDetail.value = res
+    yearData.value = res
+    console.log(yearData.value, 'yearData.valu')
+   //设置默认数据
+   if (list.length > 0) {
+        yearKey.value = list[0].planYear
+        yearIndex.value = 0
+    }
 
+}
 //删除
 const delTableItem = ({ item }, resolve) => {
     console.log('我被执行了', item)
@@ -328,6 +353,13 @@ const delTableItem = ({ item }, resolve) => {
         emit('del', item)
     }, 3000)
 }
+//关闭抽屉
+const drawerCancel = () => {
+    isDrawer.value = false
+    isDrawerType.value = ''
+    yearData.value = {}
+}
+
 
 //导出数据
 const deriveTableItem = ({ item }, resolve) => {
@@ -354,11 +386,12 @@ const batchExport = () => {
 
 //年数据
 const yearKey = ref('2023')
-const yearData = ref([
-    { key: '2023', label: '2023年' },
-    { key: '2024', label: '2024年' },
-])
-
+const yearData = ref({})
+const yearIndex = ref(-1)
+const yearChange = (_, index) => {
+  
+    yearIndex.value = index
+}
 //年份表格数据
 const tableYearData = ref([
     { quarter: '一季度', month: '1月', key1: '13', key2: '1.1', key3: '11.9' },