剩余模块:生产入库,销售出库
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<up-popup :show="state.show" @close="close" @open="open">
|
||||
<view class="input-box">
|
||||
<view class="input-box" v-if="screeningTypes('warehouseStr')">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="t('public.xzck')" border="none" clearable inputAlign="left"
|
||||
v-model="state.scanFrame.warehouseStr" confirmType="next" :disabled="true">
|
||||
@@ -13,7 +13,7 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-box">
|
||||
<view class="input-box" v-if="screeningTypes('locationStr')">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="state.NoLocationListText" border="none" clearable inputAlign="left"
|
||||
v-model="state.scanFrame.locationStr" confirmType="next" @change="locationChange">
|
||||
@@ -26,7 +26,7 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-box">
|
||||
<view class="input-box" v-if="screeningTypes('articlesStr')">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="t('public.qsrwlbmmessage')" border="none" clearable inputAlign="right"
|
||||
v-model="state.scanFrame.articlesStr" confirmType="next">
|
||||
@@ -36,7 +36,7 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-box">
|
||||
<view class="input-box" v-if="screeningTypes('quantityStr')">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="t('public.qsrsl')" border="none" clearable inputAlign="right"
|
||||
v-model="state.scanFrame.quantityStr" @change="quantityStrChangeFun">
|
||||
@@ -46,10 +46,7 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="warningsText" >
|
||||
默认值数量 {{ state.scanFrame.quantityStr }} 大于未扫数量 {{ state.receiveBillScanData.UnScanQty }} 请修改!
|
||||
</view> -->
|
||||
<view class="input-box">
|
||||
<view class="input-box" v-if="screeningTypes('batchNumberStr')">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="state.batchNumberStrPdr" border="none" clearable inputAlign="right"
|
||||
v-model="state.scanFrame.batchNumberStr" confirmType="next" :disabled="state.batchNumberStrState">
|
||||
@@ -59,19 +56,9 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <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">{{ t('public.xxh') }}</view>
|
||||
</template>
|
||||
</up-input>
|
||||
</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>
|
||||
<up-button type="primary" :plain="true" :text="t('index.qx')" @click="() => {state.show = false}"></up-button>
|
||||
<up-button type="primary" :text="t('index.qd')" style="margin-left: 36rpx;" @click="confirmationFun"></up-button>
|
||||
</view>
|
||||
<warehouse :show="state.warehouse" @warehouseClose="warehouseClosefun" @warehouseData="warehouseDataFun" />
|
||||
<location :show="state.location"
|
||||
@@ -81,7 +68,7 @@
|
||||
</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,defineProps } from 'vue';
|
||||
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
|
||||
import warehouse from '../warehouse/warehouse.vue'
|
||||
import location from '../warehouse/location.vue'
|
||||
@@ -91,13 +78,21 @@
|
||||
const getI18n = useI18n()
|
||||
const { t, locale } = getI18n
|
||||
const eimts = defineEmits(['scanFrameDataFeedback', 'confirmation', 'fast', 'err'])
|
||||
const props = defineProps({
|
||||
types:{
|
||||
type:Array,
|
||||
default: () => {
|
||||
return ['warehouseStr', 'locationStr', 'articlesStr', 'quantityStr', 'batchNumberStr']
|
||||
}
|
||||
}
|
||||
})
|
||||
const state = reactive({
|
||||
show: false,
|
||||
warehouse: false,
|
||||
location: false,
|
||||
NoLocationList: true,
|
||||
NoLocationListText: '可扫描仓位',
|
||||
batchNumberStrPdr: '请输入批号',
|
||||
NoLocationListText: '',
|
||||
batchNumberStrPdr: t('index.qsrph'),
|
||||
warehouseData: {},
|
||||
locationData: {},
|
||||
quantityStrState: false,
|
||||
@@ -118,6 +113,10 @@
|
||||
/**
|
||||
* 数据逻辑
|
||||
*/
|
||||
const screeningTypes = (str:string) => {
|
||||
if(props.types.indexOf(str) !== -1) return true
|
||||
else return false
|
||||
}
|
||||
watch(() => state.scanFrame, () => {
|
||||
console.log('目标已出发');
|
||||
eimts('scanFrameDataFeedback', state.scanFrame)
|
||||
@@ -133,15 +132,14 @@
|
||||
state.locationData = obj.locationData
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.NoLocationListText = t('index.ksmcw')
|
||||
} else {
|
||||
state.NoLocationList = false
|
||||
state.NoLocationListText = '仓位未启用'
|
||||
state.NoLocationListText = t('index.cwwqy')
|
||||
}
|
||||
}
|
||||
//来自接口的数据
|
||||
const getreceiveBillScanData = (row : any) => {
|
||||
console.log(row);
|
||||
state.receiveBillScanData = row
|
||||
dataValidation()
|
||||
}
|
||||
@@ -155,7 +153,7 @@
|
||||
state.scanFrame.warehouseStr = ''
|
||||
state.scanFrame.locationStr = ''
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.NoLocationListText = t('index.ksmcw')
|
||||
state.warehouseData = {}
|
||||
state.locationData = {}
|
||||
}
|
||||
@@ -167,7 +165,7 @@
|
||||
if (state.scanFrame.batchNumberStr !== '' && state.scanFrame.batchNumberStr !== state.receiveBillScanData.FLot_Text) {
|
||||
state.show = true
|
||||
uni.showModal({
|
||||
title: '提示', content: '与默认批号不同,是否替换新的批号', cancelText: '取消', confirmText: '替换',
|
||||
title: t('index.ts'), content: '与默认批号不同,是否替换新的批号', cancelText: '取消', confirmText: '替换',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
state.scanFrame.batchNumberStr = state.receiveBillScanData.FLot_Text
|
||||
@@ -190,7 +188,7 @@
|
||||
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: '替换',
|
||||
title: t('index.ts'), content: t('index.ymrckbt'), cancelText: t('index.qx'), confirmText: t('index.qd'),
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
|
||||
@@ -211,10 +209,10 @@
|
||||
}
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.NoLocationListText = t('index.ksmcw')
|
||||
} else {
|
||||
state.NoLocationList = false
|
||||
state.NoLocationListText = '仓位未启用'
|
||||
state.NoLocationListText = t('index.cwwqy')
|
||||
}
|
||||
}
|
||||
//数量校验
|
||||
@@ -222,7 +220,7 @@
|
||||
state.show = true
|
||||
state.quantityStrState = true
|
||||
} else if (state.scanFrame.quantityStr == '') {
|
||||
state.scanFrame.quantityStr = state.receiveBillScanData.BarCodeQty
|
||||
state.scanFrame.quantityStr = state.receiveBillScanData.UnScanQty
|
||||
}
|
||||
state.scanFrame.articlesStr = state.receiveBillScanData.MaterialNumber
|
||||
state.scanFrame.barCodeStr = state.receiveBillScanData.queryString
|
||||
@@ -253,7 +251,7 @@
|
||||
}
|
||||
if (state.receiveBillScanData.stashVerify) {
|
||||
if (state.scanFrame.warehouseStr == '') {
|
||||
uni.$u.toast('该模块需要指定仓库')
|
||||
uni.$u.toast(t('index.gmkxyzdck'))
|
||||
eimts('err')
|
||||
return false
|
||||
}
|
||||
@@ -264,7 +262,7 @@
|
||||
}
|
||||
}
|
||||
if (state.receiveBillScanData.FIsBatchManage === 'True' && (state.scanFrame.batchNumberStr === '' || state.scanFrame.batchNumberStr === ' ')) {
|
||||
uni.$u.toast('批号已启用,不能为空')
|
||||
uni.$u.toast(t('index.phbnwk'))
|
||||
eimts('err')
|
||||
return false
|
||||
}
|
||||
@@ -285,7 +283,7 @@
|
||||
|
||||
}
|
||||
} else {
|
||||
uni.$u.toast('数量不能为空,不能为0')
|
||||
uni.$u.toast(t('index.slbnwk'))
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -309,16 +307,14 @@
|
||||
console.log(item);
|
||||
state.scanFrame.warehouseStr = item.FNAME
|
||||
state.warehouse = false
|
||||
|
||||
state.locationData = {}
|
||||
state.shortcut.locationStr = ""
|
||||
|
||||
state.scanFrame.locationStr = ""
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.NoLocationListText = t('index.ksmcw')
|
||||
} else {
|
||||
state.NoLocationList = false
|
||||
state.NoLocationListText = '仓库未启用'
|
||||
state.NoLocationListText = t('index.cwwqy')
|
||||
state.scanFrame.locationStr = ''
|
||||
state.locationData = {}
|
||||
}
|
||||
@@ -363,10 +359,10 @@
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.location = true
|
||||
} else {
|
||||
uni.$u.toast('仓库未启用')
|
||||
uni.$u.toast(t('index.cwwqy'))
|
||||
}
|
||||
} else {
|
||||
uni.$u.toast('请选择仓库')
|
||||
uni.$u.toast(t('public.qxzck'))
|
||||
}
|
||||
}
|
||||
const locationDataFun = (item : any) => {
|
||||
|
||||
Reference in New Issue
Block a user