diff --git a/src/api/http/http-api.js b/src/api/http/http-api.js index 0391306..23d1a0c 100644 --- a/src/api/http/http-api.js +++ b/src/api/http/http-api.js @@ -178,6 +178,11 @@ export default { name: '行列的库存状态', method: 'POST' }, + checkSummaryGetStatusByRowColumn: { + url: '/checkSummary/statusByRowColumn', + name: '行列的库存状态', + method: 'POST' + }, exportStock: { url: '/stock/export', name: '导出单个巷道', diff --git a/src/layouts/PageHeader.vue b/src/layouts/PageHeader.vue index 5868523..e2f0789 100644 --- a/src/layouts/PageHeader.vue +++ b/src/layouts/PageHeader.vue @@ -15,9 +15,10 @@ +
- - + + diff --git a/src/router/index.js b/src/router/index.js index ba5d56f..76b377a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -76,6 +76,15 @@ const routes = [{ }, component: () => import('@/views/checkSummary/index') }, + { + path: 'emptyCheckManage', + name: 'emptyCheckManage', + meta: { + icon: 'form', + name: '空货位管理', + }, + component: () => import('@/views/emptyCheckManage/index'), + }, { path: 'checkManage', name: 'checkManage', diff --git a/src/store/modules/styles.js b/src/store/modules/styles.js index 368f15d..fef5cf6 100644 --- a/src/store/modules/styles.js +++ b/src/store/modules/styles.js @@ -14,19 +14,19 @@ const store = { "text":"中国电科智能视觉", "style":{ - "color":"rgba(255, 255, 255, 1)", - "background-color":"rgba(163, 60, 12, 1)", + "color":"rgba(0,0,0, 1)", + "background-color":"rgba(204,55,43, 1)", "font-size":"24px" } }, "menu":{ "default":{ - "color":"rgba(230, 224, 224, 1)", - "background-color":"rgba(163, 60, 12, 1)" + "color":"rgba(255,255,255, 1)", + "background-color":"rgba(204,55,43, 1)" }, "select":{ - "color":"rgba(255, 255, 255, 1)", - "background-color":"rgba(184, 68, 13, 1)" + "color":"rgba(255,255,255, 1)", + "background-color":"rgba(182,44,46, 1)" } } } @@ -39,7 +39,7 @@ const store = { // } state.data = data; // 改变主题颜色 - changeTheme(data.theme['primary-color']); + //changeTheme(data.theme['primary-color']); // setItem(data); } }, diff --git a/src/views/checkSummary/model.vue b/src/views/checkSummary/model.vue index 6ddccbc..1c281e0 100644 --- a/src/views/checkSummary/model.vue +++ b/src/views/checkSummary/model.vue @@ -11,6 +11,7 @@ class="add-edit-model" > { + 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 => { + + }); + }, + + } +} + + + diff --git a/src/views/emptyCheckManage/index.vue b/src/views/emptyCheckManage/index.vue new file mode 100644 index 0000000..fbb225f --- /dev/null +++ b/src/views/emptyCheckManage/index.vue @@ -0,0 +1,262 @@ + + +