diff --git a/pages/materialManagement/MaterialRequisition/MaterialRequisition.vue b/pages/materialManagement/MaterialRequisition/MaterialRequisition.vue index 9e004e0..13a2a8e 100644 --- a/pages/materialManagement/MaterialRequisition/MaterialRequisition.vue +++ b/pages/materialManagement/MaterialRequisition/MaterialRequisition.vue @@ -267,7 +267,7 @@ //todo 确认起点 confirm_startpoint(point) { this.start_point = point; - + }, //todo获取车间点 get_fab_go_points() { @@ -300,23 +300,35 @@ }; go_workshop(query).then((res) => { if (res.code == 200) { - this.reqCode = res.data.data; - this.$refs.uToast.show({ - type: 'error', - message: 'agv起动成功' + res.data - }); + try { + let json = JSON.parse(res.data); + this.reqCode = json.data; + this.$refs.uToast.show({ + type: 'success', + message: 'agv起动成功' + this.reqCode + }); + } catch (e) { + this.$refs.uToast.show({ + type: 'error', + message: 'agv起动失败:' + this.reqCode + }); + } } }); }, //todo 紧急终止agv stop_agv() { - if (this.reqCode == '') { + if (this.reqCode === '' || this.reqCode === null || this.reqCode === undefined) { this.$refs.uToast.show({ type: 'error', message: '无任务编号' }); return; } + // const query = { + // reqCode: this.reqCode + // }; + const query = { reqCode: this.reqCode }; diff --git a/pages/materialManagement/MaterialWarehousing/MaterialWarehousing.vue b/pages/materialManagement/MaterialWarehousing/MaterialWarehousing.vue index ee9f569..aef8c43 100644 --- a/pages/materialManagement/MaterialWarehousing/MaterialWarehousing.vue +++ b/pages/materialManagement/MaterialWarehousing/MaterialWarehousing.vue @@ -7,13 +7,15 @@ - + - + @@ -42,9 +44,9 @@ return { loading: false, start_point: '', - startOptions:[], + startOptions: [], end_point: '', - endOptions:[], + endOptions: [], reqCode: '' }; }, @@ -57,8 +59,8 @@ }, methods: { init() { - getAllOptions().then(res=>{ - if(res.code===200){ + getAllOptions().then(res => { + if (res.code === 200) { let _list = []; res.data.forEach(item => { _list.push({ @@ -86,11 +88,19 @@ }; go_workshop(query).then((res) => { if (res.code == 200) { - this.reqCode = res.data.data; - this.$refs.uToast.show({ - type: 'error', - message: 'agv起动成功' + res.data - }); + try { + let json = JSON.parse(res.data); + this.reqCode = json.data; + this.$refs.uToast.show({ + type: 'success', + message: 'agv起动成功' + this.reqCode + }); + } catch (e) { + this.$refs.uToast.show({ + type: 'error', + message: 'agv起动失败:' + this.reqCode + }); + } } }); }, @@ -106,7 +116,7 @@ reqCode: this.reqCode }; - emergency_stop_agv().then((res) => { + emergency_stop_agv(query).then((res) => { if (res.code == 200) { this.$refs.uToast.show({ type: 'success',