Ver Fonte

Merge remote-tracking branch 'origin/yidin-vue' into yidin-vue

callm há 2 meses atrás
pai
commit
8c286a38d6
36 ficheiros alterados com 250 adições e 153 exclusões
  1. 1 1
      src/assets/scss/indexprodline.scss
  2. 0 1
      src/components/prodlinechart/bottom1Chart/index.vue
  3. 0 1
      src/components/prodlinechart/bottom2Chart/index.vue
  4. 5 1
      src/components/qualityechart/bottom1Chart/four/index.vue
  5. 5 1
      src/components/qualityechart/bottom1Chart/one/index.vue
  6. 5 1
      src/components/qualityechart/bottom1Chart/three/index.vue
  7. 5 1
      src/components/qualityechart/bottom1Chart/two/index.vue
  8. 20 7
      src/components/qualityechart/bottom3Chart/index.vue
  9. 5 1
      src/components/qualityechart/up1Chart/index.vue
  10. 5 2
      src/components/shopechart/bottom1Chart/chart.vue
  11. 0 1
      src/components/shopechart/bottom1Chart/index.vue
  12. 5 2
      src/components/shopechart/bottom2Chart/chart.vue
  13. 0 1
      src/components/shopechart/bottom2Chart/index.vue
  14. 5 2
      src/components/shopechart/up4Chart/index.vue
  15. 0 1
      src/components/smtechart/centerLeft/centerLeft1ALLChart/index.vue
  16. 0 1
      src/components/smtechart/up/up1Chart/index.vue
  17. 0 1
      src/components/smtechart/up/up1ChartOld/index.vue
  18. 0 1
      src/components/smtechart/up/up2ChartOld/index.vue
  19. 0 1
      src/components/totalchart/bottom/bottomLeft2Chart/index.vue
  20. 0 1
      src/components/totalchart/centerLeft/centerLeft1ALLChart/index.vue
  21. 7 6
      src/main.js
  22. 15 14
      src/store/index.js
  23. 50 11
      src/views/login.vue
  24. 29 25
      src/views/prodline/index.vue
  25. 1 2
      src/views/prodline/up1.vue
  26. 6 3
      src/views/prodline/up3.vue
  27. 9 3
      src/views/quality/bottom2.vue
  28. 7 2
      src/views/quality/bottom3.vue
  29. 18 15
      src/views/quality/index.vue
  30. 6 1
      src/views/quality/up2.vue
  31. 7 1
      src/views/quality/up3.vue
  32. 13 33
      src/views/shop/index.vue
  33. 5 2
      src/views/shop/up1.vue
  34. 5 2
      src/views/shop/up2.vue
  35. 6 2
      src/views/shop/up3.vue
  36. 5 2
      src/views/shop/up4.vue

+ 1 - 1
src/assets/scss/indexprodline.scss

@@ -72,7 +72,7 @@
         width: 500px;
       }
       font-size: 18px;
-      width: 300px;
+      width: 120px;
       line-height: 50px;
       text-align: center;
       transform: skewX(-45deg);

+ 0 - 1
src/components/prodlinechart/bottom1Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 0 - 1
src/components/prodlinechart/bottom2Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 5 - 1
src/components/qualityechart/bottom1Chart/four/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -40,7 +44,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
           {
             params: {
-              condition: "1=1",
+              condition: "V_OUTLINE='"+this.factory+"'",
             }
           }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 5 - 1
src/components/qualityechart/bottom1Chart/one/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -39,7 +43,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
           {
             params: {
-              condition: "1=1",
+              condition: "V_OUTLINE='"+this.factory+"'",
             }
           }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 5 - 1
src/components/qualityechart/bottom1Chart/three/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -41,7 +45,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
           {
             params: {
-              condition: "1=1",
+              condition: "V_OUTLINE='"+this.factory+"'",
             }
           }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 5 - 1
src/components/qualityechart/bottom1Chart/two/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -41,7 +45,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
           {
             params: {
-              condition: "1=1",
+              condition: "V_OUTLINE='"+this.factory+"'",
             }
           }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 20 - 7
src/components/qualityechart/bottom3Chart/index.vue

@@ -6,7 +6,11 @@
 
 <script>
 import Chart from './chart.vue'
