|
@@ -57,24 +57,30 @@
|
|
|
|
|
|
<!-- 网格系统 -->
|
|
<!-- 网格系统 -->
|
|
<div class="grid-container">
|
|
<div class="grid-container">
|
|
- <!-- 内容层 -->
|
|
+ <!-- 内容层 -->
|
|
<div class="grid-content">
|
|
<div class="grid-content">
|
|
<div v-for="(row, rowIndex) in shelf.rows" :key="`row-${rowIndex}|${shelf.layer_now}`" class="grid-row">
|
|
<div v-for="(row, rowIndex) in shelf.rows" :key="`row-${rowIndex}|${shelf.layer_now}`" class="grid-row">
|
|
<div v-for="(col, colIndex) in shelf.cols" :key="`col-${colIndex}|${shelf.layer_now}`" class="grid-item">
|
|
<div v-for="(col, colIndex) in shelf.cols" :key="`col-${colIndex}|${shelf.layer_now}`" class="grid-item">
|
|
- <q-btn
|
|
+ <div
|
|
- v-if="shouldShowButton(
|
|
+ v-if="shouldShowButton(
|
|
- shelf.rows - rowIndex,
|
|
+ shelf.rows - rowIndex,
|
|
- colIndex + 1,
|
|
+ colIndex + 1,
|
|
- shelf.layer_now
|
|
+ shelf.layer_now
|
|
- )"
|
|
+ )"
|
|
- :key="`${shelf.rows - rowIndex}-${col}-${shelf.layer_now}`"
|
|
+ :key="`${shelf.rows - rowIndex}-${colIndex}-${shelf.layer_now}`"
|
|
- :style="{
|
|
+ :style="{
|
|
- width: 'var(--cell-d)',
|
|
+ border: '1px solid #ccc',
|
|
- height: 'var(--cell-d)',
|
|
+ borderRadius: '5px',
|
|
- backgroundColor: getBinColor(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)
|
|
+ width: 'var(--cell-d)',
|
|
- }"
|
|
+ height: 'var(--cell-d)',
|
|
- @click="handleBinClick(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)"
|
|
+ backgroundColor: getBinColor(shelf.rows - rowIndex, colIndex+1, shelf.layer_now),
|
|
- />
|
|
+ cursor: 'pointer' // 明确指示点击行为
|
|
|
|
+ }"
|
|
|
|
+ @click="handleBinClick(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)"
|
|
|
|
+ >
|
|
|
|
+ <!-- 确保没有子元素获得焦点 -->
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
|
|
content-style="font-size: 10px">
|
|
content-style="font-size: 10px">
|
|
{{ $t('stock.rowtip') }} {{ shelf.rows - rowIndex }}
|
|
{{ $t('stock.rowtip') }} {{ shelf.rows - rowIndex }}
|
|
@@ -96,7 +102,6 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import goodscard from 'components/goodscard.vue'
|
|
import goodscard from 'components/goodscard.vue'
|
|
-
|
|
|
|
import { LocalStorage } from 'quasar'
|
|
import { LocalStorage } from 'quasar'
|
|
import { getauth, postauth, putauth, deleteauth, getfile } from 'boot/axios_request'
|
|
import { getauth, postauth, putauth, deleteauth, getfile } from 'boot/axios_request'
|
|
|
|
|
|
@@ -119,7 +124,8 @@ export default {
|
|
},
|
|
},
|
|
filter: "",
|
|
filter: "",
|
|
auth_edit: false,
|
|
auth_edit: false,
|
|
- goodsMap: {}, // 坐标映射表
|
|
+ goodsMap: {}, //
|
|
|
|
+
|
|
goodsMatrix: [] , // 二维数据矩阵
|
|
goodsMatrix: [] , // 二维数据矩阵
|
|
|
|
|
|
// 颜色配置
|
|
// 颜色配置
|
|
@@ -138,21 +144,21 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 修正后的路由守卫
|
|
+ // 修正后的路由守卫
|
|
- beforeRouteEnter(to, from, next) {
|
|
+ beforeRouteEnter(to, from, next) {
|
|
- next(vm => {
|
|
+ next(vm => {
|
|
- // 使用 vm 访问组件实例
|
|
+ // 使用 vm 访问组件实例
|
|
- vm.goodsMatrix = []
|
|
+ vm.goodsMatrix = []
|
|
- vm.selectedBin = null
|
|
+
|
|
- vm.goodsMap = {}
|
|
+ vm.goodsMap = {}
|
|
- })
|
|
+ })
|
|
- },
|
|
+ },
|
|
- // beforeDestroy() {
|
|
+ beforeDestroy() {
|
|
- // //清空数据
|
|
+ //清空数据
|
|
-
|
|
+ this.goodsMap = {}
|
|
- // this.goodsMatrix = []
|
|
+ this.goodsMatrix = []
|
|
- // this.selectedBin = null
|
|
+
|
|
- // },
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
shouldShowButton(row, col, layer) {
|
|
shouldShowButton(row, col, layer) {
|
|
const bin = this.goodsMap[`${row}-${col}-${layer}`]
|
|
const bin = this.goodsMap[`${row}-${col}-${layer}`]
|
|
@@ -298,7 +304,7 @@ export default {
|
|
// 清理数据
|
|
// 清理数据
|
|
this.goodsMap = {}
|
|
this.goodsMap = {}
|
|
this.goodsMatrix = []
|
|
this.goodsMatrix = []
|
|
- this.selectedBin = null
|
|
+
|
|
|
|
|
|
// 清理事件监听
|
|
// 清理事件监听
|
|
window.removeEventListener('resize', this.handleResize)
|
|
window.removeEventListener('resize', this.handleResize)
|