From 0358c535963edb19780cd53c8e133bf298da6419 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 31 十月 2023 10:14:47 +0800
Subject: [PATCH] 上架规则列表修改
---
src/views/warehouseManage/listingRules/index.vue | 47 ++++++++++++++++++++++-------------------------
src/components/makepager/CommonFormTableView.vue | 12 ++++++++++--
2 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 9d3349d..1962ce1 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -216,7 +216,10 @@
v-for="item in productTypeNameOptions"
:key="item.id"
:label="item.name"
- :value="item.name"
+ :value="{
+ value: item.id,
+ label: item.name,
+ }"
>
</el-option>
</el-select>
@@ -463,7 +466,6 @@
},
// 閫夋嫨浜у搧
selProductClick(item) {
- console.log(item)
this.tableList.tableData.map((ite) => {
if (ite.productName.label === item.label) {
ite.productId = item.value
@@ -491,6 +493,12 @@
},
// 閫夋嫨浜у搧绫诲瀷
selProductTypeClick(item) {
+ this.tableList.tableData.map((ite) => {
+ if (ite.productCategory.label === item.label) {
+ ite.productCategoryId = item.value
+ ite.productCategory = item.label
+ }
+ })
if (this.isinventory) {
this.getProductCategoryList()
}
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index d4d8ba5..b7be896 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -89,6 +89,7 @@
isRowClick: false,
areaId: 0,
productId: 0,
+ productCategoryId:0,
subLocationId: 0,
currentRowId: 0,
rowIndex:-1,
@@ -180,8 +181,8 @@
} else {
if (this.areaId === 0) {
this.$message.error("璇烽�夋嫨褰撳墠浜у搧鍒拌揪浣嶇疆")
- } else if (this.productId === 0) {
- this.$message.error("璇烽�夋嫨浜у搧")
+ } else if (this.productId === 0 && this.productCategoryId==='') {
+ this.$message.error("璇烽�夋嫨浜у搧鎴栦骇鍝佺被鍒�")
} else if (this.subLocationId === 0) {
this.$message.error("璇烽�夋嫨瀛樺偍鍒板瓙浣嶇疆")
} else {
@@ -199,12 +200,12 @@
})
let requestUrl = this.currentRowId === 0 ? addListingRules : updateListingRules
requestUrl({
- RuleType:this.RuleType,
- id: this.currentRowId,
- areaId: this.areaId,
- locationId: this.subLocationId,
- productCategoryId: this.productCategoryId,
- productId: this.productId
+ RuleType:this.RuleType,
+ id: this.currentRowId,
+ areaId: this.areaId,
+ locationId: this.subLocationId,
+ productCategoryId: this.productCategoryId||'',
+ productId: this.productId||''
}).then((res) => {
console.log(res)
if (res.code === 200) {
@@ -220,7 +221,7 @@
isSel() {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].productName.length === 0) {
- this.isNoProduct = false
+ this.isNoProduct = true
break
} else {
this.isNoProduct = true
@@ -299,15 +300,12 @@
this.subLocationId = row.locationId
this.productCategoryId = row.productCategoryId
this.productId = row.productId
- if(this.tableList.tableData[rowIndex].productCategory===""){
- this.tableList.tableColumn[2].productType=false
- }else{
- this.tableList.tableColumn[2].productType=true
- }
if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){
this.tableList.tableColumn[1].product=false
+ this.tableList.tableColumn[2].productType=true
}else{
this.tableList.tableColumn[1].product=true
+ this.tableList.tableColumn[2].productType=false
}
}
},
@@ -354,11 +352,14 @@
// 閫変腑浜у搧绫诲瀷鏂规硶
selProductTypeClick(item) {
this.RuleType=2
- console.log(item,"浜у搧绫诲瀷",this.tableList.tableData[this.rowIndex])
- // this.tableList.tableColumn[1].product=false
- this.tableList.tableData[this.rowIndex].productName=' '
- this.productId=''
- this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
+ if(this.currentRowId===0){
+ this.productCategoryId=item.value
+ }else{
+ this.tableList.tableColumn[1].product=false
+ this.tableList.tableData[this.rowIndex].productName=' '
+ this.productId=''
+ this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
+ }
},
// 鍒犻櫎
async delClick(scope) {
@@ -373,16 +374,12 @@
},
watch:{
rowIndex(newVal){
- console.log(this.tableList.tableData[newVal].productName.length,"watch")
- if(this.tableList.tableData[newVal].productCategory.length===0){
- this.tableList.tableColumn[2].productType=false
- }else{
- this.tableList.tableColumn[2].productType=true
- }
if(this.tableList.tableData[newVal].productName===" "){
this.tableList.tableColumn[1].product=false
+ this.tableList.tableColumn[2].productType=true
}else{
this.tableList.tableColumn[1].product=true
+ this.tableList.tableColumn[2].productType=false
}
}
}
--
Gitblit v1.8.0