| | |
| | | unit: "", |
| | | reorderId: 0, |
| | | queryProductId: null, |
| | | searchTaskMap: [] |
| | | searchTaskMap: [], |
| | | currentRowId: -1 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.pagerOptions.currPage = 1 |
| | | this.searchTaskMap = |
| | | query.productId?.length > 0 ? [{ productId: this.queryProductId, title: query.productName }] : [] |
| | | console.log(this.searchTaskMap) |
| | | } |
| | | this.getData() |
| | | }, |
| | |
| | | selectBox: false, |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "产品", prop: "productName", product: true }, |
| | | { label: "产品", prop: "productName", product: true, width: "150px" }, |
| | | { label: "位置", prop: "locationName", defaultLocation: true }, |
| | | { label: "在库数量", prop: "amount" }, |
| | | { label: "预测数量", prop: "prediction" }, |
| | |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | const list = res.data.map((item) => { |
| | | let orderNum = 0 |
| | | if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) { |
| | |
| | | }, |
| | | // 新增 |
| | | addProductClick() { |
| | | console.log(this.addTitle) |
| | | this.isSel() |
| | | if (this.isNoProduct && this.addTitle === "新建") { |
| | | this.$refs.tablelistRef.getProductList() |
| | |
| | | let params = this.saveParams() |
| | | requestUrl(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | let tipStr = this.currentRowId === 0 ? "添加成功" : "修改成功" |
| | | this.$message.success(tipStr) |
| | |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(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 |
| | |
| | | }, |
| | | // 选中产品方法 |
| | | selProductClick(item) { |
| | | this.productId = item.value |
| | | this.productId = item.productId |
| | | this.unit = item.unit |
| | | this.amount = item.amount |
| | | this.prediction = item.prediction |
| | | }, |
| | | // 选中路线方法 |
| | | selRouteClick(item, prop) { |