diff --git a/pages/container/record/containerBindRecord.vue b/pages/container/record/containerBindRecord.vue index 487c0571..4a4f553c 100644 --- a/pages/container/record/containerBindRecord.vue +++ b/pages/container/record/containerBindRecord.vue @@ -38,7 +38,8 @@ - + + @@ -142,8 +143,8 @@ getContainerDetailByNumber(this.containerCode).then(res => { if (res.data != null && res.data.subList.length > 0) { this.detailSource = this.getDataSource(res.data.subList) - this.showScanLocation(); } + this.showScanLocation(); }).catch(error => { this.showErrorMessage(error.message) }) @@ -167,15 +168,24 @@ var qty = result.label.qty; var itemCode = result.label.itemCode; - var detail = this.detailSource.find(r => r.itemCode == itemCode); - if (detail == undefined) { - this.showMessage("绑定物料【" + itemCode + "】与现有物料不一致,不可以绑定"); + var item = this.detailSource.find(r => r.itemCode == itemCode); + if (item == undefined) { + + if (this.detailSource.length == 0) { + item = this.createItemInfo(result.label); + let itemDetail = result.balance; + itemDetail.scaned = true; + item.subList.push(itemDetail); + this.detailSource.push(item); + } else { + this.showMessage("绑定物料【" + itemCode + "】与现有物料不一致,不可以绑定"); + } } else { - var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); + var itemDetail = item.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); if (itemDetail == undefined) { itemDetail = result.balance; itemDetail.scaned = true; - detail.subList.push(itemDetail); + item.subList.push(itemDetail); } else { if (itemDetail.scaned) { this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】已经扫描") @@ -266,7 +276,7 @@ }, openScanPopup() { - if (this.fromLocationInfo != null) { + if (this.fromLocationInfo.code != undefined) { this.$refs.scanPopup.openScanPopupForType(this.fromLocationInfo.code, this.businessType); } else { this.showScanLocation(); diff --git a/static/config.json b/static/config.json index 5ff11180..3f6576ad 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.230:12080/admin-api", + "value": "http://dev.ccwin-in.com:25100/api/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.176:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",