|
@@ -58,15 +58,22 @@ export default {
|
|
if (!this.$store.state.app.reader) {
|
|
if (!this.$store.state.app.reader) {
|
|
// The Web Serial API is supported.
|
|
// The Web Serial API is supported.
|
|
console.log('the Web Serial API is supported.')
|
|
console.log('the Web Serial API is supported.')
|
|
- console.log(this.param)
|
|
|
|
const port = await navigator.serial.requestPort()
|
|
const port = await navigator.serial.requestPort()
|
|
|
|
+ debugger
|
|
|
|
+ if(this.deptBudgetList.warehouseName == '白城内陆港'){
|
|
|
|
+ this.param = 1200
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ this.param = 9600
|
|
|
|
+ }
|
|
|
|
+ console.log(this.param)
|
|
await port.open({
|
|
await port.open({
|
|
baudRate: this.param,
|
|
baudRate: this.param,
|
|
}) // set baud rate
|
|
}) // set baud rate
|
|
this.reader = port.readable.getReader()
|
|
this.reader = port.readable.getReader()
|
|
- console.log('beforeReader', port)
|
|
|
|
- console.log('beforeReader', this.reader)
|
|
|
|
|
|
+ console.log('port ', port)
|
|
this.$store.dispatch('app/setReader', this.reader)
|
|
this.$store.dispatch('app/setReader', this.reader)
|
|
|
|
+ console.log('reader ', this.reader)
|
|
} else {
|
|
} else {
|
|
console.log('afterport', this.$store.state.app.reader)
|
|
console.log('afterport', this.$store.state.app.reader)
|
|
this.reader = this.$store.state.app.reader
|
|
this.reader = this.$store.state.app.reader
|
|
@@ -105,14 +112,20 @@ export default {
|
|
// this.deptBudgetList.tare = parseInt(result)
|
|
// this.deptBudgetList.tare = parseInt(result)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
- console.log('value:', value)
|
|
|
|
|
|
+ if(value.length > 3){
|
|
|
|
+ console.log('value:', value)
|
|
|
|
+ }
|
|
|
|
+ else if(this.deptBudgetList.warehouseName == '白城内陆港'){
|
|
|
|
+ break
|
|
|
|
+ }
|
|
if (
|
|
if (
|
|
this.deptBudgetList.warehouseName &&
|
|
this.deptBudgetList.warehouseName &&
|
|
(this.deptBudgetList.warehouseName == '山东诸城迈饶库' ||
|
|
(this.deptBudgetList.warehouseName == '山东诸城迈饶库' ||
|
|
this.deptBudgetList.warehouseName == '克东千红库' ||
|
|
this.deptBudgetList.warehouseName == '克东千红库' ||
|
|
this.deptBudgetList.warehouseName == '鲅鱼圈祥腾库' ||
|
|
this.deptBudgetList.warehouseName == '鲅鱼圈祥腾库' ||
|
|
this.deptBudgetList.warehouseName == '哈尔滨依兰库'||
|
|
this.deptBudgetList.warehouseName == '哈尔滨依兰库'||
|
|
- this.deptBudgetList.warehouseName == '龙江金信库')
|
|
|
|
|
|
+ this.deptBudgetList.warehouseName == '龙江金信库'||
|
|
|
|
+ this.deptBudgetList.warehouseName == '白城内陆港')
|
|
) {
|
|
) {
|
|
|
|
|
|
for (var i = 0; i < value.length; i++) {
|
|
for (var i = 0; i < value.length; i++) {
|