|
@@ -2,25 +2,34 @@
|
|
<a-card>
|
|
<a-card>
|
|
<a-tabs :default-active-key="defaultActive" @change="handleClick">
|
|
<a-tabs :default-active-key="defaultActive" @change="handleClick">
|
|
<a-tab-pane v-for="(item, index) in positionsList" :tab="item.name" :key="index">
|
|
<a-tab-pane v-for="(item, index) in positionsList" :tab="item.name" :key="index">
|
|
- <div style="position: relative;">
|
|
|
|
- <div class="point" v-for="store in storeList" :key="store.id" :style="computPosition(store.positionX, store.positionY)" />
|
|
|
|
|
|
+ <div style="position: relative;" v-show="visible">
|
|
|
|
+ <div class="point" v-for="store in storeList" :key="store.id" :style="computPosition(store.positionX, store.positionY)" @click="handleView(store)">
|
|
|
|
+ {{ store.name }}
|
|
|
|
+ </div>
|
|
<img v-if="item.opcImg" :src="item.opcImg" width="100%" alt="">
|
|
<img v-if="item.opcImg" :src="item.opcImg" width="100%" alt="">
|
|
<a-empty v-else description="暂无底图,请上传" />
|
|
<a-empty v-else description="暂无底图,请上传" />
|
|
</div>
|
|
</div>
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
|
|
+ <StoreDetailMap ref="storeDetailMap" @ok="handleOk" />
|
|
|
|
+
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { querySbPosition } from '@/api/sb/position'
|
|
import { querySbPosition } from '@/api/sb/position'
|
|
import { fetchStorePosition, fetchStoreStore } from '@/api/store/store'
|
|
import { fetchStorePosition, fetchStoreStore } from '@/api/store/store'
|
|
|
|
+import StoreDetailMap from './modules/StoreDetailMap.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ StoreDetailMap
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
positionsList: [],
|
|
positionsList: [],
|
|
defaultActive: 0,
|
|
defaultActive: 0,
|
|
- storeList: []
|
|
|
|
|
|
+ storeList: [],
|
|
|
|
+ visible: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -35,22 +44,34 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
computPosition (x, y) {
|
|
computPosition (x, y) {
|
|
- const left = x + '%'
|
|
|
|
- const top = y + '%'
|
|
|
|
|
|
+ const left = `calc(${x}% - 35px)`
|
|
|
|
+ const top = `calc(${y}% - 85px)`
|
|
return {
|
|
return {
|
|
left, top
|
|
left, top
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleClick (i) {
|
|
handleClick (i) {
|
|
this.defaultActive = i
|
|
this.defaultActive = i
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.$refs.storeDetailMap.handleCancel()
|
|
fetchStorePosition({ id: this.positionsList[i].id }).then(res => {
|
|
fetchStorePosition({ id: this.positionsList[i].id }).then(res => {
|
|
this.storeList = res.data
|
|
this.storeList = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleClickImg (e) {
|
|
|
|
- console.log(e.offsetX, e.offsetY)
|
|
|
|
- console.log(e.target.width, e.target.height)
|
|
|
|
- // console.log(e.offsetX, e.offsetY)
|
|
|
|
|
|
+ handleView (store) {
|
|
|
|
+ if (!store.existPosition) {
|
|
|
|
+ this.$message.warning('该仓库不存在库位!')
|
|
|
|
+ } else if (!store.backGroundMap) {
|
|
|
|
+ this.$message.warning('该仓库未上传底图!')
|
|
|
|
+ } else {
|
|
|
|
+ fetchStoreStore({ id: store.id }).then(res => {
|
|
|
|
+ this.visible = false
|
|
|
|
+ this.$refs.storeDetailMap.base(res.data, store.backGroundMap)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleOk () {
|
|
|
|
+ this.visible = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -59,9 +80,18 @@ export default {
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.point {
|
|
.point {
|
|
position: absolute;
|
|
position: absolute;
|
|
- width: 10px;
|
|
|
|
- height: 10px;
|
|
|
|
- background: red;
|
|
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
|
|
+ background: url(~@/assets/a/6.png) repeat;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ // border: 2px solid #fff;
|
|
|
|
+ color: #fff;
|
|
|
|
+ height: 80px;
|
|
|
|
+ width: 70px;
|
|
|
|
+display: flex;
|
|
|
|
+justify-content: center;
|
|
|
|
+align-items: center;
|
|
|
|
+text-align: center;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ cursor: pointer;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|