diff --git a/pages/outWarehouse/outWarehouse.vue b/pages/outWarehouse/outWarehouse.vue index 50c5988..be04b61 100644 --- a/pages/outWarehouse/outWarehouse.vue +++ b/pages/outWarehouse/outWarehouse.vue @@ -23,7 +23,7 @@ - + 选择物料号 @@ -130,17 +130,15 @@ export default { this.searchType = 2; this.outInfo = data; this.newMaterialList = []; - - let arry=[] - this.columns=[]; - - this.outInfo.materialList.forEach((item)=>{ + + let arry = []; + this.columns = []; + + this.outInfo.materialList.forEach((item) => { arry.push(item.partnumber); - - }) - this.columns.push(arry) - this.material_id=this.outInfo.materialList[0].partnumber - + }); + this.columns.push(arry); + this.material_id = this.outInfo.materialList[0].partnumber; } else if (type === 2) { if (this.newMaterialList.length > 0) { uni.showModal({ @@ -154,7 +152,7 @@ export default { const checkData = { production_packcode: data.originalCode, shipment_num: this.outInfo.shipmentNum, - partnumber:this.material_id + partnumber: this.material_id }; //检查是否可以出货 WarehoseApi.checkProductionOut(checkData).then((res) => { @@ -226,8 +224,7 @@ export default { if (res.confirm) { const data = { shipmentNum: this.outInfo.shipmentNum, - patchCode: [this.newMaterialList[0].patchCode], - + patchCode: [this.newMaterialList[0].patchCode] }; WarehoseApi.doMaterialOut(data).then((res) => { if (res.code !== 200) { @@ -237,31 +234,35 @@ export default { showCancel: false, confirmText: '确认' }); - - if(res.data.item1=100){ - uni.showModal({ - title: '提示', - content: '此物料已经出库完成,没有可以出库的了', - showCancel: false, - confirmText: '确认' - }); - }else if(res.data.item2=100){ - uni.showModal({ - title: '提示', - content: '不是此物料最早批次,无法出库', - showCancel: false, - confirmText: '确认' - }); - } + return; + } else { + if (res.data.item1 == 100) { + uni.showModal({ + title: '提示', + content: '此物料已经出库完成,不可以再出库', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + } else if (res.data.item2 == 200) { + uni.showModal({ + title: '提示', + content: '不是此物料最早批次,无法出库', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + } else { + uni.showModal({ + title: '提示', + content: '出库成功', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + } } - uni.showModal({ - title: '提示', - content: '出库成功', - showCancel: false, - confirmText: '确认' - }); - this.newMaterialList = []; }); } } diff --git a/utils/request.js b/utils/request.js index 9e5c998..b9f827e 100644 --- a/utils/request.js +++ b/utils/request.js @@ -18,7 +18,7 @@ import { let timeout = 10000 const request = config => { // 浏览器测试用 - // const storageBaseUrl = 'http://' + getBaseUrl() + '/api'; + // const storageBaseUrl = 'http://' + getBaseUrl() + '/api'; // 真机测试以及部署用 const storageBaseUrl = 'http://' + getBaseUrl(); // 是否需要设置 token