开发
This commit is contained in:
100
pages/manage/hnby.vue
Normal file
100
pages/manage/hnby.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<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="index1" filterable :localdata="options1"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<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">
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<input type="number" class="filter_input" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap.stop="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index1 || !index2}" :disabled="disabled1" @tap="_pdaHnby">混碾搬运</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {pdaHnby} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options1: this.generateArray('HNJ', 'DJW'),
|
||||
index1: '',
|
||||
options2: this.generateArray('YJ', 'SLW01'),
|
||||
index2: '',
|
||||
val1: null,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
generateArray(prefix, suffix) {
|
||||
const array = []
|
||||
for (let i = 1; i <= 8; i++) {
|
||||
array.push({
|
||||
value: `${prefix}${String(i).padStart(2, '0')}${suffix}`,
|
||||
text: `${prefix}${String(i).padStart(2, '0')}${suffix}`
|
||||
})
|
||||
}
|
||||
return array
|
||||
},
|
||||
clearUp () {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.val1 = null
|
||||
this.disabled1 = false
|
||||
},
|
||||
async _pdaHnby () {
|
||||
this.disabled1 = true
|
||||
if (!this.index1 || !this.index2) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await pdaHnby(this.index1, this.index2, this.val1)
|
||||
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>
|
||||
Reference in New Issue
Block a user