Browse Source

年度经营预算修改

duy 2 năm trước cách đây
mục cha
commit
dd63106084
1 tập tin đã thay đổi với 12 bổ sung20 xóa
  1. 12 20
      src/views/program/annual/form.vue

+ 12 - 20
src/views/program/annual/form.vue

@@ -66,7 +66,7 @@
                             </el-select>
                         </template>
                         <template #projectTypeValue="{ row, index }">
-                            <el-input v-model="row.projectTypeValue" disabled :getdata="getprojectType(row)" />
+                            <el-input v-model="row.projectTypeValue" disabled />
                         </template>
                         <template #contractTypeValue="{ row, index }">
                             <el-input v-model="row.contractTypeValue" disabled :getdata="getprojectType(row)" />
@@ -81,7 +81,7 @@
                             <el-input v-model="row.predictAnnualReturned" onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/)" />
                         </template>
                         <template #action="{ row, index }">
-                            <el-button size="small" type="primary" @click="addRow">
+                            <el-button size="small" type="primary" @click="addRow(row, index)">
                                 <HcIcon name="add" />
                                 <span>新增</span>
                             </el-button>
@@ -141,7 +141,7 @@
                             <el-input v-model="row.december" onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/)" />
                         </template>
                         <template #action="{ row, index }">
-                            <el-button size="small" type="primary" @click="addRow1">
+                            <el-button size="small" type="primary" @click="addRow1(row, index)">
                                 <HcIcon name="add" />
                                 <span>新增</span>
                             </el-button>
@@ -268,23 +268,13 @@ const getBudgetTypeList = async ()=>{
 }
 const secondBudgetTypeList = ref({})
 const getsecondBudgetTypeList = async (val, index)=>{
-    let id = ''
     budgetTypeList.value.forEach((ele)=>{
         if (ele.dictValue === val) {
-            id = ele.id
+            secondBudgetTypeList.value[index] = ele.children
         }
     })
-    if (id.length > 0) {
-        const { error, code, data } = await costApi.getChlidList({ parentId:id, type:1 })
-        if (!error && code === 200) {
-            secondBudgetTypeList.value[index] = getArrValue(data)
-        } else {
-            secondBudgetTypeList.value[index] = []
-           
-        }
-    }
-   
-}
+
+ }
 
 
 //设置表单tabs样式
@@ -348,8 +338,9 @@ const changeTab = (val)=>{
 const tableData = ref([
     { id: 1 }, { id: 2 },
 ])
-const addRow = ()=>{
-    incomeTable.value.push({})
+const addRow = (row, index)=>{
+    // incomeTable.value.push({})
+    incomeTable.value.splice(index + 1, 0, {})
 }
 const delRow = (row, index)=>{
     incomeTable.value.splice(index, 1)
@@ -358,8 +349,9 @@ const delRow = (row, index)=>{
     }
  
 }
-const addRow1 = ()=>{
-    costTable.value.push({})
+const addRow1 = (row, index)=>{
+    // costTable.value.push({})
+    costTable.value.splice(index + 1, 0, {})
 }
 const delRow1 = (row, index)=>{
     costTable.value.splice(index, 1)