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:
@ -3,6 +3,7 @@
|
||||
v-model="visible"
|
||||
title="智能扫码"
|
||||
width="600px"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 打印机配置弹窗 -->
|
||||
<el-dialog v-model="printerDialogVisible" title="打印机 IP 配置" width="500px">
|
||||
<el-dialog v-model="printerDialogVisible" title="打印机 IP 配置" width="500px" destroy-on-close>
|
||||
<el-form :model="printerForm" label-width="120px">
|
||||
<el-form-item label="标签打印机 IP">
|
||||
<el-input v-model="printerForm.label_ip" placeholder="例如 192.168.9.221" />
|
||||
@ -69,7 +69,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 库位管理弹窗 -->
|
||||
<el-dialog v-model="warehouseDialogVisible" title="库位管理" width="700px" :close-on-click-modal="false">
|
||||
<el-dialog v-model="warehouseDialogVisible" title="库位管理" width="700px" destroy-on-close :close-on-click-modal="false">
|
||||
<div class="warehouse-dialog">
|
||||
<div class="warehouse-header">
|
||||
<!-- 非批量模式 -->
|
||||
@ -145,7 +145,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增/编辑库位弹窗 -->
|
||||
<el-dialog v-model="locationFormVisible" :title="locationFormTitle" width="400px">
|
||||
<el-dialog v-model="locationFormVisible" :title="locationFormTitle" width="400px" destroy-on-close>
|
||||
<el-form :model="locationForm" label-width="80px">
|
||||
<el-form-item label="上级库位">
|
||||
<el-input :value="locationForm.parentName" disabled />
|
||||
@ -164,7 +164,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 批量生成库位弹窗 -->
|
||||
<el-dialog v-model="batchGenerateVisible" title="批量生成库位" width="800px">
|
||||
<el-dialog v-model="batchGenerateVisible" title="批量生成库位" width="800px" destroy-on-close>
|
||||
<el-form :model="batchGenerateForm" label-width="100px">
|
||||
<el-form-item label="父级库位">
|
||||
<el-input :value="batchGenerateForm.parentName" disabled />
|
||||
|
||||
@ -194,13 +194,14 @@
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
row-key="id"
|
||||
:size="tableSize"
|
||||
:row-class-name="tableRowClassName"
|
||||
@sort-change="handleSortChange"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%; margin-top: 15px"
|
||||
>
|
||||
<el-table-column v-if="isBatchMode" type="selection" width="55" />
|
||||
<el-table-column v-if="isBatchMode" type="selection" width="55" :reserve-selection="true" />
|
||||
<el-table-column v-if="columns.id.visible" prop="id" label="ID" min-width="80" align="center" fixed="left" />
|
||||
|
||||
<el-table-column v-if="columns.companyName.visible" prop="companyName" label="所属公司" min-width="100" align="center" show-overflow-tooltip sortable="custom">
|
||||
@ -323,6 +324,7 @@
|
||||
:title="dialog.title"
|
||||
width="700px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="cancel"
|
||||
:close-on-click-modal="!isUploading"
|
||||
:close-on-press-escape="!isUploading"
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog v-model="detailDialogVisible" title="操作详情" width="700px">
|
||||
<el-dialog v-model="detailDialogVisible" title="操作详情" width="700px" destroy-on-close>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="ID">{{ currentLog.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="操作人">{{ currentLog.username }} ({{ currentLog.display_name }})</el-descriptions-item>
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
v-model="dialogVisible"
|
||||
:title="isEdit ? '编辑员工账号' : '新增员工账号'"
|
||||
width="500px"
|
||||
destroy-on-close
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form
|
||||
|
||||
Reference in New Issue
Block a user