This commit is contained in:
2025-04-29 13:26:19 +08:00
parent 6e1ae24845
commit bf88fcb395
73 changed files with 12939 additions and 4637 deletions

View File

@@ -2,10 +2,10 @@
<up-popup :show="state.show" @close="close" @open="open">
<view class="input-box">
<view class="input-item">
<up-input placeholder="可扫描仓库" border="none" clearable inputAlign="left"
<up-input :placeholder="t('public.xzck')" border="none" clearable inputAlign="left"
v-model="state.scanFrame.warehouseStr" confirmType="next" :disabled="true">
<template #prefix>
<view class="item-title" style="margin-right: 16rpx;">仓库名称</view>
<view class="item-title" style="margin-right: 16rpx;">{{ t('public.ckmc') }}</view>
</template>
<template #suffix>
<up-icon name="search" color="#6c6c6c" size="24" @click="warehouseShowFun"></up-icon>
@@ -18,7 +18,7 @@
<up-input :placeholder="state.NoLocationListText" border="none" clearable inputAlign="left"
v-model="state.scanFrame.locationStr" confirmType="next" :disabled="true">
<template #prefix>
<view class="item-title" style="margin-right: 16rpx;">仓位名称</view>
<view class="item-title" style="margin-right: 16rpx;">{{ t('public.cwmc') }}</view>
</template>
<template #suffix>
<up-icon name="search" color="#6c6c6c" size="24" @click="locationStrShowFun"></up-icon>
@@ -28,57 +28,47 @@
</view>
<view class="input-box">
<view class="input-item">
<up-input placeholder="请输入物料编码" border="none" clearable inputAlign="right"
<up-input :placeholder="t('public.qsrwlbmmessage')" border="none" clearable inputAlign="right"
v-model="state.scanFrame.articlesStr" confirmType="next">
<template #prefix>
<view class="item-title">物料编码</view>
<view class="item-title">{{ t('public.wlbm') }}</view>
</template>
</up-input>
</view>
</view>
<view class="input-box">
<view class="input-item">
<up-input placeholder="请输入条码" border="none" clearable inputAlign="right"
v-model="state.scanFrame.barCodeStr" confirmType="next">
<template #prefix>
<view class="item-title">条码</view>
</template>
</up-input>
</view>
</view>
<view class="input-box">
<view class="input-item">
<up-input placeholder="请输入数量" border="none" clearable inputAlign="right"
<up-input :placeholder="t('public.qsrsl')" border="none" clearable inputAlign="right"
v-model="state.scanFrame.quantityStr" @change="quantityStrChangeFun">
<template #prefix>
<view class="item-title">数量</view>
<view class="item-title">{{ t('public.qty') }}</view>
</template>
</up-input>
</view>
</view>
<view class="warningsText" v-if="state.quantityStrState">
<!-- <view class="warningsText" >
默认值数量 {{ state.scanFrame.quantityStr }} 大于未扫数量 {{ state.receiveBillScanData.UnScanQty }} 请修改!
</view>
</view> -->
<view class="input-box">
<view class="input-item">
<up-input :placeholder="state.batchNumberStrPdr" border="none" clearable inputAlign="right"
v-model="state.scanFrame.batchNumberStr" confirmType="next" :disabled="state.batchNumberStrState">
<template #prefix>
<view class="item-title">批号</view>
<view class="item-title">{{ t('public.mmsph') }}</view>
</template>
</up-input>
</view>
</view>
<view class="input-box">
<!-- <view class="input-box">
<view class="input-item">
<up-input placeholder="请输入序列号" border="none" clearable inputAlign="right"
v-model="state.scanFrame.sequenceStr" confirmType="next">
<template #prefix>
<view class="item-title">序列号</view>
<view class="item-title">{{ t('public.xxh') }}</view>
</template>
</up-input>
</view>
</view>
</view> -->
<view class="btnListSc">
<up-button type="primary" :plain="true" text="取消" @click="() => {state.show = false}"></up-button>
<up-button type="primary" text="确定" style="margin-left: 36rpx;" @click="confirmationFun"></up-button>
@@ -91,10 +81,14 @@
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted, ref, computed, defineEmits, watch } from 'vue';
import { reactive, nextTick, onMounted, ref, computed, defineEmits, watch,defineExpose } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import warehouse from '../warehouse/warehouse.vue'
import location from '../warehouse/location.vue'
import i18n from '../../locale/index'
import { useI18n } from 'vue-i18n'
const getI18n = useI18n()
const { t, locale } = getI18n
const eimts = defineEmits(['scanFrameDataFeedback', 'confirmation', 'fast','err'])
const state = reactive({
show: false,
@@ -120,7 +114,6 @@
receiveBillScanData: {}
})
/**
* 数据逻辑
*/
@@ -129,7 +122,7 @@
eimts('scanFrameDataFeedback', state.scanFrame)
}, { deep: true })
//来自默认值的数据
const getComponentsData = (obj : object) => {
const getComponentsData = (obj : any) => {
state.componentsData = obj
state.scanFrame.warehouseStr = obj.warehouseStr
state.scanFrame.locationStr = obj.locationStr
@@ -153,10 +146,10 @@
}
//数据擦除
const dataErase = () => {
if(state.componentsData.warehouseStr === '') state.scanFrame.warehouseStr = ''
if(state.componentsData.locationStr === '') state.scanFrame.locationStr = ''
if(state.componentsData.quantityStr === '') state.scanFrame.quantityStr = ''
if(state.componentsData.batchNumberStr === '') state.scanFrame.batchNumberStr = ''
if(state.componentsData.warehouseStr == '') state.scanFrame.warehouseStr = ''
if(state.componentsData.locationStr == '') state.scanFrame.locationStr = ''
if(state.componentsData.quantityStr == '') state.scanFrame.quantityStr = ''
if(state.componentsData.batchNumberStr == '') state.scanFrame.batchNumberStr = ''
if(Object.keys(state.componentsData.warehouseData).length === 0){
state.scanFrame.warehouseStr = ''
state.scanFrame.locationStr = ''
@@ -223,17 +216,12 @@
state.NoLocationListText = '仓位未启用'
}
}
//数量校验
if(state.receiveBillScanData.quantityStateSup && state.receiveBillScanData.quantityStateSup === '0'){
state.scanFrame.quantityStr = state.receiveBillScanData.UnScanQty
} else {
if (state.scanFrame.quantityStr !== '' && Number(state.scanFrame.quantityStr) > state.receiveBillScanData.UnScanQty) {
state.show = true
state.quantityStrState = true
} else if (state.scanFrame.quantityStr == '') {
state.scanFrame.quantityStr = state.receiveBillScanData.UnScanQty
}
if (state.scanFrame.quantityStr !== '' && Number(state.scanFrame.quantityStr) > state.receiveBillScanData.UnScanQty) {
state.show = true
state.quantityStrState = true
} else if (state.scanFrame.quantityStr == '') {
state.scanFrame.quantityStr = state.receiveBillScanData.BarCodeQty
}
state.scanFrame.articlesStr = state.receiveBillScanData.MaterialNumber
state.scanFrame.barCodeStr = state.receiveBillScanData.queryString
@@ -250,8 +238,7 @@
const confirmationFun = () => {
if(dataVerifyFun()){
console.log({ ...state.scanFrame, warehouseData: state.warehouseData, locationData: state.locationData, id: state.receiveBillScanData.Id });
debugger
eimts('confirmation', { ...state.scanFrame, warehouseData: state.warehouseData, locationData: state.locationData, id: state.receiveBillScanData.Id })
eimts('confirmation', { ...state.scanFrame, warehouseData: state.warehouseData, locationData: state.locationData || {}, id: state.receiveBillScanData.Id })
dataErase()
}
}
@@ -282,10 +269,6 @@
}
return true
}
//数量输入校验
const quantityStrChangeFun = (e : any) => {
console.log(state.receiveBillScanData);
@@ -294,7 +277,6 @@
state.quantityStrState = false
} else {
if(state.receiveBillScanData.quantityStateSup && state.receiveBillScanData.quantityStateSup === '0'){
debugger
state.quantityStrState = false
} else {
state.quantityStrState = true
@@ -305,8 +287,6 @@
uni.$u.toast('数量不能为空不能为0')
}
}
/**
* 弹窗逻辑
*/
@@ -358,7 +338,7 @@
}
const locationDataFun = (item : any) => {
state.locationData = item
state.scanFrame.locationStr = formatLangTextValue(item.FlexEntryId.Name)
state.scanFrame.locationStr = item.FFlexValueName
state.location = false
}