Forráskód Böngészése

抽检目录接口调用

duy 1 éve
szülő
commit
6442916779

+ 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)
+    },
 }

+ 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>

+ 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>