11
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<up-popup :show="state.show" @close="close">
|
||||
<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.shortcut.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.shortcut.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>
|
||||
@@ -26,32 +26,32 @@
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-box">
|
||||
<!-- <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.shortcut.quantityStr" confirmType="next">
|
||||
<template #prefix>
|
||||
<view class="item-title">数量</view>
|
||||
<view class="item-title">{{ t('public.qty') }}</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.qsrmssph')" border="none" clearable inputAlign="right"
|
||||
v-model="state.shortcut.batchNumberStr" confirmType="next">
|
||||
<template #prefix>
|
||||
<view class="item-title">批号</view>
|
||||
<view class="item-title">{{ t('public.mmsph') }}</view>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="input-box">
|
||||
<view class="input-item">
|
||||
<up-input border="none" clearable inputAlign="right" :disabled="true"
|
||||
v-model="state.shortcut.scanFrameTextState" confirmType="next">
|
||||
<template #prefix>
|
||||
<view class="item-title">扫描后是否固定弹出</view>
|
||||
<view class="item-title">{{ t('public.gdtcckMessage') }}</view>
|
||||
</template>
|
||||
<template #suffix>
|
||||
<up-switch style="margin-left: 16rpx;" v-model="state.shortcut.scanFrameShowSate"
|
||||
@@ -61,8 +61,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnListSc">
|
||||
<up-button type="primary" :plain="true" text="重置" @click="dataResetFun"></up-button>
|
||||
<up-button type="primary" text="保存" style="margin-left: 36rpx;" @click="dataToscanFrameFun"></up-button>
|
||||
<up-button type="primary" :plain="true" :text="t('public.cz')" @click="dataResetFun"></up-button>
|
||||
<up-button type="primary" :text="t('public.bc')" style="margin-left: 36rpx;" @click="dataToscanFrameFun"></up-button>
|
||||
</view>
|
||||
<warehouse :show="state.warehouse" @warehouseClose="warehouseClosefun" @warehouseData="warehouseDataFun" />
|
||||
<location :show="state.location"
|
||||
@@ -76,6 +76,10 @@
|
||||
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(['dataToscanFrame'])
|
||||
const state = reactive({
|
||||
show: false,
|
||||
@@ -83,14 +87,15 @@
|
||||
location: false,
|
||||
warehouseData: {},
|
||||
locationData: {},
|
||||
NoLocationListText: '可扫描仓位',
|
||||
NoLocationListText: computed(() => t('public.xzcw')),
|
||||
NoLocationList: true,
|
||||
specialModule: '',
|
||||
shortcut: {
|
||||
warehouseStr: '',
|
||||
locationStr: '',
|
||||
quantityStr: '',
|
||||
batchNumberStr: '',
|
||||
scanFrameTextState: '固定弹出',
|
||||
scanFrameTextState: t('public.gdtc'),
|
||||
scanFrameShowSate: true
|
||||
}
|
||||
})
|
||||
@@ -100,8 +105,9 @@
|
||||
const close = () => { state.show = false }
|
||||
const dataToscanFrameFun = () => {
|
||||
if (state.shortcut.warehouseStr !== '' && state.NoLocationList && state.shortcut.locationStr === '') {
|
||||
uni.$u.toast('仓位为空,不能保存')
|
||||
return
|
||||
uni.$u.toast(t('public.qxzcw'))
|
||||
state.show = true
|
||||
return
|
||||
}
|
||||
eimts('dataToscanFrame', {
|
||||
...state.shortcut,
|
||||
@@ -115,12 +121,15 @@
|
||||
locationStr: '',
|
||||
quantityStr: '',
|
||||
batchNumberStr: '',
|
||||
scanFrameTextState: '固定弹出',
|
||||
scanFrameTextState: t('public.gdtc'),
|
||||
scanFrameShowSate: false
|
||||
}
|
||||
eimts('dataToscanFrame', {})
|
||||
}
|
||||
const stateShow = (val : boolean) => { state.show = val }
|
||||
const stateShow = (val : boolean, specialModule : string = '') => {
|
||||
state.specialModule = specialModule
|
||||
state.show = val
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓库逻辑
|
||||
@@ -133,24 +142,36 @@
|
||||
state.warehouse = false
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.NoLocationList = true
|
||||
state.NoLocationListText = '可扫描仓位'
|
||||
state.NoLocationListText = t('public.xzcw')
|
||||
} else {
|
||||
state.NoLocationList = false
|
||||
state.NoLocationListText = '仓库未启用'
|
||||
state.NoLocationListText = t('public.cwwqy')
|
||||
state.shortcut.locationStr = ''
|
||||
state.locationData = {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定模块可以不需要仓库仓位
|
||||
*/
|
||||
const isWarehouseAndLocationState = () => {
|
||||
if(state.specialModule = 'encasement'){
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const scanFrameShowSateSwitch = () => {
|
||||
console.log(state.shortcut.scanFrameShowSate);
|
||||
state.shortcut.scanFrameShowSate ? state.shortcut.scanFrameTextState = '固定弹出' : state.shortcut.scanFrameTextState = '异常弹出'
|
||||
if (!state.shortcut.scanFrameShowSate) {
|
||||
if (state.shortcut.warehouseStr == '' && state.NoLocationList) {
|
||||
state.shortcut.scanFrameShowSate = true
|
||||
uni.$u.toast('仓库仓位为空时,只可固定弹出')
|
||||
} else if (state.shortcut.warehouseStr !== '' && state.NoLocationList && state.shortcut.locationStr === '') {
|
||||
state.shortcut.scanFrameShowSate = true
|
||||
uni.$u.toast('仓位为空时,只可固定弹出')
|
||||
state.shortcut.scanFrameShowSate ? state.shortcut.scanFrameTextState = t('public.gdtc') : state.shortcut.scanFrameTextState = t('public.yctc')
|
||||
if(isWarehouseAndLocationState()){
|
||||
if (!state.shortcut.scanFrameShowSate) {
|
||||
if (state.shortcut.warehouseStr == '' && state.NoLocationList) {
|
||||
state.shortcut.scanFrameShowSate = true
|
||||
uni.$u.toast(t('public.qxzcw'))
|
||||
} else if (state.shortcut.warehouseStr !== '' && state.NoLocationList && state.shortcut.locationStr === '') {
|
||||
state.shortcut.scanFrameShowSate = true
|
||||
uni.$u.toast(t('public.qxzcw'))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,10 +184,10 @@
|
||||
if (state.warehouseData.FIsOpenLocation) {
|
||||
state.location = true
|
||||
} else {
|
||||
uni.$u.toast('仓库未启用')
|
||||
uni.$u.toast(t('public.cwwqy'))
|
||||
}
|
||||
} else {
|
||||
uni.$u.toast('请选择仓库')
|
||||
uni.$u.toast(t('public.qxzcw'))
|
||||
}
|
||||
}
|
||||
const locationClosefun = () => {
|
||||
@@ -174,7 +195,7 @@
|
||||
}
|
||||
const locationDataFun = (item : any) => {
|
||||
state.locationData = item
|
||||
state.shortcut.locationStr = formatLangTextValue(item.FlexEntryId.Name)
|
||||
state.shortcut.locationStr = item.FFlexValueName
|
||||
state.location = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user