|
@@ -642,6 +642,7 @@ export default {
|
|
|
},
|
|
|
accessoryTFs: false,
|
|
|
allowEdit: true,
|
|
|
+ param: 9600,
|
|
|
information:''
|
|
|
}
|
|
|
},
|
|
@@ -712,22 +713,73 @@ export default {
|
|
|
// var receData = HexConvert.ByteToString(value);
|
|
|
// console.log("receData",receData);
|
|
|
var flag = false;
|
|
|
- for (var i = 0; i < value.length; i++) {
|
|
|
- var tmp = String.fromCharCode(value[i])
|
|
|
- if (tmp == '+') {
|
|
|
+ // for (var i = 0; i < value.length; i++) {
|
|
|
+ // var tmp = String.fromCharCode(value[i])
|
|
|
+ // if (tmp == '+') {
|
|
|
+ // flag = true
|
|
|
+ // }
|
|
|
+ // if (flag && result.length < 6 && tmp != '+') {
|
|
|
+ // result += tmp
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (this.information != '毛重检斤') {
|
|
|
+ // if(parseInt(result)){
|
|
|
+ // this.deptBudgetList.grossWeight = parseInt(result)
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if(parseInt(result)){
|
|
|
+ // this.deptBudgetList.tare = parseInt(result)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ console.log('value:',value);
|
|
|
+
|
|
|
+ if(this.warehouseName&&this.warehouseName == '山东诸城迈饶库'){
|
|
|
+ for (var i = 0; i < value.length; i++) {
|
|
|
+ var tmp = String.fromCharCode(value[i])
|
|
|
+ if (tmp == '+') {
|
|
|
flag = true
|
|
|
- }
|
|
|
- if (flag && result.length < 6 && tmp != '+') {
|
|
|
+ }
|
|
|
+ if (flag && result.length < 6 && tmp != '+') {
|
|
|
result += tmp
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.information != '毛重检斤') {
|
|
|
+ if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ this.deptBudgetList.grossWeight = parseInt(result)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ this.deptBudgetList.tare = parseInt(result)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (this.information != '毛重检斤') {
|
|
|
- if(parseInt(result)){
|
|
|
- this.deptBudgetList.grossWeight = parseInt(result)
|
|
|
+ else{
|
|
|
+ for(var i=0;i<value.length;i++){
|
|
|
+ var tmp = String.fromCharCode(value[i])
|
|
|
+ if(value[0] != 49 && value[0] != 2){
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if (tmp == String.fromCharCode(32) ) {
|
|
|
+ flag = true
|
|
|
+ }
|
|
|
+ if (flag && result.length < 7 && tmp != String.fromCharCode(32)) {
|
|
|
+ // if(i-1 >=0 &&tmp == String.fromCharCode(48) && value[i-1] == 32){
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // if(i-2 >=0 &&tmp == String.fromCharCode(48) && value[i-2] == 32){
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ result += tmp
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- if(parseInt(result)){
|
|
|
- this.deptBudgetList.tare = parseInt(result)
|
|
|
+ if (this.information != '毛重检斤') {
|
|
|
+ if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ this.deptBudgetList.grossWeight = parseInt(result)*100
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ this.deptBudgetList.tare = parseInt(result)*100
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
setTimeout(1000)
|