+import {mapState} from "vuex";
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       drawTiming: null,
@@ -64,8 +68,11 @@ export default {
           +"/"
           +(dateBase.getDate()  < 10 ? "0" + (dateBase.getDate()) : dateBase.getDate() );
       //获取统计数据,上周,历史
-      await this.$http.get("kanban/datalist.action?caller=KB!QualityBadDutyInfo&_noc=1&page=1&pageSize=100&condition=1=1")
-          .then((result)=>{
+      await this.$http.get("kanban/datalist.action?caller=KB!QualityBadDutyInfo&_noc=1&page=1&pageSize=100", {
+          params: {
+            condition: "V_OUTLINE='"+this.factory+"'",
+          }
+      }).then((result)=>{
                 let dataList = JSON.parse(result.data.data);
                 let lastw ;
                 let hisd;
@@ -84,8 +91,11 @@ export default {
               }
           );
       //良率直通图
-      await this.$http.get("kanban/datalist.action?caller=KB!QualityDayOkRate&_noc=1&page=1&pageSize=100&condition=1=1")
-          .then((result)=>{
+      await this.$http.get("kanban/datalist.action?caller=KB!QualityDayOkRate&_noc=1&page=1&pageSize=100", {
+        params: {
+          condition: "V_OUTLINE='"+this.factory+"'",
+        }
+      }).then((result)=>{
                 let dataList = JSON.parse(result.data.data);
                 let weekCategory = new Array();
                 let weekLineData = new Array();
@@ -103,7 +113,7 @@ export default {
                 }
                 //获取最小值,取整十的数
                 minDa = Math.floor(minDa/10)*10;
-                //this.cdata.minData = minDa;
+                this.cdata.minData = minDa;
                 this.cdata.weekCategory = weekCategory;
                 this.cdata.weekLineData = weekLineData;
               },(result)=>{
@@ -111,8 +121,11 @@ export default {
               }
           );
       //雷达图:
-      await this.$http.get("kanban/datalist.action?caller=KB!QualityRadiusBadDuty&_noc=1&page=1&pageSize=100&condition=1=1")
-          .then((result)=>{
+      await this.$http.get("kanban/datalist.action?caller=KB!QualityRadiusBadDuty&_noc=1&page=1&pageSize=100", {
+        params: {
+          condition: "V_OUTLINE='"+this.factory+"'",
+        }
+      }).then((result)=>{
                 let dataList = JSON.parse(result.data.data);
                 let radarData = new Array();
                 let radarAvgData = new Array();

+ 5 - 1
src/components/qualityechart/up1Chart/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -42,7 +46,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
               {
                 params: {
-                  condition: "1=1",
+                  condition: "V_OUTLINE='"+this.factory+"'",
                 }
               }).then((result)=>{
                         let dataList = JSON.parse(result.data.data);

+ 5 - 2
src/components/shopechart/bottom1Chart/chart.vue

@@ -12,8 +12,12 @@
 
 <script>
 import Echart from '@/common/echart'
+import {mapState} from "vuex";
 //import { formatDate } from '../../../../utils/index.js'
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -174,8 +178,7 @@ export default {
       var caller = 'KB!ShopPlanFinishInfo';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition:  "v_wccode='"+sessionStorage.getItem('wc_code')+"'"
-              + " and V_OUTLINE='"+sessionStorage.getItem('shli_code')+"'",
+          condition:  "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 0 - 1
src/components/shopechart/bottom1Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 5 - 2
src/components/shopechart/bottom2Chart/chart.vue

@@ -12,8 +12,12 @@
 
 <script>
 import Echart from '@/common/echart'
+import {mapState} from "vuex";
 //import { formatDate } from '../../../../utils/index.js'
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -218,8 +222,7 @@ export default {
       var caller = 'KB!ShopHourQTY';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition:  "v_wccode='"+sessionStorage.getItem('wc_code')+"'"
-              + " and v_outline='"+sessionStorage.getItem('shli_code')+"'",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 0 - 1
src/components/shopechart/bottom2Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 5 - 2
src/components/shopechart/up4Chart/index.vue

@@ -6,8 +6,12 @@
 
 <script>
 import Chart from './chart.vue';
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data () {
     return {
       timing :null,
@@ -42,8 +46,7 @@ export default {
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",
               {
                 params: {
-                  condition: "v_wccode='"+sessionStorage.getItem('wc_code')+"'"
-                      + " and v_outline='"+sessionStorage.getItem('shli_code')+"'",
+                  condition: "V_OUTLINE='"+this.factory+"'",
                 }
               }).then((result)=>{
                         let dataList = JSON.parse(result.data.data);

+ 0 - 1
src/components/smtechart/centerLeft/centerLeft1ALLChart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 0 - 1
src/components/smtechart/up/up1Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

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

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 0 - 1
src/components/smtechart/up/up2ChartOld/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 0 - 1
src/components/totalchart/bottom/bottomLeft2Chart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 0 - 1
src/components/totalchart/centerLeft/centerLeft1ALLChart/index.vue

@@ -34,7 +34,6 @@ export default {
         let rate = this.cdata.barData[i] / this.cdata.lineData[i];
         this.cdata.rateData.push(rate.toFixed(2));
       }
-      console.log(this)
     },
   }
 };

+ 7 - 6
src/main.js

@@ -72,12 +72,13 @@ Vue.prototype.$http.interceptors.request.use(config => {
   if(sessionStorage.getItem('x-access-token')) {
     config.headers['x-access-token'] = sessionStorage.getItem('x-access-token');
   }
-  if(config.params && config.params['condition']) {
-    //console.log(sessionStorage.getItem('li_code'));
-    /*if(sessionStorage.getItem('li_code') != '所有') {
-      config.params['condition'] = config.params['condition'] + " and V_LICODE='" + sessionStorage.getItem('li_code') + "'";
-    }*/
-  }
+  /* if(config.params && config.params['condition']) {
+     console.log(store.state.factory);
+     config.params['condition'] = config.params['condition'] + " and v_outline='" + store.state.factory + "'";
+     /*if(sessionStorage.getItem('li_code') != '所有') {
+       config.params['condition'] = config.params['condition'] + " and V_LICODE='" + sessionStorage.getItem('li_code') + "'";
+     }
+  }*/
   return config;
 });
 

+ 15 - 14
src/store/index.js

@@ -7,32 +7,33 @@ Vue.use(Vuex)
 export default new Vuex.Store({
   state: {
     user:'',
-    lineoptions:'', //所有线别
-    line:''  //当前选中的线别
+    factoryoptions :[], //数组厂区
+    factory:'',//厂区
   },
   mutations: {
     setUser(state,user){
       state.user = { ... user};
-      sessionStorage.setItem('user',JSON.stringify(user));
+      //sessionStorage.setItem('user',JSON.stringify(user));
     },
-    setLines(state, lines) {
-      state.lineoptions = lines;
-    },
-    setline(state, line) {
-      state.line = line;
+    setFactoryOptions(state,factories){
+      state.factoryoptions = factories;
     },
+    setFactory(state,factory){
+      state.factory = factory;
+    }
   },
   getters : {
     user(state) {
-      return state.user || JSON.parse(sessionStorage.getItem("user"))
+      return state.user //|| JSON.parse(sessionStorage.getItem("user"))
     },
-    lines(state){
-      return state.lines
+    factoryoptions(state) {
+      return state.factoryoptions
     },
-    line(state){
-      return state.line
+    factory(state){
+      return state.factory
     }
   },
+
   actions: {
   },
   modules: {
@@ -41,6 +42,6 @@ export default new Vuex.Store({
     // eslint-disable-next-line no-undef
      createPersistedState({
        storage:sessionStorage //指明存储在sessionStorage中
-       })
+     })
   ]
 })

+ 50 - 11
src/views/login.vue

@@ -24,6 +24,16 @@
                     </el-option>
                 </el-select>
             </el-form-item>
+          <el-form-item prop="factory">
+            <el-select v-model="loginForm.factory"  placeholder="请选择厂区" style="width:100%">
+              <el-option
+                  v-for="item in factoryoptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
             <el-form-item prop="username">
                 <el-input type="text" v-model="loginForm.username" placeholder="请输入用户名" >
                 </el-input>
@@ -50,7 +60,8 @@
                     sob:"",
                     username:"",
                     password:"",
-                    type:"产线看板"
+                    type:"产线看板",
+                    factory:""
                 },
                 checked: true,
                 rules:{
@@ -65,9 +76,9 @@
                     {label: '车间看板', value: '车间看板'},
                     {label: '产线看板', value: '产线看板'},
                     {label: '品质看板', value: '品质看板'},
-                    {label: '设备看板', value: '设备看板'}
-                ]
-
+                   /* {label: '设备看板', value: '设备看板'}*/
+                ],
+                factoryoptions:[],  //产区
             }
         },
         created() {
@@ -75,6 +86,8 @@
             this.getCookies();
             //获取账套信息
             this.getMasters();
+            //获取厂区信息
+            this.getFactory();
         },
         mounted() {
             //监听enter键
@@ -100,7 +113,21 @@
                         console.error(result)
                     });
             },
-
+            getFactory(){
+            this.$http.get("kanban/getFactory.action").then(
+                (result)=>{
+                  var res = JSON.parse(JSON.stringify(result.data.factories));
+                  for (let i = 0; i < res.length; i++) {
+                    this.factoryoptions.push({label: res[i].FA_NAME, value: res[i].FA_NAME});
+                  }
+                  //设置默认值
+                  if("" == this.loginForm.factory || !result.data.factories.some(item => item.FA_NAME === this.loginForm.factory) ){
+                    this.loginForm.factory = res[0].FA_NAME;
+                  }
+                },(result)=>{
+                  console.error(result)
+                });
+          },
             //登录操作
             submitLogin(){
                 this.$refs.loginForm.validate((valid) => {
@@ -112,15 +139,13 @@
                                     username:this.loginForm.username,
                                     password:this.loginForm.password,
                                     sob:this.loginForm.sob,
-                                    type:this.loginForm.type
+                                    type:this.loginForm.type,
+                                    factory:this.loginForm.factory
                                 }}).then(
                             (result)=>{
                                 var res = result.data;
                                 if(res.success || "检测到您已登录本系统,请不要重复登录、打开空白页!" == res.reason) {
-                                    //登录成功返回session
-                                    sessionStorage.setItem('x-access-token', res.token);
-                                    sessionStorage.setItem('user',res);
-                                    this.$store.commit('setUser',res);
+                                    this.setStoreSession(res);
                                     this.setCookieData();
                                     if(this.loginForm.type =='产线看板'){
                                         this.$router.push({path: this.redirect || '/prodline'});
@@ -155,6 +180,14 @@
                     this.submitLogin();
                 }
             },
+           setStoreSession(res){
+             //登录成功返回session
+             sessionStorage.setItem('x-access-token', res.token);
+             sessionStorage.setItem('user',res);
+             this.$store.commit('setUser',res);
+             this.$store.commit('setFactoryOptions',this.factoryoptions);
+             this.$store.commit('setFactory',this.loginForm.factory);
+           },
             setCookieData(){
                 if (this.checked) {
                     this.$cookie.set(
@@ -179,6 +212,9 @@
                 this.$cookie.set("checked", this.checked, {
                     expires: 30,
                 });
+                this.$cookie.set("factory", this.loginForm.factory, {
+                  expires: 30,
+                });
             },
             getCookies(){
                 if(this.$cookie.get("sob")) {
@@ -199,6 +235,9 @@
                         this.checked = false;
                     }
                 }
+                if(this.$cookie.get("factory")) {
+                  this.loginForm.factory = this.$cookie.get("factory");
+                }
             }
         },
     };
@@ -208,7 +247,7 @@
     .loginContainer{
         border-radius: 15px;
         background-clip: padding-box;
-        margin: 180px auto;
+        margin: 120px auto;
         width: 350px;
         padding: 15px 35px 15px 35px;
         background: aliceblue;

+ 29 - 25
src/views/prodline/index.vue

@@ -42,19 +42,6 @@
             </div>
             <div class="react-right mr-4 react-l-s" style="width: 900px">
               <span class="react-after"></span>
-
-             <!-- <el-dropdown class="dropdown">
-                <span class="el-dropdown-link" ref="echarType">
-                   {{linecode.LI_CODE}} <i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>&nbsp;&nbsp;&nbsp;&nbsp;
-                </span>
-                <el-dropdown-menu slot="dropdown">
-                  <el-dropdown-item class="dropdownitem"
-                                    v-for="item in linedata"
-                                    :key="item.LI_CODE"
-                  >{{item.LI_CODE}}</el-dropdown-item>
-                 </el-dropdown-menu>
-              </el-dropdown>*/-->
-
               <el-dropdown class="dropdown">
                 <span class="el-dropdown-link" ref="echarType">
                   产线看板<i class="el-icon-arrow-down el-icon--right"></i>&nbsp;&nbsp;&nbsp;&nbsp;
@@ -62,15 +49,24 @@
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item class="dropdownitem"><router-link to="shop">车间看板</router-link></el-dropdown-item>
                     <el-dropdown-item class="dropdownitem"><router-link to="quality">品质看板</router-link></el-dropdown-item>
-                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>
+<!--                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>-->
                   </el-dropdown-menu>
               </el-dropdown>
 
-             <el-select v-model="linecode" class="dropdown" @change ="handleBlur" style="width: 150px">
+              <el-select v-model="factory" class="dropdown" @change ="handleBlur" style="width:80px">
+                <el-option
+                    v-for="item in factoryoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                ></el-option>
+              </el-select>
+
+            <el-select v-model="linecode" class="dropdown" @change ="handleBlur1" style="width: 190px">
                 <el-option
                         v-for="item in linedata"
                         :key="item.LI_CODE"
-                        :label="item.LI_CODE"
+                        :label="`${(item.LI_NAME)}(${(item.LI_CODE)})`"
                         :value="item.LI_CODE"
                    ></el-option>
               </el-select>
@@ -123,12 +119,13 @@ import up2 from './up2'
 import up3 from './up3'
 import bottom1 from './bottom1'
 import bottom2 from './bottom2'
-import { mapState } from "vuex"
+import {mapMutations, mapState} from "vuex"
 
 export default {
   mixins: [ drawMixin ],
   computed: {
-    ...mapState('user', ['user'])
+    //数组写法
+    ...mapState(['user','factoryoptions','factory']),
   },
   data() {
     return {
@@ -140,7 +137,7 @@ export default {
       weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
       decorationColor: ['#568aea', '#000000'],
       linecode:null,
-      linedata:[]
+      linedata:[],
     }
   },
   components: {
@@ -162,6 +159,7 @@ export default {
     clearInterval(this.intervalId)
   },
   methods: {
+    ...mapMutations(['setFactory']),
     timeFn() {
       this.timing = setInterval(() => {
         this.dateDay = formatTime(new Date(), 'HH: mm: ss')
@@ -175,25 +173,31 @@ export default {
       }, 5000)
     },
     handleBlur (val){
+      this.setFactory(val);
+      location.reload();
+    },
+    handleBlur1 (val){
       sessionStorage.setItem('li_code',val);
-      this.$cookie.set("SMT_LI_CODE", val, {
-        expires: 30,
-      });
       location.reload();
     },
     getLines (){
-      this.$http.get("kanban/getLinesByWorkCenter.action").then(
+      this.$http.get("kanban/getLinesByFactory.action",{
+        params: {
+          fa_name: this.factory
+        }
+      }).then(
               (res)=>{
                 if(res.data.linedata) {
                   const data = res.data.linedata;
-                  if(this.$cookie.get("SMT_LI_CODE") && data.some(item => item.LI_CODE === this.$cookie.get("SMT_LI_CODE")) ){
+                  sessionStorage.setItem('li_code', data[0].LI_CODE);
+                  /*if(this.$cookie.get("SMT_LI_CODE") && data.some(item => item.LI_CODE === this.$cookie.get("SMT_LI_CODE")) ){
                     sessionStorage.setItem('li_code', this.$cookie.get("SMT_LI_CODE"));
                   }else {
                     sessionStorage.setItem('li_code', data[0].LI_CODE);
                     this.$cookie.set("SMT_LI_CODE", data[0].LI_CODE, {
                       expires: 30,
                     });
-                  }
+                  }*/
                   this.linedata = data;
                 }else{
                   sessionStorage.setItem('li_code','');

+ 1 - 2
src/views/prodline/up1.vue

@@ -43,7 +43,7 @@
             </div>
             <div  style="width:80%">
               <p class="colorText fw-b fs-xl ">
-                <span class="dv-dig-flop"> {{ upitem.v_resttime }}
+                <span class="dv-dig-flop"> {{ upitem.v_jitype }}
               </span>
               </p>
             </div>
@@ -176,7 +176,6 @@ export default {
               this.bardata.planData = [dataList[0].v_planinqty,dataList[0].v_planoutqty];
               this.bardata.actData = [dataList[0].v_actinqty,dataList[0].v_actoutqty];
               this.bardata.max = Math.ceil(maxnumber*1.2);
-              console.log(this.bardata.max);
               //this.options.yAxis[0].max = (maxnumber*1.2).toFixed();
             }else{
               this.upitem={

+ 6 - 3
src/views/prodline/up3.vue

@@ -8,7 +8,7 @@
         <div class="item fs-xxxl">
           <p class="ml-3 colorText fw-b ">拉长</p>
           <div class="dv-dig-flop ml-1 mt-2 pl-3 ">
-            <div class = 'ai-center d-flex'>
+            <div class = 'ai-center d-flex w-80' >
               <p>{{ upitem.v_leadname }}</p>
             </div>
             <img :src="imgSrc1" class="responsive-img">
@@ -27,7 +27,7 @@
         <div class="item fs-xxxl">
           <p class="ml-3 fw-b fs-xl">IPQC</p>
           <div class="dv-dig-flop ml-1 mt-2 pl-3 ">
-            <div class = 'ai-center d-flex'>
+            <div class = 'ai-center d-flex w-80'>
               <p>{{ upitem.v_quaname }}</p>
             </div>
             <img :src="imgSrc2"  class="responsive-img">
@@ -36,7 +36,7 @@
         <div class="item fs-xxxl">
           <p class="ml-3 colorText fw-b ">PE</p>
           <div class="dv-dig-flop ml-1 mt-2 pl-3 ">
-            <div class = 'ai-center d-flex'>
+            <div class = 'ai-center d-flex w-80'>
               <p>{{ upitem.v_engineername }}</p>
             </div>
             <img :src="imgSrc3" class="responsive-img"> <!--//imgSrc1-->
@@ -156,6 +156,9 @@ $box-width: 100%;
         display: flex;
       //  align-items: center;
       }
+      .w-80{
+        width : 80px;
+      }
       .responsive-img {
         width: 150px; /* 或者指定宽度,如 300px */
         height: 150px; /* 保持图片的宽高比 */

+ 9 - 3
src/views/quality/bottom2.vue

@@ -74,7 +74,13 @@
 </template>
 
 <script>
+import {mapState} from "vuex";
+
 export default {
+  computed: {
+    //数组写法
+    ...mapState(['user','factoryoptions','factory']),
+  },
   data() {
     return {
       timing:null,
@@ -114,7 +120,7 @@ export default {
       var caller = 'KB!QualityOBAData';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "1=1",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);
@@ -129,7 +135,7 @@ export default {
       caller = 'KB!QualityOQCData';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "1=1",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);
@@ -144,7 +150,7 @@ export default {
       caller = 'KB!QualityFirstData';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "1=1",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 7 - 2
src/views/quality/bottom3.vue

@@ -31,16 +31,21 @@
 
 <script>
 import Bottom3Chart from "@/components/qualityechart/bottom3Chart";
+import {mapState} from "vuex";
 export default {
   components: {
     Bottom3Chart
   },
+  computed: {
+    //数组写法
+    ...mapState(['user','factoryoptions','factory']),
+  },
   data() {
     return {
       config: {
         header: ['车间', '产出', '不良','直通率%'],
         data: [],
-        rowNum: 5, //表格行数
+        rowNum: 4, //表格行数
         headerHeight: 35,
         headerBGC: '#0f1325', //表头
         oddRowBGC: '#0f1325', //奇数行
@@ -69,7 +74,7 @@ export default {
       var caller = 'KB!QualityZTRate';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100", {
         params: {
-          condition:  "1=1",
+          condition:  "V_OUTLINE='"+this.factory+"'",
         }
       })
           .then((result)=>{

+ 18 - 15
src/views/quality/index.vue

@@ -43,18 +43,6 @@
             <div class="react-right mr-4 react-l-s" style="width: 900px">
               <span class="react-after"></span>
 
-             <!-- <el-dropdown class="dropdown">
-                <span class="el-dropdown-link" ref="echarType">
-                   {{linecode.LI_CODE}} <i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>&nbsp;&nbsp;&nbsp;&nbsp;
-                </span>
-                <el-dropdown-menu slot="dropdown">
-                  <el-dropdown-item class="dropdownitem"
-                                    v-for="item in linedata"
-                                    :key="item.LI_CODE"
-                  >{{item.LI_CODE}}</el-dropdown-item>
-                 </el-dropdown-menu>
-              </el-dropdown>*/-->
-
               <el-dropdown class="dropdown">
                 <span class="el-dropdown-link" ref="echarType">
                   品质看板<i class="el-icon-arrow-down el-icon--right"></i>&nbsp;&nbsp;&nbsp;&nbsp;
@@ -62,10 +50,19 @@
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item class="dropdownitem"><router-link to="shop">车间看板</router-link></el-dropdown-item>
                     <el-dropdown-item class="dropdownitem"><router-link to="prodline">产线看板</router-link></el-dropdown-item>
-                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>
+<!--                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>-->
                   </el-dropdown-menu>
               </el-dropdown>
 
+              <el-select v-model="factory" class="dropdown" @change ="handleBlur" style="width: 120px">
+                <el-option
+                    v-for="item in factoryoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                ></el-option>
+              </el-select>
+
               <span class="text">&nbsp;&nbsp;&nbsp;&nbsp;</span>
               <span class="text">{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span>
             </div>
@@ -118,12 +115,13 @@ import up3 from './up3'
 import bottom1 from './bottom1'
 import bottom2 from './bottom2'
 import bottom3 from './bottom3'
-import { mapState } from "vuex"
+import {mapMutations, mapState} from "vuex"
 
 export default {
   mixins: [ drawMixin ],
   computed: {
-    ...mapState('user', ['user'])
+    //数组写法
+    ...mapState(['user','factoryoptions','factory']),
   },
   data() {
     return {
@@ -155,6 +153,7 @@ export default {
     clearInterval(this.intervalId)
   },
   methods: {
+    ...mapMutations(['setFactory']),
     timeFn() {
       this.timing = setInterval(() => {
         this.dateDay = formatTime(new Date(), 'HH: mm: ss')
@@ -167,6 +166,10 @@ export default {
         this.loading = false
       }, 5000)
     },
+    handleBlur (val) {
+      this.setFactory(val);
+      location.reload();
+    },
   }
 }
 </script>

+ 6 - 1
src/views/quality/up2.vue

@@ -13,7 +13,12 @@
 
 <script>
 
+import {mapState} from "vuex";
+
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data() {
     return {
       timing:null,
@@ -44,7 +49,7 @@ export default {
       //关键工序直通率
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "1=1",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 7 - 1
src/views/quality/up3.vue

@@ -13,7 +13,13 @@
 
 <script>
 
+import {mapState} from "vuex";
+
 export default {
+  computed: {
+    //数组写法
+    ...mapState(['user','factoryoptions','factory']),
+  },
   data() {
     return {
       timing:null,
@@ -50,7 +56,7 @@ export default {
       //关键工序直通率
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "1=1",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
         let dataList = JSON.parse(result.data.data);

+ 13 - 33
src/views/shop/index.vue

@@ -49,24 +49,16 @@
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item class="dropdownitem"><router-link to="prodline">产线看板</router-link></el-dropdown-item>
                     <el-dropdown-item class="dropdownitem"><router-link to="quality">品质看板</router-link></el-dropdown-item>
-                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>
+<!--                    <el-dropdown-item class="dropdownitem"><router-link to="device">设备看板</router-link></el-dropdown-item>-->
                   </el-dropdown-menu>
               </el-dropdown>
 
-             <el-select v-model="wccode" class="dropdown" @change ="handleBlur" style="width: 120px">
+              <el-select v-model="factory" class="dropdown" @change ="handleBlur" style="width: 120px">
                 <el-option
-                        v-for="item in shopdata"
-                        :key="item.WC_CODE"
-                        :label="item.WC_NAME"
-                        :value="item.WC_CODE"
-                   ></el-option>
-              </el-select>
-              <el-select v-model="linecode" class="dropdown" @change ="handleBlur1" style="width: 120px">
-                <el-option
-                    v-for="item in linedata"
-                    :key="item.LI_CODE"
-                    :label="item.LI_NAME"
-                    :value="item.LI_CODE"
+                    v-for="item in factoryoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
                 ></el-option>
               </el-select>
 
@@ -124,12 +116,12 @@ import up3 from './up3'
 import up4 from './up4'
 import bottom1 from './bottom1'
 import bottom2 from './bottom2'
-import { mapState } from "vuex"
+import {mapMutations, mapState} from "vuex"
 
 export default {
   mixins: [ drawMixin ],
   computed: {
-    ...mapState('user', ['user'])
+    ...mapState(['user','factoryoptions','factory']),
   },
   data() {
     return {
@@ -140,10 +132,6 @@ export default {
       dateWeek: null,
       weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
       decorationColor: ['#568aea', '#000000'],
-      wccode:null,
-      shopdata:[],
-      linecode:null,
-      linedata:[],
     }
   },
   components: {
@@ -155,7 +143,7 @@ export default {
     bottom2
   },
   created() {
-    this.getShops();
+
   },
   mounted() {
     this.timeFn()
@@ -166,6 +154,7 @@ export default {
     clearInterval(this.intervalId)
   },
   methods: {
+    ...mapMutations(['setFactory']),
     timeFn() {
       this.timing = setInterval(() => {
         this.dateDay = formatTime(new Date(), 'HH: mm: ss')
@@ -179,19 +168,10 @@ export default {
       }, 5000)
     },
     handleBlur (val){
-      sessionStorage.setItem('wc_code',val);
-      this.$cookie.set("SHOP_WC_CODE", val, {
-        expires: 30,
-      });
+      this.setFactory(val);
       location.reload();
     },
-    handleBlur1 (val) {
-      sessionStorage.setItem('shli_code', val);
-      this.$cookie.set("SH_LI_CODE", val, {
-        expires: 30,
-      });
-    },
-    getShops (){
+    /*getShops (){
       this.$http.get("kanban/getAllWorkCenter.action").then(
               (res)=>{
                 if(res.data.centerdata) {
@@ -238,7 +218,7 @@ export default {
               console.error(result)
             });
       }
-    }
+    }*/
   }
 }
 </script>

+ 5 - 2
src/views/shop/up1.vue

@@ -15,8 +15,12 @@
 
 <script>
 import BarChart from '@/components/shopechart/up1Chart'
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data() {
     return {
       timing:null,
@@ -48,8 +52,7 @@ export default {
       var caller = 'KB!ShopLinePlan';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "v_wccode='"+sessionStorage.getItem('wc_code')+"'" +
-              " and V_OUTLINE='"+sessionStorage.getItem('shli_code')+"'",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 5 - 2
src/views/shop/up2.vue

@@ -15,8 +15,12 @@
 
 <script>
 import BarChart from '@/components/shopechart/up2Chart'
+import {mapState} from "vuex";
 
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data() {
     return {
       timing:null,
@@ -48,8 +52,7 @@ export default {
       var caller = 'KB!ShopLineMonthPlan';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "v_wccode='"+sessionStorage.getItem('wc_code')+"'"+
-              " and V_OUTLINE='"+sessionStorage.getItem('shli_code')+"'",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 6 - 2
src/views/shop/up3.vue

@@ -13,7 +13,12 @@
 
 <script>
 
+import {mapState} from "vuex";
+
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data() {
     return {
       timing:null,
@@ -44,8 +49,7 @@ export default {
       //关键工序直通率
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
         params: {
-          condition: "v_wccode='"+sessionStorage.getItem('wc_code')+"'"+
-              " and v_outline='"+sessionStorage.getItem('shli_code')+"'",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       }).then((result)=>{
             let dataList = JSON.parse(result.data.data);

+ 5 - 2
src/views/shop/up4.vue

@@ -31,7 +31,11 @@
 
 <script>
 import BadChart from '@/components/shopechart/up4Chart'
+import {mapState} from "vuex";
 export default {
+  computed: {
+    ...mapState(['factory']),
+  },
   data() {
     return {
       config: {
@@ -69,8 +73,7 @@ export default {
       var caller = 'KB!SHOPDPLANTOUTPUT';
       await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100", {
         params: {
-          condition: "v_wccode='"+sessionStorage.getItem('wc_code')+"'"
-              +  " and v_outline='"+sessionStorage.getItem('shli_code')+"'",
+          condition: "V_OUTLINE='"+this.factory+"'",
         }
       })
           .then((result)=>{