|
@@ -180,6 +180,17 @@
|
|
|
单位:吨
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="btn">
|
|
|
+ <view class="btn-in" :class='btnIndex==1?"btn-active":""' @click="changeWeight(1)">
|
|
|
+ 折算纯重
|
|
|
+ </view>
|
|
|
+ <view class="btn-in" :class='btnIndex==2?"btn-active":""' @click="changeWeight(2)">
|
|
|
+ 实际重量
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="row2">
|
|
|
<view class="" v-for="(item,index) in clList">
|
|
|
<view class="name">
|
|
@@ -377,6 +388,7 @@
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ btnIndex: "2",
|
|
|
rkList: [],
|
|
|
ztList: [],
|
|
|
ztColor: ['#38CA80', '#8D9EE9', '#FFBB6E'],
|
|
@@ -862,6 +874,10 @@
|
|
|
this.getServerData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeWeight(index) {
|
|
|
+ this.btnIndex = index
|
|
|
+ this.makeDate4(this.chartList, index)
|
|
|
+ },
|
|
|
color4(index) {
|
|
|
console.log(index)
|
|
|
index = index + 1
|
|
@@ -1178,47 +1194,44 @@
|
|
|
this.chartData3 = JSON.parse(JSON.stringify(res3));
|
|
|
|
|
|
},
|
|
|
- makeDate4(val) {
|
|
|
-
|
|
|
+ makeDate4(val, type) {
|
|
|
+ let _data = []
|
|
|
+ // 合计储量
|
|
|
+ let _count = 0
|
|
|
+ this.clList = []
|
|
|
+ if (type == 1) {
|
|
|
+ _data = val[14].biViewInfoList
|
|
|
+ } else {
|
|
|
+ _data = val[8].biViewInfoList
|
|
|
+ }
|
|
|
let _categorieslr = []
|
|
|
let _countlr = []
|
|
|
// this.clList =
|
|
|
let _weightList = []
|
|
|
let _maxWeight = ''
|
|
|
- if (val[8].biViewInfoList && val[8].biViewInfoList.length > 0) {
|
|
|
- for (let i = 0; i < val[8].biViewInfoList.length; i++) {
|
|
|
- _weightList.push(Number(val[8].biViewInfoList[i].weight).toFixed(0) ? Number(val[8].biViewInfoList[
|
|
|
- i]
|
|
|
+ if (_data && _data.length > 0) {
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
+ _weightList.push(Number(_data.weight).toFixed(0) ? Number(_data[i]
|
|
|
.weight).toFixed(0) : 0)
|
|
|
}
|
|
|
_maxWeight = Math.max(..._weightList) + Math.max(..._weightList) * 0.05
|
|
|
- for (let i = 0; i < val[8].biViewInfoList.length; i++) {
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
+ console.log("_data", _data)
|
|
|
+ _count += _data[i].weight
|
|
|
let _obj = {
|
|
|
- percent: Number(val[8].biViewInfoList[i].weight).toFixed(0) / _maxWeight * 100,
|
|
|
- name: val[8].biViewInfoList[i].name,
|
|
|
- weight: Number(val[8].biViewInfoList[i].weight).toFixed(0)
|
|
|
+ percent: Number(_data[i].weight).toFixed(0) / _maxWeight * 100,
|
|
|
+ name: _data[i].name,
|
|
|
+ weight: Number(_data[i].weight).toFixed(0)
|
|
|
}
|
|
|
console.log("库存储量", _obj)
|
|
|
this.clList.push(_obj)
|
|
|
- // _categorieslr.push(val[8].biViewInfoList[i].name)
|
|
|
- // _countlr.push(Number(val[8].biViewInfoList[i].weight).toFixed(0) ? Number(val[8]
|
|
|
- // .biViewInfoList[i]
|
|
|
- // .weight).toFixed(0) : 0)
|
|
|
}
|
|
|
}
|
|
|
- // let res4 = {
|
|
|
- // categories: _categorieslr,
|
|
|
- // series: [{
|
|
|
- // name: '库存储量',
|
|
|
- // data: _countlr
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // this.chartData4 = JSON.parse(JSON.stringify(res4));
|
|
|
- let _tc = Number(val[6].biViewInfoList[0].count) + Number(val[6].biViewInfoList[1].count) - Number(
|
|
|
+ let _tc = Number(_count) + Number(val[6].biViewInfoList[1].count) - Number(
|
|
|
val[6].biViewInfoList[2].count)
|
|
|
this.InventoryList = [{
|
|
|
name: '合计储量',
|
|
|
- number: Number(val[6].biViewInfoList[0].count).toFixed(3),
|
|
|
+ number: Number(_count).toFixed(3),
|
|
|
src: '../../static/img/cl.png'
|
|
|
}, {
|
|
|
name: '采购待执行',
|
|
@@ -1451,6 +1464,7 @@
|
|
|
.compId + '&seachMoth=' + this.seachMoth + '&seachYear=' + this.seachYear).then(
|
|
|
res => {
|
|
|
console.log("数据报表", res)
|
|
|
+
|
|
|
uni.hideLoading()
|
|
|
this.chartList = res.data.data
|
|
|
// 收支核算数据处理
|
|
@@ -1470,171 +1484,7 @@
|
|
|
//APP注册
|
|
|
this.makeDate8(res.data.data)
|
|
|
// uni.hideLoading()
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
- //模拟从服务器获取数据时的延时
|
|
|
- setTimeout(() => {
|
|
|
- //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
|
|
|
- // let res = {
|
|
|
- // categories: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023"],
|
|
|
- // series: [{
|
|
|
- // name: "收入",
|
|
|
- // data: [70, 40, 65, 100, 44, 68, 90, 240]
|
|
|
- // }, {
|
|
|
- // name: "支出",
|
|
|
- // data: [35, 8, 25, 37, 4, 20, 56, 30]
|
|
|
- // }
|
|
|
-
|
|
|
- // ]
|
|
|
- // };
|
|
|
- // this.chartData = JSON.parse(JSON.stringify(res));
|
|
|
- // let res1 = {
|
|
|
- // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
|
|
|
- // series: [{
|
|
|
- // name: this.index == 1 ? '过去12个月累计签订数量' : '本季累计签订合同数量',
|
|
|
- // data: [35, 36, 31, 33, 13, 34],
|
|
|
- // legendShape: "circle",
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: this.index == 1 ? '当前执行中数量' : '本季执行中数量',
|
|
|
- // data: [18, 27, 21, 24, 6, 28],
|
|
|
- // legendShape: "circle"
|
|
|
- // }
|
|
|
-
|
|
|
- // ]
|
|
|
- // };
|
|
|
- // this.chartData1 = JSON.parse(JSON.stringify(res1));
|
|
|
- // let res3 = {
|
|
|
- // categories: ["销售", "采购", "收购", "代收", "代储"],
|
|
|
- // series: [{
|
|
|
- // name: "利润金额",
|
|
|
- // data: [35, 36, 31, 33, 13]
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // this.chartData3 = JSON.parse(JSON.stringify(res3));
|
|
|
- let res4 = {
|
|
|
- categories: ["小麦", "高粱(潮粮)", "高粱", "玉米(潮粮)", "玉米"],
|
|
|
- series: [{
|
|
|
- name: '库存储量',
|
|
|
- data: [{
|
|
|
- value: 35,
|
|
|
- color: "#FFBB6E"
|
|
|
- },
|
|
|
- {
|
|
|
- value: 36,
|
|
|
- color: "#8D9EE9"
|
|
|
- }, {
|
|
|
- value: 31,
|
|
|
- color: "#FF8B95"
|
|
|
- }, {
|
|
|
- value: 33,
|
|
|
- color: "#38CA80"
|
|
|
- },
|
|
|
- {
|
|
|
- color: "#FFDD85"
|
|
|
- }
|
|
|
- ]
|
|
|
- }]
|
|
|
- };
|
|
|
- this.chartData4 = JSON.parse(JSON.stringify(res4));
|
|
|
- // let res5 = {
|
|
|
- // categories: ["小麦", "高粱(潮粮)", "高粱", "玉米(潮粮)", "玉米"],
|
|
|
- // series: [{
|
|
|
- // name: "利润金额",
|
|
|
- // data: [{
|
|
|
- // value: 10000,
|
|
|
- // color: "#FFBB6E"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // value: 40000,
|
|
|
- // color: "#8D9EE9"
|
|
|
- // }, {
|
|
|
- // value: 70000,
|
|
|
- // color: "#FF8B95"
|
|
|
- // }, {
|
|
|
- // value: 90000,
|
|
|
- // color: "#38CA80"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // value: 100000,
|
|
|
- // color: "#FFDD85"
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // this.chartData5 = JSON.parse(JSON.stringify(res5));
|
|
|
- // let res6 = {
|
|
|
- // series: [{
|
|
|
- // data: [{
|
|
|
- // "name": "一班",
|
|
|
- // "value": 50
|
|
|
- // }, {
|
|
|
- // "name": "二班",
|
|
|
- // "value": 30
|
|
|
- // }, {
|
|
|
- // "name": "三班",
|
|
|
- // "value": 20
|
|
|
- // }, {
|
|
|
- // "name": "四班",
|
|
|
- // "value": 18
|
|
|
- // }, {
|
|
|
- // "name": "五班",
|
|
|
- // "value": 8
|
|
|
- // }]
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // this.chartData6 = JSON.parse(JSON.stringify(res6));
|
|
|
- // let res7 = {
|
|
|
- // series: [{
|
|
|
- // data: [{
|
|
|
- // "name": "一班",
|
|
|
- // "value": 50
|
|
|
- // }, {
|
|
|
- // "name": "二班",
|
|
|
- // "value": 30
|
|
|
- // }, {
|
|
|
- // "name": "三班",
|
|
|
- // "value": 20
|
|
|
- // }, {
|
|
|
- // "name": "四班",
|
|
|
- // "value": 18
|
|
|
- // }, {
|
|
|
- // "name": "五班",
|
|
|
- // "value": 8
|
|
|
- // }]
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // this.chartData7 = JSON.parse(JSON.stringify(res7));
|
|
|
- // let res8 = {
|
|
|
- // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
|
|
|
- // series: [{
|
|
|
- // name: "成交量A",
|
|
|
- // data: [35, 8, 25, 37, 4, 20]
|
|
|
- // }
|
|
|
-
|
|
|
- // ]
|
|
|
- // };
|
|
|
- // this.chartData8 = JSON.parse(JSON.stringify(res8));
|
|
|
- // let res9 = {
|
|
|
- // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
|
|
|
- // series: [{
|
|
|
- // name: "成交量A",
|
|
|
- // data: [35, 8, 25, 37, 4, 20]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: "成交量B",
|
|
|
- // data: [70, 40, 65, 100, 44, 68]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: "成交量C",
|
|
|
- // data: [100, 80, 95, 150, 112, 132]
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // };
|
|
|
- // this.chartData9 = JSON.parse(JSON.stringify(res9));
|
|
|
- },
|
|
|
- 500);
|
|
|
},
|
|
|
back() {
|
|
|
uni.navigateBack()
|
|
@@ -1942,6 +1792,30 @@
|
|
|
}
|
|
|
|
|
|
.content3 {
|
|
|
+ .btn {
|
|
|
+ display: flex;
|
|
|
+ font-size: 24rpx;
|
|
|
+ background: #F5F6FA;
|
|
|
+ padding: 8rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ width: 332rpx;
|
|
|
+
|
|
|
+ .btn-in {
|
|
|
+ text-align: center;
|
|
|
+ width: 400rpx;
|
|
|
+ padding: 10rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn-active {
|
|
|
+ padding: 10rpx 0;
|
|
|
+ text-align: center;
|
|
|
+ width: 400rpx;
|
|
|
+ background: #fff;
|
|
|
+ font-weight: 700;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.right {
|
|
|
color: #9E9E9E;
|
|
|
}
|