Prechádzať zdrojové kódy

修复分部分项划分的节点层级问题

iZaiZaiA 2 rokov pred
rodič
commit
627dfaf73d
1 zmenil súbory, kde vykonal 23 pridanie a 1 odobranie
  1. 23 1
      src/views/data-fill/division.vue

+ 23 - 1
src/views/data-fill/division.vue

@@ -31,6 +31,7 @@
                 <HcCard title="当前节点工程用表信息">
                     <HcTable :column="tableProjectColumn" :datas="tableProjectData" :isIndex="false" border>
                         <template #tableType="{row}">{{getRowTableType(row['tableType'])}}</template>
+                        <template #tableOwner="{row}">{{getRowTableOwnerType(row['tableOwner'])}}</template>
                     </HcTable>
                 </HcCard>
             </div>
@@ -281,6 +282,7 @@ onMounted(() => {
     getWbsNodeTypeApi()
     getMajorDataTypeApi()
     getWbsNodeTableTypeApi()
+    getTableOwnerTypeApi()
 })
 
 //获取节点类型
@@ -347,6 +349,26 @@ const getRowTableType = (type) => {
     }
 }
 
+//获取表类型数据
+const tableOwnerTypeData = ref([])
+const getTableOwnerTypeApi = async () => {
+    const { data } = await getDictionary({
+        code: 'owner_type'
+    })
+    tableOwnerTypeData.value = getArrValue(data)
+}
+
+//获取表类型
+const getRowTableOwnerType = (type) => {
+    if (type > 0) {
+        const nodeData = tableOwnerTypeData.value
+        const index = getIndex(nodeData, 'dictKey', type)
+        return nodeData[index]?.dictValue ?? type
+    } else {
+        return ''
+    }
+}
+
 //树被点击
 const treeNodeInfo = ref({})
 const treeItemInfo = ref({})
@@ -380,7 +402,7 @@ const tableBasicData = ref([])
 const tableProjectColumn = ref([
     {key:'nodeName', name: '工程用表名称'},
     {key:'tableType', name: '用表类型'},
-    {key:'taskStatusStr', name: '用表单位'},
+    {key:'tableOwner', name: '用表单位'},
     {key:'fillRate', name: '填报完整率'}
 ])
 const tableProjectData = ref([])