This commit is contained in:
ChenQiuYu 2025-05-23 13:41:55 +08:00
parent 6ad6ff721c
commit 6416d2f629
2 changed files with 81 additions and 51 deletions

View File

@ -1,27 +1,26 @@
<template>
<Mask :is-show="isShow" :height="600" :width="800" @close="close" title="采集相同追溯码" :show-footer="true">
<div class="tips">
入库单位包装无追溯码时可重复采集上层包装的追溯码
</div>
<Mask :is-show="isShow" :height="321" :width="818" @close="close" title="采集相同追溯码">
<div class="content">
<div class="code">
<div class="before-code">
{{ data.code.slice(0, 7) }}
<div class="top">
<div class="tip">
入库单位包装无追溯码时可重复采集上层包装的追溯码
</div>
<div class="code">
<span class="before-code">
{{ data.code.slice(0, 7) }}
</span>
<span class="after-code">
{{ data.code.slice(7) }}
</span>
</div>
</div>
<div class="after-code">
{{ data.code.slice(7) }}
<div class="body">
<span class="text">采集</span>
<el-input-number v-model="data.num" min="1" size="large" ref="inputRef"
@keydown.enter="close"></el-input-number>
<span class="text"></span>
</div>
</div>
<div class="number">
<span class="text">
采集
</span>
<el-input-number v-model="data.num" min="1" size="large" ref="inputRef" @keydown.enter="close"></el-input-number>
<span class="text">
</span>
</div>
</div>
</Mask>
</template>
<script setup lang="ts">
@ -29,14 +28,14 @@ import Mask from "@/components/common/Mask.vue";
import {nextTick, ref} from "vue";
const data = ref<any>()
const emit = defineEmits(['close'])
const emit = defineEmits(['close', 'save'])
const inputRef = ref<any>()
const init = (codeInfo: any) => {
isShow.value = true
data.value = codeInfo
nextTick(()=>{
nextTick(() => {
inputRef.value?.focus()
const inputElement = inputRef.value?.$el?.querySelector('input');
if (inputElement) {
@ -51,45 +50,77 @@ const close = () => {
emit('close')
isShow.value = false
}
const save = () => {
emit('save', data.value)
isShow.value = false
}
</script>
<style scoped lang="scss">
.tips{
.content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.content{
border: 1px solid #ddd;
margin: 40px;
border-radius: 10px;
.code {
.top {
width: 100%;
font-weight: 800;
font-size: 30px;
color: #333333;
padding: 40px 0;
height: 126px;
background: #F9FAFC;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: 20px;
color: #666666;
font-style: normal;
display: flex;
justify-content: center;
border-bottom: 1px solid #ddd;
.before-code {
color: #999999;
}
padding: 24px;
.after-code {
margin-left: 10px;
.code {
width: 100%;
display: flex;
justify-content: center;
font-weight: 800;
font-size: 30px;
color: #999999;
font-style: normal;
.after-code {
color: #333;
margin-left: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.number{
padding: 40px 0;
width: 100%;
.body {
flex: 1;
min-height: 0;
display: flex;
justify-content: center;
.text{
font-size: 24px;
line-height: 40px;
text-align: center;
align-items: center;
.text {
margin: 0 16px;
}
}
}
.footer {
height: 100%;
padding: 24px;
display: flex;
justify-content: flex-end;
align-items: center;
.default-btn, .btn {
width: 60px;
height: 32px;
line-height: 32px;
margin-left: 10px;
font-size: 14px;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<el-popover placement="bottom-end" :visible="true" width="400">
<el-popover placement="bottom-end" :visible="isVisible" width="400">
<template #reference>
<el-input v-model="input" style="width:100%;height: 100%" placeholder="追溯码" size="small" @focus="focus"
@blur="handlerBlur" @keydown.enter="addCode"></el-input>
@ -13,7 +13,7 @@
</el-table-column>
<el-table-column label="数量" prop="num" width="70" show-overflow-tooltip>
<template #default="{row}">
<span class="small-btn edit" style="cursor: pointer" @click="openCodeNumEdit(row)">
<span class="edit" @click="openCodeNumEdit(row)">
{{ row.num }}
</span>
</template>
@ -95,11 +95,10 @@ const openCodeNumEdit = (row: any) => {
:deep(.el-table td.el-table__cell) {
.edit {
padding: 2px;
width: 100%;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
color: #4d6de4;
}
}
</style>