فهرست منبع

项目台账修改

duy 1 سال پیش
والد
کامیت
33af55c2f1
2فایلهای تغییر یافته به همراه43 افزوده شده و 11 حذف شده
  1. 30 10
      src/views/project/ledger.vue
  2. 13 1
      src/views/project/modules/project-list.vue

+ 30 - 10
src/views/project/ledger.vue

@@ -4,13 +4,13 @@
             <div v-if="tabsKey === '1'" class="hc-flex">
                 <hc-date-year v-model="searchForm1.startYear" v-model:end="searchForm1.endYear" />
                 <div class="relative ml-3 w-[300px]">
-                    <hc-search-input v-model="searchForm1.queryValue" text="搜索" color="#151921" @search="searchClick1">
-                        <template #prepend>
+                    <hc-search-input v-model="searchForm1.searchValue" text="搜索" color="#151921" @search="searchClick1">
+                        <!-- <template #prepend>
                             <el-select v-model="searchForm1.year" placeholder="年份" clearable style="width: 80px">
                                 <el-option label="2023" value="2023" />
                                 <el-option label="2024" value="2024" />
                             </el-select>
-                        </template>
+                        </template> -->
                     </hc-search-input>
                 </div>
             </div>
@@ -18,12 +18,12 @@
         <template #extra>
             <div v-if="tabsKey === '1'" class="hc-flex">
                 <div class="ml-6 w-[120px]">
-                    <el-select v-model="searchForm1.key1" filterable clearable block placeholder="项目阶段" @change="searchClick1">
+                    <el-select v-model="searchForm1.projectStage" filterable clearable block placeholder="项目阶段" @change="searchClick1">
                         <el-option v-for="item in projectStage" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                 </div>
                 <div class="ml-2 w-[100px]">
-                    <el-select v-model="searchForm1.key2" filterable clearable block placeholder="项目类型" @change="searchClick1">
+                    <el-select v-model="searchForm1.projectType" filterable clearable block placeholder="项目类型" @change="searchClick1">
                         <el-option v-for="item in typeData" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                 </div>
@@ -42,7 +42,7 @@
                 <el-button v-yes-com:[deriveTableItem2] :disabled="tableCheckKeys2.length <= 0" type="primary" class="ml-2">批量导出</el-button>
             </div>
         </template>
-        <HcTableList1 v-if="tabsKey === '1'" ref="table1Ref" />
+        <HcTableList1 v-if="tabsKey === '1'" ref="table1Ref" :datas="tableData1" />
         <HcTableList2 v-if="tabsKey === '2'" :datas="tableData2" :loading="tableLoading2" @tap="rowNameClick2" @check="tableCheck2" @change="searchClick2" />
         <template #action>
             <hc-pages v-if="tabsKey === '1'" :pages="searchForm1" @change="pageChange1" />
@@ -56,7 +56,7 @@ import { onMounted, ref } from 'vue'
 import { getDictionaryData } from '~src/utils/tools'
 import { arrToId, getArrValue, newDownBlob } from 'js-fast-way'
 import mainApi from '~api/project/gist'
-
+import mainProApi from '~api/project/project'
 //子组件
 import HcTableList1 from './modules/project-list.vue'
 import HcTableList2 from './modules/gist-list.vue'
@@ -85,14 +85,15 @@ onMounted(() => {
 const projectStage = ref([])//项目阶段
 const getDataApi = async () => {
     projectStage.value = await getDictionaryData('projectStage', true)
+    getTableData1()
 }
 
 //项目类型
-const typeData = ref([{ value: '1', label: '铁路' }, { value: '2', label: '高速公路' }])
+const typeData = ref([])
 
 //搜索条件
 const searchForm1 = ref({
-    startYear: '', endYear: '', queryValue: '', year: '',
+    startYear: '', endYear: '', searchValue: '', projectStage:null, projectType:null,
     current: 1, size: 20, total: 0,
 })
 const searchForm2 = ref({
@@ -102,7 +103,8 @@ const searchForm2 = ref({
 
 //搜索
 const searchClick1 = () => {
-
+    searchForm1.value.current = 1
+    getTableData1()
 }
 const searchClick2 = () => {
     searchForm2.value.current = 1
@@ -113,6 +115,7 @@ const searchClick2 = () => {
 const pageChange1 = ({ current, size }) => {
     searchForm1.value.current = current
     searchForm1.value.size = size
+    getTableData1()
 }
 
 //分页
@@ -127,6 +130,8 @@ const table1Ref = ref(null)
 //表格数据
 const tableData2 = ref([])
 const tableLoading2 = ref(false)
+const tableData1 = ref([])
+const tableLoading1 = ref(false)
 
 //表格被选择
 const tableCheckKeys1 = ref([])
@@ -151,6 +156,21 @@ const getTableData2 = async () => {
     }
 }
 
+//获取表格数据
+const getTableData1 = async () => {
+    tableData1.value = []
+    tableLoading1.value = true
+    const { error, code, data } = await mainProApi.page(searchForm1.value)
+    //处理数据
+    tableLoading2.value = false
+    if (!error && code === 200) {
+        tableData1.value = getArrValue(data['records'])
+        searchForm1.value.total = data.total || 0
+    } else {
+        tableData1.value = []
+        searchForm1.value.total = 0
+    }
+}
 //名称被点击
 const rowNameClick2 = (row) => {
     console.log(row)

+ 13 - 1
src/views/project/modules/project-list.vue

@@ -40,6 +40,18 @@
                         <hc-info-table-td is-title width="30px" center>完 工 年</hc-info-table-td>
                         <hc-info-table-td center>{{ rowDetail?.endYear }}</hc-info-table-td>
                     </tr>
+                    <tr>
+                        <hc-info-table-td is-title width="30px" center>总投资</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.allInvestMoney }}</hc-info-table-td>
+                        <hc-info-table-td is-title width="30px" center>“十四五”计划投资</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.fourteenFiveInvest }}</hc-info-table-td>
+                    </tr>
+                    <tr>
+                        <hc-info-table-td is-title width="30px" center>市级重点项目</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail.isFocusProject === 1 ? '是' : '否' }}</hc-info-table-td>
+                        <hc-info-table-td is-title width="30px" center>交通强国建设试点任务</hc-info-table-td>
+                        <hc-info-table-td center>{{ rowDetail?.isPilotPlan === 1 ? '是' : '否' }}</hc-info-table-td>
+                    </tr>
                     <tr>
                         <hc-info-table-td is-title width="30px" center>牵头单位</hc-info-table-td>
                         <hc-info-table-td center>{{ rowDetail?.leaderUnit }}</hc-info-table-td>
@@ -275,7 +287,7 @@ const tableColumn = ref([
    { key: 'startYear', name: '开工年' },
    { key: 'endYear', name: '完工年' },
    { key: 'allInvest', name: '总投资(亿元)' },
-   { key: 'fourteenFiveInvest', name: '\'十四五\'计划投资(亿元)' },
+   { key: 'fourteenFiveInvest', name: '\“十四五”\'计划投资(亿元)' },
    { key: 'isFocusProjectName', name: '市级重点项目' },
    { key: 'isPilotPlanName', name: '交通强国建设试点任务' },
    { key: 'finishedInvestMoney', name: '完成投资金额(亿元)' },