merge-requests/1/head
qiushui 4 years ago
parent a5c9dd6a36
commit 9935dce208

Binary file not shown.

@ -142,6 +142,11 @@ export default {
name: '复核页面的核对信息', name: '复核页面的核对信息',
method: 'POST' method: 'POST'
}, },
getStatusByRowColumn: {
url: '/stock/statusByRowColumn',
name: '行列的库存状态',
method: 'POST'
},
exportStock: { exportStock: {
url: '/stock/export', url: '/stock/export',
name: '导出所有巷道', name: '导出所有巷道',

@ -3,14 +3,14 @@
<a-layout style="width: 900px"> <a-layout style="width: 900px">
<a-layout style="width: 100%;height: 310px"> <a-layout style="width: 100%;height: 310px">
<a-layout-sider width="110px"> <a-layout-sider width="110px">
<a-tabs default-active-key="1" tab-position="left" @change="value => select.column = value" v-if="total.column > nums.column"> <a-tabs default-active-key="1" tab-position="left" @change="changeTabLeft" v-if="total.column > nums.column">
<a-tab-pane <a-tab-pane
v-for="index in latticeColumn" v-for="index in latticeColumn"
:key="index" :key="index"
> >
<span slot="tab"> <span slot="tab" >
{{ getRandom(index, latticeColumn, nums.column, total.column) }} {{ getRandom(index, latticeColumn, nums.column, total.column) }}
<a-icon type="close-circle" v-if="status.column[index] === 1" style="color: #d81e06" /> <a-icon type="close-circle" v-if="status.column[index] === 1" style="color: #d81e06"/>
<a-icon type="check-circle" v-else-if="status.column[index] === 2" style="color: #1afa29" /> <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" /> <a-icon type="exclamation-circle" v-else style="color: #909399" />
</span> </span>
@ -18,18 +18,35 @@
</a-tabs> </a-tabs>
</a-layout-sider> </a-layout-sider>
<a-layout-content> <a-layout-content>
<slot :data="{select, nums, random}"></slot> <!-- <slot :data="{select, nums, random}"></slot> -->
<div class="roadway-buttom">
<div class="roadway-box">
<div class="line" v-for="(column,index) in total.column" :key="index" v-if="column >= random.column[0] && column <= random.column[1]">
<div v-for="(row,index) in total.row" :key="index" class="el" v-if="row >= random.row[0] && row <= random.row[1]">
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应-->
<span
class="default"
:id="`${shelveId}-${row}-${column}`"
@click="tocheck(row,column,shelveId)">
{{row}}-{{column}}
</span>
</div>
</div>
</div>
</div>
</a-layout-content> </a-layout-content>
</a-layout> </a-layout>
<a-layout-footer> <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="value => select.row = value" v-if="total.row > nums.row"> -->
<a-tabs default-active-key="1" tab-position="bottom" @onChange="changeTab" @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.row > nums.row">
<a-tab-pane <a-tab-pane
v-for="index in latticeRow" v-for="index in latticeRow"
:key="index" :key="index"
> >
<span slot="tab"> <span slot="tab">
{{ getRandom(index, latticeRow, nums.row, total.row) }} {{ getRandom(index, latticeRow, nums.row, total.row) }}
<!-- <a-icon :id="`${shelveId}-row-${getRandom(index,latticeRow,nums.row,total.row)}`"/> -->
<a-icon type="close-circle" v-if="status.row[index] === 1" style="color: #d81e06" /> <a-icon type="close-circle" v-if="status.row[index] === 1" style="color: #d81e06" />
<a-icon type="check-circle" v-else-if="status.row[index] === 2" style="color: #1afa29" /> <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" /> <a-icon type="exclamation-circle" v-else style="color: #909399" />
@ -57,9 +74,11 @@ export default {
} }
}, },
// //
total: { total:{
row: 1, type: Object,
column: 1 default:()=>{
return {}
}
}, },
nums: { nums: {
// 20 10 // 20 10
@ -76,7 +95,8 @@ export default {
default: () => { default: () => {
return {} return {}
} }
} },
}, },
computed: { computed: {
// //
@ -96,11 +116,12 @@ export default {
}, },
watchShelveIdInfo() { watchShelveIdInfo() {
return this.shelveId; return this.shelveId;
} },
}, },
watch: { watch: {
watchShelveIdInfo() { watchShelveIdInfo() {
//this.getStatus(); this.getStatus();
} }
}, },
data() { data() {
@ -108,20 +129,34 @@ export default {
status: { status: {
row: {}, row: {},
column: {} column: {}
} },
} }
}, },
mounted() { mounted() {
//this.changeTab('1-1')
this.getStatus();
}, },
created() { created() {
//this.getStatus(); this.getStatus();
//this.changeTab('1-1')
}, },
destroyed() { destroyed() {
}, },
methods: { methods: {
changeTab(){ changeTab(value){
console.log("latticeRow"+this.latticeRow) console.log(value)
this.select.row = value
console.log("latticeRow"+this.latticeRow+"select"+this.select.row+","+this.select.column+"random"+this.random.row+","+this.random.column)
this.getStatus()
},
changeTabLeft(value){
console.log(value)
this.select.column = value
this.getStatus()
console.log("latticeRow"+this.latticeRow+"select"+this.select.row+","+this.select.column+"random"+this.random.row+","+this.random.column)
}, },
// //
getRandom(index, lattice, num, total) { getRandom(index, lattice, num, total) {
@ -138,76 +173,74 @@ export default {
getRandomColumn(val) { getRandomColumn(val) {
return this.getRandom(val, this.latticeColumn, this.nums.column, this.total.column).split(' - ').map(item => Number(item)); return this.getRandom(val, this.latticeColumn, this.nums.column, this.total.column).split(' - ').map(item => Number(item));
}, },
//
fragmentStatus(type, val) { getStatusBg(row,column,status) {
let status0 = false;// var dom = document.getElementById(this.shelveId+"-"+row+'-'+column);
let status1 = false;// var color = status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf';
let rowStart = 1, rowEnd = this.total.row; dom.style.background = color
let columnStart = 1, columnEnd = this.total.column;
if(type === 'row') {
[rowStart, rowEnd] = this.getRandomRow(val);
}else {
[columnStart, columnEnd] = this.getRandomColumn(val);
}
console.log(rowStart, rowEnd, columnStart, columnEnd);
//
// for(let row = rowStart; row++; row <= rowEnd) {
// for(let column = columnStart; column++; column <= columnEnd) {
// let rowColStatus = (this.stockInfo[`${row}-${column}`] || {}).status;
// if(!rowColStatus) {
// //
// status0 = true;
// }else if(rowColStatus === 1) {
// //
// status1 = true;
// }
// }
// }
// if(status1) {
// return 1; //
// }else if(status0) {
// return 0; //
// }else {
// return 2; //
// }
}, },
async getStatus() { getStatusTab(tab,status,rowColumn){
console.log( "column"+this.latticeColumn) var dom = document.getElementById(this.shelveId+'-'+rowColumn+'-'+tab);
console.log( "row"+this.latticeRow) console.log(dom)
// for(let i = 1 ; i++; i < this.latticeRow) { console.log(this.shelveId+'-'+rowColumn+'-'+tab)
// let r = this.getRandomRow(i); dom.style.type ="close-circle"
// console.log(r)
// //this.status.row[i] = this.fragmentStatus('row', i);
// }
// for(let i = 1 ; i++; i < this.latticeColumn) { var color = status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf';
// let rowColumn = this.getRandomColumn(i); dom.style.color = color
// this.status.column[i] = this.fragmentStatus('column', i); console.log(dom)
// } },
// for(let row = 1; row <= this.total.row; row++) { getStatus(){
if(this.shelveId == {}){
// for(let column = 1; column <= this.total.column; column++) { return;
}
// let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0; var columnTab = []
// if(status < 2) { for(let c = 1; c <= this.latticeColumn ;c++){
// // let tab = this.getRandom(c,this.latticeColumn,this.nums.column,this.total.column)
// let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0); columnTab.push(tab)
// let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0); }
// if(status === 1) { var rowTab = []
// console.log('', latticeRow, latticeColumn); for(let r = 1; r <= this.latticeRow ;r++){
// console.log(row, column,status); let tab = this.getRandom(r,this.latticeRow,this.nums.row,this.total.row)
// this.$set(this.status.row, latticeRow, status); rowTab.push(tab)
// this.$set(this.status.column, latticeColumn, status); }
// }else { this.$api.httpApi.getStatusByRowColumn({
// if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status); data: {
// if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status); columnStart: this.random.column[0],
// } columnEnd: this.random.column[1],
// } rowStart: this.random.row[0],
// } rowEnd: this.random.row[1],
// } shelveId: this.shelveId,
// console.log(this.status); rowTabs: rowTab,
columnTabs: columnTab
}
}).then(res => {
if(res.code == 200){
if(res.data.stocks){
for(let a of res.data.stocks){
this.getStatusBg(a.row,a.column,a.status)
}
}
this.columnTabStatus = res.data.columnTabStatus
var i = 1;
for(let a in res.data.columnTabStatus){
this.status.column[i] = res.data.columnTabStatus[a]
i++;
}
var j = 1;
for(let a in res.data.rowTabStatus){
this.status.row[j] = res.data.rowTabStatus[a]
j++;
}
}
}).catch(err => {
});
}, },
toCheck(row,column){
}
} }
} }
</script> </script>
@ -262,5 +295,37 @@ export default {
.ant-layout, .ant-layout-sider, .ant-layout-footer { .ant-layout, .ant-layout-sider, .ant-layout-footer {
background-color: #ffffff; 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> </style>

@ -49,12 +49,12 @@
<div class="check-content" v-for="item in data" :key="item.id"> <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}" :shelveId="leftShelveId.shelveId"> <subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :shelveId="leftShelveId.shelveId">
<template v-slot="scope"> <!-- <template v-slot="scope">
<div class="roadway-top"> <div class="roadway-top">
<div class="roadway-box"> <div class="roadway-box">
<div class="line" v-for="(column,index) in item.leftColumn" :key="index" v-if="column >= scope.data.random.column[0] && column <= scope.data.random.column[1]"> <div class="line" v-for="(column,index) in item.leftColumn" :key="index" v-if="column >= scope.data.random.column[0] && column <= scope.data.random.column[1]">
<div v-for="(row,i) in item.leftRow" :key="i" class="el" v-if="row >= scope.data.random.row[0] && row <= scope.data.random.row[1]"> <div v-for="(row,i) in item.leftRow" :key="i" class="el" v-if="row >= scope.data.random.row[0] && row <= scope.data.random.row[1]">
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应--> 渲染默认巷道框架规格 定位浮在 已有巷道上做对应
<span <span
class="default" class="default"
:style="{background:getStatusBg(stockInfo.left, `${row}-${column}`)}" :style="{background:getStatusBg(stockInfo.left, `${row}-${column}`)}"
@ -66,7 +66,7 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template> -->
</subsection> </subsection>
</div> </div>
@ -92,13 +92,13 @@
<div class="check-content" v-for="item in data" :key="item.name"> <div class="check-content" v-for="item in data" :key="item.name">
<subsection v-if="item.id == select" :total="{row:item.leftRow, column: item.leftColumn}" :shelveId="rightShelveId.shelveId"> <subsection v-if="item.id == select" :total="{row:item.leftRow, column: item.leftColumn}" :shelveId="rightShelveId.shelveId">
<template v-slot="scope"> <!-- <template v-slot="scope">
<div class="roadway-buttom"> <div class="roadway-buttom">
<div class="roadway-box"> <div class="roadway-box">
<div class="line" v-for="(column,index) in item.rightColumn" :key="index" v-if="column >= scope.data.random.column[0] && column <= scope.data.random.column[1]"> <div class="line" v-for="(column,index) in item.rightColumn" :key="index" v-if="column >= scope.data.random.column[0] && column <= scope.data.random.column[1]">
<div v-for="(row,index) in item.rightRow" :key="index" class="el" v-if="row >= scope.data.random.row[0] && row <= scope.data.random.row[1]"> <div v-for="(row,index) in item.rightRow" :key="index" class="el" v-if="row >= scope.data.random.row[0] && row <= scope.data.random.row[1]">
<!--渲染默认巷道框架规格 定位浮在 已有巷道上做对应--> 渲染默认巷道框架规格 定位浮在 已有巷道上做对应
<span <span
class="default" class="default"
:style="{background:getStatusBg(stockInfo.right, `${row}-${column}`)}" :style="{background:getStatusBg(stockInfo.right, `${row}-${column}`)}"
@ -109,7 +109,7 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template> -->
</subsection> </subsection>
</div> </div>
</div> </div>

@ -68,11 +68,6 @@ export default {
} }
this.tabKey = sessionStorage.getItem('tabKey'); this.tabKey = sessionStorage.getItem('tabKey');
this.getClientHeight(); this.getClientHeight();
//
// window.onresize = () => {
// this.getClientHeight();
// }
}, },
destroyed() { destroyed() {
// window.onresize = null; // window.onresize = null;

@ -243,14 +243,14 @@ export default {
plcIp: newVal.plcIp, plcIp: newVal.plcIp,
plcPort: newVal.plcPort, plcPort: newVal.plcPort,
leftType: newVal.leftType === null ? '' : newVal.leftType === 0 ? '单伸' : '双伸', leftType: newVal.leftType === null ? '' : newVal.leftType === 0 ? '单伸' : '双伸',
leftRow: 7 || newVal.leftRow, leftRow: newVal.leftRow,
leftColumn: 18 || newVal.leftColumn, leftColumn: newVal.leftColumn,
leftShelveId: newVal.leftShelveId, leftShelveId: newVal.leftShelveId,
leftInsideShelveId: newVal.leftInsideShelveId, leftInsideShelveId: newVal.leftInsideShelveId,
leftOutsideShelveId: newVal.leftOutsideShelveId, leftOutsideShelveId: newVal.leftOutsideShelveId,
rightType: newVal.rightType === null ? '' : newVal.rightType === 0 ? '单伸' : '双伸', rightType: newVal.rightType === null ? '' : newVal.rightType === 0 ? '单伸' : '双伸',
rightRow: 7 || newVal.rightRow, rightRow: newVal.rightRow,
rightColumn: 18 || newVal.rightColumn, rightColumn: newVal.rightColumn,
rightShelveId: newVal.rightShelveId, rightShelveId: newVal.rightShelveId,
rightInsideShelveId:newVal.rightInsideShelveId, rightInsideShelveId:newVal.rightInsideShelveId,
rightOutsideShelveId:newVal.rightOutsideShelveId, rightOutsideShelveId:newVal.rightOutsideShelveId,

Loading…
Cancel
Save