Bläddra i källkod

组装车间全部看板修改

callm 1 år sedan
förälder
incheckning
0f476c3af9

+ 1 - 1
src/components/assemblyechart/bottom/bottomLeft2Chart/chart.vue

@@ -179,7 +179,7 @@ export default {
       //20220211 -+formatDate(new Date()
       var caller = 'WCDAYTURNOUT!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'WCDAYTURNOUT!ZZ!ALL';
+        caller = 'ZZ!WCDAYTURNOUT!ALL';
       }
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {

+ 2 - 2
src/components/assemblyechart/bottom/bottomRightChart/index.vue

@@ -57,11 +57,11 @@ export default {
       this.cdata.year = dateBase.getFullYear();
       this.cdata.nowdate = (dateBase.getMonth() + 1 < 10 ? "0" + (dateBase.getMonth() + 1) : dateBase.getMonth() + 1)
               +"/"
-              +(dateBase.getDate() + 1 < 10 ? "0" + (dateBase.getDate() + 1) : dateBase.getDate() + 1);
+              +(dateBase.getDate()  < 10 ? "0" + (dateBase.getDate() ) : dateBase.getDate() );
       //良率直通图
       var caller1 = 'DAYTURNOUT!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller1 = 'DAYTURNOUT!ZZ!ALL';
+        caller1 = 'ZZ!DAYTURNOUT!ALL';
       }
       await this.$http.get("kanban/datalist.action?caller="+caller1+"&_noc=1&page=1&pageSize=100",{
           params: {

+ 105 - 0
src/components/assemblyechart/centerLeft/centerChartRate/index.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <!-- 通过率/达标率 -->
+    <Echart
+        :options="options"
+        :id="id"
+        height="100px"
+        width="150px"
+    ></Echart>
+  </div>
+</template>
+
+<script>
+import Echart from '@/common/echart'
+export default {
+  data () {
+    return {
+      options: {},
+    };
+  },
+  components: {
+    Echart,
+  },
+  props: {
+    id: {
+      type: String,
+      required: true,
+      default: "chartRate"
+    },
+    tips: {
+      type: Number,
+      required: true,
+      default: 50
+    },
+    colorObj: {
+      type: Object,
+      default: function () {
+        return {
+          textStyle: "#3fc0fb",
+          series: {
+            color: ["#00bcd44a", "transparent"],
+            dataColor: {
+              normal: "#03a9f4",
+              shadowColor: "#97e2f5"
+            }
+          }
+        };
+      }
+    }
+  },
+  watch: {
+    // tips 是会变更的数据,所以进行监听
+    tips: {
+      handler (newData) {
+        this.options = {
+          title:{
+            text: newData * 1 + "%",
+            x: "center",
+            y: "center",
+            textStyle: {
+              color: this.colorObj.textStyle,
+              fontSize: 15
+            }
+          },
+          series: [
+            {
+              type: "pie",
+              radius: ["95%", "80%"],
+              center: ["50%", "50%"],
+              hoverAnimation: false,
+              color: this.colorObj.series.color,
+              label: {
+                normal: {
+                  show: false
+                }
+              },
+              data: [
+                {
+                  value: newData,
+                  itemStyle: {
+                    normal: {
+                      color: this.colorObj.series.dataColor.normal,
+                      shadowBlur: 10,
+                      shadowColor: this.colorObj.series.dataColor.shadowColor
+                    }
+                  }
+                },
+                {
+                  value: 100 - newData
+                }
+              ],
+              height: '90%',
+            }
+          ]
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 186 - 0
src/components/assemblyechart/centerLeft/centerLeft1ALLChart/chart.vue

@@ -0,0 +1,186 @@
+<template>
+  <div>
+    <!-- 年度开工率 -->
+    <Echart
+      :options="options"
+      id="centerLeft1ALLChart"
+      height="250px"
+      width="450px"
+      ref="column-board"
+    ></Echart>
+  </div>
+</template>
+
+<script>
+import Echart from '@/common/echart'
+//import { formatDate } from '../../../../utils/index.js'
+export default {
+    data () {
+    return {
+      timing :null,
+      options:{
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        legend: {
+          textStyle: {
+            fontSize: 18
+          },
+          itemWidth: 29,
+          itemHeight: 19
+        },
+        grid: {
+          left: '0%',
+          right: '0%',
+          bottom: '3%',
+          containLabel: true
+        },
+        xAxis: [
+          {
+            type: 'category',
+            axisLabel: {
+              show: false,
+              fontSize: 16,
+              fontWeight: "bold"
+            }
+          }
+        ],
+        yAxis: [
+          {
+            type: 'value',
+            axisLabel: {
+              fontSize: 16
+            }
+          },
+
+        ],
+        series: [
+          {
+            name: '计划数',
+            type: 'bar',
+            barWidth: 70,
+            emphasis: {
+              focus: 'series'
+            },
+            data:[],
+            label: {
+              show: true,
+              position: 'top',
+              fontSize:14,
+              fontWeight: "bold"
+            },
+          },
+          {
+            name: '投入数',
+            type: 'bar',
+            barWidth: 70,
+            emphasis: {
+              focus: 'series'
+            },
+            data:[],
+            label: {
+              show: true,
+              position: 'top',
+              color:'#fff'
+            },
+          },
+          {
+            name: '产出数',
+            type: 'bar',
+            stack: 'Ad',
+            barWidth: 70,
+            data:[],
+            emphasis: {
+              focus: 'series'
+            },
+            label: {
+              show: true,
+              position: 'top',
+              color:'#fff'
+            }
+          },
+          {
+            name: '不良数',
+            type: 'bar',
+            barWidth: 70,
+            data:[],
+            label: {
+              show: true,
+              position: 'top',
+              color:'#fff'
+            },
+            emphasis: {
+              focus: 'series'
+            }
+          }
+        ]
+      },
+    };
+  },
+  components: {
+    Echart, //子组件
+  },
+  props: {
+    cdata: {
+      type: Object,
+      default: () => ({})
+    },
+  },
+
+  mounted() {
+    this.getdata();
+    this.refreshdata();
+  },
+  beforeDestroy () {
+    clearInterval(this.timing)
+  },
+  methods: {
+    refreshdata() {
+      this.timing = setInterval(() => {
+        this.getdata(); //获取-数据
+      }, 30000);
+    },
+    async getdata() {
+      //20220211 -+formatDate(new Date()
+      var caller = 'MAKEQTY';
+      if (sessionStorage.getItem('li_code') == '所有'){
+        caller = 'ZZ!MAKEQTY!ALL';
+      }
+      await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "1=1",
+        }
+      }).then((result)=>{
+                        let dataList = JSON.parse(result.data.data);
+                        let series0 = new Array();
+                        let series1 = new Array();
+                        let series2 = new Array();
+                        let series3 = new Array();
+                        let xAxis0 = new Array();
+                        for (let index = 0; index < dataList.length; index++) {
+                          const element = dataList[index];
+                          xAxis0.push(element.inqty);
+                          series0.push(element.planqty);
+                          //投入
+                          series1.push(element.inqty);
+                          //产出
+                          series2.push(element.outqty);
+                          //不良
+                          series3.push(element.ngqty);
+                        }
+                        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;
+                      },(result)=>{
+                        console.error(result)
+                      }
+              );
+    }
+  }
+}
+</script>

+ 44 - 0
src/components/assemblyechart/centerLeft/centerLeft1ALLChart/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>

+ 1 - 1
src/components/assemblyechart/centerLeft/centerLeft1Chart/index.vue

@@ -47,7 +47,7 @@ export default {
       //20220211 -+formatDate(new Date()
       var caller = 'NGREASONF!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'NGREASONF!ZZ!ALL';
+        caller = 'ZZ!NGREASONF!ALL';
       }
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
               {

+ 1 - 1
src/components/assemblyechart/centerRight/centerRightChart/index.vue

@@ -75,7 +75,7 @@ export default {
       //  //雷达图:
       var caller = 'STEPOKRATE!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'STEPOKRATE!ZZ!ALL';
+        caller = 'ZZ!STEPOKRATE!ALL';
       }
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
               params: {

+ 2 - 2
src/views/assembly/center.vue

@@ -63,7 +63,7 @@ export default {
         headerBGC: '#0f1325', //表头
         oddRowBGC: '#0f1325', //奇数行
         evenRowBGC: '#171c33', //偶数行
-        columnWidth: [150,110,140],
+        columnWidth: [130,80,110],
         align: ['center']
       },
       timing : null,
@@ -116,7 +116,7 @@ export default {
                 );*/
       var caller = 'KeyStepRate!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'KeyStepRate!ALL!ZZ';
+        caller = 'ZZ!KeyStepRate!ALL';
       }
       //关键工序直通率
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{

+ 203 - 0
src/views/assembly/centerLeft1ALL.vue

@@ -0,0 +1,203 @@
+<template>
+  <div id="centerLeft1ALL">
+    <div class="bg-color-black">
+      <div class="d-flex pt-2 pl-2">
+        <span>
+          <icon name="chart-bar" class="text-icon"></icon>
+        </span>
+        <span class="fs-xl text mx-2 mb-1 pl-3">工单完成情况统计</span>
+      </div>
+      <div class="d-flex jc-center columnperent">
+         <CenterLeft1ALLChart/>
+      </div>
+      <div class="d-flex circleperent">
+          <div class="item"  v-for="item in rate" :key="item.id">
+          <span>{{ item.title }}</span>
+          <CenterChart :id="item.id" :tips="item.tips" :colorObj="item.colorData"/>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import CenterLeft1ALLChart from '@/components/assemblyechart/centerLeft/centerLeft1ALLChart'
+import CenterChart from '@/components/assemblyechart/centerLeft/centerChartRate'
+export default {
+  data() {
+    return {
+      titleItem:[],
+      config: {
+        data: [],
+        showValue: true
+      },
+      // 通过率和达标率的组件复用数据
+      rate: [
+        {
+          id: 'centerRate1',
+          tips: 50,
+          colorData: {
+            textStyle: '#31b4fb',
+            series: {
+              color: ['rgba(19,122,244,0.29)', 'transparent'],
+              dataColor: {
+                normal: '#137af4',
+                shadowColor: '#80e0f5'
+              }
+            }
+          }
+        },
+        {
+          id: 'centerRate2',
+          tips: 60,
+          colorData: {
+            textStyle: '#43cfe9',
+            series: {
+              color: ['#00bcd44a', 'transparent'],
+              dataColor: {
+                normal: '#32C5E9',
+                shadowColor: '#9fe5f5'
+              }
+            }
+          }
+        },
+        {
+          id: 'centerRate3',
+          tips: 60,
+          colorData: {
+            textStyle: '#6ad59c',
+            series: {
+              color: ['rgba(25,161,95,0.29)', 'transparent'],
+              dataColor: {
+                normal: '#00a11a',
+                shadowColor: '#6cda9c'
+              }
+            }
+          }
+        }
+      ],
+      intervalId :null
+    }
+  },
+  components: {
+    CenterLeft1ALLChart,
+    CenterChart
+  },
+  mounted() {
+    this.changeTiming()
+  },
+  beforeDestroy () {
+   clearInterval(this.intervalId)
+    this.chart.dispose()
+    this.chart.clear()
+    this.chart=null
+  },
+  methods: {
+    changeTiming() {
+      this.changeNumber();
+      this.intervalId =  setInterval(() => {
+        this.changeNumber()
+      }, 20000)
+    },
+    async changeNumber() {
+      var caller2 = 'ZZ!MakeComRate';
+      if (sessionStorage.getItem('li_code') == '所有'){
+        caller2 = 'ZZ!MakeComRate!ALL';
+      }
+      //工单关闭率
+      await this.$http.get("kanban/datalist.action?caller="+caller2+"&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "1=1",
+        }
+      }).then((result)=>{
+                let dataList = JSON.parse(result.data.data);
+                for (let index = 0; index < dataList.length; index++) {
+                  const element = dataList[index];
+                  this.rate[index].tips = element.rate;
+                  this.rate[index].title = element.title;
+                }
+              },(result)=>{
+                console.error(result)
+              }
+          );
+
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+$box-height: 420px;
+$box-width: 500px;
+#centerLeft1ALL {
+  padding: 0px;
+  height: $box-height;
+  font-size: 50px;
+  width: $box-width;
+  border-radius: 10px;
+  .bg-color-black {
+    height: $box-height - 10px;
+    border-radius: 10px;
+    padding: 5px;
+  }
+
+  .circleperent {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    .item {
+      width: 33%;
+      height: 118px;
+      span {
+        margin-top: 15px;
+        font-size: 18px;
+        display: flex;
+        justify-content: center;
+      }
+    }
+  }
+  .columnperent {
+    width: 100%;
+    display: flex;
+  }
+  .text {
+    color: #FFE900;
+  }
+  .dv-dec-3 {
+    position: relative;
+    width: 150px;
+    height: 20px;
+    top: -3px;
+  }
+
+  .bottom-data {
+    .item-box {
+      & > div {
+        padding-right: 5px;
+      }
+      font-size: 14px;
+      float: right;
+      position: relative;
+      width: 50%;
+      color: #d3d6dd;
+      .dv-digital-flop {
+        width: 120px;
+        height: 30px;
+      }
+      // 金币
+      .coin {
+        position: relative;
+        top: 6px;
+        font-size: 20px;
+        color: #ffc107;
+      }
+      .colorYellow {
+        color: yellowgreen;
+      }
+      p {
+        text-align: center;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/views/assembly/centerLeft_two.vue

@@ -90,7 +90,7 @@ export default {
     async settestdata(){
       var caller = 'MAKEQTY!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'MAKEQTY!ZZ!ALL';
+        caller = 'ZZ!MAKEQTY!ALL';
       }
       //完成工单数统计
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{

+ 1 - 1
src/views/assembly/centerRight1.vue

@@ -61,7 +61,7 @@ export default {
     async getdata() {
       var caller = 'DPLANTOUTPUT!ZZ';
       if (sessionStorage.getItem('li_code') == '所有'){
-        caller = 'DPLANTOUTPUT!ZZ!ALL';
+        caller = 'ZZ!DPLANTOUTPUT!ALL';
       }
     //  const {data} = await this.$http.get("kanban/panelView/parseData/2B247DC439B3?index=0&kanbanCode=2B23AC00BCFB");
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{

+ 6 - 1
src/views/assembly/index.vue

@@ -76,9 +76,12 @@
           <!-- 第三行数据 -->
           <div class="content-box">
             <div>
-              <dv-border-box-12>
+              <dv-border-box-12 v-show="linecode!='所有'">
                 <centerLeft_two />
               </dv-border-box-12>
+              <dv-border-box-12 v-show="linecode=='所有'">
+                <centerLeft1ALL />
+              </dv-border-box-12>
             </div>
             <div>
               <dv-border-box-12>
@@ -126,6 +129,7 @@ import centerRight1 from './centerRight1'
 import center from './center'
 import bottomLeft2 from './bottomLeft2'
 import bottomRight from './bottomRight'
+import centerLeft1ALL from "@/views/assembly/centerLeft1ALL.vue";
 
 export default {
   mixins: [ drawMixin ],
@@ -141,6 +145,7 @@ export default {
     }
   },
   components: {
+    centerLeft1ALL,
     centerLeft1,
     centerLeft_two,
     centerRight1,