Browse Source

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

hella_online_20240829
wangyufei 3 months ago
parent
commit
5ae6174b2a
  1. 1
      src/api/httpRequest3.js
  2. 21
      src/mycomponents/scan/winScanLocation.vue
  3. 1023
      src/mycomponents/scan/winScanPackAndLocation.vue
  4. 22
      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 { }else {
if(res.data.code==401){ if(res.data.code==401){
uni.clearStorageSync() uni.clearStorageSync()
uni.removeStorageSync('overPackageRecord') // 删除直接翻包中缓存的来源库位
removeToken(); removeToken();
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/index' url: '/pages/login/index'

21
src/mycomponents/scan/winScanLocation.vue

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

1023
src/mycomponents/scan/winScanPackAndLocation.vue

File diff suppressed because it is too large

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

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

1
src/store/modules/user.js

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

Loading…
Cancel
Save