fix(frontend): resolve cross-page selection loss, add destroy-on-close to dialogs, and fix row-key collision in stocktake
This commit is contained in:
@ -86,7 +86,7 @@
|
||||
/>
|
||||
|
||||
<!-- 新增调整单弹窗 -->
|
||||
<el-dialog v-model="showDialog" title="新增盘盈盘亏调整单" width="700px" :close-on-click-modal="false">
|
||||
<el-dialog v-model="showDialog" title="新增盘盈盘亏调整单" width="700px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
|
||||
<el-form-item label="选择物料" prop="stock_id">
|
||||
<el-select
|
||||
@ -128,7 +128,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物料选择弹窗 -->
|
||||
<el-dialog v-model="showStockDialog" title="选择物料" width="800px">
|
||||
<el-dialog v-model="showStockDialog" title="选择物料" width="800px" destroy-on-close>
|
||||
<div class="filter-container" style="margin-bottom: 15px">
|
||||
<el-input v-model="stockKeyword" placeholder="搜索SKU/条码" style="width: 200px" @keyup.enter="fetchStocks" clearable />
|
||||
<el-button type="primary" @click="fetchStocks">搜索</el-button>
|
||||
@ -152,7 +152,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 盘点差异审核弹窗 -->
|
||||
<el-dialog v-model="showReviewDialog" title="盘点差异审核" width="1200px" :close-on-click-modal="false">
|
||||
<el-dialog v-model="showReviewDialog" title="盘点差异审核" width="1200px" destroy-on-close :close-on-click-modal="false">
|
||||
<div v-loading="reviewLoading">
|
||||
<!-- 搜索栏 -->
|
||||
<div style="margin-bottom: 16px; display: flex; gap: 12px;">
|
||||
@ -171,8 +171,8 @@
|
||||
<el-button type="primary" @click="handleReviewSearch">搜索</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="reviewList" border stripe ref="reviewTableRef" @selection-change="handleReviewSelectionChange">
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table :data="reviewList" border stripe ref="reviewTableRef" row-key="id" @selection-change="handleReviewSelectionChange">
|
||||
<el-table-column type="selection" width="50" :reserve-selection="true" />
|
||||
<el-table-column prop="sku" label="SKU" width="140" />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="spec_model" label="规格" width="120" show-overflow-tooltip />
|
||||
@ -226,7 +226,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 处理调整单弹窗 -->
|
||||
<el-dialog v-model="showProcessDialog" title="处理调整单" width="500px" :close-on-click-modal="false">
|
||||
<el-dialog v-model="showProcessDialog" title="处理调整单" width="500px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="调整单号">
|
||||
<el-input v-model="processForm.order_no" disabled />
|
||||
|
||||
@ -84,6 +84,7 @@
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="700px"
|
||||
destroy-on-close
|
||||
@close="resetDialog"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
|
||||
@ -121,6 +121,7 @@
|
||||
v-model="showConfirmDialog"
|
||||
title="⚠️ 确认清除盘点数据"
|
||||
width="400"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
show-close
|
||||
@ -237,7 +238,7 @@
|
||||
height="100%"
|
||||
stripe
|
||||
border
|
||||
row-key="id"
|
||||
row-key="uniqueKey"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="sku" label="SKU" width="140" show-overflow-tooltip />
|
||||
@ -1004,6 +1005,7 @@ const fetchInventoryList = async (silent = false) => {
|
||||
id: draft?.id || null,
|
||||
stock_id: item.id,
|
||||
source_table: item.source_table,
|
||||
uniqueKey: `${item.source_table}_${item.id}`, // ★ 绝对唯一键,解决row-key冲突
|
||||
sku: item.sku,
|
||||
material_name: item.material_name,
|
||||
spec_model: item.spec_model,
|
||||
|
||||
Reference in New Issue
Block a user