复制斗山
This commit is contained in:
116
pages/manage/call-manage.vue
Normal file
116
pages/manage/call-manage.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row mgb20 border-bottom">
|
||||
<uni-icons type="arrow-up" size="18" color="#ff6a00"></uni-icons>
|
||||
<view class="zd-col-6 filter_label">{{$t('call.sp')}}</view>
|
||||
<view class="zd-col-18 relative">
|
||||
<input type="text" class="filter_input" v-model="sCode">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<uni-icons type="arrow-down" size="18" color="#ff6a00"></uni-icons>
|
||||
<view class="zd-col-6 filter_label">{{$t('call.ep')}}</view>
|
||||
<view class="zd-col-18 relative">
|
||||
<input type="text" class="filter_input" v-model="nCode">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="toSure('1')">{{$t('button.handtask')}}</button>
|
||||
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="toCharge">{{$t('charging-task')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea, callTask, taskCharge} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
disabled: false,
|
||||
sCode: 'QFQ_2',
|
||||
nCode: 'QFQ_4'
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
toSure (type) {
|
||||
this.disabled = true
|
||||
uni.showModal({
|
||||
title: this.$t('warning'),
|
||||
cancelText: this.$t('button.cancel'),
|
||||
confirmText: this.$t('button.confirm'),
|
||||
content: this.$t('toast.command-reissue'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this._callTask(type)
|
||||
} else if (res.cancel) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async _callTask (type) {
|
||||
try {
|
||||
let res = await callTask(this.sCode, this.nCode, type)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (err) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toCharge () {
|
||||
this.disabled = true
|
||||
uni.showModal({
|
||||
title: this.$t('warning'),
|
||||
cancelText: this.$t('button.cancel'),
|
||||
confirmText: this.$t('button.confirm'),
|
||||
content: this.$t('toast.charging-task'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this._taskCharge()
|
||||
} else if (res.cancel) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async _taskCharge () {
|
||||
try {
|
||||
let res = await taskCharge()
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (err) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.item-font-6
|
||||
color #fff
|
||||
.filter_label
|
||||
padding-left 0
|
||||
.pop_point_content_up
|
||||
top -200rpx
|
||||
</style>
|
||||
Reference in New Issue
Block a user