修改
This commit is contained in:
@@ -50,12 +50,51 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_againTask">重新下发</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirm">强制完成</button> -->
|
||||
<button class="zd-col-8 button-primary" @tap="searchList">{{$t('button.search')}}</button>
|
||||
<!-- <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="handleConfirm">{{$t('button.reissue')}}</button> -->
|
||||
<!-- <button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="handleConfirm2">{{$t('button.force-complete')}}</button> -->
|
||||
<!-- <button class="zd-col-6 button-primary" @tap="searchList">{{$t('button.search')}}</button> -->
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="toStartConfirm">{{$t('button.start-confirm')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="toEndConfirm">{{$t('button.end-confirm')}}</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled3" @tap="handleConfirm">{{$t('button.finish')}}</button>
|
||||
</view>
|
||||
<view class="msg_wrapper" :class="show ? 'popshow' : 'pophide'">
|
||||
<view class="pop_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">{{$t('filter.start-point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-22 button-primary" :class="{'button-info': !val2}" :disabled="disabled1" @tap="_startPointConfirm">{{$t('button.start-confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="show" class="msg_mask"></view>
|
||||
<view class="msg_wrapper" :class="show2 ? 'popshow' : 'pophide'">
|
||||
<view class="pop_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">{{$t('filter.end-point')}}</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val3"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-22 button-primary" :class="{'button-info': !val3}" :disabled="disabled2" @tap="_endPointConfirm">{{$t('button.end-confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="show2" class="msg_mask"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -63,7 +102,7 @@
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import { confirmAction } from '@/utils/utils.js'
|
||||
import {queryTask, againTask, forceConfirm} from '@/utils/getData4.js'
|
||||
import {queryTask, finishTask, startPointConfirm, endPointConfirm} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -73,8 +112,14 @@
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
show: false,
|
||||
show2: false,
|
||||
dataList: [],
|
||||
// dataList: [{task_code: 't01', point_code1: 'p01', point_code2: 'p02'}],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
@@ -85,8 +130,9 @@
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false,
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -134,13 +180,62 @@
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = e.task_code === this.pkId ? '' : e.task_code
|
||||
this.pkObj = e
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.pkId = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
this.show = false
|
||||
this.show2 = false
|
||||
this.searchList()
|
||||
},
|
||||
toStartConfirm () {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
this.val2 = this.pkObj.point_code1
|
||||
this.show = true
|
||||
},
|
||||
async _startPointConfirm () {
|
||||
this.disabled1 = true
|
||||
this.show = false
|
||||
try {
|
||||
let res = await startPointConfirm(this.pkId, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toEndConfirm () {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
this.val3 = this.pkObj.point_code2
|
||||
this.show2 = true
|
||||
},
|
||||
async _endPointConfirm () {
|
||||
this.disabled2 = true
|
||||
this.show2 = false
|
||||
try {
|
||||
let res = await endPointConfirm(this.pkId, this.val3)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
if (!this.pkId) {
|
||||
@@ -148,46 +243,31 @@
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._againTask()
|
||||
this._finishTask()
|
||||
}
|
||||
},
|
||||
async _againTask () {
|
||||
this.disabled = true
|
||||
async _finishTask () {
|
||||
this.disabled3 = true
|
||||
try {
|
||||
let res = await againTask(this.pkId)
|
||||
let res = await finishTask(this.pkId)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled = false
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async handleConfirm2() {
|
||||
if (!this.pkId) {
|
||||
return
|
||||
}
|
||||
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
|
||||
if (isConfirmed) {
|
||||
this._forceConfirm()
|
||||
}
|
||||
},
|
||||
async _forceConfirm () {
|
||||
this.disabled2 = true
|
||||
try {
|
||||
let res = await forceConfirm(this.pkId)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.button-primary, .button-default
|
||||
_fj(center)
|
||||
font-size 26rpx
|
||||
height 88rpx
|
||||
line-height 30rpx
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user