|
@@ -60,7 +60,7 @@
|
|
|
<span class="text-orange text-sm">为您分配抽检范围,若有异动,可手动勾选想要验收的部分</span>
|
|
|
</template>
|
|
|
|
|
|
- <HcTree :types="checkList.join(',')" :project-id="projectId" style="margin-bottom: 10px;" />
|
|
|
+ <HcTree style="margin-bottom: 10px;" :tree-data="ElTreeData" />
|
|
|
|
|
|
<template #action>
|
|
|
<div class="hc-card-action-diy">
|
|
@@ -86,6 +86,8 @@ import { ref } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import HcTree from './components/entry-sampling/hc-tree.vue'
|
|
|
+import initialgApi from '~api/initial/initial'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
|
|
|
//变量
|
|
|
const router = useRouter()
|
|
@@ -110,15 +112,31 @@ const emptyTypeClick = () => {
|
|
|
const isNull = ref(true)
|
|
|
const isCard = ref(false)
|
|
|
const isLoading = ref(false)
|
|
|
+const treeLoaing = ref(false)
|
|
|
+const getElTreeData = async ()=>{
|
|
|
+ treeLoaing.value = true
|
|
|
+ const { error, code, data } = await initialgApi.getUnitAllNode({
|
|
|
+ projectId: projectId.value,
|
|
|
+ types:checkList.value.join(','),
|
|
|
+ })
|
|
|
+ treeLoaing.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ console.log(data, 'data')
|
|
|
+ ElTreeData.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ ElTreeData.value = []
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+const ElTreeData = ref( [])
|
|
|
|
|
|
//确认分配
|
|
|
-const confirmAllocationClick = () => {
|
|
|
+const confirmAllocationClick = async () => {
|
|
|
isNull.value = false
|
|
|
isLoading.value = true
|
|
|
- setTimeout(() => {
|
|
|
- isCard.value = true
|
|
|
- isLoading.value = false
|
|
|
- }, 3000)
|
|
|
+ await getElTreeData()
|
|
|
+ isCard.value = true
|
|
|
+ isLoading.value = false
|
|
|
}
|
|
|
|
|
|
//确认并进入抽检
|
|
@@ -128,6 +146,7 @@ const ToInspection = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//清空重置
|
|
|
const clearResetClick = () => {
|
|
|
isNull.value = true
|