Преглед изворни кода

Merge remote-tracking branch 'origin/master'

ZaiZai пре 1 година
родитељ
комит
bedefeafed

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

@@ -41,4 +41,12 @@ export default {
             params: form,
         }, msg)
     },
+    //档案验收返回单位所有节点
+    async getUnitAllNode(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/archiveTreeContract/getUnitAllNode',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
 }

+ 2 - 2
src/global/components/hc-tasks-user/index.vue

@@ -66,11 +66,11 @@
             </div>
             <template #footer>
                 <div class="dialog-footer">
-                    <el-button size="large" @click="showModal = false">
+                    <el-button hc-btn style="border: 1px solid var(--el-button-border-color);" @click="showModal = false">
                         <HcIcon name="close" />
                         <span>取消</span>
                     </el-button>
-                    <el-button hc-btn type="primary" size="large" :loading="sureSignUserLoading" @click="sureSignUserClick">
+                    <el-button hc-btn type="primary" :loading="sureSignUserLoading" @click="sureSignUserClick">
                         <HcIcon name="check" />
                         <span>确定</span>
                     </el-button>

+ 47 - 80
src/views/transfer/components/entry-sampling/hc-tree.vue

@@ -1,19 +1,21 @@
 <template>
-    <el-tree ref="ElTreeRef" :class="ui"
-             :data="ElTreeData"
-             :indent="0"
-             :props="ElTreeProps"
-             accordion
-             class="hc-tree-node tree-line"
-             highlight-current
-             node-key="id"
-             show-checkbox
+    <el-tree
+        ref="ElTreeRef" v-loaing="treeLoaing"
+        :class="ui"
+        :data="ElTreeData"
+        :indent="0"
+        :props="ElTreeProps"
+        accordion
+        class="hc-tree-node tree-line"
+        highlight-current
+        node-key="id"
+        show-checkbox
     >
         <template #default="{ node, data }">
-            <div :id="`'entry-sampling-'${data['primaryKeyId']}`" class="data-custom-tree-node">
+            <div :id="`'entry-sampling-'${data.id}`" class="data-custom-tree-node">
                 <div class="label">
-                    <span> {{ node.label }}</span>
-                    <span class="text-orange text-sm">(该目录已分属XX专家,如需调整,请联系该专家进行转让)</span>
+                    <span> {{ data.nodeName }}</span>
+                    <span v-if="data.nodeInfo" class="text-orange text-sm">(该目录已分属XX专家,如需调整,请联系该专家进行转让)</span>
                 </div>
             </div>
         </template>
@@ -21,96 +23,61 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
+import { onMounted, ref } from 'vue'
 //import dataFillQuery from '~api/data-fill/query';
-//import {isItem,getArrValue,getObjValue,isValueNull} from "vue-utils-plus"
+import { getArrValue, getObjValue } from 'js-fast-way'
+import initialgApi from '~api/initial/initial'
 
 //参数
 const props = defineProps({
     ui: {
         type: String,
-        default: ''
+        default: '',
     },
     projectId: {
         type: [String, Number],
-        default: ''
+        default: '',
     },
     contractId: {
         type: [String, Number],
-        default: ''
+        default: '',
+    },
+    types:{
+        type: [String, Number],
+        default: '',
     },
 })
+const projectId = ref(props.projectId)
+const types = ref(props.types)
 
+onMounted(()=>{
+    getElTreeData()
+})
 //变量
 const ElTreeRef = ref(null)
 const ElTreeProps = ref({
     children: 'children',
-    label: 'label',
+    label: 'nodeName',
 })
-
-const ElTreeData = [
-    {
-        id: 1,
-        label: '建设单位资料(1600卷)',
-        children: [
-            {
-                id: 4,
-                label: '资料 1-1',
-                children: [
-                    {
-                        id: 9,
-                        label: '资料 1-1-1',
-                    },
-                    {
-                        id: 10,
-                        label: '资料 1-1-2',
-                    },
-                ],
-            },
-        ],
-    },
-    {
-        id: 2,
-        label: '监理单位资料(890卷)',
-        children: [
-            {
-                id: 5,
-                label: '监理资料 2-1',
-            },
-            {
-                id: 6,
-                label: '监理资料 2-2',
-            },
-        ],
-    },
-    {
-        id: 3,
-        label: '施工单位资料(3200卷)',
-        children: [
-            {
-                id: 7,
-                label: '质量进度控制文件(120卷)',
-            },
-            {
-                id: 8,
-                label: '第二段',
-                children: [
-                    {
-                        id: 11,
-                        label: '第三段',
-                    },
-                    {
-                        id: 12,
-                        label: '第四段',
-                    },
-                ],
-            },
-        ],
-    },
-]
+const treeLoaing = ref(false)
+const getElTreeData = async ()=>{
+    treeLoaing.value = true
+    const { error, code, data } = await initialgApi.getUnitAllNode({
+        projectId: projectId.value,
+        types:types.value,
+    })
+    treeLoaing.value = false
+    if (!error && code === 200) {
+        console.log(data, 'data')
+        ElTreeData.value = getArrValue(data)
+    } else {
+        ElTreeData.value = []
+     
+    }
+}
+const ElTreeData = ref( [])
 </script>
 
 <style lang="scss" scoped>
 @import "../../../../styles/app/tree.scss";
