|
@@ -927,7 +927,7 @@ export default {
|
|
|
async openPort() {
|
|
|
console.log('openPort', navigator)
|
|
|
if ('serial' in navigator) {
|
|
|
- if (!this.$store.state.app.reader) {
|
|
|
+ // if (!this.$store.state.app.reader) {
|
|
|
// The Web Serial API is supported.
|
|
|
console.log('the Web Serial API is supported.')
|
|
|
console.log(this.param)
|
|
@@ -939,10 +939,10 @@ export default {
|
|
|
console.log('beforeReader', port)
|
|
|
console.log('beforeReader', this.reader)
|
|
|
this.$store.dispatch('app/setReader', this.reader)
|
|
|
- } else {
|
|
|
- console.log('afterport', this.$store.state.app.reader)
|
|
|
- this.reader = this.$store.state.app.reader
|
|
|
- }
|
|
|
+ // } else {
|
|
|
+ // console.log('afterport', this.$store.state.app.reader)
|
|
|
+ // this.reader = this.$store.state.app.reader
|
|
|
+ // }
|
|
|
// 监听来自串行设备的数据
|
|
|
while (true) {
|
|
|
const { value, done } = await this.reader.read()
|
|
@@ -1188,9 +1188,9 @@ export default {
|
|
|
//提交按钮
|
|
|
submit() {
|
|
|
|
|
|
- // if(this.reader){
|
|
|
- // this.reader.cancel()
|
|
|
- // }
|
|
|
+ if(this.reader){
|
|
|
+ this.reader.cancel()
|
|
|
+ }
|
|
|
if (!this.deptBudgetList.goodsName) {
|
|
|
this.$message({
|
|
|
message: '货名不能为空',
|
|
@@ -1770,9 +1770,9 @@ export default {
|
|
|
// this.deptBudgetList.netWeight = Math.round(this.dataList.netWeight*1000)
|
|
|
// this.deptBudgetList.pureWeight = Math.round(this.dataList.pureWeight*1000)
|
|
|
// this.deptBudgetList.deductionWeight = Math.round(this.dataList.deductionWeight*1000)
|
|
|
- // if (this.reader) {
|
|
|
- // this.reader.cancel()
|
|
|
- // }
|
|
|
+ if (this.reader) {
|
|
|
+ this.reader.cancel()
|
|
|
+ }
|
|
|
this.$message.success('添加成功')
|
|
|
this.$router.push({
|
|
|
path: 'warehouseManagementList',
|
|
@@ -1807,9 +1807,9 @@ export default {
|
|
|
},
|
|
|
temporaryStorage() {
|
|
|
|
|
|
- // if(this.reader){
|
|
|
- // this.reader.cancel()
|
|
|
- // }
|
|
|
+ if(this.reader){
|
|
|
+ this.reader.cancel()
|
|
|
+ }
|
|
|
if (!this.deptBudgetList.goodsName) {
|
|
|
this.$message({
|
|
|
message: '货名不能为空',
|
|
@@ -2304,9 +2304,9 @@ export default {
|
|
|
addstorageputList(this.deptBudgetList)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
- // if (this.reader) {
|
|
|
- // this.reader.cancel()
|
|
|
- // }
|
|
|
+ if (this.reader) {
|
|
|
+ this.reader.cancel()
|
|
|
+ }
|
|
|
this.$message.success('保存成功')
|
|
|
this.$router.push({
|
|
|
path: 'warehouseManagementList',
|