|
@@ -1189,69 +1189,91 @@
|
|
|
})
|
|
|
},
|
|
|
changeWeight(e) {
|
|
|
- //实际重量
|
|
|
- if(e == '0'){
|
|
|
+ //实际重量
|
|
|
+ if (e == '0') {
|
|
|
+ if (this.warehouseType == '1') {
|
|
|
getQualityReal({
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
warehouseName: this.warehouseInfo.warehouseName
|
|
|
})
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.totalReserves = response.warehouseNumViewList
|
|
|
- this.initCharts()
|
|
|
- })
|
|
|
- }else{
|
|
|
- getQualityZhe({
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.totalReserves = response.warehouseNumViewList
|
|
|
+ this.initCharts()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.getList1()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ getQualityZhe({
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
baseId: this.warehouseInfo.warehouseId
|
|
|
}).toPromise().then((response) => {
|
|
|
console.log(this.totalReserves)
|
|
|
this.totalMoney1 = 0
|
|
|
this.totalMoney2 = 0
|
|
|
- for (let j = 0; j < this.totalReserves.length; j++) {
|
|
|
- if (this.totalReserves[j].cost && this.totalReserves[j].stockNum) {
|
|
|
- if (this.totalReserves[j].goodsName.indexOf('玉米') != -1) {
|
|
|
- this.totalReserves[j].totalMoney1 = (Number(this.totalReserves[j].cost) * Number(this.totalReserves[j].stockNum)).toFixed(3)
|
|
|
- this.totalMoney1 = (Number(this.totalMoney1) + Number(this.totalReserves[j].totalMoney1)).toFixed(3)
|
|
|
- }
|
|
|
- else if (this.totalReserves[j].goodsName.indexOf('高粱') != -1) {
|
|
|
- this.totalReserves[j].totalMoney2 = (Number(this.totalReserves[j].cost) * Number(this.totalReserves[j].stockNum)).toFixed(3)
|
|
|
- this.totalMoney2 = (Number(this.totalMoney2) + Number(this.totalReserves[j].totalMoney2)).toFixed(3)
|
|
|
+ if (this.warehouseType == '1') {
|
|
|
+ for (let j = 0; j < this.totalReserves.length; j++) {
|
|
|
+ if (this.totalReserves[j].cost && this.totalReserves[j].stockNum) {
|
|
|
+ if (this.totalReserves[j].goodsName.indexOf('玉米') != -1) {
|
|
|
+ this.totalReserves[j].totalMoney1 = (Number(this.totalReserves[j].cost) * Number(this.totalReserves[j].stockNum)).toFixed(3)
|
|
|
+ this.totalMoney1 = (Number(this.totalMoney1) + Number(this.totalReserves[j].totalMoney1)).toFixed(3)
|
|
|
+ }
|
|
|
+ else if (this.totalReserves[j].goodsName.indexOf('高粱') != -1) {
|
|
|
+ this.totalReserves[j].totalMoney2 = (Number(this.totalReserves[j].cost) * Number(this.totalReserves[j].stockNum)).toFixed(3)
|
|
|
+ this.totalMoney2 = (Number(this.totalMoney2) + Number(this.totalReserves[j].totalMoney2)).toFixed(3)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- console.log(this.totalReserves)
|
|
|
- if (response.warehouseNumViewList.length != 0) {
|
|
|
- var result = []
|
|
|
+ console.log(this.totalReserves)
|
|
|
+ if (response.warehouseNumViewList.length != 0) {
|
|
|
+ var result = []
|
|
|
|
|
|
- for (let i = 0; i < response.warehouseNumViewList.length; i++) {
|
|
|
- let param = {}
|
|
|
- for (let num = 0; num < this.totalReserves.length; num++) {
|
|
|
- if (response.warehouseNumViewList[i].goodsName == this.totalReserves[num].goodsName
|
|
|
- && response.warehouseNumViewList[i].goodsName != '玉米'
|
|
|
- && response.warehouseNumViewList[i].goodsName != '高粱') {
|
|
|
- param.cost = this.totalReserves[num].cost
|
|
|
+ for (let i = 0; i < response.warehouseNumViewList.length; i++) {
|
|
|
+ let param = {}
|
|
|
+ for (let num = 0; num < this.totalReserves.length; num++) {
|
|
|
+ if (response.warehouseNumViewList[i].goodsName == this.totalReserves[num].goodsName
|
|
|
+ && response.warehouseNumViewList[i].goodsName != '玉米'
|
|
|
+ && response.warehouseNumViewList[i].goodsName != '高粱') {
|
|
|
+ param.cost = this.totalReserves[num].cost
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (response.warehouseNumViewList[i].pureWeight) {
|
|
|
- param.goodsName = response.warehouseNumViewList[i].goodsName
|
|
|
- param.stockNum = Number(response.warehouseNumViewList[i].pureWeight).toFixed(3)
|
|
|
- if (param.goodsName == '玉米') {
|
|
|
- param.conversionCost = (Number(this.totalMoney1) / Number(param.stockNum)).toFixed(3)
|
|
|
- } else if (param.goodsName == '高粱') {
|
|
|
- param.conversionCost = (Number(this.totalMoney2) / Number(param.stockNum)).toFixed(3)
|
|
|
+ if (response.warehouseNumViewList[i].pureWeight) {
|
|
|
+ param.goodsName = response.warehouseNumViewList[i].goodsName
|
|
|
+ param.stockNum = Number(response.warehouseNumViewList[i].pureWeight).toFixed(3)
|
|
|
+ if (param.goodsName == '玉米') {
|
|
|
+ param.conversionCost = (Number(this.totalMoney1) / Number(param.stockNum)).toFixed(3)
|
|
|
+ } else if (param.goodsName == '高粱') {
|
|
|
+ param.conversionCost = (Number(this.totalMoney2) / Number(param.stockNum)).toFixed(3)
|
|
|
+ }
|
|
|
+ result.push(param)
|
|
|
}
|
|
|
- result.push(param)
|
|
|
}
|
|
|
+ console.log(result)
|
|
|
+ this.totalReserves = result
|
|
|
+ this.initCharts()
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // this.$message.error('当前仓库无潮粮库存,无需折算!')
|
|
|
+ // this.value = '0'
|
|
|
+ // return
|
|
|
}
|
|
|
- console.log(result)
|
|
|
- this.totalReserves = result
|
|
|
- this.initCharts()
|
|
|
}
|
|
|
else {
|
|
|
- // this.$message.error('当前仓库无潮粮库存,无需折算!')
|
|
|
- // this.value = '0'
|
|
|
- // return
|
|
|
+ //临时库
|
|
|
+ if (response.warehouseNumViewList.length != 0) {
|
|
|
+ var result1 = []
|
|
|
+ for (let i = 0; i < response.warehouseNumViewList.length; i++) {
|
|
|
+ let param = {}
|
|
|
+ if (response.warehouseNumViewList[i].pureWeight) {
|
|
|
+ param.goodsName = response.warehouseNumViewList[i].goodsName
|
|
|
+ param.surplus = Number(response.warehouseNumViewList[i].pureWeight).toFixed(3)
|
|
|
+ result1.push(param)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.totalReserves = result1
|
|
|
+ this.initCharts()
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|