You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
6.0 KiB

<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
校验客户标签
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="" style="position: relative">
<win-com-scan ref="comscanFgLabel" placeholder="WMS制品标签" @getResult="getScanFgResult"
:isShowHistory="false" :clearResult="false" :headerType="headerType"></win-com-scan>
<view class="uni-flex"
style="position: absolute; color: #3C9CFF; font-weight: bold; font-size: 15px; left: 10px;bottom:10px; z-index: 999;">
{{itemCode}}
</view>
</view>
<view class="">
<win-com-scan-customer-label ref="comscanCustomerLabel" placeholder="客户标签"
@getResult="getScanCustomerResult" :isShowHistory="false" :clearResult="false"
:headerType="headerType"></win-com-scan-customer-label>
</view>
</view>
</view>
</uni-popup>
</view>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import winComScanCustomerLabel from '@/mycomponents/scan/winComScanCustomerLabel.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getBalanceByManagementPrecision,
} from '@/common/balance.js';
import {
getBasicLocationByCode,
} from '@/api/request2.js';
import {
getListLocationAreaTypeDesc,
checkDirectoryItemExist,
getDirectoryItemArray,
getLocationAreaTypeName,
getInventoryStatusDesc
} from '@/common/directory.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close", "getCountScanResult"],
components: {
winComScan,
winComScanCustomerLabel
},
props: {
title: {
type: String,
default: '箱标签'
},
headerType: {
type: String,
default: "HPQ,HMQ"
},
},
data() {
return {
scanResult: {},
show: false,
scanList: [],
expand: false,
showScanResult: {},
expendIcon: 'arrow-down',
fromLocationCode: '',
fromLocation: '',
fromLocationList: [],
fromLocationAreaTypeList: [],
locationOnFocus: false,
businessType: {},
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses: "",
isCheck: false,
itemCode: '',
customerItem: null
}
},
created() {
},
methods: {
//直接扫描
openScanPopupForType(fromLocationCode, businessType) {
this.businessType = businessType;
this.fromLocationCode = fromLocationCode;
if (fromLocationCode != '') {
this.packGetFocus();
} else {
this.locationGetFocus();
}
this.fromInventoryStatuses = this.businessType.outInventoryStatuses
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //出库库区
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
},
//在任务中扫描
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) {
this.fromLocationCode = fromLocationCode;
this.fromLocationList = fromLocationList;
if (fromLocationCode != '') {
this.packGetFocus();
} else {
if (this.fromLocationList.length == 0) {
this.locationGetFocus();
} else {
this.fromLocationCode = this.fromLocationList[0];
}
}
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
this.fromInventoryStatuses = jobContent.outInventoryStatuses
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态
},
closeScanPopup(content) {
this.$refs.popup.close();
this.$emit("close", '');
},
getScanFgResult(result) {
this.itemCode = result.label.itemCode;
var filters = []
filters.push({
column: "customerCode",
action: "==",
value: '20001004'
})
filters.push({
column: "itemCode",
action: "==",
value: this.itemCode
})
var params = {
filters: filters,
pageNo: this.pageCurrent,
pageSize: this.pageSize,
}
getCustomerItemList(params).then(res => {
if (res.data != null && res.data.list.length > 0) {
this.customerItem = res.data.list[0];
} else {
this.showErrorMessage('未查找到客户物料代码');
}
}).catch(error => {
this.showErrorMessage(error);
})
this.customerGetFocus();
},
getScanCustomerResult(result) {
if (this.customerItem != null) {
1 year ago
// if(this.customerItem
// )
}
},
afterCheck() {
},
packGetFocus() {
if (this.$refs.comscanFgLabel != undefined) {
this.$refs.comscanFgLabel.getfocus();
}
},
packLoseFocus() {
if (this.$refs.comscanFgLabel != undefined) {
this.$refs.comscanFgLabel.losefocus();
}
},
customerGetFocus() {
if (this.$refs.comscanCustomerLabel != undefined) {
this.$refs.comscanCustomerLabel.getfocus();
}
},
customerLoseFocus() {
if (this.$refs.comscanCustomerLabel != undefined) {
this.$refs.comscanCustomerLabel.losefocus();
}
},
locationGetFocus() {
this.fromLocationCode = '';
this.locationOnFocus = true;
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback)
})
}
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>