|
@@ -119,7 +119,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column property="carNumber" label="车牌号">
|
|
|
</el-table-column>
|
|
|
- <el-table-column property="status" label="状态">
|
|
|
+ <el-table-column property="status" label="状态">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div style="text-align: center">
|
|
@@ -236,12 +236,15 @@
|
|
|
warehouseName: '',
|
|
|
result1: '00',
|
|
|
allowEdit: 0,
|
|
|
- mListTop:[],
|
|
|
- mListBottom:[],
|
|
|
- pListTop:[],
|
|
|
- pListBottom:[]
|
|
|
+ mListTop: [],
|
|
|
+ mListBottom: [],
|
|
|
+ pListTop: [],
|
|
|
+ pListBottom: []
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.openPort()
|
|
|
+ },
|
|
|
activated() {
|
|
|
console.log(this.common.name)
|
|
|
this.cangid = this.$route.query.cangid
|
|
@@ -354,18 +357,18 @@
|
|
|
if (_list[i].status == '已质检') {
|
|
|
this.mListTop.push(_list[i])
|
|
|
}
|
|
|
- if (_list[i].status == '已称毛重') {
|
|
|
+ if (_list[i].status == '已称毛重') {
|
|
|
this.mListBottom.push(_list[i])
|
|
|
}
|
|
|
if (_list[i].status == '已称皮重') {
|
|
|
this.pListBottom.push(_list[i])
|
|
|
}
|
|
|
if (_list[i].status == '已称毛重') {
|
|
|
- this.pListTop.push(_list[i])
|
|
|
+ this.pListTop.push(_list[i])
|
|
|
}
|
|
|
}
|
|
|
- this.mList= this.mListTop.concat(this.mListBottom)
|
|
|
- this.pList= this.pListTop.concat(this.pListBottom)
|
|
|
+ this.mList = this.mListTop.concat(this.mListBottom)
|
|
|
+ this.pList = this.pListTop.concat(this.pListBottom)
|
|
|
if (this.information == '毛重') {
|
|
|
this.index = 0
|
|
|
this.carList = this.mList
|
|
@@ -433,10 +436,10 @@
|
|
|
}
|
|
|
},
|
|
|
tabClick(val) {
|
|
|
- this.mListTop=[]
|
|
|
- this.mListBottom=[]
|
|
|
- this.pListTop=[]
|
|
|
- this.pListBottom=[]
|
|
|
+ this.mListTop = []
|
|
|
+ this.mListBottom = []
|
|
|
+ this.pListTop = []
|
|
|
+ this.pListBottom = []
|
|
|
this.carWeightInfo.carNumber = ''
|
|
|
this.weighingList = []
|
|
|
this.index = val
|
|
@@ -469,17 +472,24 @@
|
|
|
}
|
|
|
},
|
|
|
async openPort() {
|
|
|
- console.log('openPort', navigator);
|
|
|
+ console.log('openPort', navigator)
|
|
|
if ('serial' in navigator) {
|
|
|
- // The Web Serial API is supported.
|
|
|
- console.log('the Web Serial API is supported.');
|
|
|
- console.log(this.param);
|
|
|
- const port = await navigator.serial.requestPort();
|
|
|
- await port.open({
|
|
|
- baudRate: this.param
|
|
|
- }); // set baud rate
|
|
|
- this.reader = port.readable.getReader();
|
|
|
-
|
|
|
+ if (!this.$store.state.app.reader) {
|
|
|
+ // The Web Serial API is supported.
|
|
|
+ console.log('the Web Serial API is supported.')
|
|
|
+ console.log(this.param)
|
|
|
+ const port = await navigator.serial.requestPort()
|
|
|
+ await port.open({
|
|
|
+ baudRate: this.param,
|
|
|
+ }) // set baud rate
|
|
|
+ this.reader = port.readable.getReader()
|
|
|
+ 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
|
|
|
+ }
|
|
|
// 监听来自串行设备的数据
|
|
|
while (true) {
|
|
|
const {
|
|
@@ -896,8 +906,9 @@
|
|
|
}
|
|
|
|
|
|
.substance {
|
|
|
- padding-bottom: 20px;
|
|
|
- overflow-y: scroll;
|
|
|
+ padding-bottom: 20px;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
.active {
|
|
|
background: #5878e8;
|
|
|
color: white;
|
|
@@ -1083,7 +1094,8 @@
|
|
|
width: 50%;
|
|
|
}
|
|
|
}
|
|
|
- .car-right{
|
|
|
+
|
|
|
+ .car-right {
|
|
|
width: 50%;
|
|
|
}
|
|
|
</style>
|