| | |
| | | unit: "", |
| | | reorderId: 0, |
| | | queryProductId: null, |
| | | searchTaskMap: [] |
| | | searchTaskMap: [], |
| | | currentRowId:-1 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.showDiscard = false |
| | | let requestUrl = this.currentRowId === 0 ? addReorderRule : updateReorderRule |
| | | let params = this.saveParams() |
| | | requestUrl(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | let tipStr = this.currentRowId === 0 ? "添加成功" : "修改成功" |
| | | this.$message.success(tipStr) |
| | | this.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | requestUrl(params).then((res) => { |
| | | if (res.code === 200) { |
| | | let tipStr = this.currentRowId === 0 ? "添加成功" : "修改成功" |
| | | this.$message.success(tipStr) |
| | | this.getData() |
| | | }) |
| | | // } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.getData() |
| | | console.log(err) |
| | | }) |
| | | } |
| | | }, |
| | | saveParams() { |
| | |
| | | if (!this.isNoProduct && this.currentRowId === 0) { |
| | | this.$message.error("请完成当前新建或取消新建") |
| | | } else { |
| | | this.currentRowId = row.id |
| | | this.currentRowId = row.id||0 |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | | this.isRowClick = true |
| | |
| | | this.locationId = item?.value ?? item?.id |
| | | }, |
| | | // 选中产品方法 |
| | | selProductClick(item) { |
| | | this.productId = item.value |
| | | this.unit = item.unit |
| | | selProductClick(value,item){ |
| | | if(value==="product"){ |
| | | this.productId=item.id |
| | | this.unit=item.unit |
| | | } |
| | | }, |
| | | // 选中路线方法 |
| | | selRouteClick(item, prop) { |