|
@@ -5,7 +5,7 @@
|
|
<div class="title" v-else>皮重</div>
|
|
<div class="title" v-else>皮重</div>
|
|
<div class="number" v-if="information.indexOf('毛重') > -1">{{grossWeightVal}} kg</div>
|
|
<div class="number" v-if="information.indexOf('毛重') > -1">{{grossWeightVal}} kg</div>
|
|
<div class="number" v-else>{{tareVal}} KG</div>
|
|
<div class="number" v-else>{{tareVal}} KG</div>
|
|
-
|
|
|
|
|
|
+
|
|
<div class="btn" @click="sendVal">确定</div>
|
|
<div class="btn" @click="sendVal">确定</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -14,28 +14,34 @@
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'balanceAlert',
|
|
name: 'balanceAlert',
|
|
- props: ['deptBudgetList', 'information'],
|
|
|
|
|
|
+ props: ['deptBudgetList1', 'information'],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
param: 9600,
|
|
param: 9600,
|
|
grossWeightVal:'',
|
|
grossWeightVal:'',
|
|
- tareVal:''
|
|
|
|
|
|
+ tareVal:'',
|
|
|
|
+ deptBudgetList:this.deptBudgetList1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
activated(){
|
|
activated(){
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
|
|
+ mounted(){debugger
|
|
console.log('11111111111111111111111111111111111')
|
|
console.log('11111111111111111111111111111111111')
|
|
- console.log(this.deptBudgetList)
|
|
|
|
|
|
+ console.log(this.deptBudgetList1)
|
|
this.openPort()
|
|
this.openPort()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ deptBudgetList1: function (deptBudgetList1) {debugger
|
|
|
|
+ this.deptBudgetList = deptBudgetList1
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
sendVal(){
|
|
sendVal(){
|
|
console.log(this.grossWeightVal)
|
|
console.log(this.grossWeightVal)
|
|
@@ -45,7 +51,7 @@ export default {
|
|
}else{
|
|
}else{
|
|
this.$emit('balanceListen',this.tareVal)
|
|
this.$emit('balanceListen',this.tareVal)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
async closePort() {
|
|
async closePort() {
|
|
console.log('closePort')
|
|
console.log('closePort')
|
|
@@ -72,7 +78,7 @@ export default {
|
|
}
|
|
}
|
|
// 监听来自串行设备的数据
|
|
// 监听来自串行设备的数据
|
|
while (true) {
|
|
while (true) {
|
|
-
|
|
|
|
|
|
+
|
|
const { value, done } = await this.reader.read()
|
|
const { value, done } = await this.reader.read()
|
|
// console.log("value",value);
|
|
// console.log("value",value);
|
|
if (done) {
|
|
if (done) {
|
|
@@ -114,7 +120,7 @@ export default {
|
|
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++) {
|
|
var tmp = String.fromCharCode(value[i])
|
|
var tmp = String.fromCharCode(value[i])
|
|
if (tmp == '+') {
|
|
if (tmp == '+') {
|
|
@@ -161,7 +167,7 @@ export default {
|
|
if(value.length > 10){
|
|
if(value.length > 10){
|
|
for (var i = 0; i < value.length; i++) {
|
|
for (var i = 0; i < value.length; i++) {
|
|
var tmp = String.fromCharCode(value[i])
|
|
var tmp = String.fromCharCode(value[i])
|
|
-
|
|
|
|
|
|
+
|
|
// if (value[0] != 49 && value[0] != 2) {
|
|
// if (value[0] != 49 && value[0] != 2) {
|
|
// // if (
|
|
// // if (
|
|
// // value[value.length - 1] == 48 &&
|
|
// // value[value.length - 1] == 48 &&
|
|
@@ -187,7 +193,7 @@ export default {
|
|
if (
|
|
if (
|
|
flag &&
|
|
flag &&
|
|
result.length < 7 &&
|
|
result.length < 7 &&
|
|
- tmp != String.fromCharCode(32)
|
|
|
|
|
|
+ tmp != String.fromCharCode(32)
|
|
// &&
|
|
// &&
|
|
// !(
|
|
// !(
|
|
// value[value.length - 1] == 48 && value[value.length - 2] == 48
|
|
// value[value.length - 1] == 48 && value[value.length - 2] == 48
|
|
@@ -199,7 +205,7 @@ export default {
|
|
else{
|
|
else{
|
|
result += tmp
|
|
result += tmp
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
// if (flag1 && tmp != String.fromCharCode(32)) {
|
|
// if (flag1 && tmp != String.fromCharCode(32)) {
|
|
// // if (
|
|
// // if (
|
|
@@ -216,7 +222,7 @@ export default {
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (this.information.indexOf('毛重') > -1) {
|
|
if (this.information.indexOf('毛重') > -1) {
|
|
if (parseInt(result) || parseInt(result) == 0) {
|
|
if (parseInt(result) || parseInt(result) == 0) {
|
|
this.grossWeightVal = parseInt(
|
|
this.grossWeightVal = parseInt(
|