Bläddra i källkod

档案预警接口

duy 2 år sedan
förälder
incheckning
175aef8520
2 ändrade filer med 39 tillägg och 16 borttagningar
  1. 31 14
      src/views/custody/components/tab-reform.vue
  2. 8 2
      src/views/custody/early.vue

+ 31 - 14
src/views/custody/components/tab-reform.vue

@@ -12,6 +12,8 @@
 
 <script setup>
 import {ref, nextTick, watch} from "vue";
+import archiveFileApi from "~api/archiveFile/archiveFile";
+import {getArrValue} from "js-fast-way"
 
 //参数
 const props = defineProps({
@@ -38,8 +40,12 @@ const nodeData = ref(props.treeData);
 watch(() => [
     props.treeData
 ], ([treeData]) => {
+    console.log(treeData,'treeData');
     nodeData.value = treeData;
     setQueryData(treeData)
+},
+{
+    deep: true
 })
 
 //渲染完成
@@ -49,6 +55,8 @@ nextTick(() => {
 
 //获取相关数据
 const setQueryData = (data) => {
+    console.log(11111);
+    searchForm.value.nodeIds=data.id
     /*const cid = data?.contractIdRelation || ''
     const wbsId = data['contractIdRelation'] ? data['id'] : data['primaryKeyId']
     if (wbsId) {
@@ -65,13 +73,15 @@ const searchForm = ref({
 })
 
 //tab数据和相关处理
-const tabKey = ref('tab1')
+const tabKey = ref('1')
 const tabData = ref([
-    {key:'tab1',  name: '需要整改的文件'},
-    {key:'tab2', name: '已整改记录'}
+    {key:'1',  name: '需要整改的文件'},
+    {key:'2', name: '已整改记录'}
 ]);
 const tabChange = (item) => {
     tabKey.value = item?.key;
+    getTableData()
+
 }
 
 
@@ -86,7 +96,7 @@ const pageChange = ({current, size}) => {
 const tableRef = ref(null)
 const tableColumn = ref([
     {key:'key1', name: '所属案卷'},
-    {key:'key2', name: '具体文件'},
+    {key:'fileName', name: '具体文件'},
     {key:'key3', name: '问题描述'}
 ])
 const tableData = ref([])
@@ -94,19 +104,26 @@ const tableData = ref([])
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-    /*tableInternalLoading.value = true
-    const {error, code, data} = await internalApi.queryInternalPage({
-        ...searchInternalForm.value,
+    tableLoading.value = true
+    const { error, code, data } = await archiveFileApi.getarchiveFilePage({
+        ...searchForm.value,
+        nodeIds: nodeData.value.id,
         projectId: projectId.value,
+        contractId: contractId.value,
+        rectification:tabKey.value
     })
-    //判断状态
-    tableInternalLoading.value = false
+    tableLoading.value = false
     if (!error && code === 200) {
-        tableInternalData.value = getArrValue(data['records'])
-        searchInternalForm.value.total = data['total'] || 0
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total'] || 0
     } else {
-        tableInternalData.value = []
-        searchInternalForm.value.total = 0
-    }*/
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
+// 暴露出去
+defineExpose({
+    getTableData,
+    
+})
 </script>

+ 8 - 2
src/views/custody/early.vue

@@ -49,7 +49,7 @@
         <div class="hc-page-content-box ledger-write-box">
             <HcTabsSimple :datas="sbTableData" :cur="sbTableKey" @tabClick="sbTableClick">
                 <template #tab-reform>
-                    <TabReform :projectId="projectId" :contractId="contractId" :treeData="nodeDataInfo" v-if="sbTableKey === 'reform'"/>
+                    <TabReform :projectId="projectId" :contractId="contractId" :treeData="nodeDataInfo" v-if="sbTableKey === 'reform'" ref="tabReform"/>
                 </template>
                 <template #tab-expire>
                     <TabExpire :projectId="projectId" :contractId="contractId" :treeData="nodeDataInfo" v-if="sbTableKey === 'expire'"/>
@@ -72,6 +72,7 @@ import TabExpire from "./components/tab-expire.vue"
 import TabSpite from "./components/tab-spite.vue"
 import {getStoreValue, setStoreValue} from '~src/utils/storage'
 
+
 //变量
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId);
@@ -110,13 +111,18 @@ const sbTableClick = (key) => {
 
 //树操作
 const nodeDataInfo = ref({})
+const tabReform=ref(null)
 //自动展开缓存
 const treeAutoExpandKeys = ref(getStoreValue('earlyExpandKeys') || [])
 const projectTreeClick = ({key, node, data, keys}) => {
-    console.log(data)
+    nodeDataInfo.value=data
       //缓存展开的节点
       setStoreValue('earlyExpandKeys', keys)
         treeAutoExpandKeys.value = keys || []
+       if(sbTableKey.value==='reform'){
+        tabReform?.value?.getTableData()
+       }
+      
 }
 //树菜单被点击
 const ElTreeMenuClick = async ({key, node, data, keys}) => {