Răsfoiți Sursa

blade-manager/wbsPrivate/get-node-tables

duy 2 ani în urmă
părinte
comite
127aa3721a

+ 12 - 0
src/api/modules/tentative/laboratory/print.js

@@ -0,0 +1,12 @@
+import {httpApi} from "../../../request/httpApi";
+
+export default {
+    //打印空查询
+    async queryPage(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/wbsPrivate/get-node-tables',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+}

+ 23 - 4
src/views/tentative/laboratory/print.vue

@@ -56,6 +56,8 @@ import {useAppStore} from "~src/store";
 import WbsTree from "../../data-fill/components/WbsTree.vue"
 import TestTree from "../material/components/TestTree.vue"
 import {getStoreData, setStoreData} from '~src/utils/storage'
+import dataApi from "~api/tentative/laboratory/print"
+import {getArrValue, getArrKeyValue, isIdCard, formValidate} from "vue-utils-plus"
 
 //变量
 const useAppState = useAppStore()
@@ -89,18 +91,20 @@ const searchForm = ref({
 const primaryKeyId = ref('')
 const nodeItemInfo = ref({})
 const nodeDataInfo = ref({})
-
+const clicID=ref('')
 //树被点击
 const wbsElTreeClick = ({node, data, keys}) => {
     nodeItemInfo.value = node
     nodeDataInfo.value = data
     primaryKeyId.value = data['primaryKeyId'] || ''
+    clicID.value=data['id']||''
+    console.log(data,'dtat');
     //缓存自动展开
     treeAutoExpandKeys.value = keys
     setStoreData('wbsTreeExpandKeys',keys)
     //改变搜索表单数据
-    //searchForm.value.wbsId = data['contractIdRelation'] ? data['id'] : data['primaryKeyId']
-    //searchForm.value.contractIdRelation = data['contractIdRelation']
+    searchForm.value.wbsId = projectInfo?.value.referenceWbsTemplateIdTrial
+    //searchForm.value.contractIdRelation = data['contractIdRelation'] projectInfo?.referenceWbsTemplateIdTrial
     searchForm.value.current = 1;
     getTableData()
 }
@@ -122,7 +126,22 @@ const tableColumn = ref([
 const tableLoading = ref(false)
 const tableData = ref([])
 const getTableData = async () => {
-
+    tableLoading.value = true
+    const { error, code, data } = await dataApi.queryPage({
+        projectId: projectId.value,
+        parentId:clicID.value,
+        // contractId: contractId.value,
+        ...searchForm.value,
+    })
+    //处理数据
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data.total || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
 //多选