-
 </style>

+ 7 - 100
src/views/transfer/components/table-collect.vue

@@ -31,13 +31,13 @@
                             <span>{{ item1.nodeInfo }}</span>
                             <!-- <span class="text-gray">(238卷)</span> -->
                         </template>
-                        <div :style="`height: ${item1.list !== null ? '300px' : 'auto'};`">
+                        <div :style="`height: ${item1.list !== null && item1.list.length > 9 ? '300px' : 'auto'};`">
                             <!-- <HcTable
                                 ref="tableRef" :column="tableColumn" :datas="item1.list" :loading="tableLoading"
                                 is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
                                 @selection-change="tableSelection"
                             /> -->
-                            <visualTable :table-data="item1.list " />
+                            <visualTable :table-data="item1.list " @getTableKeys="getTableKeys" />
                         </div>
                     </HcCardItem>
                 </template>
@@ -133,119 +133,26 @@ const getTotalData = async ()=>{
      
     }
 }
-//tab数据和相关处理
-const tabKey = ref('tab2')
-const tabData = ref([
-    // { key:'tab1', name: '全部汇总' },
-    { key:'tab2', name: '历史验收报告' },
-    { key:'tab3', name: '历史整改报告' },
-])
-const tabChange = (item) => {
-    tabKey.value = item?.key
-}
-
-
-//------立项审批
-
-//搜索表单
-const searchForm = ref({
-    current: 1, size: 20, total: 0,
-})
 
-//分页被点击
-const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
 
-//表头
-const tableRef = ref(null)
-const tableColumn = ref([
-    { 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)
-const getTableData = async () => {
+//------立项审批
 
-}
 
-//多选
-const tableKeys = ref([])
-const tableSelection = (rows) => {
-    tableKeys.value = rows
-}
 
-//------勘察设计文件
 
-//搜索表单
-const searchFormFile = ref({
-    current: 1, size: 20, total: 0,
-})
 
-//分页被点击
-const pageFileChange = ({ current, size }) => {
-    searchFormFile.value.current = current
-    searchFormFile.value.size = size
-    getTableFileData()
-}
 
-//表头
-const tableFileRef = ref(null)
-const tableFileColumn = ref([
-    { key:'key1', name: '档号', width: 180 },
-    { key:'key2', name: '案卷题名' },
-    { key:'key3', name: '总页数', width: 120 },
-    { key:'key4', name: '保管期限', width: 120 },
-    { key:'key5', name: '备注' },
-])
-const tableFileData = 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: '备注信息',
-    },
-])
 
-//获取数据
-const tableFileLoading = ref(false)
-const getTableFileData = async () => {
 
-}
 
-//多选
-const tableFileKeys = ref([])
-const tableeFileSelection = (rows) => {
-    tableFileKeys.value = rows
-}
 
 
 //上报
+const tableKeys = ref([])
+const getTableKeys = (val)=>{
+    tableKeys.value = val
+}
 const reportIds = ref('')
 const reportTaskName = ref('')
 const reportDatas = ref([])

+ 48 - 59
src/views/transfer/components/visual-table.vue

@@ -1,62 +1,35 @@
 <!--  -->
 <template>
-    <!-- <el-table
-        ref="myTable"
-        v-loading="loading"
-        :data="tableData"
-        height="250"
-        border
-        element-loading-background="rgba(0, 0, 0, 0.8)"
-        class="table-left color-table"
-    >
-        <el-table-column label="序号" type="index" align="center" width="56" />
-        <el-table-column
-            prop="fileNumber"
-            label="档号"
-            align="center"
-        />
-        <el-table-column
-            prop="name"
-            label="案卷题名"
-            align="center"
-        />
-        <el-table-column
-            prop="pageN"
-            label="总页数"
-            align="center"
-        />
-        <el-table-column
-            prop="storageTimeValue"
-            label="保管期限"
-            align="center"
-        />
-        <el-table-column
-            prop="remark"
-            label="备注"
-            align="center"
-        />
-    </el-table> -->
     <HcTable
         ref="tableRef"
-        heights="250px" :column="tableColumn" :datas="tableData" :loading="tableLoaing"
+        :column="tableColumn" :datas="tableData" :loading="tableLoaing"
         is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+        @selection-change="tableSelection"
     />
 </template>
 
 <script setup>
