Files
hht-huaxiang-uni/pages/manage/hnby.vue

94 lines
2.2 KiB
Vue
Raw Normal View History

2025-05-13 18:09:14 +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 border-bottom">
<view class="zd-col-7">
<span class="filter_label">终点</span>
</view>
<view class="zd-col-17 filter_select">
<zxz-uni-data-select v-model="index2" filterable :localdata="options2"></zxz-uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
2025-05-22 16:03:37 +08:00
<span class="filter_label">条码</span>
2025-05-13 18:09:14 +08:00
</view>
<view class="zd-col-17 filter_select">
2025-05-22 16:03:37 +08:00
<search-box
v-model="val1"
/>
2025-05-13 18:09:14 +08:00
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap.stop="clearUp">清空</button>
2025-07-03 11:01:26 +08:00
<button class="zd-col-15 button-primary" :class="{'button-info': !index2 || !val1}" :disabled="disabled1" @tap="_pdaHnby">混碾搬运</button>
2025-05-13 18:09:14 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
2025-05-22 16:03:37 +08:00
import SearchBox from '@/components/SearchBox.vue'
2025-05-13 18:09:14 +08:00
import {pdaHnby} from '@/utils/getData2.js'
export default {
components: {
2025-05-22 16:03:37 +08:00
NavBar,
SearchBox
2025-05-13 18:09:14 +08:00
},
data() {
return {
title: '',
2025-05-20 09:25:22 +08:00
options2: this.generateArray('YJ', 'SLW01', '压机', '号上料位', 10),
2025-05-13 18:09:14 +08:00
index2: '',
val1: null,
disabled1: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
2025-05-20 09:25:22 +08:00
generateArray(prefix, suffix, name1, name2, num) {
2025-05-13 18:09:14 +08:00
const array = []
2025-05-15 13:53:47 +08:00
for (let i = 1; i <= num; i++) {
2025-05-13 18:09:14 +08:00
array.push({
value: `${prefix}${String(i).padStart(2, '0')}${suffix}`,
2025-05-20 09:25:22 +08:00
text: `${name1}${String(i).padStart(2, '0')}${name2}`
2025-05-13 18:09:14 +08:00
})
}
return array
},
clearUp () {
this.index2 = ''
this.val1 = null
this.disabled1 = false
},
async _pdaHnby () {
this.disabled1 = true
2025-07-03 11:01:26 +08:00
if (!this.index2 || !this.val1) {
2025-05-13 18:09:14 +08:00
this.disabled1 = false
return
}
try {
2025-07-03 11:01:26 +08:00
let res = await pdaHnby(this.index2, this.val1)
2025-05-13 18:09:14 +08:00
this.disabled1 = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
</style>