Files
hht-xzhy-uni/pages/outbound/pick-confirm-2nd.vue
2025-09-01 17:18:37 +08:00

100 lines
2.3 KiB
Vue

<template>
<view class="zd_container">
<!-- 二楼取货确认 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-8">
<span class="filter_label">产线站点编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val1"
@handleChange="handleChange1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-8">
<span class="filter_label">取货确认状态</span>
</view>
<view class="zd-col-16">
<span v-show="val1" class="filter_input" style="font-size: 34rpx; color: #ff6a00; font-weight: 700;">{{status === '1' ? '已确认取货' : '未确认取货'}}</span>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-primary" @tap="toEmpty">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_takeConfirm">扫码取货确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getPointStatus, takeConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
status: null,
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
handleChange1 (e) {
this._getPointStatus(e)
},
// 产线站点编码验证
async _getPointStatus (e) {
try {
let res = await getPointStatus(e)
if (res) {
this.val1 = res.code
this.status = res.point_location
}
} catch (e) {
this.val1 = ''
this.status = null
}
},
toEmpty () {
this.val1 = ''
this.status = null
this.disabled = false
},
async _takeConfirm () {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await takeConfirm(this.val1)
if (res.code === '200') {
this.toEmpty()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>