瀏覽代碼

测算类型回显

duy 2 年之前
父節點
當前提交
7d33bd5721
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      src/views/project/cost/form.vue

+ 14 - 2
src/views/project/cost/form.vue

@@ -140,7 +140,7 @@
 </template>
 
 <script setup>
-import {onActivated, ref} from "vue";
+import {onActivated, ref,watch} from "vue";
 import {useRouter, useRoute} from 'vue-router'
 import costApi from '~api/project/cost.js';
 import {getArrValue,getObjValue,formValidate} from "js-fast-way"
@@ -159,6 +159,7 @@ onActivated(() => {
     bulidUnitData.value=[]
     tabsKey.value = 'base'
     tabKey.value='construction'
+    getBudgetTypeList()
     if(dataId.value.length>0){
         getBudgetStatsById()
         getProjectList(2)
@@ -168,7 +169,7 @@ onActivated(() => {
     }
 
     getCostTypeDict()
-    getBudgetTypeList()
+   
     getPostDict()
 
 
@@ -176,6 +177,8 @@ onActivated(() => {
    
     
 })
+
+
 const projectList=ref([])
 //获取项目下拉框
 const getProjectList=async(type)=>{
@@ -354,6 +357,15 @@ const tableColumn = [
     {key: 'action', name: '操作', width: '200', align: 'center', fixed: 'right'},
 ]
 const tableData = ref([{}])
+//深度监听
+watch(() => [
+  tableData.value,
+], ([data]) => {
+   if(data!=={}&&data.length>0){
+    budgetTypeChange(data[0].budgetType)
+   }
+//    
+}, {deep: true})
 const originTableData=ref([ {}])
 const addRow=()=>{
     tableData.value.push({})