修复托盘登录批次选择确认
This commit is contained in:
@@ -136,9 +136,15 @@
|
||||
:row-buttons="[]"
|
||||
:pagination="null"
|
||||
:table-attrs="{ size: 'mini', rowKey: 'batch', highlightCurrentRow: true }"
|
||||
:table-listeners="batchTableListeners"
|
||||
height="420px"
|
||||
@row-dblclick="selectBatch"
|
||||
/>
|
||||
<span slot="footer">
|
||||
<el-button size="mini" @click="batchDialogVisible = false">{{ $t(key('cancel')) }}</el-button>
|
||||
<el-button size="mini" type="primary" :disabled="!currentBatch" @click="confirmBatch">
|
||||
{{ $t(key('confirm')) }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="$t(key('format_dialog_title'))" :visible.sync="formatDialogVisible" width="820px">
|
||||
@@ -154,8 +160,8 @@
|
||||
:row-buttons="[]"
|
||||
:pagination="null"
|
||||
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
|
||||
:table-listeners="formatTableListeners"
|
||||
height="360px"
|
||||
@row-dblclick="selectFormatRow"
|
||||
>
|
||||
<template #col-actions="{ row }">
|
||||
<el-button type="text" class="danger-action" @click="deleteFormat(row)">
|
||||
@@ -239,6 +245,7 @@ export default {
|
||||
batchList: [],
|
||||
formatList: [],
|
||||
selectedRows: [],
|
||||
currentBatch: null,
|
||||
batchDialogVisible: false,
|
||||
formatDialogVisible: false,
|
||||
formatFormVisible: false,
|
||||
@@ -312,6 +319,18 @@ export default {
|
||||
selectionWidth: 0,
|
||||
indexWidth: 0
|
||||
})
|
||||
},
|
||||
batchTableListeners () {
|
||||
return {
|
||||
'current-change': this.onBatchCurrentChange,
|
||||
'row-click': this.onBatchCurrentChange,
|
||||
'row-dblclick': this.selectBatch
|
||||
}
|
||||
},
|
||||
formatTableListeners () {
|
||||
return {
|
||||
'row-dblclick': this.selectFormatRow
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -335,11 +354,21 @@ export default {
|
||||
return new RegExp(`^${escaped}$`)
|
||||
},
|
||||
openBatchDialog () {
|
||||
this.currentBatch = this.batchList.find(item => item.batch === this.form.batch) || null
|
||||
this.batchDialogVisible = true
|
||||
if (!this.batchList.length) this.fetchBatchList()
|
||||
},
|
||||
onBatchCurrentChange (row) {
|
||||
this.currentBatch = row || null
|
||||
},
|
||||
confirmBatch () {
|
||||
if (!this.currentBatch) return
|
||||
this.selectBatch(this.currentBatch)
|
||||
},
|
||||
selectBatch (row) {
|
||||
if (!row || !row.batch) return
|
||||
this.form.batch = row.batch
|
||||
this.currentBatch = row
|
||||
this.batchDialogVisible = false
|
||||
},
|
||||
async fetchBatchList () {
|
||||
|
||||
Reference in New Issue
Block a user