duy 1 year ago
parent
commit
f2fc1a9a0c

+ 1 - 1
src/views/project/debit/contract/components/unit/info-table.vue

@@ -6,7 +6,7 @@
             <hc-info-table-td center is-title width="120px">工程编号:</hc-info-table-td>
             <hc-info-table-td width="auto">{{ infoData?.nodeCode }}</hc-info-table-td>
             <hc-info-table-td center is-title width="120px">节点类型:</hc-info-table-td>
-            <hc-info-table-td width="auto">{{ infoData?.nodeType }}</hc-info-table-td>
+            <hc-info-table-td width="auto">{{ infoData?.nodeTypeName }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title width="120px">工程类型:</hc-info-table-td>

+ 16 - 2
src/views/project/debit/contract/components/unit/row-data.vue

@@ -16,13 +16,13 @@
                     <el-col :span="6">
                         <el-form-item label="节点类型:">
                             <el-select v-model="formModel.nodeType" placeholder="节点类型" block>
-                                <el-option label="单位工程" :value="1" />
+                                <el-option v-for="item in nodeOptions" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
                             </el-select>
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
                         <el-form-item label="工程类型:">
-                            <el-select v-model="formModel.engineeringType" placeholder="工程类型" disabled block>
+                            <el-select v-model="formModel.engineeringTypeName" placeholder="工程类型" disabled block>
                                 <el-option label="总则" :value="1" />
                             </el-select>
                         </el-form-item>
@@ -114,6 +114,8 @@ import { ref, watch } from 'vue'
 import AddCheckList from './addCheckList.vue'
 import unitApi from '~api/project/debit/contract/unit.js'
 import { useAppStore } from '~src/store'
+import { getDictionary } from '~api/other'
+import { getArrValue } from 'js-fast-way'
 
 const props = defineProps({
     ids: {
@@ -152,6 +154,17 @@ const tableRowStyle = ({ row, rowIndex }) => {
         return '--el-fill-color-lighter: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
     }
 }
+//获节点类型
+const nodeOptions = ref([])
+const getNodeType = async () => {
+    const { data } = await getDictionary({
+        code: 'meter_node_type',
+    })
+    nodeOptions.value = getArrValue(data)
+    nodeOptions.value.forEach((ele)=>{
+        ele.dictKey = Number(ele.dictKey)
+    })
+}
 //监听
 watch(() => [
     props.ids,
@@ -169,6 +182,7 @@ watch(() => [
 watch(isShow, (val) => {
     if (val) {
         console.log('isShow', val)
+        getNodeType()
     }
 })
 

+ 18 - 1
src/views/project/debit/contract/unit.vue

@@ -84,6 +84,7 @@ import unitApi from '~api/project/debit/contract/unit.js'
 import { useAppStore } from '~src/store'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import { delMessageV2 } from '~com/message/index.js'
+import { getDictionary } from '~api/other'
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId || '')
 const contractId = ref(useAppState.getContractId || '')
@@ -96,6 +97,7 @@ const uuid = getRandom(4)
 //渲染完成
 onMounted(() => {
     setSplitRef()
+    getNodeType()
 })
 
 //初始化设置拖动分割线
@@ -109,7 +111,17 @@ const setSplitRef = () => {
         })
     })
 }
-
+//获节点类型
+const nodeOptions = ref([])
+const getNodeType = async () => {
+    const { data } = await getDictionary({
+        code: 'meter_node_type',
+    })
+    nodeOptions.value = getArrValue(data)
+    nodeOptions.value.forEach((ele)=>{
+        ele.dictKey = Number(ele.dictKey)
+    })
+}
 //搜索表单
 const searchForm = ref({})
 
@@ -173,6 +185,11 @@ const getTreeNodeDetail = async (node)=>{
     if (!error && code === 200) {
         curTreeData.value = getObjValue(data)
         tableData.value = curTreeData.value['decompositionList']
+        nodeOptions.value.forEach((ele)=>{
+            if (curTreeData.value.nodeType === ele.dictKey) {
+                curTreeData.value.nodeTypeName = ele.dictValue
+            }
+        })
        
    
     } else {