Commit 769a2101 by Sweet Zhang

修改更新数据的时候第一次默认数据不显示

parent c3092767
...@@ -382,7 +382,9 @@ const addCheckRecordConfig = [ ...@@ -382,7 +382,9 @@ const addCheckRecordConfig = [
labelKey: 'realName', labelKey: 'realName',
onChangeExtraFields: { onChangeExtraFields: {
broker: 'realName', // 自动同步 raw.name 到 reconciliationCompany broker: 'realName', // 自动同步 raw.name 到 reconciliationCompany
reconciliationCompanyCode: 'code' reconciliationCompanyCode: 'code',
team:'deptName',
teamBizId:'deptBizId',
}, },
transform: res => { transform: res => {
return res?.data.records || [] return res?.data.records || []
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<script setup name="Receivables"> <script setup name="Receivables">
import CommonPage from '@/components/commonPage' import CommonPage from '@/components/commonPage'
import CommonDialog from '@/components/commonDialog' import CommonDialog from '@/components/commonDialog'
import { ref, reactive, onMounted, computed } from 'vue' import { ref, reactive, onMounted, computed,nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { MoreFilled } from '@element-plus/icons-vue' import { MoreFilled } from '@element-plus/icons-vue'
import { import {
...@@ -696,11 +696,14 @@ const handleSelect = async (e, row) => { ...@@ -696,11 +696,14 @@ const handleSelect = async (e, row) => {
} else if (e === 'updateData') { } else if (e === 'updateData') {
editStatus.value = 'update' editStatus.value = 'update'
addReceivablesDialogVisible.value = true addReceivablesDialogVisible.value = true
if (addRecordRef.value) { // 2. 使用 nextTick 等待 DOM 更新
addReceivablesFormModel.value = { nextTick(() => {
...selectedRow.value // 3. 此时 addRecordRef.value 一定存在了
} if (addRecordRef.value && selectedRow.value) {
addReceivablesFormModel.value = { ...selectedRow.value };
console.log('赋值成功:', addReceivablesFormModel.value);
} }
});
console.log('更新数据', selectedRow.value) console.log('更新数据', selectedRow.value)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment