Kaynağa Gözat

华研看板,获取车间接口,增加返回车间设备总数,总数大于0的才展示稼动率

xiaost 6 ay önce
ebeveyn
işleme
7f8c7443a8
3 değiştirilmiş dosya ile 198 ekleme ve 6 silme
  1. 2 2
      src/views/login.vue
  2. 15 4
      src/views/oth/index.vue
  3. 181 0
      src/views/oth/left2-1.vue

+ 2 - 2
src/views/login.vue

@@ -101,9 +101,9 @@
                     (result)=>{
                         var res = JSON.parse(JSON.stringify(result.data.shopdata));
                         for (let i = 0; i < res.length; i++) {
-                            this.workshopoptions.push({label: res[i].WS_WORKSHOP, value: res[i].WS_WORKSHOP});
+                            this.workshopoptions.push({label: res[i].WS_WORKSHOP, value: res[i].WS_WORKSHOP,deviceqty:res[i].V_TOTALQTY});
                         }
-                       this.workshopoptions.push({'label':'办公室','value':'办公室'});
+                       this.workshopoptions.push({'label':'办公室','value':'办公室','deviceqty':0});
                        this.$store.commit('setShops',this.workshopoptions);
                       //设置默认值
                         /*if("" == this.loginForm.workshop || !result.data.shopdata.some(item => item.value === this.loginForm.workshop) ){

+ 15 - 4
src/views/oth/index.vue

@@ -61,14 +61,19 @@
         <div class="body-box">
           <!--左边 -->
           <div class="left-box">
-            <div>
+            <div v-if="deivceqty>0">
               <dv-border-box-12>
                 <left1 />
               </dv-border-box-12>
             </div>
-            <div>
+            <div v-if="deivceqty>0">
+              <dv-border-box-12>
+                <left2/>
+              </dv-border-box-12>
+            </div>
+            <div v-else>
               <dv-border-box-12>
-                <left2 />
+                <left21/>
               </dv-border-box-12>
             </div>
           </div>
@@ -97,6 +102,7 @@ import { formatTime } from '../../utils/index.js'
 import left1 from './left1.vue'
 import right1 from './right1.vue'
 import left2 from './left2.vue'
+import left21 from './left2-1.vue'
 import right2 from './right2.vue'
 import { mapState } from "vuex"
 
@@ -117,6 +123,7 @@ export default {
       dateWeek: null,
       weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
       decorationColor: ['#568aea', '#000000'],
+      deivceqty :0,
     }
   },
   components: {
@@ -124,11 +131,15 @@ export default {
     left2,
     right1,
     right2,
+    left21
   },
   created() {
-
+    //设备数量
+    let selectedDevQty = this.$store.getters.shops.find(item => item.value === this.$store.getters.shop);
+    if(selectedDevQty) this.deivceqty = selectedDevQty.deviceqty;
   },
   mounted() {
+    console.log(this.deivceqty);
     this.timeFn()
     this.cancelLoading()
   },

+ 181 - 0
src/views/oth/left2-1.vue

@@ -0,0 +1,181 @@
+<template>
+  <div id="left2-1">
+    <swiper class="listdata swiper" :options="swiperOption"  ref="mySwiper">
+      <swiper-slide  class="listdata" v-for="i in sreencount" :key="i"> <!--:key="item.dl_id"-->
+        <div class="item " v-for="item in devicedata.slice(16*(i-1), 16*i)" :key="item.sp_id"> <!--:key="item.dl_id"-->
+          <div class="bg-color-black" >
+            <div v-if="item.sp_id>0">
+              <div style=" color: #29dd70; font-size: 22px;" class="mg-t20">  {{item.v_type}} {{ item.v_code }} </div>
+              <div class="fs-md mg-t10 ">岗位:{{ item.sc_name }} </div>
+              <div class="fs-md mg-t10 ">工单:{{ item.v_makecode }} </div>
+              <div class="fs-md mg-t10 ">项目号:{{ item.v_itemcode }} </div>
+              <div class="fs-md mg-t10 ">产出数:{{ item.v_outqty }} </div>
+              <!--                  <div class ="circled">
+                                  <div class ="circleitem" style="padding-top: 10px;">
+                                    <div class="fs-xs">工单数:{{ item.ma_qty }} </div>
+                                    <div class="fs-xs">完成数:{{ item.outqty }}</div>
+                                  </div>
+                                  <div  class ="circleitem" >
+                                    <CircleChart :tips="item.rate" :id="item.id"/>
+                                  </div>
+                                </div>-->
+            </div>
+            <div v-else="" class="nodataitem">
+              <!--                  <span class=" display: block;"> 无数据</span>-->
+            </div>
+          </div>
+        </div>
+      </swiper-slide>
+      <div class="swiper-pagination" slot="pagination"></div>
+    </swiper>
+
+  </div>
+</template>
+
+<script>
+/*import CircleChart from '@/components/cxchart/bottom';*/
+import { swiper, swiperSlide } from 'vue-awesome-swiper';
+import 'swiper/dist/css/swiper.css';
+export default {
+  data() {
+    return {
+      devicedata:[],
+      swiperOption: {
+        direction: 'vertical',
+        slidesPerView: 1,
+        spaceBetween: 0,
+        autoplay:7000,
+        autoplayDisableOnInteraction:false,
+        pagination: '.swiper-pagination',
+        paginationClickable: true,
+        //loop: true,
+      },
+      sreencount :1,
+      timing :null
+    }
+  },
+  components: {
+    //CircleChart,
+    swiper,
+    swiperSlide
+  },
+  mounted () {
+    this.drawTimingFn();
+  },
+  computed: {
+    mySwiper () {
+      return this.$ref.mySwiper.swiper
+    }
+  },
+  beforeDestroy () {
+    clearInterval(this.timing)
+  },
+  methods: {
+    drawTimingFn () {
+      this.setData();
+      this.timing = setInterval(() => {
+        this.setData(); //获取--数据
+      }, 30000);
+    },
+    async setData () {
+      //  this.devicedata =[];
+      await this.$http.get("kanban/datalist.action?caller=KB!SourcePassedData&_noc=1&page=1&pageSize=100",{
+        params: {
+          condition: "shop='"+this.$store.getters.shop+"'",
+        }
+      }).then((result)=>{
+            let pageSize = 16;
+            let dataList = JSON.parse(result.data.data);
+            this.devicedata=dataList;
+            if(null != this.devicedata) {
+              let len = this.devicedata.length;
+              let cn = Math.ceil(len / pageSize);
+              this.sreencount =cn;
+              let minuscn = cn*pageSize-len;
+              if(minuscn>0){
+                let arr = new Array();
+                for(let i = 1; i<= minuscn; i++) {
+                  let ar1 = [{"sp_id":-1*i}];
+                  arr.push(ar1);
+                }
+                this.devicedata = this.devicedata.concat(arr);
+              }
+            }
+          },(result)=>{
+            console.error(result)
+          }
+      );
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+$box-height: 955px;
+#left2-1 {
+  height: $box-height;
+  .listdata{
+    //width: 1888px;
+    height: $box-height;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-around;
+    .item {
+      border-radius: 6px;
+      padding: 4px 1px 0px 4px;
+      margin-top: 4px;
+      width: 24.2%;
+      height: 200px;
+      .inlineshow{
+        white-space:nowrap;/*强制单行显示*/
+        text-overflow:ellipsis;/*超出部分省略号表示*/
+        overflow:hidden;/*超出部分隐藏*/
+      }
+      .bg-color-black {
+        border-radius: 5px;
+        padding: 2px 2px 0px 8px;
+        height: 200px - 5px;
+        // font-family: Arial;
+        font-weight: bold;
+      }
+      .mg-t10 {
+        margin-top: 10px;
+      }
+      .mg-t20 {
+        margin-top: 20px;
+      }
+    }
+    .nodataitem{
+      display: flex;
+      justify-content: center; /* 水平居中 */
+      align-items: center;
+    }
+    .circled{
+      display: flex;
+      flex-wrap: wrap;
+      justify-content: space-around;
+      .circleitem {
+        /* border-radius: 6px;
+         padding-top: 8px;
+         margin-top: 4px;*/
+        width: 50%;
+      }
+    }
+    .swiper-pagination {
+      //height: 10px;
+      ::v-deep .swiper-pagination-bullet{
+        width: 15px;  /* 设置宽度 */
+        height: 15px
+      }
+      ::v-deep .swiper-pagination-bullet{
+        background-color: #FFFFFF;
+      }
+      ::v-deep .swiper-pagination-bullet-active{
+        background-color: #007aff;
+      }
+
+    }
+  }
+}
+
+</style>