-import { getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
+import { getCurrentInstance, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
 const props = defineProps({
     tableData: {
         type: Array,
         default: () => ([]),
     },
 })
+//事件
+const emit = defineEmits(['getTableKeys'])
 const { proxy } = getCurrentInstance()
 
 const allData = ref(props.tableData)
 const needle = ref(10)//数据指针 默认19
 const tableData = ref([])
 const tableLoaing = ref(false)
+//多选
+const tableKeys = ref([])
+const tableSelection = (rows) => {
+    tableKeys.value = rows
+    emit('getTableKeys', rows)
+}
 //表头
 const tableRef = ref(null)
 const tableColumn = ref([
@@ -73,8 +46,8 @@ watch(() => [
     allData.value = Data
     tableData.value = []
         //判断数据长度有没有9个,有就先添加9个,没有直接获取所有数据
-        if (allData.value.length > 5) {
-          for (let i = 0;i < needle.value + 1;i++) {
+        if (allData.value.length > 9) {
+          for (let i = 0;i < needle.value ;i++) {
             tableData.value[i] = allData.value[i]
           }
         } else {
@@ -84,29 +57,45 @@ watch(() => [
 },
 { immediate: true, deep: true })
 onMounted(()=>{
-    setTimeout(() => {
-      lazyLoading()
-    }, 1500)
+  tableRef.value && tableRef.value.tableRef && tableRef.value.tableRef.$refs.bodyWrapper.addEventListener('mousewheel', scrollBehavior)
 })
 
-
-const queryData = ()=>{
-        // 一条一条加载记录,直至遍历到最后一条
-        while (needle.value < allData.value.length ) {
-          tableLoaing.value = true
-            tableData.value[needle.value] = allData.value[needle.value]
-            tableLoaing.value = false
-            proxy.$forceUpdate()
-            needle.value++
-          }
+onUnmounted(() => {
+      // 卸载
+      tableRef.value && tableRef.value.tableRef && tableRef.value.tableRef.$refs.bodyWrapper.removeEventListener('mousewheel', scrollBehavior)
+    })
+const queryData = async ()=>{
+    console.log('查询数据')
+        let ortab = tableData.value
+        if (needle.value < allData.value.length) {
+           let pusharr = allData.value.slice(needle.value, needle.value + 10)
+            pusharr.forEach((ele)=>{
+                ortab.push(ele)
+          })
+          needle.value = needle.value + 10
+          return ortab
+        }
+      
 }
-const lazyLoading = ()=>{
-  const wrapRef = tableRef.value.tableRef.$refs.scrollBarRef.wrapRef
-   if ('onscrollend' in window) {
-    console.log(5555555)
-    wrapRef.addEventListener('scrollend', queryData)
-  } 
 
+const scrollBehavior = async (e)=>{
+      // 滚动方向判定
+      const scrollDirection = e.deltaY > 0 ? 'down' : 'up'
+      if (scrollDirection === 'down') {
+        // 获取提供实际滚动的容器
+        const dom = tableRef.value.tableRef.$refs.bodyWrapper.getElementsByClassName('el-scrollbar__wrap')[0]
+        
+        const { clientHeight, scrollTop, scrollHeight } = dom
+        // 父容器高度 + 子容器距离父容器顶端的高度 = 子容器可滚动的高度
+        if (clientHeight + scrollTop === scrollHeight) {
+          console.log('竖向滚动条已经滚动到底部')
+          const res = await queryData()
+          if (res) {
+            tableData.value = res
+          }
+         
+        }
+      }
 }
 </script>
 

+ 2 - 1
src/views/transfer/entry-sampling.vue

@@ -60,7 +60,7 @@
                     <span class="text-orange text-sm">为您分配抽检范围,若有异动,可手动勾选想要验收的部分</span>
                 </template>
 
-                <HcTree />
+                <HcTree :types="checkList.join(',')" :project-id="projectId" />
 
                 <template #action>
                     <div class="hc-card-action-diy">
@@ -133,6 +133,7 @@ const clearResetClick = () => {
     isNull.value = true
     isLoading.value = false
     isCard.value = false
+    checkList.value = []
 }
 </script>
 

+ 7 - 5
src/views/transfer/initial-expert.vue

@@ -42,12 +42,13 @@
                                 <span>{{ item1.nodeInfo }}</span>
                             <!-- <span class="text-gray">(238卷)</span> -->
                             </template>
-                            <div :style="`height: ${item1.list !== null ? '300px' : 'auto'};`">
-                                <HcTable
+                            <div :style="`height: ${item1.list !== null && item1.list.length > 9 ? '300px' : 'auto'};`">
+                                <!-- <HcTable
                                     ref="tableRef" :column="tableColumn" :datas="item1.list" :loading="tableLoading"
                                     is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
                                     @selection-change="tableSelection"
-                                />
+                                /> -->
+                                <visualTable :table-data="item1.list " @getTableKeys="getTableKeys" />
                             </div>
                         </HcCardItem>
                     </template>
@@ -91,6 +92,7 @@ import { useRouter } from 'vue-router'
 import { useAppStore } from '~src/store'
 import initialgApi from '~api/initial/initial'
 import { getArrValue, getObjValue } from 'js-fast-way'
+import visualTable from './components/visual-table.vue'
 //变量
 const router = useRouter()
 const useAppState = useAppStore()
@@ -118,8 +120,8 @@ const tabChange = (item) => {
 }
 //多选
 const tableKeys = ref([])
-const tableSelection = (rows) => {
-    tableKeys.value = rows
+const getTableKeys = (val)=>{
+    tableKeys.value = val
 }
 const totalData = ref([])
 const totalLoaing = ref(false)