二次确认
This commit is contained in:
@@ -47,8 +47,8 @@
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="_inArea">进入</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_outArea">退出</button> -->
|
||||
<button class="zd-col-7 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="_inArea">{{$t('button.enter')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_outArea">{{$t('button.quit')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="handleConfirm">{{$t('button.enter')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.quit')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -56,6 +56,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {getChargeRegions, selectRegionInfo, inArea, outArea} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
@@ -152,12 +153,17 @@
|
||||
this.pkId = e.create_name === this.pkId ? '' : e.create_name
|
||||
this.pkObj = this.pkId === e.create_name ? e : {}
|
||||
},
|
||||
async _inArea () {
|
||||
this.disabled = true
|
||||
async handleConfirm() {
|
||||
if (!this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._inArea()
|
||||
}
|
||||
},
|
||||
async _inArea () {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await inArea(this.index)
|
||||
if (res.code === '200') {
|
||||
@@ -177,12 +183,17 @@
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _outArea () {
|
||||
this.disabled2 = true
|
||||
async handleConfirm2() {
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._outArea()
|
||||
}
|
||||
},
|
||||
async _outArea () {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await outArea(this.pkObj)
|
||||
if (res.code === '200') {
|
||||
|
||||
Reference in New Issue
Block a user