|
@@ -81,13 +81,12 @@
|
|
|
width="90%" style="height: 200px" :before-close="handleClose">
|
|
width="90%" style="height: 200px" :before-close="handleClose">
|
|
|
<el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
|
|
<el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
|
|
|
<el-form-item label="SKU">
|
|
<el-form-item label="SKU">
|
|
|
- <el-input v-model="snCodeForm.bar_code" :inputmode="inputmode" ref="inputRef"
|
|
|
|
|
- @keyup.enter="toSearch()">
|
|
|
|
|
- <template #append> <el-button @click="getInfo">搜索</el-button> </template>
|
|
|
|
|
|
|
+ <el-input class="hidden-input" v-model="snCodeForm.bar_code" @keyup.enter="toSearch()" clearable :inputmode="inputmode" ref="inputRef">
|
|
|
|
|
+ <template #append> <img src="../../assets/images/JP.png" @click="inputmode='text'" class="w-8 h-8" /> </template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="序列号">
|
|
<el-form-item label="序列号">
|
|
|
- <el-input v-model="snCodeForm.sn_code" inputmode="none" ref="snInputRef"
|
|
|
|
|
|
|
+ <el-input v-model="snCodeForm.sn_code" clearable inputmode="none" ref="snInputRef"
|
|
|
@keyup.enter="toSnCode()" />
|
|
@keyup.enter="toSnCode()" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -130,7 +129,7 @@ const defaultTime = new Date(2000, 1, 1, 12, 0, 0)
|
|
|
let dialogVisible = ref(false)
|
|
let dialogVisible = ref(false)
|
|
|
const tableData = ref([])
|
|
const tableData = ref([])
|
|
|
let barcodeValue = ref('')
|
|
let barcodeValue = ref('')
|
|
|
-let inputmode = ref('none')
|
|
|
|
|
|
|
+let inputmode = ref('text')
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const activeTab = ref('product-info');
|
|
const activeTab = ref('product-info');
|
|
@@ -227,6 +226,10 @@ const getInfo = () => {
|
|
|
const toSearch = async () => {
|
|
const toSearch = async () => {
|
|
|
activeTab.value = 'product-info'
|
|
activeTab.value = 'product-info'
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if (!snCodeForm.bar_code) {
|
|
|
|
|
+ console.log('扫码枪输入为空,忽略此次事件');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const res: any = await orderApi.getProduct(
|
|
const res: any = await orderApi.getProduct(
|
|
|
shippingForm.value.warehouse_id,
|
|
shippingForm.value.warehouse_id,
|
|
|
snCodeForm.bar_code.replace(/\s+/g, '')
|
|
snCodeForm.bar_code.replace(/\s+/g, '')
|
|
@@ -265,6 +268,7 @@ const toSearch = async () => {
|
|
|
snInputRef.value.focus();
|
|
snInputRef.value.focus();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if (shippingForm.value.order_item_vos[index.value].num >= shippingForm.value.order_item_vos[index.value].orderNum) return ElMessage.warning('录入完成,请录入下一条!')
|
|
|
shippingForm.value.order_item_vos[index.value].num += 1
|
|
shippingForm.value.order_item_vos[index.value].num += 1
|
|
|
snCodeForm.bar_code = ''
|
|
snCodeForm.bar_code = ''
|
|
|
//dialogVisible.value = false;
|
|
//dialogVisible.value = false;
|
|
@@ -304,7 +308,8 @@ const toSnCode = async () => {
|
|
|
//shippingForm.value.order_item_vos[index.value].id = shippingForm.value.order_item_vos[indexs].id;
|
|
//shippingForm.value.order_item_vos[index.value].id = shippingForm.value.order_item_vos[indexs].id;
|
|
|
if (shippingForm.value.order_item_vos[index.value].num === shippingForm.value.order_item_vos[index.value].orderNum) {
|
|
if (shippingForm.value.order_item_vos[index.value].num === shippingForm.value.order_item_vos[index.value].orderNum) {
|
|
|
snCodeForm.bar_code = "";
|
|
snCodeForm.bar_code = "";
|
|
|
- dialogVisible.value = false;
|
|
|
|
|
|
|
+ return ElMessage.warning('录入完成,请录入下一条!')
|
|
|
|
|
+ /* dialogVisible.value = false; */
|
|
|
} else {
|
|
} else {
|
|
|
snCodeForm.bar_code = "";
|
|
snCodeForm.bar_code = "";
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
@@ -338,6 +343,7 @@ const scanCode = () => {
|
|
|
// 首先,让输入框失去焦点,这会阻止键盘的唤起
|
|
// 首先,让输入框失去焦点,这会阻止键盘的唤起
|
|
|
//inputRef.value.removeAttribute('readonly');
|
|
//inputRef.value.removeAttribute('readonly');
|
|
|
inputRef.value.focus();
|
|
inputRef.value.focus();
|
|
|
|
|
+ inputmode.value='none'
|
|
|
}
|
|
}
|
|
|
}, 100);
|
|
}, 100);
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -574,4 +580,8 @@ const getInforList = async () => {
|
|
|
.p-4 {
|
|
.p-4 {
|
|
|
padding: 1rem;
|
|
padding: 1rem;
|
|
|
}
|
|
}
|
|
|
|
|
+.hidden-input .el-input__inner {
|
|
|
|
|
+ width: 0;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|