Commit 769a2101 by Sweet Zhang

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

parent c3092767
......@@ -382,7 +382,9 @@ const addCheckRecordConfig = [
labelKey: 'realName',
onChangeExtraFields: {
broker: 'realName', // 自动同步 raw.name 到 reconciliationCompany
reconciliationCompanyCode: 'code'
reconciliationCompanyCode: 'code',
team:'deptName',
teamBizId:'deptBizId',
},
transform: res => {
return res?.data.records || []
......
......@@ -196,7 +196,7 @@
<script setup name="Receivables">
import CommonPage from '@/components/commonPage'
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 { MoreFilled } from '@element-plus/icons-vue'
import {
......@@ -696,11 +696,14 @@ const handleSelect = async (e, row) => {
} else if (e === 'updateData') {
editStatus.value = 'update'
addReceivablesDialogVisible.value = true
if (addRecordRef.value) {
addReceivablesFormModel.value = {
...selectedRow.value
}
// 2. 使用 nextTick 等待 DOM 更新
nextTick(() => {
// 3. 此时 addRecordRef.value 一定存在了
if (addRecordRef.value && selectedRow.value) {
addReceivablesFormModel.value = { ...selectedRow.value };
console.log('赋值成功:', addReceivablesFormModel.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