From 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f Mon Sep 17 00:00:00 2001 From: charles <981744753@qq.com> Date: 星期二, 06 八月 2024 11:16:58 +0800 Subject: [PATCH] gitlab上面的wms转移到公司git --- src/components/makepager/TableCommonView.vue | 45 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index 9169ad1..d4bc001 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -102,6 +102,10 @@ export default { name: "TableCommonView", props: { + warehouseId:{ + type:Number, + default:0 + }, tableList: { type: Object, default: () => { @@ -219,12 +223,20 @@ }, // 鍗曢�夎鐩稿叧 tableRowClassName({ row }) { - if (Object.keys(this.selectClassRow).length > 0) { - if (row.id == this.selectClassRow.id) { - return "onSelect" + if(this.$route.query.workType!=1){ + if(Object.keys(this.selectClassRow).length>0&&this.selectClassRow.location){ + if(this.selectClassRow.id==row.id&&this.selectClassRow.location.warehouseId==row.location.warehouseId&&row.location.name==this.selectClassRow.location.name){ + return "onSelect"; + } + } + } else{ + if (Object.keys(this.selectClassRow).length > 0) { + if (row.id == this.selectClassRow.id) { + return "onSelect" + } + } } - } - this.$emit("tableRowClassName", row) + this.$emit("tableRowClassName", row); }, timeAgo(val) { return timeago(val) @@ -241,7 +253,7 @@ } this.tableList.countcol.forEach((countcols) => { if (column.label === countcols) { - const values = data.map((item) => Number(item[column.property])) + const values = (data||[]).map((item) => Number(item[column.property])) if (!values.every((value) => isNaN(value))) { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) @@ -269,11 +281,21 @@ if(this.name=='product'){ prop='productId' } - let list = this.selectBoxList.map((item) => item[prop]) - if (list.findIndex((v) => v == row.id) == -1) { - return true - } else { - return false + if(this.$route.query.workType!=1){ + const flag= this.selectBoxList.some(item=>{ + if(item.location){ + return item[prop]==row.id&&item.location.warehouseId==row.location.warehouseId&&item.location.name==row.location.name; + } + return false; + }) + return !flag; + }else{ + let list = (this.selectBoxList||[]).map((item) => item[prop]) + if (list.findIndex((v) => v == row.id) == -1) { + return true + } else { + return false + } } } } @@ -413,6 +435,7 @@ .el-table__cell.is-right { text-align: right !important; } + .el-table::before{ width: 0px; } } .overSpread1 { width: 100%; -- Gitblit v1.8.0