|
@@ -652,6 +652,9 @@ export default {
|
|
|
addressUrl:'',
|
|
|
warehouseInOutDetail: {},
|
|
|
deductionAmount:0,
|
|
|
+ deductionWeight:0,
|
|
|
+ grossWeight:0,
|
|
|
+ tare:0
|
|
|
},
|
|
|
historyList: [],
|
|
|
cost:'',
|
|
@@ -663,7 +666,8 @@ export default {
|
|
|
accessoryTFs: false,
|
|
|
allowEdit: true,
|
|
|
param: 9600,
|
|
|
- information:''
|
|
|
+ information:'',
|
|
|
+ result1 : '00'
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -738,6 +742,7 @@ export default {
|
|
|
// var receData = HexConvert.ByteToString(value);
|
|
|
// console.log("receData",receData);
|
|
|
var flag = false;
|
|
|
+ var flag1 = false;
|
|
|
// for (var i = 0; i < value.length; i++) {
|
|
|
// var tmp = String.fromCharCode(value[i])
|
|
|
// if (tmp == '+') {
|
|
@@ -757,18 +762,17 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
console.log('value:',value);
|
|
|
-
|
|
|
- if(this.warehouseName&&this.warehouseName == '山东诸城迈饶库'){
|
|
|
+ if(this.deptBudgetList.warehouseName&&(this.deptBudgetList.warehouseName == '山东诸城迈饶库'||this.deptBudgetList.warehouseName == '克东千红库')){
|
|
|
for (var i = 0; i < value.length; i++) {
|
|
|
var tmp = String.fromCharCode(value[i])
|
|
|
if (tmp == '+') {
|
|
|
- flag = true
|
|
|
+ flag = true
|
|
|
}
|
|
|
if (flag && result.length < 6 && tmp != '+') {
|
|
|
- result += tmp
|
|
|
+ result += tmp
|
|
|
}
|
|
|
}
|
|
|
- if (this.information != '毛重检斤') {
|
|
|
+ if (this.information == '毛重检斤') {
|
|
|
if(parseInt(result)|| parseInt(result) == 0){
|
|
|
this.deptBudgetList.grossWeight = parseInt(result)
|
|
|
}
|
|
@@ -781,29 +785,36 @@ export default {
|
|
|
else{
|
|
|
for(var i=0;i<value.length;i++){
|
|
|
var tmp = String.fromCharCode(value[i])
|
|
|
- if(value[0] != 49 && value[0] != 2){
|
|
|
- break
|
|
|
+
|
|
|
+ if((value[0] != 49 && value[0] != 2)){
|
|
|
+ if((value[value.length-1] == 48&&value[value.length-2] == 48)){
|
|
|
+ flag1 = true
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
if (tmp == String.fromCharCode(32) ) {
|
|
|
- flag = true
|
|
|
+ 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
|
|
|
+ if (flag && result.length < 7 && tmp != String.fromCharCode(32)&&!(value[value.length-1] == 48&&value[value.length-2] == 48)) {
|
|
|
+ result += tmp
|
|
|
+ }
|
|
|
+ if (flag1 && tmp != String.fromCharCode(32)) {
|
|
|
+ if((value[value.length-1] == 48&&value[value.length-2] == 48)){
|
|
|
+ if(i == 0 ){
|
|
|
+ this.result1 = tmp + '0'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (this.information != '毛重检斤') {
|
|
|
+ if (this.information == '毛重检斤') {
|
|
|
if(parseInt(result)|| parseInt(result) == 0){
|
|
|
- this.deptBudgetList.grossWeight = parseInt(result)*100
|
|
|
+ this.deptBudgetList.grossWeight = parseInt(result+this.result1)
|
|
|
}
|
|
|
} else {
|
|
|
if(parseInt(result)|| parseInt(result) == 0){
|
|
|
- this.deptBudgetList.tare = parseInt(result)*100
|
|
|
+ this.deptBudgetList.tare = parseInt(result+this.result1)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -881,7 +892,7 @@ export default {
|
|
|
for (let i = 0; i < this.tranCarInfoList.length; i++) {
|
|
|
if (this.tranCarInfoList[i].carNo == this.deptBudgetList.carNo) {
|
|
|
this.deptBudgetList.tranCarNo=this.tranCarInfoList[i].tranCarNo
|
|
|
- this.deptBudgetList.freight = this.tranCarInfoList[i].tranPrice
|
|
|
+ this.deptBudgetList.freight = Math.round(this.tranCarInfoList[i].tranPrice)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1195,13 +1206,13 @@ export default {
|
|
|
// })
|
|
|
// return
|
|
|
// }
|
|
|
- if (!this.deptBudgetList.addressUrl) {
|
|
|
- this.$message({
|
|
|
- message: '附件不能为空',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (!this.deptBudgetList.addressUrl) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '附件不能为空',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
//自检员
|
|
|
if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
|
|
|
if (
|
|
@@ -1398,7 +1409,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
console.log(this.deptBudgetList, '入库对象')
|
|
|
- this.deptBudgetList.id = this.$route.query.id
|
|
|
this.$confirm(`确定提交入库信息`, {
|
|
|
cancelButtonText: '取消',
|
|
|
confirmButtonText: '确定',
|
|
@@ -1412,15 +1422,36 @@ export default {
|
|
|
this.deptBudgetList.inOutFlag = 2
|
|
|
this.deptBudgetList.pcFlag = 1
|
|
|
this.deptBudgetList.statusFlag = 3
|
|
|
- his.deptBudgetList.grossWeight /= 1000
|
|
|
- this.deptBudgetList.tare /= 1000
|
|
|
- this.deptBudgetList.netWeight /= 1000
|
|
|
- this.deptBudgetList.pureWeight /= 1000
|
|
|
- this.deptBudgetList.deductionAmount *= 1000
|
|
|
- this.deptBudgetList.deductionWeight /= 1000
|
|
|
+ this.deptBudgetList.grossWeight = (this.deptBudgetList.grossWeight/1000).toFixed(2)
|
|
|
+ this.deptBudgetList.tare = (this.deptBudgetList.tare/1000).toFixed(2)
|
|
|
+ this.deptBudgetList.netWeight = (this.deptBudgetList.netWeight/1000).toFixed(2)
|
|
|
+ if(!this.deptBudgetList.pureWeight){
|
|
|
+ this.deptBudgetList.pureWeight = 0
|
|
|
+ }
|
|
|
+ this.deptBudgetList.pureWeight = (this.deptBudgetList.pureWeight/1000).toFixed(2)
|
|
|
+ if(!this.deptBudgetList.deductionWeight){
|
|
|
+ this.deptBudgetList.deductionWeight = 0
|
|
|
+ }
|
|
|
+ if(!this.deptBudgetList.deductionAmount){
|
|
|
+ this.deptBudgetList.deductionAmount = 0
|
|
|
+ }
|
|
|
+ this.deptBudgetList.deductionWeight = (this.deptBudgetList.deductionWeight/1000).toFixed(2)
|
|
|
+ this.deptBudgetList.deductionAmount = Math.round(this.deptBudgetList.deductionAmount*1000)
|
|
|
+
|
|
|
+ // this.deptBudgetList.grossWeight /= 1000
|
|
|
+ // this.deptBudgetList.tare /= 1000
|
|
|
+ // this.deptBudgetList.netWeight /= 1000
|
|
|
+ // this.deptBudgetList.pureWeight /= 1000
|
|
|
+ // this.deptBudgetList.deductionAmount *= 1000
|
|
|
+ // this.deptBudgetList.deductionWeight /= 1000
|
|
|
addstorageputList(this.deptBudgetList)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
+ // this.deptBudgetList.grossWeight = Math.round(this.dataList.grossWeight*1000)
|
|
|
+ // this.deptBudgetList.tare = Math.round(this.dataList.tare*1000)
|
|
|
+ // 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)
|
|
|
this.$message.success('添加成功')
|
|
|
this.$router.push({ path: 'warehouseManagementList' })
|
|
|
})
|