xiaost 2 жил өмнө
parent
commit
970257ebc1

+ 5 - 2
src/components/assemblyechart/bottom/bottomLeft2Chart/chart.vue

@@ -138,8 +138,11 @@ export default {
     },
     async getdata() {
       //20220211 -+formatDate(new Date()
-      await this.$http.get("kanban/datalist.action?caller=WCDAYTURNOUT!ZZ&_noc=1&page=1&pageSize=100&condition=1=1")
-              .then((result)=>{
+      await this.$http.get("kanban/datalist.action?caller=WCDAYTURNOUT!ZZ&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "1=1",
+        }
+      }).then((result)=>{
                         let dataList = JSON.parse(result.data.data);
                         let xAxis0 = new Array();
                         let series0 = new Array();

+ 7 - 5
src/components/assemblyechart/centerLeft/centerLeft1Chart/index.vue

@@ -65,11 +65,13 @@ export default {
                           sum1 +=element.v_cn;
                           totalsum = element.v_sum;
                         }
-                        xData0.push('其它');
-                       let ob = new Object();
-                       ob.value = totalsum-sum1;
-                       ob.name = '其它';
-                       seriesData0.push(ob);
+                        if(totalsum-sum1>0){
+                          xData0.push('其它');
+                          let ob = new Object();
+                          ob.value = totalsum-sum1;
+                          ob.name = '其它';
+                          seriesData0.push(ob);
+                        }
                        this.cdata.xData = xData0;
                        this.cdata.seriesData = seriesData0;
                       },(result)=>{

+ 6 - 4
src/components/packageechart/centerLeft/centerLeft1Chart/index.vue

@@ -65,11 +65,13 @@ export default {
                           sum1 +=element.v_cn;
                           totalsum = element.v_sum;
                         }
+                      if(totalsum-sum1>0){
                         xData0.push('其它');
-                       let ob = new Object();
-                       ob.value = totalsum-sum1;
-                       ob.name = '其它';
-                       seriesData0.push(ob);
+                        let ob = new Object();
+                        ob.value = totalsum-sum1;
+                        ob.name = '其它';
+                        seriesData0.push(ob);
+                      }
                        this.cdata.xData = xData0;
                        this.cdata.seriesData = seriesData0;
                       },(result)=>{

+ 4 - 0
src/components/smtechart/bottom/bottom1Chart/chart.vue

@@ -336,6 +336,10 @@
                                     }
                                 },
                                 data: newData.weekLineData,
+                                label: {
+                                    show: true,
+                                    position: 'top'
+                                },
                                 lineSmooth: true,
                                 markLine: {
                                     silent: true,

+ 78 - 57
src/components/smtechart/up/up1Chart/chart.vue

@@ -4,7 +4,7 @@
     <Echart
       :options="options"
       id="up1Chart"
-      height="455px"
+      height="425px"
       width="100%"
       ref="column-board"
     ></Echart>
@@ -13,6 +13,7 @@
 
 <script>
 import Echart from '@/common/echart'
+//import { formatDate } from '../../../../utils/index.js'
 export default {
   data () {
     return {
@@ -23,12 +24,10 @@ export default {
             type: 'shadow'
           }
         },
-        legend: {
-         // data: ["标准产量", "实际产量达标","实际产量未达标" ,"抛料PPM"],
-        },
+        legend: {},
         grid: {
-          left: '2%',
-          right: '3%',
+          left: '3%',
+          right: '4%',
           bottom: '3%',
           containLabel: true
         },
@@ -36,66 +35,78 @@ export default {
           {
             type: 'category',
             data:[]
+            //data: ['插件-01', '插件-02', '插件-03', '插件-04', '插件-05', '插件-06', '插件-07'],
           }
         ],
         yAxis: [
           {
             type: 'value',
-            name: '产量',
           },
           {
             type: 'value',
-            name: '抛料PPM',
+            name: 'rate',
             min: 0,
-           /* max: 100,
-            interval: 20,*/
+            max: 100,
+            interval: 20,
+            axisLabel: {
+              formatter: '{value}%'
+            }
           }
 
         ],
         series: [
           {
-            name: '标准产量',
+            name: '投入',
             type: 'bar',
             barWidth: 20,
             emphasis: {
               focus: 'series'
             },
-            data:[],
-            itemStyle: {
-              color: '#31b4fb'
-            }
+            data:[]
+            //data: [320, 332, 301, 334, 390, 330, 320]
           },
           {
-            name: '实际产量',
+            name: '产出',
             type: 'bar',
             barWidth: 20,
+            stack: 'Ad',
             emphasis: {
               focus: 'series'
             },
-            data: [],
-            itemStyle: {
-              color: '#afe6c2'
+            data:[]
+            //data: [220, 232, 221, 234, 290, 230, 220]
+          },
+          {
+            name: '不良',
+            type: 'bar',
+            stack: 'Ad',
+            barWidth: 10,
+            data:[],
+            //data: [12, 22, 32, 12, 32, 12, 32],
+            emphasis: {
+              focus: 'series'
             }
           },
           {
-            name: '抛料PPM',
+            name: '良率%',
             type: 'line',
             data:[],
             yAxisIndex: 1,
-            symbolSize:14,
+            //data: [92, 92,92, 72, 82, 62, 62],
+            tooltip: {
+              valueFormatter: function (value) {
+                return value + '%';
+              }
+            },
             itemStyle: {
-              color: "rgba(156,107,211, 1)"
-            /*  normal: {
+              normal: {
                 barBorderRadius: 5,
                 color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
                   { offset: 0, color: "rgba(156,107,211,0.8)" },
                   { offset: 0.2, color: "rgba(156,107,211,0.5)" },
                   { offset: 1, color: "rgba(156,107,211,0.2)" }
                 ])
-              }*/
-            },
-            lineStyle: {
-              width: 5
+              }
             },
             emphasis: {
               focus: 'series'
@@ -127,48 +138,58 @@ export default {
     },
     async getdata() {
       //20220211 -+formatDate(new Date()
-      await this.$http.get("kanban/datalist.action?caller=KB!SMT!UP1&_noc=1&page=1&pageSize=100",{
-        params: {
-          condition: "1=1",
-        }
-      }).then((result)=>{
+      await this.$http.get("kanban/datalist.action?caller=WCDAYTURNOUT!SMT&_noc=1&page=1&pageSize=100",{
+            params: {
+              condition: "1=1",
+            }
+          }).then((result)=>{
                         let dataList = JSON.parse(result.data.data);
                         let xAxis0 = new Array();
                         let series0 = new Array();
                         let series1 = new Array();
                         let series2 = new Array();
+                        let series3 = new Array();
                         for (let index = 0; index < dataList.length; index++) {
                           const element = dataList[index];
-                          //
-                          xAxis0.push(element.v_hour);
-                          //标准产量
-                          series0.push(element.v_bbcl);
-                          //实际产量
-                          series1.push(element.v_sjcl);
-                          /*实际产量大于等于标准产量就是 产量达标 否则产量未达标,
-                          if(element.v_bbcl>element.v_sjcl) {
-                            // series1.push(element.v_sjcl);
-                            series1.push({
-                                  value: element.v_sjcl,
-                                  itemStyle: {
-                                    color: '#a9410b'
-                                  }
-                            });
-                          }else{
-                            series1.push({
-                              value: element.v_sjcl,
-                              itemStyle: {
-                                color: '#37e66f'
-                              }
-                            });
-                          }*/
-                          //抛料PPM
-                          series2.push(element.v_plppm);
+                          xAxis0.push(element.sp_wccode);
+                          //投入
+                          series0.push(element.v_inqty);
+                          //产出
+                          series1.push(element.v_outqty);
+                          //不良
+                          series2.push(element.v_ngqty);
+                          //良率
+                          series3.push(element.v_okrate);
                         }
                         this.options.xAxis[0].data = xAxis0;
                         this.options.series[0].data = series0;
                         this.options.series[1].data = series1;
                         this.options.series[2].data = series2;
+                        this.options.series[3].data = series3;
+                       /*let myChart = this.$children[0].chart;
+                       myChart.setOption({
+                          xAxis: {
+                            data: xAxis0
+                          },
+                          series: [
+                            {
+                              // 根据名字对应到相应的系列
+                              name: '投入',
+                              data: series0
+                            },
+                            {
+                              name: '产出',
+                              data: series2
+                            }, {
+                              name: '不良',
+                              data: series3
+                            },
+                            {
+                              name: '不良率%',
+                              data: series4
+                            },
+                          ]
+                        });*/
                       },(result)=>{
                         console.error(result)
                       }

+ 179 - 0
src/components/smtechart/up/up1ChartOld/chart.vue

@@ -0,0 +1,179 @@
+<template>
+  <div>
+    <!-- 年度开工率 -->
+    <Echart
+      :options="options"
+      id="up1Chart"
+      height="455px"
+      width="100%"
+      ref="column-board"
+    ></Echart>
+  </div>
+</template>
+
+<script>
+import Echart from '@/common/echart'
+export default {
+  data () {
+    return {
+      options:{
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        legend: {
+         // data: ["标准产量", "实际产量达标","实际产量未达标" ,"抛料PPM"],
+        },
+        grid: {
+          left: '2%',
+          right: '3%',
+          bottom: '3%',
+          containLabel: true
+        },
+        xAxis: [
+          {
+            type: 'category',
+            data:[]
+          }
+        ],
+        yAxis: [
+          {
+            type: 'value',
+            name: '产量',
+          },
+          {
+            type: 'value',
+            name: '抛料PPM',
+            min: 0,
+           /* max: 100,
+            interval: 20,*/
+          }
+
+        ],
+        series: [
+          {
+            name: '标准产量',
+            type: 'bar',
+            barWidth: 20,
+            emphasis: {
+              focus: 'series'
+            },
+            data:[],
+            itemStyle: {
+              color: '#31b4fb'
+            }
+          },
+          {
+            name: '实际产量',
+            type: 'bar',
+            barWidth: 20,
+            emphasis: {
+              focus: 'series'
+            },
+            data: [],
+            itemStyle: {
+              color: '#afe6c2'
+            }
+          },
+          {
+            name: '抛料PPM',
+            type: 'line',
+            data:[],
+            yAxisIndex: 1,
+            symbolSize:14,
+            itemStyle: {
+              color: "rgba(156,107,211, 1)"
+            /*  normal: {
+                barBorderRadius: 5,
+                color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                  { offset: 0, color: "rgba(156,107,211,0.8)" },
+                  { offset: 0.2, color: "rgba(156,107,211,0.5)" },
+                  { offset: 1, color: "rgba(156,107,211,0.2)" }
+                ])
+              }*/
+            },
+            lineStyle: {
+              width: 5
+            },
+            emphasis: {
+              focus: 'series'
+            }
+          }
+        ]
+      },
+    };
+  },
+  components: {
+    Echart, //子组件
+  },
+  props: {
+    cdata: {
+      type: Object,
+      default: () => ({})
+    },
+  },
+
+  mounted() {
+    this.getdata();
+    this.refreshdata();
+  },
+  methods: {
+    refreshdata() {
+      setInterval(() => {
+        this.getdata(); //获取-数据
+      }, 30000);
+    },
+    async getdata() {
+      //20220211 -+formatDate(new Date()
+      await this.$http.get("kanban/datalist.action?caller=KB!SMT!UP1&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "1=1",
+        }
+      }).then((result)=>{
+                        let dataList = JSON.parse(result.data.data);
+                        let xAxis0 = new Array();
+                        let series0 = new Array();
+                        let series1 = new Array();
+                        let series2 = new Array();
+                        for (let index = 0; index < dataList.length; index++) {
+                          const element = dataList[index];
+                          //
+                          xAxis0.push(element.v_hour);
+                          //标准产量
+                          series0.push(element.v_bbcl);
+                          //实际产量
+                          series1.push(element.v_sjcl);
+                          /*实际产量大于等于标准产量就是 产量达标 否则产量未达标,
+                          if(element.v_bbcl>element.v_sjcl) {
+                            // series1.push(element.v_sjcl);
+                            series1.push({
+                                  value: element.v_sjcl,
+                                  itemStyle: {
+                                    color: '#a9410b'
+                                  }
+                            });
+                          }else{
+                            series1.push({
+                              value: element.v_sjcl,
+                              itemStyle: {
+                                color: '#37e66f'
+                              }
+                            });
+                          }*/
+                          //抛料PPM
+                          series2.push(element.v_plppm);
+                        }
+                        this.options.xAxis[0].data = xAxis0;
+                        this.options.series[0].data = series0;
+                        this.options.series[1].data = series1;
+                        this.options.series[2].data = series2;
+                      },(result)=>{
+                        console.error(result)
+                      }
+              );
+    }
+  }
+}
+</script>

+ 44 - 0
src/components/smtechart/up/up1ChartOld/index.vue

@@ -0,0 +1,44 @@
+<template>
+  <div>
+    <Chart :cdata="cdata" />
+  </div>
+</template>
+
+<script>
+import Chart from './chart.vue'
+export default {
+  data () {
+    return {
+      cdata: {
+        rateData:[
+        ]
+      }
+    };
+  },
+  components: {
+    Chart,
+  },
+  mounted () {
+    //this.setData();
+  },
+  beforeDestroy () {
+    clearInterval(this.intervalId);
+    this.chart.dispose()
+    this.chart.clear()
+    this.chart=null
+  },
+  methods: {
+    // 根据自己的业务情况修改
+    setData () {
+      for (let i = 0; i < this.cdata.barData.length -1; i++) {
+        let rate = this.cdata.barData[i] / this.cdata.lineData[i];
+        this.cdata.rateData.push(rate.toFixed(2));
+      }
+      console.log(this)
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 7 - 5
src/components/smtechart/up/up3Chart/index.vue

@@ -59,11 +59,13 @@ export default {
                           sum1 +=element.v_cn;
                           totalsum = element.v_sum;
                         }
-                        xData0.push('其它');
-                       let ob = new Object();
-                       ob.value = totalsum-sum1;
-                       ob.name = '其它';
-                       seriesData0.push(ob);
+                        if(totalsum-sum1>0){
+                           xData0.push('其它');
+                           let ob = new Object();
+                           ob.value = totalsum-sum1;
+                           ob.name = '其它';
+                           seriesData0.push(ob);
+                       }
                        this.cdata.xData = xData0;
                        this.cdata.seriesData = seriesData0;
                       //console.log(this);

+ 13 - 9
src/views/smt/up1.vue

@@ -1,6 +1,14 @@
 <template>
   <div id="up1">
     <div class="bg-color-black">
+      <div class="d-flex pt-2 pl-2">
+        <span>
+          <icon name="chart-bar" class="text-icon"></icon>
+        </span>
+        <div class="d-flex">
+          <span class="fs-xl text mx-2">当日工段投产良率</span>
+        </div>
+      </div>
       <div>
         <Up1Chart />
       </div>
@@ -9,7 +17,7 @@
 </template>
 
 <script>
-import Up1Chart from '@/components/smtechart/up/up1Chart'
+  import Up1Chart from '@/components/smtechart/up/up1Chart'
 export default {
   components: {
     Up1Chart
@@ -18,21 +26,17 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-$box-height: 475px;
-$box-width: 100%;
+  $box-height: 475px;
+  $box-width: 100%;
 #up1 {
-  padding: 16px 16px;
+  padding: 10px 10px;
   height: $box-height;
   width: $box-width;
   border-radius: 5px;
   .bg-color-black {
-    height: $box-height - 30px;
+    height: $box-height - 20px;
     border-radius: 10px;
   }
-  .text {
-    color: #c3cbde;
-    font-size: 15px;
-  }
   .chart-box {
     margin-top: 16px;
     width: 170px;

+ 45 - 0
src/views/smt/up1Old.vue

@@ -0,0 +1,45 @@
+<template>
+  <div id="up1">
+    <div class="bg-color-black">
+      <div>
+        <Up1Chart />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Up1Chart from '@/components/smtechart/up/up1Chart'
+export default {
+  components: {
+    Up1Chart
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+$box-height: 475px;
+$box-width: 100%;
+#up1 {
+  padding: 16px 16px;
+  height: $box-height;
+  width: $box-width;
+  border-radius: 5px;
+  .bg-color-black {
+    height: $box-height - 30px;
+    border-radius: 10px;
+  }
+  .text {
+    color: #c3cbde;
+    font-size: 15px;
+  }
+  .chart-box {
+    margin-top: 16px;
+    width: 170px;
+    height: 170px;
+    .active-ring-name {
+      padding-top: 10px;
+    }
+  }
+}
+</style>