Pārlūkot izejas kodu

获取汇总目录接口

duy 1 gadu atpakaļ
vecāks
revīzija
ff4a340511

+ 13 - 0
src/api/modules/initial/initial.js

@@ -0,0 +1,13 @@
+import { httpApi } from '../../request/httpApi'
+
+export default {
+    //验收申请-汇总目录
+    async getAllUnitArchivesView(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archivesauto/getAllUnitArchivesView',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+ 
+}

+ 56 - 59
src/views/transfer/components/table-collect.vue

@@ -11,30 +11,37 @@
                 </el-button>
             </HcTooltip>
         </template>
-        <div class="hc-card-table-title">建设单位归档资料(1200卷)</div>
-        <HcCardItem ui="h-half">
-            <template #header>
-                <span>一、立项审批</span>
-                <span class="text-gray">(238卷)</span>
-            </template>
-            <HcTable
-                ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
-                heights="auto" is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
-                @selection-change="tableSelection"
-            />
-        </HcCardItem>
+        <div v-loading="totalLoaing" class="h-screen">
+            <div v-for="(item, index) in totalData" :key="index">
+                <div class="hc-card-table-title">{{ item.unitInfo }}</div>
+                <HcCardItem v-for="(item1, index1) in item.nodeLists" :key="index1" ui="h-half">
+                    <template #header>
+                        <span>{{ item1.nodeInfo }}</span>
+                    <!-- <span class="text-gray">(238卷)</span> -->
+                    </template>
+               
+                    <HcTable
+                        v-if="item1.list !== null"
+                        ref="tableRef" :column="tableColumn" :datas="item1.list" :loading="tableLoading"
+                        is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+                        heights="300px"
+                        @selection-change="tableSelection"
+                    />
+                </HcCardItem>
 
-        <HcCardItem ui="h-half">
-            <template #header>
-                <span>二、勘察设计文件</span>
-                <span class="text-gray">(95卷)</span>
-            </template>
-            <HcTable
-                ref="tableFileRef" :column="tableFileColumn" :datas="tableFileData" :loading="tableFileLoading"
-                heights="auto" is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
-                @selection-change="tableeFileSelection"
-            />
-        </HcCardItem>
+            <!-- <HcCardItem ui="h-half">
+                <template #header>
+                    <span>二、勘察设计文件</span>
+                    <span class="text-gray">(95卷)</span>
+                </template>
+                <HcTable
+                    ref="tableFileRef" :column="tableFileColumn" :datas="tableFileData" :loading="tableFileLoading"
+                    heights="auto" is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+                    @selection-change="tableeFileSelection"
+                />
+            </HcCardItem> -->
+            </div>
+        </div>
     </hc-new-card>
 
     <!-- 批量上报审批 -->
@@ -59,7 +66,7 @@
 import { nextTick, onMounted, ref, watch } from 'vue'
 import { getArrValue, getObjValue } from 'js-fast-way'
 import { rowsToId } from '~uti/tools'
-
+import initialgApi from '~api/initial/initial'
 //参数
 const props = defineProps({
     projectId: {
@@ -90,9 +97,24 @@ watch(() => [
 
 //渲染完成
 onMounted(() => {
-
+    getTotalData()
 })
-
+const totalData = ref([])
+const totalLoaing = ref(false)
+const getTotalData = async ()=>{
+    totalLoaing.value = true
+    const { error, code, data } = await initialgApi.getAllUnitArchivesView({
+        projectId: projectId.value,
+    })
+    totalLoaing.value = false
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        totalData.value = getArrValue(data)
+    } else {
+        totalData.value = []
+     
+    }
+}
 //tab数据和相关处理
 const tabKey = ref('tab2')
 const tabData = ref([
@@ -122,38 +144,13 @@ const pageChange = ({ current, size }) => {
 //表头
 const tableRef = ref(null)
 const tableColumn = ref([
-    { key:'key1', name: '档号', width: 180 },
-    { key:'key2', name: '案卷题名' },
-    { key:'key3', name: '总页数', width: 120 },
-    { key:'key4', name: '保管期限', width: 120 },
-    { key:'key5', name: '备注' },
-])
-const tableData = ref([
-    {
-        id: 1,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '永久',
-        key5: '备注信息',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '永久',
-        key5: '备注信息',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '永久',
-        key5: '备注信息',
-    },
+    { key:'fileNumber', name: '档号', width: 180 },
+    { key:'name', name: '案卷题名' },
+    { key:'pageN', name: '总页数', width: 120 },
+    { key:'storageTimeValue', name: '保管期限', width: 120 },
+    { key:'remark', name: '备注' },
 ])
+const tableData = ref([])
 
 //获取数据
 const tableLoading = ref(false)
@@ -247,12 +244,12 @@ const reportModalClick = async () => {
         rows.forEach(item => {
             reportDataArr.push({
                 id: item?.id,
-                name: item?.key2,
+                name: item?.name,
             })
         })
         reportDatas.value = reportDataArr
         //设置任务名称
-        reportTaskName.value = rows.length > 1 ? `${row.key2}等${rows.length}个文件` : row.key2
+        reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
         reportLoading.value = false
         showReportModal.value = true
     } else {

+ 29 - 28
src/views/transfer/initial.vue

@@ -1,30 +1,30 @@
 <template>
     <div class="hc-page-layout-box">
-        <div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'" v-if="sbTableKey === 'classify'">
+        <div v-if="sbTableKey === 'classify'" class="hc-layout-left-box" :style="`width:${leftWidth}px;`">
             <div class="hc-project-box">
                 <div class="hc-project-icon-box">
-                    <HcIcon name="stack"/>
+                    <HcIcon name="stack" />
                 </div>
                 <div class="ml-2 project-name-box">
-                    <span class="text-xl text-cut project-alias">{{projectInfo['projectAlias']}}</span>
-                    <div class="text-xs text-cut project-name">{{projectInfo['name']}}</div>
+                    <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
+                    <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
                 </div>
             </div>
-            <div class="hc-tree-box" v-loading="treeLoading" element-loading-text="加载中...">
+            <div v-loading="treeLoading" class="hc-tree-box" element-loading-text="加载中...">
                 <el-scrollbar>
-                    <HcTree :projectId="projectId" :contractId="contractId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading"/>
+                    <HcTree :project-id="projectId" :contract-id="contractId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" />
                 </el-scrollbar>
             </div>
-            <!--左右拖动-->
-            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+            <!-- 左右拖动 -->
+            <div class="horizontal-drag-line" @mousedown="onmousedown" />
         </div>
         <div class="hc-page-content-box ledger-write-box">
             <HcTabsSimple :datas="sbTableData" :cur="sbTableKey" @tabClick="sbTableClick">
                 <template #tab-collect>
-                    <TableCollect :projectId="projectId" :contractId="contractId" :treeData="nodeDataInfo" v-if="sbTableKey === 'collect'"/>
+                    <TableCollect v-if="sbTableKey === 'collect'" :project-id="projectId" :contract-id="contractId" :tree-data="nodeDataInfo" />
                 </template>
                 <template #tab-classify>
-                    <TableClassify :projectId="projectId" :contractId="contractId" :treeData="nodeDataInfo" v-if="sbTableKey === 'classify'"/>
+                    <TableClassify v-if="sbTableKey === 'classify'" :project-id="projectId" :contract-id="contractId" :tree-data="nodeDataInfo" />
                 </template>
             </HcTabsSimple>
         </div>
@@ -32,23 +32,24 @@
 </template>
 
 <script setup>
-import {ref, watch, onMounted} from "vue";
-import {useAppStore} from "~src/store";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
 //import HcTree from "./components/hc-tree.vue"
-import HcTree from "~src/components/tree/hc-tree.vue"
-import TableCollect from "./components/table-collect.vue"
-import TableClassify from "./components/table-classify.vue"
+import HcTree from '~src/components/tree/hc-tree.vue'
+import TableCollect from './components/table-collect.vue'
+import TableClassify from './components/table-classify.vue'
+
 
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId);
-const contractId = ref(useAppState.getContractId);
-const projectInfo = ref(useAppState.getProjectInfo);
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
 const isCollapse = ref(useAppState.getCollapse)
 
 //监听
 watch(() => [
-    useAppState.getCollapse
+    useAppState.getCollapse,
 ], ([Collapse]) => {
     isCollapse.value = Collapse
 })
@@ -67,8 +68,8 @@ const treeNodeLoading = () => {
 //类型处理
 const sbTableKey = ref('collect')
 const sbTableData = ref([
-    {icon: 'bar-chart-box', label: '汇总目录', key: 'collect'},
-    {icon: 'menu-3', label: '分类目录', key: 'classify'},
+    { icon: 'bar-chart-box', label: '汇总目录', key: 'collect' },
+    { icon: 'menu-3', label: '分类目录', key: 'classify' },
 ])
 const sbTableClick = (key) => {
     sbTableKey.value = key
@@ -76,24 +77,24 @@ const sbTableClick = (key) => {
 
 //树操作
 const nodeDataInfo = ref({})
-const projectTreeClick = ({data}) => {
+const projectTreeClick = ({ data }) => {
     console.log(data)
 }
 
 
 //左右拖动,改变树形结构宽度
-const leftWidth = ref(382);
+const leftWidth = ref(382)
 const onmousedown = () => {
     const leftNum = isCollapse.value ? 142 : 272
     document.onmousemove = (ve) => {
-        let diffVal = ve.clientX - leftNum;
-        if(diffVal >= 310 && diffVal <= 900) {
-            leftWidth.value = diffVal;
+        let diffVal = ve.clientX - leftNum
+        if (diffVal >= 310 && diffVal <= 900) {
+            leftWidth.value = diffVal
         }
     }
     document.onmouseup = () => {
-        document.onmousemove = null;
-        document.onmouseup = null;
+        document.onmousemove = null
+        document.onmouseup = null
     }
 }
 </script>