From d68b036a3b3c67273b8effa3c9925ef3869a91ba Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期三, 07 二月 2024 13:56:50 +0800 Subject: [PATCH] wms项目 wms系统参数设置的页面开发+路由+是否显示表头配置 --- src/views/warehouseManage/listingRules/index.vue | 90 ++++++++++++++++++++++----------------------- 1 files changed, 44 insertions(+), 46 deletions(-) diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue index 6d60a38..32b3b4c 100644 --- a/src/views/warehouseManage/listingRules/index.vue +++ b/src/views/warehouseManage/listingRules/index.vue @@ -27,7 +27,7 @@ @querySearchData="querySearchData" @selProductClick="selProductClick" > - <!-- + <!-- @selProductTypeClick="selProductTypeClick" --> <template slot="tableButton"> @@ -82,15 +82,14 @@ queryProductId: null, categoryId: null, searchTaskMap: [], - isCreate:false, - thatRow:{}, + isCreate: false, + thatRow: {} } }, created() { this.setTable() let query = this.$route.query if (query) { - console.log("aaaaaaaaaaaaa", query) this.queryProductId = query.productId?.length ? query.productId : null this.categoryId = query.id ? Number(query.id) : null this.pagerOptions.currPage = 1 @@ -111,13 +110,13 @@ selectBox: false, selectIndex: true, tableColumn: [ - { label: "褰撲骇鍝佸埌杈�", prop: "areaName", location: true }, + { label: "褰撲骇鍝佸埌杈�", prop: "areaName", toLocation: true }, { label: "浜у搧", prop: "productName", product: true }, { label: "浜у搧绫诲埆", prop: "productCategory", productType: true }, { label: "瀛樺偍鍒板瓙浣嶇疆", prop: "subLocation", sonLocation: true } // { label: "鍏徃", prop: "companyName", company: true } ], - rowClickIndex:-1 + rowClickIndex: -1 } }, // 璇锋眰鏁版嵁 @@ -132,7 +131,7 @@ const list = res.data.map((item) => { return { ...item, - areaName: { label: item.location.jointName, value: item.location.id }, + areaName: { label: item.area.jointName, value: item.area.id }, subLocation: { label: item.location.jointName, value: item.location.id }, productName: item.product.name, productCategory: item.productCategory.name, @@ -157,7 +156,7 @@ }, // 鏂板 addProductClick() { - this.isCreate=true + this.isCreate = true this.tableList.tableColumn[1].product = true this.tableList.tableColumn[2].productType = true console.log(this.tableData) @@ -177,7 +176,7 @@ subLocation: "", productName: "", companyName: "", - productCategory:"", + productCategory: "", isSet: true, isEdit: false, isOrder: true @@ -213,14 +212,14 @@ areaId: this.areaId, locationId: this.subLocationId, productCategoryId: this.productCategoryId, - productId: this.productId + productId: this.productId }).then((res) => { console.log(res) if (res.code === 200) { this.getData() let tipStr = this.currentRowId === 0 ? "娣诲姞鎴愬姛" : "淇敼鎴愬姛" this.$message.success(tipStr) - this.isCreate=false + this.isCreate = false } }) } @@ -240,7 +239,7 @@ // 鍙栨秷 discardBtnClick() { this.getData() - this.isCreate=false + this.isCreate = false this.tableList.tableColumn[1].product = true this.tableList.tableColumn[2].productType = true this.addTitle = "鏂板缓" @@ -279,20 +278,20 @@ }, // 琛岀偣鍑� tableRowClick(row, rowIndex) { - this.thatRow=row - this.tableList.rowClickIndex=rowIndex + this.thatRow = row + this.tableList.rowClickIndex = rowIndex this.rowIndex = rowIndex this.isSel() if (!this.isNoProduct && this.currentRowId === 0) { this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓") - }else { - this.currentRowId = row.id||0 + } else { + this.currentRowId = row.id || 0 this.addTitle = "淇濆瓨" this.showDiscard = true this.isRowClick = true - if (!this.isNoProduct) { - this.tableData.splice(this.tableData.length - 1, 1) - this.tableData.map((item, index) => { + if (this.isNoProduct) { + // this.tableData.splice(this.tableData.length - 1, 1) + this.tableData.map((item, index) => { if (index === rowIndex) { item.isEdit = false item.isOrder = true @@ -307,25 +306,25 @@ } } }, - querySearchData(queryString,results,value){ - if(this.isCreate){ - if(queryString===''){ + querySearchData(queryString, results, value) { + if (this.isCreate) { + if (queryString === "") { this.tableList.tableColumn[1].product = true this.tableList.tableColumn[2].productType = true - }else{ - if(value==="product"){ + } else { + if (value === "product") { this.tableList.tableColumn[2].productType = false - if(results.length!==0){ - this.productId=results[0].id - }else{ - this.productId=0 + if (results.length !== 0) { + this.productId = results[0].id + } else { + this.productId = 0 } - }else if(value==="productType"){ + } else if (value === "productType") { this.tableList.tableColumn[1].product = false - if(results.length!==0){ - this.productCategoryId=results[0].id - }else{ - this.productCategoryId=0 + if (results.length !== 0) { + this.productCategoryId = results[0].id + } else { + this.productCategoryId = 0 } } } @@ -367,14 +366,15 @@ this.subLocationId = item.value }, // 閫変腑浜у搧鏂规硶 - selProductClick(value,item){ - if(value==="product"){ + selProductClick(value, item) { + console.log(value, item) + if (value === "product") { this.RuleType = 1 this.tableList.tableColumn[2].productType = false - this.productId=item.id - this.productCategoryId=item.categoryId - }else if(value==="productType"){ - this.productCategoryId=item.id + this.productId = item.productId + this.productCategoryId = item.categoryId + } else if (value === "productType") { + this.productCategoryId = item.id this.RuleType = 2 this.tableList.tableColumn[1].product = false } @@ -398,19 +398,17 @@ }, watch: { rowIndex(newVal) { - if(this.isCreate){ - if(newVal===0){ + if (this.isCreate) { + if (newVal === 0) { this.tableList.tableColumn[1].product = true this.tableList.tableColumn[2].productType = true - }else{ + } else { this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓") this.tableList.tableColumn[1].product = false this.tableList.tableColumn[2].productType = false } - }else{ - if ( - this.tableList.tableData[newVal].productName === "" - ) { + } else { + if (this.tableList.tableData[newVal].productName === "") { this.tableList.tableColumn[1].product = false this.tableList.tableColumn[2].productType = true } else { -- Gitblit v1.8.0