高拍仪批量扫码问题

20240912_adapter
yewj 11 months ago
parent f6799b0b46
commit 7828bbf1aa

@ -6,7 +6,7 @@ ENV = 'development'
# 开发环境 # 开发环境
# VUE_APP_BASE_API = 'https://mudi.dsxyy.org/UDI_WMS_MC/' # VUE_APP_BASE_API = 'https://mudi.dsxyy.org/UDI_WMS_MC/'
VUE_APP_BASE_API = 'http://192.168.0.166:9991' VUE_APP_BASE_API = 'http://127.0.0.1:9991'
VUE_APP_SYNC_API ="http://127.0.0.1:10001" VUE_APP_SYNC_API ="http://127.0.0.1:10001"
# VUE_APP_BASE_API = 'http://dm.xmglxp.com:81/UDI_WMS_MC/' # VUE_APP_BASE_API = 'http://dm.xmglxp.com:81/UDI_WMS_MC/'
# 应用访问路径 例如使用前缀 /admin/ # 应用访问路径 例如使用前缀 /admin/

@ -26,7 +26,6 @@ export function deleteCodesTempById(query) {
} }
export function deleteCodesTempByCodes(query) { export function deleteCodesTempByCodes(query) {
return axios({ return axios({
url: "warehouse/inout/deleteCodesTempBycodes", url: "warehouse/inout/deleteCodesTempBycodes",

@ -347,31 +347,31 @@ import {
enterCodeWeb, submitAllocateBiz, rollbackWaitcheck, submitCodeResult, submitCheckResult, delmitBiz, enterCodeWeb, submitAllocateBiz, rollbackWaitcheck, submitCodeResult, submitCheckResult, delmitBiz,
batchVailCode, batchAddCode, batchAddCodeByOrderFinish, upProcessing, getProcessingOrder batchVailCode, batchAddCode, batchAddCodeByOrderFinish, upProcessing, getProcessingOrder
} from '@/api/inout/order' } from '@/api/inout/order'
import { filterSubAll, findByFrom, findInvByUser } from '@/api/system/invSubWarehouse' import {filterSubAll, findByFrom, findInvByUser} from '@/api/system/invSubWarehouse'
import { parseTime } from '@/utils/coTools' import {parseTime} from '@/utils/coTools'
import { getBasicUnitMaintains } from '@/api/basic/basicUnitMaintain' import {getBasicUnitMaintains} from '@/api/basic/basicUnitMaintain'
import editCodeDialog from '@/views/inout/DialogEditCode' import editCodeDialog from '@/views/inout/DialogEditCode'
import DialogCreateOrderSelect from '@/views/inout/DialogCreateOrderSelect' import DialogCreateOrderSelect from '@/views/inout/DialogCreateOrderSelect'
import { deleteCodesTempByCodes } from '@/api/inout/order' import {deleteCodesTempByCodes} from '@/api/inout/order'
import codesPanel from '@/views/collect/PanelCreateCodes' import codesPanel from '@/views/collect/PanelCreateCodes'
import codeDetailPanel from '@/views/collect/PanelCreateCodeDetail' import codeDetailPanel from '@/views/collect/PanelCreateCodeDetail'
import SelectCollectOrderEndDialog from '@/views/collect/SelectCollectOrderEndDialog' import SelectCollectOrderEndDialog from '@/views/collect/SelectCollectOrderEndDialog'
import A from '../../plugins/KeyScaner' import A from '../../plugins/KeyScaner'
import { findByInvUser, getBusTypeList } from '@/api/basic/busType' import {findByInvUser, getBusTypeList} from '@/api/basic/busType'
import { getInvSpaceList } from '@/api/inventory/invSpace' import {getInvSpaceList} from '@/api/inventory/invSpace'
import DialogSelectUnit from '@/views/inout/DialogSelectUnit' import DialogSelectUnit from '@/views/inout/DialogSelectUnit'
import selectRlDialog from '@/views/inout/DialogSelectRl' import selectRlDialog from '@/views/inout/DialogSelectRl'
import DialogSelectSpace from '@/views/inout/DialogSelectSpace' import DialogSelectSpace from '@/views/inout/DialogSelectSpace'
import { isBlank } from '@/utils/strUtil' import {isBlank} from '@/utils/strUtil'
import { filterNoPage, remoteFilter } from '@/api/basic/sicker/skPersonApi' import {filterNoPage, remoteFilter} from '@/api/basic/sicker/skPersonApi'
import dialogInvProduct from '@/views/inout/DialogSelectInvProduct' import dialogInvProduct from '@/views/inout/DialogSelectInvProduct'
import { printSplitLabel } from '@/api/collect/splitCreateOrder' import {printSplitLabel} from '@/api/collect/splitCreateOrder'
import chooseDraftOrderDialog from './chooseDraftOrderDialog' import chooseDraftOrderDialog from './chooseDraftOrderDialog'
import { getUserBindWork } from '@/api/basic/collectPoint/userWorkplace' import {getUserBindWork} from '@/api/basic/collectPoint/userWorkplace'
import { getWorkBindBusTypes } from '@/api/basic/workPlace/sysWorkplaceDocuments' import {getWorkBindBusTypes} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import { filterWorkOptimize } from '@/api/basic/workPlace/sysWorkplaceManage' import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage'
export default { export default {
name: 'ioCreateOrder', name: 'ioCreateOrder',
@ -529,16 +529,16 @@ export default {
formRules: { formRules: {
corpOrderId: [ corpOrderId: [
{ required: true, message: '请输入单据号', trigger: 'blur' } {required: true, message: '请输入单据号', trigger: 'blur'}
], ],
createTime: [ createTime: [
{ required: true, message: '请选择创建时间', trigger: 'blur' } {required: true, message: '请选择创建时间', trigger: 'blur'}
], ],
invCode: [ invCode: [
{ required: true, message: '请选择当前仓库', trigger: 'change' } {required: true, message: '请选择当前仓库', trigger: 'change'}
], ],
action: [ action: [
{ required: true, message: '请选择单据类型', trigger: 'change' } {required: true, message: '请选择单据类型', trigger: 'change'}
] ]
// acceptance: [ // acceptance: [
// {required: true, message: "", trigger: "blur"}, // {required: true, message: "", trigger: "blur"},
@ -1414,7 +1414,7 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
let query = { billNo: this.orderFormData.billNo } let query = {billNo: this.orderFormData.billNo}
this.retractLoading = true this.retractLoading = true
rollbackWaitcheck(query) rollbackWaitcheck(query)
.then((response) => { .then((response) => {
@ -1662,7 +1662,7 @@ export default {
} }
this.rowData.workPlaceCode = this.orderFormData.workPlaceCode this.rowData.workPlaceCode = this.orderFormData.workPlaceCode
this.rowData.fifoSplit = this.orderFormData.fifoSplit this.rowData.fifoSplit = this.orderFormData.fifoSplit
this.$router.push({ query: { ...this.$route.query, splitType: this.splitType }, path: this.$route.path }) this.$router.push({query: {...this.$route.query, splitType: this.splitType}, path: this.$route.path})
this.chooseDraftOrderVisible = true this.chooseDraftOrderVisible = true
}, },
closeChooseDialog() { closeChooseDialog() {
@ -1769,7 +1769,7 @@ export default {
if (this.scanStatus == 1) { if (this.scanStatus == 1) {
const codeArray = this.codeFormData.code.split(';') const codeArray = this.codeFormData.code.split(';')
let query = { let query = {
orderId : this.orderFormData.billNo, orderId: this.orderFormData.billNo,
codeList: codeArray codeList: codeArray
} }
// //
@ -1836,7 +1836,7 @@ export default {
} }
}, },
removeCodesTemp(query){ removeCodesTemp(query) {
//todo this.codeArray id deleteCodesTempById //todo this.codeArray id deleteCodesTempById
deleteCodesTempByCodes(query).then(res => { deleteCodesTempByCodes(query).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
@ -1860,14 +1860,6 @@ export default {
this.$refs.multipleTable.clearSelection() this.$refs.multipleTable.clearSelection()
this.$refs.multipleTable.toggleAllSelection() this.$refs.multipleTable.toggleAllSelection()
}, },
handleSizeChange(val) {
this.query.limit = val
this.getCodeList()
},
handleCurrentChange(val) {
this.query.page = val
this.getCodeList()
},
intentBack() { intentBack() {
this.$router.go(-1) this.$router.go(-1)
@ -1962,7 +1954,7 @@ export default {
const binaryData = [] const binaryData = []
binaryData.push(response) binaryData.push(response)
let url = window.URL.createObjectURL( let url = window.URL.createObjectURL(
new Blob(binaryData, { type: 'application/pdf' }) new Blob(binaryData, {type: 'application/pdf'})
) )
window.open(url) window.open(url)
}).catch(() => { }).catch(() => {
@ -2072,7 +2064,7 @@ export default {
if (this.scanStatus == 1) { if (this.scanStatus == 1) {
const codeArray = this.codeFormData.code.split(';') const codeArray = this.codeFormData.code.split(';')
let query = { let query = {
orderId : this.orderFormData.billNo, orderId: this.orderFormData.billNo,
codeList: codeArray codeList: codeArray
} }
// //
@ -2143,7 +2135,7 @@ export default {
this.successVisible = true this.successVisible = true
this.result = this.result + ';' + vailCodeResultResponses[i].code this.result = this.result + ';' + vailCodeResultResponses[i].code
} else if (data.status == 2) { } else if (data.status == 2) {
if (this.result == ''){ if (this.result == '') {
this.successVisible = false this.successVisible = false
} }
this.warnResult = this.warnResult + '\n' + vailCodeResultResponses[i].code + ':' + vailCodeResultResponses[i].errMsg this.warnResult = this.warnResult + '\n' + vailCodeResultResponses[i].code + ':' + vailCodeResultResponses[i].errMsg
@ -2178,10 +2170,19 @@ export default {
}, },
handleScanComplete(fullScanData) { handleScanComplete(fullScanData) {
console.log('接收 recCodes event:', fullScanData.join(';')) console.log('接收 recCodes event:', fullScanData.join(';'))
let params = { if (this.scanStatus == 1) {
codeList: fullScanData let query = {
orderId: this.orderFormData.billNo,
codeList: fullScanData
}
//
this.removeCodesTemp(query)
} else {
let params = {
codeList: fullScanData
}
this.batchVailCode(params)
} }
this.batchVailCode(params)
}, },
socketListener() { socketListener() {
@ -2191,7 +2192,7 @@ export default {
const SCAN_TIMEOUT = 1000 // 1 const SCAN_TIMEOUT = 1000 // 1
const self = this const self = this
console.log('启用监听') console.log('启用监听')
this.ws.onmessage = function(event) { this.ws.onmessage = function (event) {
let scanData = event.data // let scanData = event.data //
let currentTime = Date.now() let currentTime = Date.now()
console.log(scanData) console.log(scanData)
@ -2227,11 +2228,10 @@ export default {
if (this.ws == null || this.ws.readyState === WebSocket.CLOSED) { if (this.ws == null || this.ws.readyState === WebSocket.CLOSED) {
this.ws = new WebSocket('ws://127.0.0.1:9988') this.ws = new WebSocket('ws://127.0.0.1:9988')
const self = this const self = this
this.ws.onopen = function(evt) { this.ws.onopen = function (evt) {
console.log('工位上货WebSocket 连接中 ...') console.log('工位上货WebSocket 连接中 ...')
self.socketListener() self.socketListener()
} }
} }
} else { } else {
if (this.ws && this.ws.readyState === WebSocket.OPEN) { if (this.ws && this.ws.readyState === WebSocket.OPEN) {
@ -2240,20 +2240,20 @@ export default {
} }
} }
}, },
handleCodeArray(codeArray){ handleCodeArray(codeArray) {
this.codeArray = codeArray; this.codeArray = codeArray;
} }
}, },
filters: {}, filters: {},
mounted() { mounted() {
document.body.ondrop = function(event) { document.body.ondrop = function (event) {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
} }
var that = this var that = this
var inputer = document.getElementById('inputer') var inputer = document.getElementById('inputer')
window.sc = new A.KeyScaner(inputer) //DOM window.sc = new A.KeyScaner(inputer) //DOM
sc.onInput = function(text) { sc.onInput = function (text) {
if (text.includes('delete')) { if (text.includes('delete')) {
that.codeFormData.code = '' that.codeFormData.code = ''
that.sictomText = '' that.sictomText = ''
@ -2278,27 +2278,13 @@ export default {
window.addEventListener('gwsh', this.handleRecCodesEvent) window.addEventListener('gwsh', this.handleRecCodesEvent)
} }
document.addEventListener('visibilitychange', this.handleVisibilityChange) document.addEventListener('visibilitychange', this.handleVisibilityChange)
// window.addEventListener('storage', (event) => { this.handleVisibilityChange()
// console.log("websocket")
// if (this.ws && this.ws.readyState === WebSocket.OPEN) {
// this.ws.close();
// console.log("websocket")
// } else {
// if (!this.ws) {
// this.ws = new WebSocket("ws://127.0.0.1:9988");
// this.ws.onopen = function (evt) {
// console.log("WebSocket ...");
// };
// this.socketListener()
// }
// }
// });
// window.dispatchEvent(new CustomEvent('storage', null));
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('gwsh', this.handleRecCodesEvent) window.removeEventListener('gwsh', this.handleRecCodesEvent)
this.ws.close() this.ws.close()
this.ws.onclose = function(evt) { this.ws.onclose = function (evt) {
console.log('工位上货Connection closed.') console.log('工位上货Connection closed.')
} }
document.removeEventListener('visibilitychange', this.handleVisibilityChange) document.removeEventListener('visibilitychange', this.handleVisibilityChange)

Loading…
Cancel
Save