zhaowc
2024-09-18 bdd84cc48ba7b2527584c44d174da8e7d20c5375
HTML/views/WareHouseSetting/StorageLegend.html
@@ -197,7 +197,7 @@
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
@@ -600,7 +600,7 @@
         // 加载仓库图例
         //圆
         function GetSlotChart(warehouseNo) {
         function GetSlotChart1(warehouseNo) {
            sendData(IP + "/Sys/GetStorageProportion?WareHouseNo=" + warehouseNo, {}, 'get', function (res) {
               // console.log("园数据",res)
@@ -675,6 +675,174 @@
            });
         };
         //新版圆形图
         function GetSlotChart(warehouseNo) {
            sendData(IP + "/Sys/GetStorageProportion?WareHouseNo=" + warehouseNo, {}, 'get', function (res) {
               // console.log("圆数据",res)
               if (res.code == 0) {
                  // console.log("圆数据",res.data)
                  var LayerName = res.data[0].warehouseNo;
                  var list = res.data;
                  //0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中  6: 损坏\屏蔽
                  var key = ['空储位', '有物品', '入库中', '出库中','移入中','移出中', '损坏/屏蔽'];
                  var value = [0,0,0,0,0,0,0];
                  list.forEach(item => {
                     value[item.Status] = item.StatusNum;
                  });
                  // console.log(value)
                  this.chartLine2 = echarts.init(document.getElementById("yuan"));
                  var option2 = {
                     tooltip: {   //弹出信息
                        trigger: 'item',
                        formatter: '{a} <br/>{b}: {c} ({d}%)'
                     },
                     legend: { //左侧信息
                        top:'5%',
                        orient: 'vertical',
                        left: 'left'
                     },
                     series: [
                        { //中心图
                           type: 'pie',
                           radius: [0, '30%'],
                           label: {
                              position: 'inner',
                              fontSize: 35,
                           },
                           title:'12',
                        },
                        { //侧边图
                           color: [ //颜色
                              '#5470c6', //空储位
                              '#91cc75', //有物品
                              '#ffdc60', //入库中
                              '#ee6666', //出库中
                              '#ffff7f', //移入中
                              '#ee23ee', //移出中
                              '#808080', //损坏/屏蔽
                           ],
                           name: '储位状态',
                           type: 'pie',
                           radius: ['40%', '70%'],
                           avoidLabelOverlap: false,
                           itemStyle: {
                              borderRadius: 10,
                              borderColor: '#fff',
                              borderWidth: 2
                           },
                           label: { //是否显示外部线条信息
                              show: false,
                              position: 'center'
                           },
                           emphasis: { //鼠标移入是否中间显示信息
                              label: {
                                 show: true,
                                 fontSize: 20,
                                 fontWeight: 'bold'
                              }
                           },
                           labelLine: { //标签线条
                              show: false
                           },
                           data: [
                              { value: value[0], name: key[0] }, //空储位
                              { value: value[1], name: key[1] }, //有物品
                              { value: value[2], name: key[2] }, //入库中
                              { value: value[3], name: key[3] }, //出库中
                              { value: value[4], name: key[4] }, //移入中
                              { value: value[5], name: key[5] }, //移出中
                              { value: value[6], name: key[6] }, //损坏\屏蔽
                              // { value: 1048, name: '空储位' },
                              // { value: 735, name: '有物品' },
                              // { value: 580, name: '入库中' },
                              // { value: 484, name: '出库中' },
                              // { value: 484, name: '移入中' },
                              // { value: 484, name: '移出中' },
                              // { value: 300, name: '损坏/屏蔽' }
                           ]
                        },
                     ],
                  };
                  this.chartLine2.setOption(option2);
               } else {
                  layer.msg(res.msg, {
                     icon: 2,
                     time: 2000
                  }, function () { })
               }
            });
         };
         // option = {
         //    tooltip: { //弹出信息
         //       trigger: 'item',
         //       formatter: '{a} <br/>{b}: {c} ({d}%)'
         //    },
         //    legend: { //左侧信息
         //       top:'5%',
         //       orient: 'vertical',
         //       left: 'left'
         //    },
         //    series: [
         //       //中心图
         //       {
         //          type: 'pie',
         //          radius: [0, '30%'],
         //          label: {
         //             position: 'inner',
         //             fontSize: 35,
         //          },
         //          title:'12',
         //       },
         //       {
         //       color: [
         //                   '#5470c6', //空储位
         //                   '#91cc75', //有物品
         //                   '#ffdc60', //入库中
         //                   '#ee6666', //出库中
         //                   '#ffff7f', //移入中
         //                   '#ee23ee', //移出中
         //                   '#808080', //损坏/屏蔽
         //                ],
         //       name: '储位状态',
         //       type: 'pie',
         //       radius: ['40%', '70%'],
         //       avoidLabelOverlap: false,
         //       itemStyle: {
         //          borderRadius: 10,
         //          borderColor: '#fff',
         //          borderWidth: 2
         //       },
         //       label: { //是否显示外部线条信息
         //          show: false,
         //          position: 'center'
         //       },
         //       emphasis: { //鼠标移入是否中间显示信息
         //          label: {
         //          show: true,
         //          fontSize: 40,
         //          fontWeight: 'bold'
         //          }
         //       },
         //       labelLine: { //标签线条
         //          show: false
         //       },
         //       data: [
         //          { value: 1048, name: '空储位' },
         //          { value: 735, name: '有物品' },
         //          { value: 580, name: '入库中' },
         //          { value: 484, name: '出库中' },
         //          { value: 484, name: '移入中' },
         //          { value: 484, name: '移出中' },
         //          { value: 300, name: '损坏/屏蔽' }
         //       ]
         //       }
         //    ]
         //    };
         //柱
         function GetSlotChartz(warehouseNo, roadwayNo) {