Files
hht-xilinmen-uni/pages/manage/call-manage.vue

105 lines
2.8 KiB
Vue
Raw Permalink Normal View History

2024-09-11 11:29:44 +08:00
<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>
2024-09-11 15:45:45 +08:00
<view class="zd-col-6 filter_label">任务起点</view>
2024-09-11 11:29:44 +08:00
<view class="zd-col-18 relative">
2024-09-14 16:05:10 +08:00
<input type="text" class="filter_input" value="A1">
2024-09-11 11:29:44 +08:00
</view>
</view>
2024-09-14 16:05:10 +08:00
<view class="zd-row mgb20">
2024-09-11 11:29:44 +08:00
<uni-icons type="arrow-down" size="18" color="#ff6a00"></uni-icons>
2024-09-11 15:45:45 +08:00
<view class="zd-col-6 filter_label">任务终点</view>
2024-09-11 11:29:44 +08:00
<view class="zd-col-18 relative">
2024-09-14 16:05:10 +08:00
<input type="text" class="filter_input" value="B1">
2024-09-11 15:45:45 +08:00
</view>
</view>
2024-09-14 16:05:10 +08:00
<view class="zd-row">
<button class="zd-col-24 button-primary" :disabled="disabled" @tap="toSure('A1', 'B1', '1')">搬运物料任务</button>
</view>
2024-09-11 15:45:45 +08:00
</view>
<view class="zd_wrapper">
2024-09-14 16:05:10 +08:00
<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">任务起点</view>
<view class="zd-col-18 relative">
<input type="text" class="filter_input" value="B2">
2024-09-11 15:45:45 +08:00
</view>
2024-09-14 16:05:10 +08:00
</view>
<view class="zd-row mgb20">
<uni-icons type="arrow-down" size="18" color="#ff6a00"></uni-icons>
<view class="zd-col-6 filter_label">任务终点</view>
<view class="zd-col-18 relative">
<input type="text" class="filter_input" value="A2">
2024-09-11 11:29:44 +08:00
</view>
</view>
2024-09-14 16:05:10 +08:00
<view class="zd-row">
<button class="zd-col-24 button-primary" :disabled="disabled" @tap="toSure('B2', 'A2', '2')">补空托盘任务</button>
</view>
2024-09-11 11:29:44 +08:00
</view>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
2024-09-14 16:05:10 +08:00
import {callTask2} from '@/utils/getData2.js'
2024-09-11 11:29:44 +08:00
export default {
components: {
NavBar
},
data() {
return {
title: '',
2024-09-14 16:05:10 +08:00
disabled: false
2024-09-11 11:29:44 +08:00
};
},
onLoad (options) {
this.title = options.title
},
methods: {
2024-09-14 16:05:10 +08:00
toSure (code1, code2, type) {
this.disabled = true
uni.showModal({
title: '提示',
cancelText: '取消',
confirmText: '确定',
content: type === '1' ? '是否进行搬运物料任务?' : '是否进行补空托盘任务?',
success: (res) => {
if (res.confirm) {
2024-09-18 09:23:39 +08:00
this._callTask(code1, code2, '3')
2024-09-14 16:05:10 +08:00
} else if (res.cancel) {
this.disabled = false
2024-09-11 11:29:44 +08:00
}
}
2024-09-14 16:05:10 +08:00
})
2024-09-11 11:29:44 +08:00
},
2024-09-14 16:05:10 +08:00
async _callTask (code1, code2, type) {
2024-09-11 11:29:44 +08:00
try {
2024-09-14 16:05:10 +08:00
let res = await callTask2(code1, code2, type)
this.disabled = false
2024-09-11 11:29:44 +08:00
uni.showToast({
2024-09-14 16:05:10 +08:00
title: res.message,
2024-09-11 11:29:44 +08:00
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>