Browse Source

直接翻包--缓存库位功能

hella_online_20240829
wangyufei 3 months ago
parent
commit
5ae6174b2a
  1. 1
      src/api/httpRequest3.js
  2. 15
      src/mycomponents/scan/winScanLocation.vue
  3. 19
      src/mycomponents/scan/winScanPackAndLocation.vue
  4. 18
      src/pages/package/record/overPackageRecord.vue
  5. 1
      src/store/modules/user.js

1
src/api/httpRequest3.js

@ -36,6 +36,7 @@ function service(options = {}) {
}else {
if(res.data.code==401){
uni.clearStorageSync()
uni.removeStorageSync('overPackageRecord') // 删除直接翻包中缓存的来源库位
removeToken();
uni.reLaunch({
url: '/pages/login/index'

15
src/mycomponents/scan/winScanLocation.vue

@ -19,6 +19,8 @@
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :clearResult="true" :boxFocus="true" :isShowHistory="false" headerType=""></win-com-scan>
<comMessage ref="comMessage"></comMessage>
</template>
@ -67,8 +69,15 @@
this.$refs.popup.open('bottom')
}, 500)
},
openScanPopupSimulate(location) {
this.$refs.comscansimulate.setItemCodeSimulate(location)
this.$refs.comscansimulate.clickScanMsg();
},
closeScanPopup() {
if(this.$refs.popup){
this.$refs.popup.close()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
@ -77,6 +86,7 @@
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
@ -94,6 +104,7 @@
}
getBasicLocationByCode(this.code).then(res => {
uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
@ -142,10 +153,14 @@
return isPass
},
getfocus() {
if(this.$refs.scan){
this.$refs.scan.getfocus();
}
},
losefocus() {
if(this.$refs.scan){
this.$refs.scan.losefocus();
}
},
showErrorMessage(message) {
setTimeout(r => {

19
src/mycomponents/scan/winScanPackAndLocation.vue

@ -28,7 +28,7 @@
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
@confirm="handleConfirm" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">
@ -47,7 +47,8 @@
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="false" :clearResult="true"></win-com-scan>
</view>
<comMessage ref="comMessage"></comMessage>
@ -73,7 +74,7 @@
} from '@/common/directory.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close", "getCountScanResult"],
emits: ["getResult", "close", "getCountScanResult", "confirm"],
components: {
winComScan,
balanceSelect
@ -131,15 +132,20 @@
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses: "",
isCheck: false
isCheck: false,
}
},
created() {
},
methods: {
handleConfirm() {
this.$emit('confirm', this.fromLocationCode)
},
//
openScanPopupForType(fromLocationCode, businessType) {
this.businessType = businessType;
this.fromLocationCode = fromLocationCode;
if (fromLocationCode != '') {
@ -150,9 +156,11 @@
this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses)
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //
if (!this.show) {
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
}
},
//
@ -295,7 +303,8 @@
// mask: true
// })
// -- fromInventoryStatuses
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.balanceFromInventoryStatuses?this.fromInventoryStatuses:undefined,
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this
.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined,
res => {
uni.hideLoading();
if (res.success) {

18
src/pages/package/record/overPackageRecord.vue

@ -60,7 +60,7 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false">
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="true" @confirm="handleConfirm">
</win-scan-pack-and-location >
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
@ -139,7 +139,7 @@
itemCode: ""
};
},
onLoad(option) {
onShow(){
var typeCode = "OverPackage"
getBusinessType(typeCode, res => {
if (res.success) {
@ -209,7 +209,10 @@
this.toPackQty = pack.packQty;
this.toPackUnitShow = e[0].label
},
//
handleConfirm(fromLocationCode){
this.$refs.scanLocationCode.openScanPopupSimulate(fromLocationCode)
},
getScanResult(result) {
let balance = result.balance;
let label = result.label;
@ -289,7 +292,13 @@
},
showFromLocationPopup() {
this.$nextTick(() => {
let overPackageRecord = uni.getStorageSync('overPackageRecord')
if(overPackageRecord){
this.$refs.scanLocationCode.openScanPopupSimulate(overPackageRecord)
}else{
this.$refs.scanLocationCode.openScanPopup();
}
})
},
@ -429,6 +438,9 @@
this.scanPopupGetFocus();
},
getLocation(location, code) {
if(code){
uni.setStorageSync('overPackageRecord', code)
}
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {

1
src/store/modules/user.js

@ -118,6 +118,7 @@ const user = {
commit('SET_ID',[])
storage.removeStorage(storage.constant.token)
storage.clearStorage()
uni.removeStorageSync('overPackageRecord') // 删除直接翻包中缓存的来源库位
resolve()
}).catch(error => {
reject(error)

Loading…
Cancel
Save