| | |
| | | } |
| | | }) |
| | | let requestUrl = this.currentRowId === 0 ? addListingRules : updateListingRules |
| | | console.log({ |
| | | id: this.currentRowId, |
| | | areaId: this.areaId, |
| | | locationId: this.subLocationId, |
| | | productCategoryId: this.productCategoryId, |
| | | productId: this.productId |
| | | },"参数") |
| | | requestUrl({ |
| | | id: this.currentRowId, |
| | | areaId: this.areaId, |
| | |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row, rowIndex) { |
| | | // this.tableList.tableColumn[1].product=true |
| | | // this.tableList.tableColumn[2].productType=true |
| | | this.rowIndex=rowIndex |
| | | console.log("11111",row,rowIndex) |
| | | console.log(this.isNoProduct ,this.currentRowId,"xxx") |
| | | // this.tableList.tableColumn[1].product=true |
| | | // this.tableList.tableColumn[2].productType=false |
| | | this.rowIndex=rowIndex |
| | | this.isSel() |
| | | if (!this.isNoProduct && this.currentRowId === 0) { |
| | | this.$message.error("请完成当前新建或取消新建") |
| | | } else { |
| | | if(row.productCategory!==""){ |
| | | this.tableList.tableColumn[2].productType=true |
| | | this.currentRowId = row.id |
| | | 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 (index === rowIndex) { |
| | | item.isEdit = false |
| | | item.isOrder = true |
| | | } else { |
| | | item.isEdit = true |
| | | } |
| | | }) |
| | | this.areaId = row.areaId |
| | | this.subLocationId = row.locationId |
| | | this.productCategoryId = row.productCategoryId |
| | | this.productId = row.productId |
| | | }else if(row.productCategory===""){ |
| | | this.tableList.tableColumn[2].productType=false |
| | | this.currentRowId = row.id |
| | | 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 (index === rowIndex) { |
| | | item.isEdit = false |
| | | item.isOrder = true |
| | | } else { |
| | | item.isEdit = true |
| | | } |
| | | }) |
| | | this.areaId = row.areaId |
| | | this.subLocationId = row.locationId |
| | | this.productCategoryId = row.productCategoryId |
| | | this.productId = row.productId |
| | | }else if(row.productId!==""){ |
| | | this.tableList.tableColumn[1].product=true |
| | | this.currentRowId = row.id |
| | | 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 (index === rowIndex) { |
| | | item.isEdit = false |
| | | item.isOrder = true |
| | | } else { |
| | | item.isEdit = true |
| | | } |
| | | }) |
| | | this.areaId = row.areaId |
| | | this.subLocationId = row.locationId |
| | | this.productCategoryId = row.productCategoryId |
| | | this.productId = row.productId |
| | | }else if(row.product===""){ |
| | | this.tableList.tableColumn[1].product=false |
| | | this.currentRowId = row.id |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | |
| | | this.productCategoryId = row.productCategoryId |
| | | this.productId = row.productId |
| | | } |
| | | } |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | |
| | | }, |
| | | // 选中产品方法 |
| | | selProductClick(item) { |
| | | console.log(item,"产品") |
| | | this.tableList.tableColumn[2].productType=false |
| | | this.productId = item.value |
| | | this.productCategoryId = item.categoryId |
| | |
| | | console.log(item,"产品类型",this.tableList.tableData[this.rowIndex]) |
| | | this.tableList.tableColumn[1].product=false |
| | | this.tableList.tableData[this.rowIndex].productName='--' |
| | | this.productId='' |
| | | this.productCategoryId=item |
| | | }, |
| | | // 删除 |
| | | async delClick(scope) { |