diff --git a/dist.zip b/dist.zip index 94d488f..e20fe2c 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/src/api/http/http-api.js b/src/api/http/http-api.js index 90fc9e3..19ceb1d 100644 --- a/src/api/http/http-api.js +++ b/src/api/http/http-api.js @@ -142,6 +142,11 @@ export default { name: '复核页面的核对信息', method: 'POST' }, + getStatusByRowColumn: { + url: '/stock/statusByRowColumn', + name: '行列的库存状态', + method: 'POST' + }, exportStock: { url: '/stock/export', name: '导出所有巷道', diff --git a/src/views/checkManage/Subsection.vue b/src/views/checkManage/Subsection.vue index 89b4633..84d45ce 100644 --- a/src/views/checkManage/Subsection.vue +++ b/src/views/checkManage/Subsection.vue @@ -3,14 +3,14 @@ - - + - + {{ getRandom(index, latticeColumn, nums.column, total.column) }} - + @@ -18,18 +18,35 @@ - + +
+
+
+
+ + + + {{row}}-{{column}} + +
+
+
+
- + {{ getRandom(index, latticeRow, nums.row, total.row) }} + @@ -57,9 +74,11 @@ export default { } }, // 总共数据 - total: { - row: 1, - column: 1 + total:{ + type: Object, + default:()=>{ + return {} + } }, nums: { // 行20个 列10个 @@ -76,7 +95,8 @@ export default { default: () => { return {} } - } + }, + }, computed: { // 应有的格子数 @@ -96,11 +116,12 @@ export default { }, watchShelveIdInfo() { return this.shelveId; - } + }, + }, watch: { watchShelveIdInfo() { - //this.getStatus(); + this.getStatus(); } }, data() { @@ -108,20 +129,34 @@ export default { status: { row: {}, column: {} - } + }, + + } }, mounted() { - + //this.changeTab('1-1') + this.getStatus(); }, created() { - //this.getStatus(); + this.getStatus(); + //this.changeTab('1-1') }, destroyed() { }, methods: { - changeTab(){ - console.log("latticeRow"+this.latticeRow) + changeTab(value){ + 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) { @@ -138,76 +173,74 @@ export default { getRandomColumn(val) { return this.getRandom(val, this.latticeColumn, this.nums.column, this.total.column).split(' - ').map(item => Number(item)); }, - // 获取某段的状态 - fragmentStatus(type, val) { - let status0 = false;// 未盘点 - let status1 = false;// 盘点错误 - let rowStart = 1, rowEnd = this.total.row; - 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; // 盘点成功 - // } + + getStatusBg(row,column,status) { + var dom = document.getElementById(this.shelveId+"-"+row+'-'+column); + var color = status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf'; + dom.style.background = color }, - async getStatus() { - console.log( "column"+this.latticeColumn) - console.log( "row"+this.latticeRow) - // for(let i = 1 ; i++; i < this.latticeRow) { - // let r = this.getRandomRow(i); - // console.log(r) - // //this.status.row[i] = this.fragmentStatus('row', i); - // } + getStatusTab(tab,status,rowColumn){ + var dom = document.getElementById(this.shelveId+'-'+rowColumn+'-'+tab); + console.log(dom) + console.log(this.shelveId+'-'+rowColumn+'-'+tab) + dom.style.type ="close-circle" - // for(let i = 1 ; i++; i < this.latticeColumn) { - // let rowColumn = this.getRandomColumn(i); - // this.status.column[i] = this.fragmentStatus('column', i); - // } + var color = status == 1 ?'#d81e06': status == 2 ? '#1afa29': '#bfbfbf'; + dom.style.color = color + console.log(dom) + }, - // for(let row = 1; row <= this.total.row; row++) { - - // for(let column = 1; column <= this.total.column; column++) { - - // let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0; - // if(status < 2) { - // // 当前是在第几段 - // let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0); - // let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0); - // if(status === 1) { - // console.log('第几段', latticeRow, latticeColumn); - // console.log(row, column,status); - // this.$set(this.status.row, latticeRow, status); - // this.$set(this.status.column, latticeColumn, status); - // }else { - // if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status); - // if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status); - // } - // } - // } - // } - // console.log(this.status); + getStatus(){ + if(this.shelveId == {}){ + return; + } + 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.getStatusByRowColumn({ + data: { + columnStart: this.random.column[0], + columnEnd: this.random.column[1], + rowStart: this.random.row[0], + rowEnd: this.random.row[1], + shelveId: this.shelveId, + 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){ + + } } } @@ -262,5 +295,37 @@ export default { .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; + } + } + } + } } diff --git a/src/views/checkManage/index.vue b/src/views/checkManage/index.vue index 5287899..4c13bf4 100644 --- a/src/views/checkManage/index.vue +++ b/src/views/checkManage/index.vue @@ -49,12 +49,12 @@
- + -->
@@ -92,13 +92,13 @@
- + -->
diff --git a/src/views/realTimeMonitoring/index.vue b/src/views/realTimeMonitoring/index.vue index dfee5d4..be55ddd 100644 --- a/src/views/realTimeMonitoring/index.vue +++ b/src/views/realTimeMonitoring/index.vue @@ -68,11 +68,6 @@ export default { } this.tabKey = sessionStorage.getItem('tabKey'); this.getClientHeight(); - - // 监听界面尺寸变化 - // window.onresize = () => { - // this.getClientHeight(); - // } }, destroyed() { // window.onresize = null; diff --git a/src/views/roadwayManage/model.vue b/src/views/roadwayManage/model.vue index 68aa70f..60e2dd4 100644 --- a/src/views/roadwayManage/model.vue +++ b/src/views/roadwayManage/model.vue @@ -243,14 +243,14 @@ export default { plcIp: newVal.plcIp, plcPort: newVal.plcPort, leftType: newVal.leftType === null ? '' : newVal.leftType === 0 ? '单伸' : '双伸', - leftRow: 7 || newVal.leftRow, - leftColumn: 18 || newVal.leftColumn, + leftRow: newVal.leftRow, + leftColumn: newVal.leftColumn, leftShelveId: newVal.leftShelveId, leftInsideShelveId: newVal.leftInsideShelveId, leftOutsideShelveId: newVal.leftOutsideShelveId, rightType: newVal.rightType === null ? '' : newVal.rightType === 0 ? '单伸' : '双伸', - rightRow: 7 || newVal.rightRow, - rightColumn: 18 || newVal.rightColumn, + rightRow: newVal.rightRow, + rightColumn: newVal.rightColumn, rightShelveId: newVal.rightShelveId, rightInsideShelveId:newVal.rightInsideShelveId, rightOutsideShelveId:newVal.rightOutsideShelveId,