diff --git a/src/pages/modules/taskmanage/CarryPoint.vue b/src/pages/modules/taskmanage/CarryPoint.vue index 2fd6575..533a654 100644 --- a/src/pages/modules/taskmanage/CarryPoint.vue +++ b/src/pages/modules/taskmanage/CarryPoint.vue @@ -19,10 +19,10 @@
- - + + + -
@@ -114,7 +114,6 @@ export default { preventClickEvent: false }, statusbg: false, - pkId: '', selectObj: {}, startObj: '', // 起始点 returnObj: '', // 返回点 @@ -240,6 +239,8 @@ export default { this.$refs.child.active = true switch (type) { case '1': + this.startObj = '' + this.returnObj = '' this.pointcode = '' this.returnsitecode = '' this.unclick = true @@ -258,7 +259,7 @@ export default { break case '2': if (this.value) { - this.confirmPoint(this.pkId, '1', this.value) + this.confirmPoint(this.startObj, '1', this.value) this.value = '' } break @@ -269,7 +270,7 @@ export default { case '1': break case '2': - this.confirmPoint(this.pkId, '1', '') + this.confirmPoint(this.startObj, '1', '') this.value = '' break } @@ -314,32 +315,43 @@ export default { }, toRadio (e) { console.log('seletobj====', e) - // this.pkId = this.pkId === e.point_code ? '' : e.point_code this.selectObj = e - // this.toast('终点已选中') - if (this.startObj && this.returnObj) { // 已选中情况下清空 this.startObj = '' this.returnObj = '' - this.toast('已选点已清空') + // this.toast('已选点已清空') return } if (!this.startObj) { this.startObj = e.point_code - this.toast('终点已选中') + let tipText = this.$i18n.locale === 'en-us' ? 'End point selected' : '终点已选中' + this.toast(tipText) + // this.toast('终点已选中') return } if (this.startObj && !this.returnObj) { - this.returnObj = e.point_code - this.toast('返回点已选中') + let tipText = this.$i18n.locale === 'en-us' ? 'End point selected' : '终点已选中' + this.toast(tipText) + // this.toast('终点已选中') + if (this.startObj !== e.point_code) { + this.returnObj = e.point_code + let tipText = this.$i18n.locale === 'en-us' ? 'Return point selected' : '返回点已选中' + this.toast(tipText) + // this.toast('返回点已选中') + } } }, toSure (pcode, type, ncode) { - this.confirmPoint(pcode, type, ncode) - }, - toClear () { - this.selectObj = {} + if ((type === '3' || type === '4') && this.returnObj) { + return + } + if ((type === '3' || type === '4') && this.startObj) { + this.confirmPoint(pcode, type, ncode) + } + if (type === '1' && this.startObj) { + this.confirmPoint(pcode, type, ncode) + } } // handleMouseenter (e) { // console.log('ee', e)