空货位盘点

feature/nanjing-wuliu
yiming 3 years ago
parent 14175ea24a
commit 867782ebf7

@ -178,6 +178,11 @@ export default {
name: '行列的库存状态', name: '行列的库存状态',
method: 'POST' method: 'POST'
}, },
checkSummaryGetStatusByRowColumn: {
url: '/checkSummary/statusByRowColumn',
name: '行列的库存状态',
method: 'POST'
},
exportStock: { exportStock: {
url: '/stock/export', url: '/stock/export',
name: '导出单个巷道', name: '导出单个巷道',

@ -15,9 +15,10 @@
<a-badge :count="count" @click="openPlc" style="margin-top:10px"> <a-badge :count="count" @click="openPlc" style="margin-top:10px">
<a-icon type="bell" style="font-size:40px;cursor:pointer;"/> <a-icon type="bell" style="font-size:40px;cursor:pointer;"/>
</a-badge> </a-badge>
<div style="width:40px"></div> <div style="width:40px"></div>
<img src="@/assets/dianke.png" style="height:40" alt />
<img src="@/assets/dianke.png" style="height:40" alt />
</div> </div>
</div> </div>
</template> </template>

@ -76,6 +76,15 @@ const routes = [{
}, },
component: () => import('@/views/checkSummary/index') component: () => import('@/views/checkSummary/index')
}, },
{
path: 'emptyCheckManage',
name: 'emptyCheckManage',
meta: {
icon: 'form',
name: '空货位管理',
},
component: () => import('@/views/emptyCheckManage/index'),
},
{ {
path: 'checkManage', path: 'checkManage',
name: 'checkManage', name: 'checkManage',

@ -14,19 +14,19 @@ const store = {
"text":"中国电科智能视觉", "text":"中国电科智能视觉",
"style":{ "style":{
"color":"rgba(255, 255, 255, 1)", "color":"rgba(0,0,0, 1)",
"background-color":"rgba(163, 60, 12, 1)", "background-color":"rgba(204,55,43, 1)",
"font-size":"24px" "font-size":"24px"
} }
}, },
"menu":{ "menu":{
"default":{ "default":{
"color":"rgba(230, 224, 224, 1)", "color":"rgba(255,255,255, 1)",
"background-color":"rgba(163, 60, 12, 1)" "background-color":"rgba(204,55,43, 1)"
}, },
"select":{ "select":{
"color":"rgba(255, 255, 255, 1)", "color":"rgba(255,255,255, 1)",
"background-color":"rgba(184, 68, 13, 1)" "background-color":"rgba(182,44,46, 1)"
} }
} }
} }
@ -39,7 +39,7 @@ const store = {
// } // }
state.data = data; state.data = data;
// 改变主题颜色 // 改变主题颜色
changeTheme(data.theme['primary-color']); //changeTheme(data.theme['primary-color']);
// setItem(data); // setItem(data);
} }
}, },

@ -11,6 +11,7 @@
class="add-edit-model" class="add-edit-model"
> >
<template #footer> <template #footer>
<a-button key="submit" type="primary" @click="exportSummary"></a-button>
<a-button key="submit" type="primary" @click="handleOk"></a-button> <a-button key="submit" type="primary" @click="handleOk"></a-button>
</template> </template>
<a-table <a-table
@ -115,9 +116,11 @@ export default {
}); });
}, },
handleOk() { handleOk() {
this.$emit('close', false, {}) this.$emit('close', false, {});
}, },
exportSummary() {
this.$utils.downloadFileUrl('盘点统计'+this.mdata.taskId+'.xls', '/api/checkSummary/export?taskId='+this.mdata.taskId);
}

