2/21 优化1.1

20240912_adapter
wangwei 7 months ago
parent da9072ffcb
commit 7fbb42d160

@ -39,11 +39,11 @@
<!-- v-show="isLinkDisabled"-->
<!--&gt;选入已完成单据-->
<!--</el-button>-->
<el-button size="mini" type="primary" @click.native="chooseDraftOrder()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" v-show="isLinkDisabled "
:disabled="splitType=='out' && redMesg"
>选入单据
</el-button>
<!--<el-button size="mini" type="primary" @click.native="chooseDraftOrder()" :loading="submitLoading"-->
<!-- style="margin-right: 8px;border-radius: 5%;" v-show="isLinkDisabled "-->
<!-- :disabled="splitType=='out' && redMesg"-->
<!--&gt;选入单据-->
<!--</el-button>-->
<!--<el-button size="mini" type="primary" @click.native="delOrder()" :loading="submitLoading"-->
<!-- style="margin-right: 8px;border-radius: 5%;" v-show="isLinkDisabled"-->
<!-- :disabled="orderFormData.billNo == null && curQueueName == '' "-->

@ -22,13 +22,15 @@
style="display: flex; margin-top: 5px; float: right"
>
<el-button size="mini" type="primary" @click.native="paizhao()"
v-if="collectSet.autoDecode == 0" style="margin-right: 8px;border-radius: 5%;"
v-if="collectSet != null && collectSet.autoDecode == 0" style="margin-right: 8px;border-radius: 5%;"
>拍照解码
</el-button>
<el-button size="mini" type="primary" @click.native="fallbackCode()" :disabled="redMeg" style="margin-right: 8px;border-radius: 5%;"
<el-button size="mini" type="primary" @click.native="fallbackCode()" :disabled="redMeg"
style="margin-right: 8px;border-radius: 5%;"
>回退
</el-button>
<el-button size="mini" type="primary" :disabled="redMeg" style="margin-right: 8px;border-radius: 5%;"
<el-button size="mini" type="primary" @click.native="dropCode()" :disabled="redMeg"
style="margin-right: 8px;border-radius: 5%;"
>放弃
</el-button>
@ -305,7 +307,7 @@ export default {
valiCodes: [],
//weksolket
sitcomScan: false,
sictomText: '',
sictomText: ''
}
},
methods: {
@ -563,6 +565,7 @@ export default {
this.splitCodeQuery.relId = this.curQueue.relId
this.getCodes()
this.getSplitCodes()
this.selectSysParam()
} else {
this.init()
this.$message.error(response.message)
@ -642,14 +645,37 @@ export default {
})
})
},
paizhao(){
dropCode() {
this.redMeg = true
this.curQueueName = '',
this.isCheckQueue = false
this.curQueue = null
this.queueCodes = []
this.splitCodes = []
this.queueQuery = {
page: 1,
limit: 10,
relId: '',
action: ''
}
this.splitCodeQuery = {
page: 1,
limit: 10,
relId: ''
}
this.splitCodeTotal = 0
this.queueCodeTotal = 0
this.collectSet = null
},
paizhao() {
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
// const data = JSON.stringify({ action: "subscribe", channel: "updates" }); //
var sendData = "ManualClick=1"
this.ws.send(sendData); //
console.log("Data sent:", sendData);
var sendData = 'ManualClick=1'
this.ws.send(sendData) //
console.log('Data sent:', sendData)
} else {
console.error("WebSocket is not connected.");
console.error('WebSocket is not connected.')
}
},
init() {
@ -676,17 +702,17 @@ export default {
getSet().then((response) => {
if (response.code == 20000) {
this.collectSet = response.data
console.log("高拍仪设置" ,this.collectSet)
console.log('高拍仪设置', this.collectSet)
}
})
},
//
getDMHotskeyValue(str) {
console.log(str)
if (str.includes("DMQ")) {
if (str.includes('DMQ')) {
if (!isBlank(this.curQueueName)) {
this.scanCode = ''
return this.$message.warning("当前已录入槽位")
return this.$message.warning('当前已录入槽位')
}
let query = {
code: this.scanCode
@ -697,33 +723,33 @@ export default {
}
this.handleSlotCodeScan()
return true
}else if (str.includes("DMOENTER")) {
} else if (str.includes('DMOENTER')) {
return true
}else if (str.includes("DMOCANCEL")) {
} else if (str.includes('DMOCANCEL')) {
return true
}else if (str.includes("DMODEL")) {
} else if (str.includes('DMODEL')) {
return true
}
return false
},
handleScanComplete(fullScanData) {
if (!this.curQueue.code) {
if (fullScanData != null && fullScanData[0].includes("DMQ")) {
if (fullScanData != null && fullScanData[0].includes('DMQ')) {
this.getDMHotskeyValue(fullScanData[0])
return;
return
}
} else if (this.curQueue.code != null) {
if (fullScanData != null && fullScanData[0].includes("DMQ")) {
this.$message.warning('已绑定取货槽,请勿重复绑定!');
return;
if (fullScanData != null && fullScanData[0].includes('DMQ')) {
this.$message.warning('已绑定取货槽,请勿重复绑定!')
return
}
}
const verify = this.verifyScanCount(fullScanData)
if (verify){
let params = {
codeList: fullScanData
}
this.batchVailCode(params)
if (verify) {
let params = {
codeList: fullScanData
}
this.batchVailCode(params)
}
},
handleRecCodesEvent(event) {
@ -744,10 +770,10 @@ export default {
const SCAN_TIMEOUT = 1000 // 1
const self = this
console.log('启用监听')
this.ws.onmessage = function (event) {
this.ws.onmessage = function(event) {
let scanData = event.data //
let currentTime = Date.now()
console.log(scanData + "33333")
console.log(scanData + '33333')
//
if (currentTime - lastScanTime > SCAN_TIMEOUT) {
//
@ -780,7 +806,7 @@ export default {
if (this.ws == null || this.ws.readyState === WebSocket.CLOSED) {
this.ws = new WebSocket('ws://127.0.0.1:9988')
const self = this
this.ws.onopen = function (evt) {
this.ws.onopen = function(evt) {
console.log('工位剔除WebSocket 连接中 ...')
self.socketListener()
}
@ -791,7 +817,7 @@ export default {
console.log('关闭工位剔除websocket成功')
}
}
},
}
},
computed: {
//
@ -861,7 +887,7 @@ export default {
},
created() {
this.workplaceId = this.$route.query.workplaceId
this.selectSysParam()
// this.selectSysParam()
},
beforeDestroy() {
window.removeEventListener('gwsh', this.handleRecCodesEvent)

Loading…
Cancel
Save