Browse Source

变更令

ZaiZai 1 year ago
parent
commit
6b4ad3b5b3
1 changed files with 12 additions and 4 deletions
  1. 12 4
      src/views/alter/admin/order.vue

+ 12 - 4
src/views/alter/admin/order.vue

@@ -91,7 +91,7 @@
                         </hc-info-table>
                     </hc-card-item>
                     <hc-card-item class="mt-3" title="变更申请部位">
-                        <hc-table :column="tableColumn1" :datas="tableInfo.nodeList" is-new :index-style="{ width: 60 }" is-current-row @row-click="tableNodeRowClick" />
+                        <hc-table ref="tableRef1" :column="tableColumn1" :datas="tableInfo.nodeList" is-new :index-style="{ width: 60 }" is-current-row @row-click="tableNodeRowClick" />
                     </hc-card-item>
                     <hc-card-item v-if="tableChangeData.length > 0" class="mt-3" title="变更申请清单">
                         <div class="hc-table-ref-box no-border">
@@ -232,9 +232,16 @@ const tableInfo = ref({})
 const getTableDetail = async (row) => {
     if (!row.id) return
     const { data } = await mainApi.getDetail({ id: row.id })
-    const info = getObjValue(data)
-    info.nodeList = getArrValue(info.nodeList)
-    tableInfo.value = info
+    const dataInfo = getObjValue(data)
+    dataInfo.nodeList = getArrValue(dataInfo.nodeList)
+    tableInfo.value = dataInfo
+    //默认选中部位的第一行
+    let info = {}
+    if (dataInfo.nodeList.length > 0) {
+        info = dataInfo.nodeList[0]
+    }
+    tableRef1.value?.tableRef?.setCurrentRow(info)
+    tableChangeData.value = getArrValue(info.formList)
 }
 
 //修改
@@ -255,6 +262,7 @@ const addModalClick = () => {
     })
 }
 
+const tableRef1 = ref(null)
 //申请部位
 const tableColumn1 = ref([
     { key: 'nodeName', name: '工程名称' },