剩余模块:生产入库,销售出库
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<view class="input-box">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="state.NoLocationListText" border="none" clearable inputAlign="left"
|
||||
v-model="state.scanFrame.locationStr" confirmType="next" :disabled="true">
|
||||
v-model="state.scanFrame.locationStr" confirmType="next" @change="locationChange">
|
||||
<template #prefix>
|
||||
<view class="item-title" style="margin-right: 16rpx;">{{ t('public.cwmc') }}</view>
|
||||
</template>
|
||||
@@ -59,7 +59,7 @@
|
||||
</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">
|
||||
@@ -81,15 +81,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, nextTick, onMounted, ref, computed, defineEmits, watch,defineExpose } 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'
|
||||
import { fStockFlexDetailList } from '../../common/request/api/api';
|
||||
const getI18n = useI18n()
|
||||
const { t, locale } = getI18n
|
||||
const eimts = defineEmits(['scanFrameDataFeedback', 'confirmation', 'fast','err'])
|
||||
const eimts = defineEmits(['scanFrameDataFeedback', 'confirmation', 'fast', 'err'])
|
||||
const state = reactive({
|
||||
show: false,
|
||||
warehouse: false,
|
||||
@@ -146,23 +147,23 @@
|
||||
}
|
||||
//数据擦除
|
||||
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(Object.keys(state.componentsData.warehouseData).length === 0){
|
||||
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 = ''
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.warehouseData = {}
|
||||
state.locationData = {}
|
||||
state.warehouseData = {}
|
||||
state.locationData = {}
|
||||
}
|
||||
}
|
||||
//首次数据校验&修正
|
||||
const dataValidation = () => {
|
||||
//批号校验
|
||||
if(state.receiveBillScanData.FIsBatchManage === 'True'){
|
||||
if (state.receiveBillScanData.FIsBatchManage === 'True') {
|
||||
if (state.scanFrame.batchNumberStr !== '' && state.scanFrame.batchNumberStr !== state.receiveBillScanData.FLot_Text) {
|
||||
state.show = true
|
||||
uni.showModal({
|
||||
@@ -180,14 +181,14 @@
|
||||
}
|
||||
} else {
|
||||
state.scanFrame.batchNumberStr = '',
|
||||
state.batchNumberStrState = true
|
||||
state.batchNumberStrState = true
|
||||
state.batchNumberStrPdr = '批号未启用'
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//仓库校验
|
||||
if(Object.keys(state.warehouseData).length !== 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0){
|
||||
if(state.receiveBillScanData.StockId.Number !== state.warehouseData.FNUMBER){
|
||||
if (Object.keys(state.warehouseData).length !== 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
|
||||
if (state.receiveBillScanData.StockId.Number !== state.warehouseData.FNUMBER) {
|
||||
uni.showModal({
|
||||
title: '提示', content: '与默认仓库不同,是否替换新的仓库', cancelText: '取消', confirmText: '替换',
|
||||
success(res) {
|
||||
@@ -203,10 +204,10 @@
|
||||
} else if (Object.keys(state.warehouseData).length == 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
|
||||
state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
|
||||
state.warehouseData = {
|
||||
FIsOpenLocation:state.receiveBillScanData.StockId.IsOpenLocation,
|
||||
FNAME:formatLangTextValue(state.receiveBillScanData.StockId.Name),
|
||||
FNUMBER:state.receiveBillScanData.StockId.Number,
|
||||
FSTOCKID:state.receiveBillScanData.StockId.Id,
|
||||
FIsOpenLocation: state.receiveBillScanData.StockId.IsOpenLocation,
|
||||
FNAME: formatLangTextValue(state.receiveBillScanData.StockId.Name),
|
||||
FNUMBER: state.receiveBillScanData.StockId.Number,
|
||||
FSTOCKID: state.receiveBillScanData.StockId.Id,
|
||||
}
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
@@ -225,10 +226,10 @@
|
||||
}
|
||||
state.scanFrame.articlesStr = state.receiveBillScanData.MaterialNumber
|
||||
state.scanFrame.barCodeStr = state.receiveBillScanData.queryString
|
||||
|
||||
|
||||
//如果开启了异常弹出,则自动返回数据
|
||||
if (!state.receiveBillScanData.scanFrameShowSate && !state.show) {
|
||||
if(dataVerifyFun()){
|
||||
if (dataVerifyFun()) {
|
||||
eimts('fast', { ...state.scanFrame, warehouseData: state.warehouseData, locationData: state.locationData, id: state.receiveBillScanData.Id })
|
||||
dataErase()
|
||||
}
|
||||
@@ -236,13 +237,13 @@
|
||||
}
|
||||
//手动确认返回数据
|
||||
const confirmationFun = () => {
|
||||
if(dataVerifyFun()){
|
||||
if (dataVerifyFun()) {
|
||||
console.log({ ...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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//反馈数据校验
|
||||
const dataVerifyFun = () => {
|
||||
if (state.quantityStrState) {
|
||||
@@ -262,7 +263,7 @@
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(state.receiveBillScanData.FIsBatchManage === 'True' && (state.scanFrame.batchNumberStr === '' || state.scanFrame.batchNumberStr === ' ')){
|
||||
if (state.receiveBillScanData.FIsBatchManage === 'True' && (state.scanFrame.batchNumberStr === '' || state.scanFrame.batchNumberStr === ' ')) {
|
||||
uni.$u.toast('批号已启用,不能为空')
|
||||
eimts('err')
|
||||
return false
|
||||
@@ -276,12 +277,12 @@
|
||||
if (Number(e) <= state.receiveBillScanData.UnScanQty) {
|
||||
state.quantityStrState = false
|
||||
} else {
|
||||
if(state.receiveBillScanData.quantityStateSup && state.receiveBillScanData.quantityStateSup === '0'){
|
||||
if (state.receiveBillScanData.quantityStateSup && state.receiveBillScanData.quantityStateSup === '0') {
|
||||
state.quantityStrState = false
|
||||
} else {
|
||||
state.quantityStrState = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
uni.$u.toast('数量不能为空,不能为0')
|
||||
@@ -308,6 +309,10 @@
|
||||
console.log(item);
|
||||
state.scanFrame.warehouseStr = item.FNAME
|
||||
state.warehouse = false
|
||||
|
||||
state.locationData = {}
|
||||
state.shortcut.locationStr = ""
|
||||
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
@@ -322,6 +327,34 @@
|
||||
/**
|
||||
* 仓位逻辑
|
||||
*/
|
||||
const debounceTimer = ref()
|
||||
const locationChange = (e : any) => {
|
||||
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
|
||||
debounceTimer.value = setTimeout(() => {
|
||||
state.scanFrame.locationStr = e
|
||||
if (state.scanFrame.locationStr !== '' && state.scanFrame.warehouseStr !== '') {
|
||||
fnDataList()
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
const fnDataList = () => {
|
||||
let param = {
|
||||
Number: state.warehouseData.FNUMBER,
|
||||
queryString: state.scanFrame.locationStr,
|
||||
IsSortBySeq: true
|
||||
};
|
||||
fStockFlexDetailList(param).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code == 200) {
|
||||
if (res.data.list.length) {
|
||||
state.locationData = res.data.list[0]
|
||||
state.scanFrame.locationStr = res.data.list[0].FFlexValueName
|
||||
} else {
|
||||
uni.$u.toast('未找到该仓位')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const locationClosefun = () => {
|
||||
state.location = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user