|
|
@@ -5,21 +5,10 @@ import {path} from '../../utils/circle';
|
|
|
const app = getApp()
|
|
|
Page({
|
|
|
data: {
|
|
|
- showRight:1,
|
|
|
- transportStatusData:{},
|
|
|
- transportBusinessData:{},
|
|
|
- transportBusinessNum:1,
|
|
|
- orderWaringStatusData:{},
|
|
|
- waringStatus:0,
|
|
|
- waringStatusList:["当天","本周","本月",],
|
|
|
- transportCityData:[],
|
|
|
- transOrderList:[],
|
|
|
- transOrderIndex:0,
|
|
|
+ showRight:false,
|
|
|
polyline:[],
|
|
|
tempList:[],
|
|
|
hisLocal:[],
|
|
|
- urlLeft:'/group156/default/20211216/16/58/6/bde42061736d8dfcd68bbe33fd9464a0.jpg"',
|
|
|
- banner: "/group156/default/20211216/16/58/6/bde42061736d8dfcd68bbe33fd9464a0.jpg",
|
|
|
ossPath: app.globalData.$filePath,
|
|
|
title: '冷链追溯系统',
|
|
|
token: '',
|
|
|
@@ -31,45 +20,9 @@ Page({
|
|
|
showCapsule: true,
|
|
|
share: false
|
|
|
},
|
|
|
- alarmDTO: {
|
|
|
- chipNum: 0,
|
|
|
- allTimeNum: 0,
|
|
|
- realTimeNum: 0
|
|
|
- },
|
|
|
- temperatureDTO: { //温度监测数量
|
|
|
- normal: 0,
|
|
|
- warning: 0,
|
|
|
- alarm: 0
|
|
|
- },
|
|
|
- waringDTO: {
|
|
|
- chipNum: 0,
|
|
|
- allTimeNum: 0,
|
|
|
- realTimeNum: 0
|
|
|
- },
|
|
|
- inTrans: 0, //已出库(个)
|
|
|
- inStore: 0, //已入库(个)
|
|
|
- inEnd: 0, //已结束(个)
|
|
|
- total: 0, //已生产(个)
|
|
|
-
|
|
|
- error11: 0, //一型有源报警数量
|
|
|
- error20: 0, //二型报警数量
|
|
|
- total10: 0, //一型无源数量
|
|
|
- total11: 0, //一型有源数量
|
|
|
- total20: 0, //二型数量
|
|
|
- warning11: 0, //一型有源预警数量
|
|
|
- warning20: 0, //一型无源预警数量
|
|
|
- mapTopData: {
|
|
|
- name: '暂无',
|
|
|
- status: '暂无',
|
|
|
- updateTime: '暂无',
|
|
|
- lastTemperature: '暂无',
|
|
|
- minTemperature: '暂无',
|
|
|
- maxTemperature: '暂无'
|
|
|
- },
|
|
|
llzsEc: {
|
|
|
lazyLoad: true,
|
|
|
},
|
|
|
- chainTempList: [],
|
|
|
tempList:[],
|
|
|
Ec: {
|
|
|
lazyLoad: true,
|
|
|
@@ -120,10 +73,6 @@ Page({
|
|
|
},
|
|
|
],
|
|
|
isAuth: false,
|
|
|
- showAuthWin: false,
|
|
|
- showChaType: false,
|
|
|
- isPrem: false,
|
|
|
- device: false,
|
|
|
modalHidden: true,
|
|
|
scrollTop:0,//滚动监听
|
|
|
// 沃森新
|
|
|
@@ -134,7 +83,7 @@ Page({
|
|
|
{name:'流感',remark:'本公司现有100个产品温度正常温度不正常0个,原料辅料20种状态正常,产品有100种,所有产品状态全部正常'}
|
|
|
],
|
|
|
tabLeftTop_remark:'本公司现有100个产品温度正常温度不正常0个,原料辅料20种状态正常,产品有100种,所有产品状态全部正常',
|
|
|
- orderCardList:[{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50},{createTime:'2022-07-01',num:50}]
|
|
|
+ orderCardList:[{city:'泰州市',used:50,stack: 2},{city:'北京市',used:50,stack: 2},{city:'西安市',used:50,stack: 2},{city:'天津市',stack: 2,used:50},{city:'廊坊市',stack: 2,used:50},{city:'广州市',used:50,stack: 2},{city:'郑州市',used:50,stack: 2}]
|
|
|
},
|
|
|
// 事件处理函数
|
|
|
onLoad() {
|
|
|
@@ -151,27 +100,11 @@ Page({
|
|
|
gopage1(){
|
|
|
this.setData({
|
|
|
showRight:false,
|
|
|
+ },()=>{
|
|
|
+ this.setCardLeft();
|
|
|
})
|
|
|
},
|
|
|
onReady: function () {
|
|
|
- var that = this;
|
|
|
- // that.canvasRingA = that.selectComponent("#canvasRingA");
|
|
|
- // that.canvasRingB = that.selectComponent("#canvasRingB");
|
|
|
- // that.canvasRingC = that.selectComponent("#canvasRingC");
|
|
|
- // that.canvasRingG = that.selectComponent("#canvasRingG");
|
|
|
- // that.canvasRingA.showCanvasRing();
|
|
|
- // that.canvasRingB.showCanvasRing();
|
|
|
- // that.canvasRingC.showCanvasRing();
|
|
|
- // that.canvasRingG.showCanvasRing();
|
|
|
-
|
|
|
- // that.canvasRingD = that.selectComponent("#canvasRingD");
|
|
|
- // that.canvasRingE = that.selectComponent("#canvasRingE");
|
|
|
- // that.canvasRingF = that.selectComponent("#canvasRingF");
|
|
|
- // that.canvasRingL = that.selectComponent("#canvasRingL");
|
|
|
- // that.canvasRingD.showCanvasRing();
|
|
|
- // that.canvasRingE.showCanvasRing();
|
|
|
- // that.canvasRingF.showCanvasRing();
|
|
|
- // that.canvasRingL.showCanvasRing();
|
|
|
},
|
|
|
onShow: function (options) {
|
|
|
var that = this;
|
|
|
@@ -185,17 +118,11 @@ Page({
|
|
|
})
|
|
|
//获取新闻
|
|
|
this.getNewsList();
|
|
|
- /**沃森新 */
|
|
|
- // this.setPie4Chart({total:8,abnormal:3,normal:8});
|
|
|
- // this.setCard_top_right_butChart([{"name":"北京","orderNum":50},{"name":"上海","orderNum":30},{"name":"安徽","orderNum":20},{"name":"成都","orderNum":20},{"name":"广东","orderNum":20},]);
|
|
|
- // this.product_two_left_two([
|
|
|
- // {name:'标签1',data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]},
|
|
|
- // {name:'标签2',data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]},
|
|
|
- // {name:'',data:[30.0, 42.2, 43.3, 44.5, 46.3, 80.2, 200.3, 123.4, 223.0, 26.5, 12.0, 6.2]},
|
|
|
- // ])
|
|
|
- // this.setCardPieTwo();
|
|
|
- // this.setCard3dBar();
|
|
|
- // this.setKLine();
|
|
|
+ // 加载
|
|
|
+ this.setCardLeft();
|
|
|
+
|
|
|
+ },
|
|
|
+ setCardLeft(){
|
|
|
var diagamList = [
|
|
|
{name: "标签1",value: 0,unNormalTotal:0,symbolSize:40},
|
|
|
{name: "标签2",value: 0,unNormalTotal:0,symbolSize:40},
|
|
|
@@ -216,34 +143,11 @@ Page({
|
|
|
{data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
]
|
|
|
this.setSevenCardPie(sevenCardPieList);
|
|
|
- // var sevenCardPieList = [
|
|
|
- // { name: "标签1", value: 50 },
|
|
|
- // { name: "标签2", value: 20 },
|
|
|
- // ]
|
|
|
- // this.setCardSenvenPie(sevenCardPieList);
|
|
|
- // var eightBarLeftList = [
|
|
|
- // {name:'标签1',data:[2.0, 4.9, 7.0, 23.2,]},
|
|
|
- // {name:'标签2',data:[2.6, 5.9, 9.0, 21.4,]},
|
|
|
- // {name:'标签3',data:[3.6, 6.9, 8.0, 18.4,]},
|
|
|
- // {name:'标签4',data:[4.6, 7.9, 7.0, 16.4,]},
|
|
|
- // ]
|
|
|
- // this.setCardEightBar(eightBarLeftList);
|
|
|
- // var eightRightBarList = [
|
|
|
- // {name:'标签1',data:[10, 20, 30, 40, 50, 60]},
|
|
|
- // {name:'标签2',data:[10, 20, 30, 40, 50, 60]},
|
|
|
- // {name:'标签3',data:[10, 20, 30, 40, 50, 60]},
|
|
|
- // {name:'',data:[15,22,32,45,48,67]}
|
|
|
- // ]
|
|
|
- // this.setCardEightRightBar(eightRightBarList);
|
|
|
- // this.setCardNineBar([{"name":"二价流脑","orderNum":50},{"name":"胶囊","orderNum":30},{"name":"产品1","orderNum":20},{"name":"颗粒","orderNum":20},]);
|
|
|
- // var nineRightBarList = [{name:'生产',data:[120, 132, 101, 134, 90, 230, 210]},{name:'销售',data:[220, 182, 191, 234, 290, 330, 310]},{name:'在途',data:[150, 232, 201, 154, 190, 330, 410]},{name:'交付',data:[158, 242, 141, 164, 180, 230, 510]}]
|
|
|
- // this.setCardNineRightBar(nineRightBarList);
|
|
|
/**沃森新 */
|
|
|
//获取token,若无则判定用户是游客访问,不进行任何请求
|
|
|
var token = wx.getStorageSync('token');
|
|
|
this.setData({
|
|
|
token,
|
|
|
- chainTempList:[],
|
|
|
tempList:[]
|
|
|
})
|
|
|
|
|
|
@@ -278,61 +182,10 @@ Page({
|
|
|
this.getSignProductUsedProduceState();
|
|
|
// 主产品不同年度 使用量统计
|
|
|
this.getSignPrroductYearUsedProduceState();
|
|
|
- },
|
|
|
- getOrderWarnOption(list){
|
|
|
- var fontSize = 12
|
|
|
- var fontColor = "#999999"
|
|
|
- return {
|
|
|
- color:["#0079FF","#FF723A","#EA1C43"],
|
|
|
- title: {
|
|
|
- show:false
|
|
|
- },
|
|
|
- grid:{
|
|
|
- top:"5%",
|
|
|
- left:"5%",
|
|
|
- right:"5%",
|
|
|
- bottom:"5%",
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- show:true
|
|
|
- },
|
|
|
- legend: {
|
|
|
- data:list.map(item=>item.name),
|
|
|
- icon:"rect",
|
|
|
- orient:"vertical",
|
|
|
- top:"middle",
|
|
|
- right:"10%",
|
|
|
- itemWidth:fontSize,
|
|
|
- itemHeight:fontSize,
|
|
|
- textStyle:{
|
|
|
- fontSize:fontSize,
|
|
|
- color:fontColor,
|
|
|
- },
|
|
|
- formatter(name){
|
|
|
- return name+" " + list.filter(item=>item.name == name)[0].num
|
|
|
- },
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: 'pie',
|
|
|
- silent:0,
|
|
|
- radius: ["40%", '90%'],
|
|
|
- center: ["30%", '50%'],
|
|
|
- label:{
|
|
|
- position:'inside',
|
|
|
- formatter:"{d}%",
|
|
|
- },
|
|
|
- itemStyle:{
|
|
|
- borderColor:"#ffffff",
|
|
|
- borderWidth:2,
|
|
|
- },
|
|
|
- data: list.filter(item=>{
|
|
|
- item.value = item.num
|
|
|
- return item
|
|
|
- }),
|
|
|
- },
|
|
|
- ]
|
|
|
- }
|
|
|
+ // 主产品在不同地区库存、使用数据统计
|
|
|
+ this.getSignProductCityState();
|
|
|
+ // 主产品最近一周每一天的使用量统计
|
|
|
+ this.getSignProductEveryWeekState();
|
|
|
},
|
|
|
getCysOrderOption(list){
|
|
|
var fontSize=8;
|
|
|
@@ -504,7 +357,6 @@ Page({
|
|
|
]
|
|
|
this.showMap(markerList);
|
|
|
this.setData({
|
|
|
- chainTempList:temp,
|
|
|
tempList:temp,
|
|
|
},()=>{
|
|
|
this.setTemp(temp);
|
|
|
@@ -549,6 +401,19 @@ Page({
|
|
|
]
|
|
|
var cardSixLineList = ["阿莫西林", "红霉素", "新型冠状病毒疫苗"];
|
|
|
this.setCardSixBar(seriesSixBar,cardSixLineList);
|
|
|
+ var klineList = [
|
|
|
+ {
|
|
|
+ maps:[{total:10,},{total:15,},{total:19,},{total:13,},{total:18,},],
|
|
|
+ productInfo:{name:'阿莫西林'}
|
|
|
+ },{
|
|
|
+ maps:[{total:16,},{total:11,},{total:14,},{total:13,},{total:18,},],
|
|
|
+ productInfo:{name:'红霉素'}
|
|
|
+ },{
|
|
|
+ maps:[{total:18,},{total:14,},{total:11,},{total:8,},{total:17,},],
|
|
|
+ productInfo:{name:'新型冠状病毒疫苗'}
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ this.setKLine(klineList);
|
|
|
},
|
|
|
showMap1(markers) {
|
|
|
var that = this;
|
|
|
@@ -572,7 +437,6 @@ Page({
|
|
|
},()=>{
|
|
|
if(markers.length!=0 && token){
|
|
|
//地图数据加载完成后,获取第一条数据的详情
|
|
|
- that.getListInfo(markers[0].bId);
|
|
|
that.getListChainTemperature(markers[0].bId);
|
|
|
}else{
|
|
|
var temp = [
|
|
|
@@ -601,10 +465,8 @@ Page({
|
|
|
if (that.data.token) {
|
|
|
for (var i in that.data.markers) {
|
|
|
if (that.data.markers[i].id == index) {
|
|
|
- //冷链信息
|
|
|
- that.getListInfo(that.data.markers[i].bId);
|
|
|
- //冷链温度曲线
|
|
|
- that.getListChainTemperature(that.data.markers[i].bId);
|
|
|
+
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -637,174 +499,6 @@ Page({
|
|
|
app.showToptip(that,'error',err.data.msg)
|
|
|
})
|
|
|
},
|
|
|
- getListInfo(id) {
|
|
|
- var that = this;
|
|
|
- app.requestP({
|
|
|
- url: '/index/getChainInfo',
|
|
|
- method: 'post',
|
|
|
- contentType: 'application/json',
|
|
|
- data: {
|
|
|
- id
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- const {
|
|
|
- name,
|
|
|
- status,
|
|
|
- updateTime,
|
|
|
- lastTemperature,
|
|
|
- minTemperature,
|
|
|
- maxTemperature
|
|
|
- } = res.data.data;
|
|
|
- that.setData({ //数据处理
|
|
|
- mapTopData: {
|
|
|
- name: name || '暂无',
|
|
|
- status: status == '00' ? '正常' : status == '10' ? '黄色预警' : status == '20' ? '红色预警' : '暂无',
|
|
|
- updateTime: updateTime || '暂无',
|
|
|
- lastTemperature: lastTemperature ? lastTemperature + '℃' : '暂无',
|
|
|
- minTemperature: minTemperature ? minTemperature + '℃' : '暂无',
|
|
|
- maxTemperature: maxTemperature || '暂无'
|
|
|
- },
|
|
|
- })
|
|
|
- }).catch(err=>{
|
|
|
- app.showToptip(that,'error',err.data.msg)
|
|
|
- })
|
|
|
- },
|
|
|
- getListChainTemperature(id) {
|
|
|
- var that = this;
|
|
|
- app.requestP({
|
|
|
- url: '/index/listChainTemperature',
|
|
|
- method: 'post',
|
|
|
- contentType: 'application/json',
|
|
|
- data: {
|
|
|
- id
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- that.setData({
|
|
|
- chainTempList: res.data.data,
|
|
|
- tempList:res.data.data
|
|
|
- })
|
|
|
- that.setTemp(res.data.data);
|
|
|
- }).catch(err => {
|
|
|
- app.showToptip(that, 'error', '暂无温度数据');
|
|
|
- })
|
|
|
- },
|
|
|
- setTransOption(temperature) {
|
|
|
- var that = this;
|
|
|
- that.ecWen = that.selectComponent('#llzsChartDom');
|
|
|
- that.ecWen.init((canvas, width, height, dpr) => {
|
|
|
- const chart = echarts.init(canvas, null, {
|
|
|
- width: width,
|
|
|
- height: height,
|
|
|
- devicePixelRatio: dpr
|
|
|
- });
|
|
|
- var option = that.getTransOption();
|
|
|
- option.xAxis.data = temperature.map(v => v.productTypeName);
|
|
|
- option.series[0].data = temperature.map(v => v.state10);
|
|
|
- option.series[1].data = temperature.map(v => v.state11);
|
|
|
- option.series[2].data = temperature.map(v => v.state20);
|
|
|
- chart.setOption(option);
|
|
|
- that.wenChart = chart;
|
|
|
- return chart;
|
|
|
- });
|
|
|
- },
|
|
|
- getTransOption() {
|
|
|
- return {
|
|
|
- title: {
|
|
|
- text: '数量',
|
|
|
- textStyle: {
|
|
|
- color: '#74788D',
|
|
|
- fontWeight: 'normal',
|
|
|
- fontSize: '16rpx'
|
|
|
- }
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- show: false,
|
|
|
- trigger: 'axis'
|
|
|
- },
|
|
|
- color: ['#7661FF', '#5AC8FA', '#00B972'],
|
|
|
- legend: {
|
|
|
- data: ['全程温控', '实时追溯', '追溯标签'],
|
|
|
- icon: "rect", // 设置形状 类型包括 circle,rect ,roundRect,triangle
|
|
|
- itemHeight: 11,
|
|
|
- itemWidth: 11,
|
|
|
- align: 'left',
|
|
|
- itemGap: 5,
|
|
|
- right: 10,
|
|
|
- top: 0,
|
|
|
- textStyle:{
|
|
|
- color:'#999',
|
|
|
- }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- left: '0%',
|
|
|
- right: '0%',
|
|
|
- bottom: '3%',
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- xAxis: {
|
|
|
- type: 'category',
|
|
|
- nameTextStyle: {
|
|
|
- color: "#77869E",
|
|
|
- fontSize: 10
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- onZero: false,
|
|
|
- lineStyle: {
|
|
|
- color: "#999"
|
|
|
- }
|
|
|
- },
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: false,
|
|
|
- },
|
|
|
- data: ["产品一", "产品二", "产品三", "产品四"],
|
|
|
- },
|
|
|
- yAxis: [{
|
|
|
- type: 'value'
|
|
|
- }],
|
|
|
- series: [{
|
|
|
- name: '追溯标签',
|
|
|
- type: 'bar',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top'
|
|
|
- },
|
|
|
- symbolSize: '0',
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- },
|
|
|
- data: [50, 180, 290, 50]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '全程温控',
|
|
|
- type: 'bar',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top'
|
|
|
- },
|
|
|
- symbolSize: '0',
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- },
|
|
|
- data: [200, 200, 292, 200]
|
|
|
- }, {
|
|
|
- name: '实时追溯',
|
|
|
- type: 'bar',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top'
|
|
|
- },
|
|
|
- symbolSize: '0',
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- },
|
|
|
- data: [248, 290, 290, 240]
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
getTempOption() {
|
|
|
return {
|
|
|
title: {
|
|
|
@@ -901,26 +595,6 @@ Page({
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
- productTypeChipCount(userId) {
|
|
|
- var that = this;
|
|
|
- app.requestP({
|
|
|
- url: '/index/productTypeChipCount',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- userId
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- that.setData({
|
|
|
- productTypeChipCount: res.data.data
|
|
|
- })
|
|
|
- const temperature = res.data.data;
|
|
|
- that.setPieChart(temperature.slice(0,6));
|
|
|
- }).catch(err => {
|
|
|
- that.setData({
|
|
|
- productTypeChipCount: []
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
setPieChart(temperature) {
|
|
|
var that = this;
|
|
|
var num = 0;
|
|
|
@@ -1008,76 +682,6 @@ Page({
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
- getChainStatus(userId) {
|
|
|
- var that = this;
|
|
|
- app.requestP({
|
|
|
- url: '/index/getChainStatus',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- userId
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- const {
|
|
|
- alarmDTO,
|
|
|
- temperatureDTO,
|
|
|
- waringDTO,
|
|
|
- inTrans,
|
|
|
- inStore,
|
|
|
- inEnd,
|
|
|
- total
|
|
|
- } = res.data.data;
|
|
|
- that.setData({
|
|
|
- temperatureDTO,
|
|
|
- waringDTO,
|
|
|
- inTrans,
|
|
|
- inStore,
|
|
|
- inEnd,
|
|
|
- total
|
|
|
- })
|
|
|
- }).catch(err=>{
|
|
|
- app.showToptip(that,'error',err.data.msg)
|
|
|
- })
|
|
|
- },
|
|
|
- getWarningState(userId) {
|
|
|
- var that = this;
|
|
|
- app.requestP({
|
|
|
- url: '/index/warningState',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- userId
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- const {
|
|
|
- error11,
|
|
|
- error20,
|
|
|
- total10,
|
|
|
- total11,
|
|
|
- total20,
|
|
|
- warning11,
|
|
|
- warning20
|
|
|
- } = res.data.data;
|
|
|
- that.setData({
|
|
|
- error11,
|
|
|
- error20,
|
|
|
- total10,
|
|
|
- total11,
|
|
|
- total20,
|
|
|
- warning11,
|
|
|
- warning20
|
|
|
- }, () => {
|
|
|
- // that.canvasRingA.showCanvasRing();
|
|
|
- // that.canvasRingB.showCanvasRing();
|
|
|
- // that.canvasRingC.showCanvasRing();
|
|
|
- // that.canvasRingD.showCanvasRing();
|
|
|
- // that.canvasRingE.showCanvasRing();
|
|
|
- // that.canvasRingF.showCanvasRing();
|
|
|
- // that.canvasRingG.showCanvasRing();
|
|
|
- // that.canvasRingL.showCanvasRing();
|
|
|
- })
|
|
|
- }).catch(err=>{
|
|
|
- app.showToptip(that,'error',err.data.msg)
|
|
|
- })
|
|
|
- },
|
|
|
setMapCenter() {
|
|
|
var that = this;
|
|
|
var locations = that.data.markers;
|
|
|
@@ -1094,39 +698,10 @@ Page({
|
|
|
}).then(function (res) {
|
|
|
var userId = res.data.data.userId;
|
|
|
// that.getProductChipState();
|
|
|
- that.productTypeChipCount(userId);
|
|
|
- that.getChainStatus(userId);
|
|
|
- // that.getWarningState(userId);
|
|
|
}).catch(err => {
|
|
|
app.showToptip(that, 'error', '请刷新重试');
|
|
|
})
|
|
|
},
|
|
|
- transportationInfo() {
|
|
|
- var token = wx.getStorageSync('token');
|
|
|
- if(!token){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- var transportationJson = JSON.stringify(this.data.productChipStateList);
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/transportationInfo/transportationInfo?list=' + transportationJson,
|
|
|
- })
|
|
|
- },
|
|
|
- monitoringNum() {
|
|
|
- var token = wx.getStorageSync('token');
|
|
|
- if(!token){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- var productTypeChipCountJson = JSON.stringify(this.data.productTypeChipCount);
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/monitoringNum/monitoringNum?list=' + productTypeChipCountJson,
|
|
|
- })
|
|
|
- },
|
|
|
packageInfo(){
|
|
|
var token = wx.getStorageSync('token');
|
|
|
if(!token){
|
|
|
@@ -1140,64 +715,6 @@ Page({
|
|
|
url: '/pages/index/packageInfo/packageinfo?list=' + packageList,
|
|
|
})
|
|
|
},
|
|
|
- expressInfo(){
|
|
|
- var token = wx.getStorageSync('token');
|
|
|
- if(!token){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- var expressData = JSON.stringify(this.data.expressData);
|
|
|
- var title = JSON.stringify([{name:'出库',type:'o'},{name:'入库',type:'i'}]);
|
|
|
- var titleName = JSON.stringify({titleName:'出入库统计'});
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/statics/statics?list=' +encodeURIComponent(expressData)+'&title='+title+'&titleName='+titleName,
|
|
|
- })
|
|
|
- },
|
|
|
- goAbnormal(){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/abnormal/abnormal',
|
|
|
- })
|
|
|
- },
|
|
|
- ordersInfo(){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/ordersList/ordersList',
|
|
|
- })
|
|
|
- },
|
|
|
- transporDetails(){
|
|
|
- var temp = this.data.temp;
|
|
|
- var productName = this.data.productName;
|
|
|
- var {product10,product20,product30,product40,product50} = this.data;
|
|
|
- var token = wx.getStorageSync('token');
|
|
|
- if(!token){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/transporDetails/transporDetails?temp='+encodeURIComponent(JSON.stringify(temp))+'&productName='+encodeURIComponent(JSON.stringify(productName))+'&productNum='+encodeURIComponent(JSON.stringify([product10,product20,product30,product40,product50])),
|
|
|
- })
|
|
|
- },
|
|
|
- onShareAppMessage() {
|
|
|
- return {
|
|
|
- title: 'cover-view',
|
|
|
- }
|
|
|
- },
|
|
|
- monitoringNum() {
|
|
|
- var token = wx.getStorageSync('token');
|
|
|
- if(!token){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- var transportCityDataJson = JSON.stringify(this.data.transportCityData);
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/monitoringNum/monitoringNum?list=' + transportCityDataJson,
|
|
|
- })
|
|
|
- },
|
|
|
getNewsList() {
|
|
|
var that = this;
|
|
|
app.requestP({
|
|
|
@@ -1319,7 +836,6 @@ Page({
|
|
|
method: 'post',
|
|
|
}).then(res=>{
|
|
|
this.setCard_top_right_butChart(res.data.data);
|
|
|
- this.setKLine(res.data.data);
|
|
|
}).catch(err=>{
|
|
|
app.showToptip(this,'err',err.data.msg)
|
|
|
})
|
|
|
@@ -1510,7 +1026,6 @@ Page({
|
|
|
method: 'post',
|
|
|
}).then(res=>{
|
|
|
this.setCard_two_left_one(res.data.data);
|
|
|
- this.setKLine(res.data.data);
|
|
|
}).catch(err=>{
|
|
|
app.showToptip(this,'err',err.data.msg)
|
|
|
})
|
|
|
@@ -1922,24 +1437,32 @@ Page({
|
|
|
height: height,
|
|
|
devicePixelRatio: dpr
|
|
|
});
|
|
|
- list = list.map(item=>{
|
|
|
- return {orderNum:item.total,name:item.city || 'N/A'}
|
|
|
+ var option = that.getStaticBarChart();
|
|
|
+ option.color = ['#2D59E6','#FFAF36','#7FD1FF']
|
|
|
+ option.grid.top='20%';
|
|
|
+ option.grid.bottom='13%';
|
|
|
+ option.series = [];
|
|
|
+ option.xAxis.data = [];
|
|
|
+ const echartsData = [];
|
|
|
+ list.map(item=>{
|
|
|
+ echartsData.push({
|
|
|
+ name:item.productInfo.name,data:item.maps.map(itemChild=>itemChild.total)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ option.xAxis.data = list.map(item=>item.productInfo.name);
|
|
|
+ echartsData.map((item,index)=>{
|
|
|
+ option.series.push({
|
|
|
+ name:item.name,
|
|
|
+ type: "bar",
|
|
|
+ stack: "Ad",
|
|
|
+ barMaxWidth: 25,
|
|
|
+ // barMinHeight: 10,
|
|
|
+ emphasis: {
|
|
|
+ focus: "series",
|
|
|
+ },
|
|
|
+ data:item.data
|
|
|
+ })
|
|
|
})
|
|
|
- var option = that.getCysOrderOption(list);
|
|
|
- // lenged
|
|
|
- option.series = [{
|
|
|
- type:'bar',
|
|
|
- barMaxWidth: 15,
|
|
|
- barMinHeight: 10,
|
|
|
- data:list.map(item=>item.orderNum),
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'inside'
|
|
|
- },
|
|
|
- itemStyle:{
|
|
|
- normal:{color:'#333FFF'}
|
|
|
- }
|
|
|
- }]
|
|
|
chart.setOption(option);
|
|
|
return chart;
|
|
|
})
|
|
|
@@ -2468,8 +1991,8 @@ Page({
|
|
|
},
|
|
|
}
|
|
|
var option = this.getStaticPieChart();
|
|
|
- option.color = ['rgb(247,20,4)','rgb(127,210,255)','rgb(44,88,288)'];
|
|
|
- var center = [["50%", "10%"],["50%", "35%"],["50%", "60%"],["50%", "85%"]];
|
|
|
+ option.color = ['rgb(127,210,255)','rgb(44,88,288)','rgb(247,20,4)',];
|
|
|
+ var center = [["50%", "12%"],["50%", "35%"],["50%", "60%"],["50%", "85%"]];
|
|
|
option.series = [];
|
|
|
list.map((item,index)=>{
|
|
|
option.series.push({
|
|
|
@@ -2830,4 +2353,35 @@ Page({
|
|
|
return chart;
|
|
|
})
|
|
|
},
|
|
|
+ // 图15 主产品在不同地区库存、使用数据统计 /daping/signProductCityState
|
|
|
+ getSignProductCityState(){
|
|
|
+ app.requestP({
|
|
|
+ url: '/daping/signProductCityState',
|
|
|
+ method: 'post',
|
|
|
+ }).then(res=>{
|
|
|
+ this.setData({
|
|
|
+ orderCardList:res.data.data,
|
|
|
+ })
|
|
|
+ var sevenCardPieNum = [];
|
|
|
+ res.data.data.map(item=>{
|
|
|
+ sevenCardPieNum.push({
|
|
|
+ data:[{name:item.city,value:item.stack},{name:item.city+'1',value:item.used}]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.setSevenCardPie(sevenCardPieNum);
|
|
|
+ }).catch(err=>{
|
|
|
+ app.showToptip(this,'err',err.data.msg)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 主产品最近一周每一天的使用量统计
|
|
|
+ getSignProductEveryWeekState(){
|
|
|
+ app.requestP({
|
|
|
+ url: '/daping/signProductEveryWeekState',
|
|
|
+ method: 'post',
|
|
|
+ }).then(res=>{
|
|
|
+ this.setKLine(res.data.data);
|
|
|
+ }).catch(err=>{
|
|
|
+ app.showToptip(this,'err',err.data.msg)
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|