| | |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | async getData(data) { |
| | | await getReorderRuleList({ |
| | | locationId: data?.id, |
| | | type: "bh", |
| | | keyWord: data?.jointName, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | const list = res.data.map((item) => { |
| | | const list = res.data?.map((item) => { |
| | | let orderNum = 0 |
| | | if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) { |
| | | orderNum = this.caculateOrderNumber( |
| | |
| | | //树点击 |
| | | handleNodeClick(data) { |
| | | console.log(data, "sss") |
| | | getReorderRuleList({ |
| | | locationId: data.id, |
| | | page: 1, |
| | | pageSize: 15, |
| | | type: "", |
| | | keyWord: data.jointName |
| | | }).then((res) => { |
| | | console.log(res, "res999") |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | const list = res.data.map((item) => { |
| | | let orderNum = 0 |
| | | if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) { |
| | | orderNum = this.caculateOrderNumber( |
| | | parseFloat(item.minInventory), |
| | | parseFloat(item.maxInventory), |
| | | parseFloat(item.prediction) |
| | | ) |
| | | } |
| | | return { |
| | | ...item, |
| | | productName: item.product.name, |
| | | locationName: item.location.name, |
| | | isSet: false, |
| | | isEdit: true, |
| | | editable: true, |
| | | isOrder: true, |
| | | isView: item?.minInventory - item?.prediction > 0 ? true : false, |
| | | orderNumber: orderNum |
| | | } |
| | | }) |
| | | this.tableList.tableData = list || [] |
| | | this.tableData = list || [] |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | this.getData(data) |
| | | }, |
| | | async getLocationList() { |
| | | await getLocationTreeList().then((res) => { |