|
@ -16,9 +16,7 @@ |
|
|
</com-issue-detail-card> |
|
|
</com-issue-detail-card> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
<!-- <comIssueRequestCreator ref="issueRequest" :dataContent="detailSource"> |
|
|
<button class="btn_add" @click="goScan(true)">+去添加</button> |
|
|
</comIssueRequestCreator> --> |
|
|
|
|
|
<!-- <button class="btn_add" @click="goScan(false)">+去添加</button> --> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<div class="btn_bottom"> |
|
|
<div class="btn_bottom"> |
|
@ -88,7 +86,8 @@ |
|
|
scanOptions: [], |
|
|
scanOptions: [], |
|
|
workShopCode: "", |
|
|
workShopCode: "", |
|
|
fromInventoryStatuses: "", |
|
|
fromInventoryStatuses: "", |
|
|
toInventoryStatuses: "" |
|
|
toInventoryStatuses: "", |
|
|
|
|
|
requestList: [], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
@ -128,6 +127,31 @@ |
|
|
//确定需求信息 |
|
|
//确定需求信息 |
|
|
requestConfirm(action, item) { |
|
|
requestConfirm(action, item) { |
|
|
if (item.itemCode == '' || item.itemCode == null) return; |
|
|
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; |
|
|
let that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中...', |
|
|
title: '加载中...', |
|
@ -137,8 +161,9 @@ |
|
|
if (res.data == null) { |
|
|
if (res.data == null) { |
|
|
that.showMessage('未获取到推荐信息'); |
|
|
that.showMessage('未获取到推荐信息'); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
if (res.data.length > 0) { |
|
|
if (res.data.length > 0) { |
|
|
this.workShopCode = item.workshopCode; |
|
|
that.workShopCode = item.workshopCode; |
|
|
res.data.forEach(r => { |
|
|
res.data.forEach(r => { |
|
|
r.toLocationCode = item.rawLocationCode; |
|
|
r.toLocationCode = item.rawLocationCode; |
|
|
r.productionLineCode = item.productionLineCode; |
|
|
r.productionLineCode = item.productionLineCode; |
|
@ -149,12 +174,14 @@ |
|
|
}) |
|
|
}) |
|
|
that.detailSource = getDataSource(that.detailSource, that.subList) |
|
|
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(); |
|
|
that.resizeCollapse(); |
|
|
} else { |
|
|
} else { |
|
|
that.showMessage('列表数据为0'); |
|
|
that.showMessage('列表数据为0'); |
|
@ -163,66 +190,8 @@ |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
uni.hideLoading() |
|
|
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) {} |
|
|
if (res) {} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
showQuestionMessage(message) { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => { |
|
|
|
|
|
// if (res) { |
|
|
|
|
|
// that.clearInfo(); |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|