|
@@ -14,6 +14,20 @@
|
|
|
<!-- <van-button type="primary" size="mini" :plain="!newCheckAllType" @click="onCheckAllType" icon="exchange" >条码校验</van-button>-->
|
|
<!-- <van-button type="primary" size="mini" :plain="!newCheckAllType" @click="onCheckAllType" icon="exchange" >条码校验</van-button>-->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <van-tabs
|
|
|
|
|
+ v-if="ownerPanpassEnabled"
|
|
|
|
|
+ v-model:active="panpassTabActive"
|
|
|
|
|
+ type="card"
|
|
|
|
|
+ class="panpass-code-tabs"
|
|
|
|
|
+ @change="onPanpassTabChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-tab>
|
|
|
|
|
+ <template #title><van-icon name="scan" />箱码</template>
|
|
|
|
|
+ </van-tab>
|
|
|
|
|
+ <van-tab>
|
|
|
|
|
+ <template #title><van-icon name="coupon-o" />盒码</template>
|
|
|
|
|
+ </van-tab>
|
|
|
|
|
+ </van-tabs>
|
|
|
<div v-if="combineSetCount > 0" class="combine-set-info">
|
|
<div v-if="combineSetCount > 0" class="combine-set-info">
|
|
|
组合{{ combineSetCount }}套 | 唯一码{{ containerList.length }}/{{ searchCount }}
|
|
组合{{ combineSetCount }}套 | 唯一码{{ containerList.length }}/{{ searchCount }}
|
|
|
</div>
|
|
</div>
|
|
@@ -94,6 +108,8 @@ const props = defineProps({
|
|
|
combineSetCount: { type: Number, default: 0 },
|
|
combineSetCount: { type: Number, default: 0 },
|
|
|
/** 组合外箱码获取内件码 */
|
|
/** 组合外箱码获取内件码 */
|
|
|
resolvePanpassCodes: { type: Function, default: undefined },
|
|
resolvePanpassCodes: { type: Function, default: undefined },
|
|
|
|
|
+ /** 货主开启兆信:箱码调接口取子码,盒码走唯一码录入 */
|
|
|
|
|
+ ownerPanpassEnabled: { type: Boolean, default: false },
|
|
|
})
|
|
})
|
|
|
const isCombineMode = computed(() => Number(props.combineSetCount) > 0)
|
|
const isCombineMode = computed(() => Number(props.combineSetCount) > 0)
|
|
|
const getDefaultCheckAllType = () => !isCombineMode.value && !!props.checkAllType
|
|
const getDefaultCheckAllType = () => !isCombineMode.value && !!props.checkAllType
|
|
@@ -105,6 +121,15 @@ const containerList = computed(() => {
|
|
|
return props.uniqueCodeList
|
|
return props.uniqueCodeList
|
|
|
})
|
|
})
|
|
|
const uniqueRuleMap = ref({})
|
|
const uniqueRuleMap = ref({})
|
|
|
|
|
+/** 兆信码类型 tab:0 箱码(调接口),1 盒码(直接录入) */
|
|
|
|
|
+const panpassTabActive = ref(0)
|
|
|
|
|
+const panpassCodeType = computed(() => (panpassTabActive.value === 0 ? 'box' : 'pack'))
|
|
|
|
|
+const isPanpassBoxMode = computed(
|
|
|
|
|
+ () => props.ownerPanpassEnabled && panpassTabActive.value === 0,
|
|
|
|
|
+)
|
|
|
|
|
+const onPanpassTabChange = () => {
|
|
|
|
|
+ refocusAfterUniqueInput()
|
|
|
|
|
+}
|
|
|
const show = async (code, desc, tips, uniqueRule) => {
|
|
const show = async (code, desc, tips, uniqueRule) => {
|
|
|
if (tips !== undefined) {
|
|
if (tips !== undefined) {
|
|
|
tag.value = tips
|
|
tag.value = tips
|
|
@@ -114,6 +139,7 @@ const show = async (code, desc, tips, uniqueRule) => {
|
|
|
uniqueCodeScanType.value = newCheckAllType.value ? 'barcode' : 'unique'
|
|
uniqueCodeScanType.value = newCheckAllType.value ? 'barcode' : 'unique'
|
|
|
uniqueBarcode.value = ''
|
|
uniqueBarcode.value = ''
|
|
|
uniqueCode.value = ''
|
|
uniqueCode.value = ''
|
|
|
|
|
+ panpassTabActive.value = 0
|
|
|
uniqueCodeTrueFalseBy.value = true
|
|
uniqueCodeTrueFalseBy.value = true
|
|
|
await nextTick()
|
|
await nextTick()
|
|
|
if (newCheckAllType.value) uniqueBarcodeRef.value?.focus()
|
|
if (newCheckAllType.value) uniqueBarcodeRef.value?.focus()
|
|
@@ -139,7 +165,6 @@ const refocusAfterUniqueInput = () => {
|
|
|
const uniqueBarcodeChange=()=>{
|
|
const uniqueBarcodeChange=()=>{
|
|
|
if (isCombineMode.value) return true
|
|
if (isCombineMode.value) return true
|
|
|
if(newCheckAllType.value){
|
|
if(newCheckAllType.value){
|
|
|
- if (props.resolvePanpassCodes) return true
|
|
|
|
|
if(!uniqueBarcode.value){
|
|
if(!uniqueBarcode.value){
|
|
|
showNotify({ type: 'danger', duration: 3000, message: `请先扫描商品条码` })
|
|
showNotify({ type: 'danger', duration: 3000, message: `请先扫描商品条码` })
|
|
|
scanError()
|
|
scanError()
|
|
@@ -162,7 +187,7 @@ const uniqueBarcodeChange=()=>{
|
|
|
const onKeydown = async () => {
|
|
const onKeydown = async () => {
|
|
|
if(!uniqueBarcodeChange()) return
|
|
if(!uniqueBarcodeChange()) return
|
|
|
if (uniqueCode.value) {
|
|
if (uniqueCode.value) {
|
|
|
- if (props.resolvePanpassCodes) {
|
|
|
|
|
|
|
+ if (isPanpassBoxMode.value && props.resolvePanpassCodes) {
|
|
|
const result = await props.resolvePanpassCodes(uniqueCode.value)
|
|
const result = await props.resolvePanpassCodes(uniqueCode.value)
|
|
|
if (result == null) {
|
|
if (result == null) {
|
|
|
uniqueCode.value = ''
|
|
uniqueCode.value = ''
|
|
@@ -212,7 +237,7 @@ const beforeClose = (action) =>
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-defineExpose({ show ,uniqueBarcode,uniqueCodeScanType })
|
|
|
|
|
|
|
+defineExpose({ show, uniqueBarcode, uniqueCodeScanType, panpassCodeType })
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang="sass">
|
|
<style scoped lang="sass">
|
|
|
.unique-code
|
|
.unique-code
|
|
@@ -302,5 +327,25 @@ defineExpose({ show ,uniqueBarcode,uniqueCodeScanType })
|
|
|
padding: 4px 15px 0
|
|
padding: 4px 15px 0
|
|
|
width: 100%
|
|
width: 100%
|
|
|
box-sizing: border-box
|
|
box-sizing: border-box
|
|
|
|
|
+ .panpass-code-tabs
|
|
|
|
|
+ width: 120px
|
|
|
|
|
+ margin: 8px 15px 0
|
|
|
|
|
+ :deep(.van-tabs__content)
|
|
|
|
|
+ display: none
|
|
|
|
|
+ :deep(.van-tabs__wrap)
|
|
|
|
|
+ height: 28px
|
|
|
|
|
+ :deep(.van-tabs__nav--card)
|
|
|
|
|
+ margin: 0
|
|
|
|
|
+ height: 28px
|
|
|
|
|
+ :deep(.van-tab)
|
|
|
|
|
+ font-size: 11px
|
|
|
|
|
+ line-height: 1
|
|
|
|
|
+ padding: 0 6px
|
|
|
|
|
+ :deep(.van-tab__text)
|
|
|
|
|
+ display: inline-flex
|
|
|
|
|
+ align-items: center
|
|
|
|
|
+ gap: 2px
|
|
|
|
|
+ :deep(.van-icon)
|
|
|
|
|
+ font-size: 12px
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|