|
@@ -1,5 +1,9 @@
|
|
|
<template>
|
|
|
<div class="content">
|
|
|
+ <el-radio-group v-if="deptBudgetList.warehouseName=='榆树库'" @change="radiochange" v-model="radio">
|
|
|
+ <el-radio :label="1">大秤</el-radio>
|
|
|
+ <el-radio :label="2">小秤</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
<div class="title" v-if="information.indexOf('毛重') > -1">毛重</div>
|
|
|
<div class="title" v-else>皮重</div>
|
|
|
<div class="contentInfo">
|
|
@@ -21,7 +25,8 @@ export default {
|
|
|
return {
|
|
|
param: 9600,
|
|
|
grossWeightVal: '',
|
|
|
- tareVal: ''
|
|
|
+ tareVal: '',
|
|
|
+ radio:1
|
|
|
}
|
|
|
},
|
|
|
activated() {},
|
|
@@ -43,14 +48,23 @@ export default {
|
|
|
this.$emit('balanceListen', this.tareVal)
|
|
|
}
|
|
|
},
|
|
|
+ radiochange(e){
|
|
|
+ console.log(e)
|
|
|
+ localStorage.setItem('balanceStatus',e)
|
|
|
+ this.openPort()
|
|
|
+ },
|
|
|
async closePort() {
|
|
|
console.log('closePort')
|
|
|
this.reader.cancel()
|
|
|
},
|
|
|
async openPort() {
|
|
|
+ console.log(localStorage.getItem('balanceStatus'),this.deptBudgetList.warehouseName)
|
|
|
console.log('openPort', navigator)
|
|
|
if ('serial' in navigator) {
|
|
|
if (!this.$store.state.app.reader) {
|
|
|
+ if(localStorage.getItem('balanceStatus')){
|
|
|
+ this.radio=localStorage.getItem('balanceStatus')
|
|
|
+ }
|
|
|
// The Web Serial API is supported.
|
|
|
console.log('the Web Serial API is supported.')
|
|
|
const port = await navigator.serial.requestPort()
|
|
@@ -66,6 +80,8 @@ export default {
|
|
|
this.param = 2400
|
|
|
} else if(this.deptBudgetList.warehouseName == '大庆朝阳沟库' ){
|
|
|
this.param = 4800
|
|
|
+ }else if(this.deptBudgetList.warehouseName == '榆树库' &&this.radio==2){
|
|
|
+ this.param = 1200
|
|
|
} else {
|
|
|
this.param = 9600
|
|
|
}
|
|
@@ -323,6 +339,20 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+/deep/.el-radio-group{
|
|
|
+ position:absolute;
|
|
|
+ top:29px;
|
|
|
+}
|
|
|
+/deep/.el-radio{
|
|
|
+ color:#fff;
|
|
|
+}
|
|
|
+/deep/.el-radio__input.is-checked+.el-radio__label{
|
|
|
+ color:#2aff7c;
|
|
|
+}
|
|
|
+/deep/.el-radio__input.is-checked .el-radio__inner {
|
|
|
+ background: #2aff7c !important;
|
|
|
+ border-color: #2aff7c !important;
|
|
|
+}
|
|
|
.content {
|
|
|
height: 350px;
|
|
|
position: relative;
|