@ -0,0 +1,366 @@
<template>
<div class="subsection">
<a-layout style="width: 1500px">
<a-layout style="width: 100%;height: 310px">
<a-layout-sider width="110px">
<a-tabs default-active-key="1" tab-position="left" @change="changeTabLeft" v-if="total.row > nums.row">
<a-tab-pane
v-for="index in latticeRow"
:key="index"
>
<span slot="tab" >
{{ getRandom(latticeRow + 1 -index, latticeRow, nums.row, total.row) }}
<a-icon type="close-circle" v-if="status.row[index] === 0" style="color: #d81e06"/>
<a-icon type="check-circle" v-else-if="status.row[index] === 2" style="color: #1afa29" />
<a-icon type="exclamation-circle" v-else style="color: #909399" />
</span>
</a-tab-pane>
</a-tabs>
</a-layout-sider>
<a-layout-content>
<!-- <slot :data="{select, nums, random}"></slot> -->
<div class="roadway-buttom">
<div class="roadway-box">
<div class="line" v-for="(row,rowIndex) in total.row" :key="rowIndex" v-if="row >= random.row[0] && row <= random.row[1]">
<div v-for="(column,index) in total.column" :key="index" class="el" v-if="column >= random.column[0] && column <= random.column[1]">
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应-->
<span
class="default"
:id="`${direction}-${side}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
>
{{ random.row[0] + random.row[1] - rowIndex - 1}}-{{column}}
</span>
</div>
</div>
</div>
</div>
</a-layout-content>
</a-layout>
<a-layout-footer>
<!-- <a-tabs default-active-key="1" tab-position="bottom" @change="value => select.row = value" v-if="total.row > nums.row"> -->
<a-tabs default-active-key="1" tab-position="bottom" @change="changeTab" v-if="total.column > nums.column">
<a-tab-pane
v-for="index in latticeColumn"
:key="index"
>
<span slot="tab">
{{ getRandom(index, latticeColumn, nums.column, total.column) }}
<!-- <a-icon :id="`${shelveId}-row-${getRandom(index,latticeRow,nums.row,total.row)}`"/> -->
<a-icon type="close-circle" v-if="status.column[index] === 0" style="color: #d81e06" />
<a-icon type="check-circle" v-else-if="status.column[index] === 2" style="color: #1afa29" />
<a-icon type="exclamation-circle" v-else style="color: #909399" />
</span>
</a-tab-pane>
</a-tabs>
</a-layout-footer>
</a-layout>
</div>
</template>
<script>
export default {
name: "Subsection",
components: {},
props: {
//
select: {
type: Object,
default: () => {
return {
row: 1,
column: 1
}
}
},
//
total:{
type: Object,
default:()=>{
return {}
}
},
nums: {
type: Object,
default: () => {
return {
row: 10,
column: 15
}
}
},
direction: {
type: Number,
default: () => {
return {}
}
},
side: {
type: Number,
default: () => {
return {}
}
},
streetId: {
type: Number,
default: () => {
return {}
}
},
streetName: {
type: String,
default: () => {
return {}
}
},
},
computed: {
//
latticeRow() {
return parseInt(this.total.row / this.nums.row) + (this.total.row % this.nums.row > 0 ? 1 : 0);
},
latticeColumn() {
return parseInt(this.total.column / this.nums.column) + (this.total.column % this.nums.column > 0 ? 1 : 0);
},
random() {
return {
row: this.getRandomRow(this.select.row),
column: this.getRandomColumn(this.select.column),
}
},
watchDirection(){
return this.direction;
},
watchSide(){
return this.side;
},
},
watch: {
watchDirection() {
this.getStatus();
},
watchSide() {
this.getStatus();
},
immediate: true,
},
data() {
return {
status: {
row: {},
column: {}
},
timer: null
}
},
mounted() {
this.$nextTick(() => {
this.getStatus();
})
this.$on('hook:activated', () => {
this.timer = window.setInterval(this.getStatus, 3000);
})
this.timer = window.setInterval(this.getStatus, 3000);
this.$on('hook:deactivated', () => {
clearInterval(this.timer)
this.timer = null
})
},
beforeDestroy() {
console.log("beforeDestroy")
window.clearInterval(this.timer);
this.timer = null;
},
created() {
},
destroyed() {
window.clearInterval(this.timer);
this.timer = null;
},
methods: {
changeTab(value){
this.select.column = value
this.getStatus()
},
changeTabLeft(value){
this.select.row = value
this.getStatus()
},
//
getRandom(index, lattice, num, total) {
if(index !== lattice) {
return `${(index - 1) * num + 1} - ${index * num}`;
}else {
return `${(index - 1) * num + 1} - ${total}`;
}
},
//
getRandomRow(val) {
console.log(this.latticeRow + 1 - val, this.latticeRow, this.nums.row, this.total.row)
return this.getRandom(this.latticeRow + 1 - val, this.latticeRow, this.nums.row, this.total.row).split(' - ').map(item => Number(item));
},
getRandomColumn(val) {
return this.getRandom(val, this.latticeColumn, this.nums.column, this.total.column).split(' - ').map(item => Number(item));
},
getStatusBg(row,column,status) {
var dom = document.getElementById(this.direction+"-"+this.side+"-"+row+'-'+column);
var color = status == 0 ?'#d81e06': (status == 1) ? '#1afa29': '#bfbfbf';
dom.style.background = color
},
getStatus(){
var columnTab = []
for(let c = 1; c <= this.latticeColumn ;c++){
let tab = this.getRandom(c,this.latticeColumn,this.nums.column,this.total.column)
columnTab.push(tab)
}
var rowTab = []
for(let r = 1; r <= this.latticeRow ;r++){
let tab = this.getRandom(r,this.latticeRow,this.nums.row,this.total.row)
rowTab.push(tab)
}
this.$api.httpApi.checkSummaryGetStatusByRowColumn({
data: {
columnStart: this.random.column[0],
columnEnd: this.random.column[1],
rowStart: this.random.row[0],
rowEnd: this.random.row[1],
streetId: this.streetId,
direction: this.direction,
side: this.side,
rowTabs: rowTab,
columnTabs: columnTab
}
}).then(res => {
if(res.code == 200){
if(res.data.emptyStatus){
for(let a of res.data.emptyStatus){
this.getStatusBg(a.row,a.column,a.emptyStatus)
}
}
var i = 1;
for(let a in res.data.columnTabStatus){
this.$set(this.status.column, i, res.data.columnTabStatus[a]);
i++;
}
var j = 0;
for(let a in res.data.rowTabStatus){
j++;
}
for(let a in res.data.rowTabStatus){
this.$set(this.status.row, j, res.data.rowTabStatus[a]);
j--;
}
}
}).catch(err => {
});
},
}
}
</script>
<style scoped lang="scss">
.subsection /deep/{
width: 100%;
height: 360px;
overflow: hidden;
.ant-tabs-nav .ant-tabs-tab {
// padding: 0;
margin-right: 0;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
&:hover{
background: #40a9ff;
border-color: #40a9ff;
}
background: #40a9ff;
border-color: #40a9ff;
box-shadow: -1px 0 0 0 #40a9ff;
}
.ant-radio-button-wrapper-checked {
box-shadow: -1px 0 0 0 #40a9ff;
}
.radio-button-cell {
width: 100px;
text-align: center;
}
.ant-layout-sider {
height: 100%;
.ant-tabs {
height: 300px;
}
.ant-tabs-tab {
padding: 8px;
margin-bottom: 5px;
width: 104px;
}
}
.ant-layout-footer {
// width: 500px;
padding: 0 0 0 110px;
.ant-tabs {
// width: 735px;
}
.ant-tabs-bottom-bar {
margin-top: 0;
}
}
.ant-layout, .ant-layout-sider, .ant-layout-footer {
background-color: #ffffff;
}
roadway-buttom {
padding: 5px 0;
width: 100%;
}
.roadway-box {
//transform: rotateX(180deg);
padding: 10px 10px 0 0;
.line {
display: flex;
//transform: rotateX(180deg); //div
.el {
width: 46px;
height: 25px;
line-height: 25px;
margin: 2px;
font-size: 12px;
text-align: center;
border-radius: 4px;
cursor: pointer;
position: relative;
.default {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
}
}
}
</style>

@ -0,0 +1,262 @@
<template>
<div class="check-page">
<div class="title-info">
<span class="explain">颜色说明</span>
<span class="info-text">
<a-tag color="#d81e06" style="width:30px;height:20px;margin-right:6px"></a-tag>
未知
</span>
<span class="info-text">
<a-tag color="#1afa29" style="width:30px;height:20px;margin-right:6px"></a-tag>
非空
</span>
<span class="info-text">
<a-tag color="#bfbfbf" style="width:30px;height:20px;margin-right:6px"></a-tag>
</span>
</div>
<div style="margin-top: 10px">
<a-select @change="handleChange" style="width:200px" v-model="select">
<a-select-option v-for="i in data" :key="i.name" :value="i.id">
{{i.name}}
</a-select-option>
</a-select>
</div>
<!--左货架DOM-->
<div class="center-box">
<span class="shelf-number">
左侧货架
</span>
<a-radio-group v-model="leftSide" style="margin:10px 0"
v-if="streetDetail.leftType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button :value=2>
深侧货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.id">
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :side="leftSide" :direction=1 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
<!--单伸类型右货架DOM-->
<div class="center-box">
<span class="shelf-number">
右侧货架
</span>
<a-radio-group v-model="rightSide" style="margin:10px 0"
v-if="streetDetail.rightType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button :value=2>
深测货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.name">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :side="rightSide" :direction=2 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
</div>
</template>
<script>
import Subsection from "./Subsection";
export default {
name:'emptyCheckManage',
data() {
return {
leftSide: 1,
rightSide: 1,
data: [],
select: '',
streetId: 0,
streetDetail: {},
}
},
computed: {
},
mounted() {
this.request();
},
created(){
},
activated() {
if(!this.$route.meta.isUseCache){
console.log("$route.meta.isUseCache false")
//
this.request();//
}else{
console.log("$route.meta.isUseCache true")
//this.request();
}
},
methods: {
//
request() {
this.$api.httpApi.getAllStreet({
}).then(res => {
console.log("update data")
for(let i = 0;i<res.data.length;i++){
this.$set(this.data,i,res.data[i])
}
this.select = res.data[0].id
this.selectName = res.data[0].name
//this.$set(this.select,res.data.list[0].id,0)
this.getStreetDetail(this.select);
}).catch(err => {
});
},
//
getStreetDetail(id) {
this.$axios.get('/street/' + id, {
data: {}
}).then(res => {
this.streetDetail = res.data
//this.getStockRowColumn()
}).catch(err => {
})
},
handleChange(value) {
this.select = value
this.getStreetDetail(value)
},
exportStock() {
this.$api.httpApi.exportStock({
params: {
streetId: this.select,
}
}).then(res => {
let blob = new Blob([res], {type: "application/vnd.ms-excel"})
this.$utils.downloadFile(this.streetDetail.name+'-盘点列表.xls', blob)
}).catch(err => {
});
},
exportAllStock() {
this.$utils.downloadFileUrl('盘点列表.xls', '/api/stock/exportAll');
},
},
components: {Subsection}
};
</script>
<style lang="scss" scoped>
.check-page {
position: relative;
.title-info {
display: flex;
align-items: center;
justify-content: start;
.explain {
font-weight: 600;
}
.info-text {
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
}
}
.ant-tag {
margin-right: 0;
display: block;
line-height: 25px;
text-align: center;
cursor: pointer;
}
.roadway-top, roadway-buttom {
padding: 5px 0;
width: 100%;
}
.roadway-box {
transform: rotateX(180deg);
padding: 10px 10px 0 0;
.line {
display: flex;
transform: rotateX(180deg); //div
.el {
width: 46px;
height: 25px;
line-height: 25px;
margin: 2px;
font-size: 12px;
text-align: center;
border-radius: 4px;
cursor: pointer;
position: relative;
.default {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
}
}
.center-box {
width: 500px;
height: 52px;
line-height: 52px;
.shelf-number {
display: inline-block;
width: 200px;
}
}
}
.button-box{
position: absolute;
top:20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.export-all {
margin-right: 20px;
}
}
</style>
Loading…
Cancel
Save