diff --git a/pages/issue/coms/comIssueRequestPopup.vue b/pages/issue/coms/comIssueRequestPopup.vue index e8e62d7a..e20fb685 100644 --- a/pages/issue/coms/comIssueRequestPopup.vue +++ b/pages/issue/coms/comIssueRequestPopup.vue @@ -14,7 +14,7 @@ - 位置 : + 位置: {{positionInfo}} @@ -22,11 +22,9 @@ - - 物料: @@ -37,20 +35,17 @@ style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="itemCodeClick"> - - - 数量 : + 数量: - diff --git a/pages/issue/record/issueRecord.vue b/pages/issue/record/issueRecord.vue index ab5e130c..0a7c68c6 100644 --- a/pages/issue/record/issueRecord.vue +++ b/pages/issue/record/issueRecord.vue @@ -16,9 +16,7 @@ - - +
@@ -88,7 +86,8 @@ scanOptions: [], workShopCode: "", fromInventoryStatuses: "", - toInventoryStatuses: "" + toInventoryStatuses: "", + requestList: [], } }, mounted() { @@ -128,6 +127,31 @@ //确定需求信息 requestConfirm(action, item) { if (item.itemCode == '' || item.itemCode == null) return; + + let that = this; + let request = that.requestList.find(r => r.itemCode == item.itemCode); + if (request == undefined) { + that.requestList.push(item); + + this.getRecommendInfo(item); + + } else { + this.$refs.comMessage.showQuestionMessage('已经存在零件[' + item.itemCode + ']的需求信息,是否要修改?', res => { + if (res) { + + that.detailSource.forEach(detail => { + let index = detail.Items.findIndex(r => { + r.itemCode == item.itemCode + }) + detail.Items.splice(index, 1); + }) + this.getRecommendInfo(item); + } + }); + } + }, + + getRecommendInfo(item) { let that = this; uni.showLoading({ title: '加载中...', @@ -137,8 +161,9 @@ if (res.data == null) { that.showMessage('未获取到推荐信息'); } else { + if (res.data.length > 0) { - this.workShopCode = item.workshopCode; + that.workShopCode = item.workshopCode; res.data.forEach(r => { r.toLocationCode = item.rawLocationCode; r.productionLineCode = item.productionLineCode; @@ -149,12 +174,14 @@ }) that.detailSource = getDataSource(that.detailSource, that.subList) //要修改一下数量 - that.detailSource.forEach(item => { - // - - + that.detailSource.forEach(detail => { + detail.Items.forEach(i => { + let request = that.requestList.find(r => r + .itemCode == i + .itemCode); + i.qty = request.qty; + }) }) - that.resizeCollapse(); } else { that.showMessage('列表数据为0'); @@ -163,66 +190,8 @@ } }).catch(error => { uni.hideLoading() - this.showErrorMessage(error) + that.showErrorMessage(error) }) - - - // if (this.detailSource.subList.length == 0) { - // this.detailSource = { - // workshopCode: item.workshopCode, - // workShopName: item.workShopName, - - // totalQty: 0, - // subList: [] - // } - // var subItem = { - // productionLineCode: item.productionLineCode, - // productionLineName: item.productionLineName, - // workStationCode: item.workStationCode, - // workStationName: item.workStationName, //工位 - // itemCode: item.itemCode, - // itemName: item.itemName, - // qty: item.qty, - // uom: item.uom - // } - // this.detailSource.subList.push(subItem) - // } else { - // var result = this.detailSource.subList.filter(res => { - // if (res.itemCode == item.itemCode && - // res.productionLineCode == item.productionLineCode && - // res.workStationCode == item.workStationCode) { - // return res - // } - // }) - - // //没有添加数据 - // if (result.length == 0) { - // var subItem = { - // productionLineCode: item.productionLineCode, - // productionLineName: item.productionLineName, - // workStationCode: item.workStationCode, - // workStationName: item.workStationName, //工位 - // itemCode: item.itemCode, - // itemName: item.itemName, - // qty: item.qty, - // uom: item.uom - // } - - // this.detailSource.subList.push(subItem) - - // } else { - // //有了更新数据 - // result[0].qty += item.qty - - // } - // } - - - - // this.caclcQty(); - // if (this.$refs.issueRequest != undefined) { - // this.$refs.issueRequest.update() - // } }, @@ -320,6 +289,16 @@ if (res) {} }); }, + showQuestionMessage(message) { + + }, + + // this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => { + // if (res) { + // that.clearInfo(); + // } + // }); + } }