You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.2 KiB
63 lines
1.2 KiB
12 months ago
|
<template>
|
||
|
<view class="" style="background-color:#fff;">
|
||
|
<view class="uni-flex uni-row" style="display: flex;align-items: center;">
|
||
|
零件
|
||
|
<uni-easyinput ref='scanInput' v-model="partCode" @confirm="confirmPartCode" @clear="clear"
|
||
|
style='font-size: 18px;padding: 10rpx 20rpx;' placeholder="请输入零件号" @iconClick="">
|
||
|
</uni-easyinput>
|
||
|
</view>
|
||
|
<view class="">
|
||
|
<u-select v-model="showPartCode" mode="single-column" :list="list" @confirm="confirmSelectPartCode">
|
||
|
</u-select>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
components: {},
|
||
|
|
||
|
data() {
|
||
|
return {
|
||
|
partCode: "",
|
||
|
showPartCode: false,
|
||
|
}
|
||
|
},
|
||
|
props: {
|
||
|
list: {
|
||
|
type: Object,
|
||
|
default: []
|
||
|
}
|
||
|
|
||
|
},
|
||
|
watch: {
|
||
|
// recommend
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
confirmPartCode() {
|
||
|
if (this.partCode == '') {
|
||
|
uni.showToast({
|
||
|
title: "请扫描零件"
|
||
|
})
|
||
|
return;
|
||
|
}
|
||
|
this.showPartCode = true;
|
||
|
},
|
||
|
confirmSelectPartCode(e) {
|
||
|
this.partCode = e[0].label
|
||
|
this.$emit("confirmSelectPartCode", this.partCode)
|
||
|
|
||
|
},
|
||
|
clear() {
|
||
|
this.partCode = "";
|
||
|
this.$emit("clearPartCode", this.partCode)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
</style>
|