diff --git a/dist.zip b/dist.zip index e1473f9..14e3823 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/public/antd_color.less b/public/antd_color.less index b746b9c..ca715dd 100644 --- a/public/antd_color.less +++ b/public/antd_color.less @@ -42,7 +42,7 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-alert-info .ant-alert-icon {color: #1890ff;} .ant-alert-warning {background-color: #fffbe6;border: 1px solid #ffe58f;} .ant-alert-warning .ant-alert-icon {color: #faad14;} -.ant-alert-error {background-color: #fff1f0;border: 1px solid #ffa39e;} +.ant-alert-error {background-color: color(~`colorPalette("@{text-color}", 1)`);border: 1px solid #ffa39e;} .ant-alert-error .ant-alert-icon {color: #f5222d;} .ant-alert-close-icon {background-color: transparent;border: none;} .ant-alert-close-icon .anticon-close {color: @text-color-secondary;} @@ -1377,7 +1377,7 @@ tr.ant-table-expanded-row:hover {background: #fbfbfb;} .ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} .ant-tag-magenta {color: #eb2f96;background: #fff0f6;border-color: #ffadd2;} .ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} -.ant-tag-red {color: #f5222d;background: #fff1f0;border-color: #ffa39e;} +.ant-tag-red {color: #f5222d;background: color(~`colorPalette("@{text-color}", 1)`);border-color: #ffa39e;} .ant-tag-red-inverse {color: #fff;background: #f5222d;border-color: #f5222d;} .ant-tag-volcano {color: #fa541c;background: #fff2e8;border-color: #ffbb96;} .ant-tag-volcano-inverse {color: #fff;background: #fa541c;border-color: #fa541c;} diff --git a/public/index.html b/public/index.html index fe2c68b..4218170 100644 --- a/public/index.html +++ b/public/index.html @@ -10,12 +10,12 @@ - 昆船垛机视觉系统 + RFID盘点系统 diff --git a/src/store/modules/styles.js b/src/store/modules/styles.js index 9ae2a4c..5b672f4 100644 --- a/src/store/modules/styles.js +++ b/src/store/modules/styles.js @@ -11,11 +11,11 @@ const store = { "primary-color":"rgba(184, 68, 13, 1)" }, "title":{ - "text":"昆船垛机智能视觉系统", + "text":"RFID盘点系统", "style":{ "color":"rgba(255, 255, 255, 1)", "background-color":"rgba(163, 60, 12, 1)", - "font-size":"24px" + "font-size":"20px" } }, "menu":{ diff --git a/src/views/checkManage/Subsection.vue b/src/views/checkManage/Subsection.vue index e11ec18..46b367c 100644 --- a/src/views/checkManage/Subsection.vue +++ b/src/views/checkManage/Subsection.vue @@ -20,24 +20,33 @@
- -
+ +

{{ random.row[0] + random.row[1] - rowIndex - 1 +"层"}}

- -
+ +
- + :id="`${direction}-${side}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`" + > - {{column}} - + {{column}} +
@@ -47,23 +56,62 @@ - + - - {{ getRandom(index, latticeColumn, nums.column, total.column) }} - - - - - + + {{ getRandom(index, latticeColumn, nums.column, total.column) }} + + + + + + + +

上位标签:{{ wmsTrayCode }}

+

扫码标签:{{ trayCode }}

+
@@ -78,76 +126,78 @@ export default { default: () => { return { row: 1, - column: 1 - } - } + column: 1, + }; + }, }, // 总共数据 - total:{ + total: { type: Object, - default:()=>{ - return {} - } + default: () => { + return {}; + }, }, nums: { type: Object, default: () => { return { row: 20, - column: 71 - } - } + column: 71, + }; + }, }, direction: { type: Number, default: () => { - return {} - } + return {}; + }, }, side: { type: Number, default: () => { - return {} - } + return {}; + }, }, - + streetId: { type: Number, default: () => { - return {} - } + return {}; + }, }, streetName: { type: String, default: () => { - return {} - } + return {}; + }, }, - - }, computed: { // 应有的格子数 latticeRow() { - return parseInt(this.total.row / this.nums.row) + (this.total.row % this.nums.row > 0 ? 1 : 0); + 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); + 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(){ + watchDirection() { return this.direction; - }, - watchSide(){ + }, + watchSide() { return this.side; - }, + }, }, watch: { watchDirection() { @@ -157,185 +207,304 @@ export default { this.getStatus(); }, immediate: true, - }, data() { return { status: { row: {}, - column: {} + column: {}, }, timer: null, - } + trayCode: "", + wmsTrayCode: "", + visible: false, + confirmLoading: false, + id: "", + }; }, mounted() { this.$nextTick(() => { this.getStatus(); - }) - this.$on('hook:activated', () => { + }); + 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 - }) + this.$on("hook:deactivated", () => { + clearInterval(this.timer); + this.timer = null; + }); }, - + beforeDestroy() { - console.log("beforeDestroy") - window.clearInterval(this.timer); + console.log("beforeDestroy"); + window.clearInterval(this.timer); this.timer = null; }, created() { - var nameEQC = "s"+this.streetId+"d"+this.direction+"e"+this.side + "c" + "="; - var nameEQR = "s"+this.streetId+"d"+this.direction+"e"+this.side + "r" + "="; - var ca = document.cookie.split(';'); - - for(var i=0;i < ca.length;i++) { + var nameEQC = + "s" + + this.streetId + + "d" + + this.direction + + "e" + + this.side + + "c" + + "="; + var nameEQR = + "s" + + this.streetId + + "d" + + this.direction + + "e" + + this.side + + "r" + + "="; + var ca = document.cookie.split(";"); + + for (var i = 0; i < ca.length; i++) { var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); + while (c.charAt(0) == " ") c = c.substring(1, c.length); if (c.indexOf(nameEQC) == 0) { - this.select.column = Number(c.substring(nameEQC.length,c.length)); + this.select.column = Number( + c.substring(nameEQC.length, c.length) + ); } if (c.indexOf(nameEQR) == 0) { - this.select.row = Number(c.substring(nameEQR.length,c.length)); + this.select.row = Number(c.substring(nameEQR.length, c.length)); } - } }, destroyed() { - window.clearInterval(this.timer); + window.clearInterval(this.timer); this.timer = null; }, - - methods: { - getTrayCode(row,column,direction){ - console.log(row,column,direction); + methods: { + showModal(trayCode, wmsTrayCode, id) { + this.trayCode = trayCode; + this.wmsTrayCode = wmsTrayCode; + this.id = id; + this.visible = true; + }, + // 人工核对 + handleOk(e) { + if (this.id != "") { + this.$api.httpApi + .stockCheckCorrect({ + data: { + id: this.id, + ok: 1, + }, + }) + .then((res) => { + if (res.code == 200) { + this.$message.success("操作成功"); + this.getStockInfo(this.row, this.column); + } + }); + } + this.visible = false; + }, + handleCancel(e) { + console.log("Clicked cancel button"); + this.visible = false; }, - changeTab(value){ - document.cookie = "s"+this.streetId+"d"+this.direction+"e"+this.side + "c"+ "=" +value; + getTrayCode(row, column, direction) { + console.log(row, column, direction); + }, + changeTab(value) { + document.cookie = + "s" + + this.streetId + + "d" + + this.direction + + "e" + + this.side + + "c" + + "=" + + value; - this.select.column = value - this.getStatus() + this.select.column = value; + this.getStatus(); }, - changeTabLeft(value){ - - document.cookie = "s"+this.streetId+"d"+this.direction+"e"+this.side + "r" + "=" +value; - - this.select.row = value - this.getStatus() + changeTabLeft(value) { + document.cookie = + "s" + + this.streetId + + "d" + + this.direction + + "e" + + this.side + + "r" + + "=" + + value; + this.select.row = value; + this.getStatus(); }, // 获取行或列的范围字符串 getRandom(index, lattice, num, total) { - if(index !== lattice) { + if (index !== lattice) { return `${(index - 1) * num + 1} - ${index * num}`; - }else { + } else { return `${(index - 1) * num + 1} - ${total}`; } }, // 获取行和列的范围数组 getRandomRow(val) { - console.log(" "+this.latticeRow); - 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)); + console.log(" " + this.latticeRow); + 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)); + return this.getRandom( + val, + this.latticeColumn, + this.nums.column, + this.total.column + ) + .split(" - ") + .map((item) => Number(item)); }, - - getStatusBg(row,column,status,trayCode) { - var dom = document.getElementById(this.direction+"-"+this.side+"-"+row+'-'+column); + + getStatusBg(row, column, status, trayCode, wmsTrayCode, id) { + var dom = document.getElementById( + this.direction + "-" + this.side + "-" + row + "-" + column + ); var color; - if(status == -1){ - color = '#f2ed48' - }else if(status == 2){ - color = '#1afa29' - }else if( status == 3){ - color = '#4c71d8' - }else if(status == 1){ - color = '#d81e06' - }else if(status == 4){ - color = '#bc55cf' - }else{ - color = '#bfbfbf' + if (status == -1) { + color = "#f2ed48"; + } else if (status == 2) { + color = "#1afa29"; + } else if (status == 3) { + color = "#4c71d8"; + } else if (status == 1) { + color = "#d81e06"; + } else if (status == 4) { + color = "#bc55cf"; + } else { + color = "#bfbfbf"; } - dom.style.background = color - console.log(trayCode); + dom.style.background = color; + // console.log(trayCode); if (trayCode != null && trayCode !== "") { - dom.title ="rfid扫描结果:"+ trayCode + dom.title = "rfid扫描结果:" + trayCode; + dom.addEventListener("click", () => { + this.showModal(trayCode, wmsTrayCode, id); // 调用 showModal 方法,传递行列参数 + }); } - }, - 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) + 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) + 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], - streetId: this.streetId, - direction: this.direction, - side: this.side, - 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,a.trayCode) + 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], + streetId: this.streetId, + direction: this.direction, + side: this.side, + 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, + a.trayCode, + a.wmsTrayCode, + a.id + ); + } } - } - - 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 => { - }); + 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) => {}); }, - tocheckPage(row,column){ + tocheckPage(row, column) { this.$router.push({ - name: 'checkOperation', - query: {row: row, column: column, direction: this.direction,side:this.side, streetId: this.streetId, name:this.streetName} - }) - } - } -} + name: "checkOperation", + query: { + row: row, + column: column, + direction: this.direction, + side: this.side, + streetId: this.streetId, + name: this.streetName, + }, + }); + }, + }, +};