瀏覽代碼

Merge remote-tracking branch 'origin/master' into master

姚云青 3 年之前
父節點
當前提交
e6aad0ccfa

+ 15 - 8
imcs-ui/src/components/Charts/GaugeGrade.vue

@@ -35,17 +35,24 @@ export default {
       chart: null
     }
   },
+  watch:{
+    gaugeData:{
+	  handler(newVal, oldVal) {		
+        console.log(newVal.value)
+      }	
+	}
+  },
   mounted() {
     this.initChart()
-  },
-  beforeDestroy() {
-    if (!this.chart) {
-      return
-    }
-    this.chart.dispose()
-    this.chart = null
-  },
+  },  
   methods: {
+	dispose(){
+      if (!this.chart) {
+      	  return
+      }
+      this.chart.dispose()
+      this.chart = null
+	},  
     initChart() {
       this.chart = echarts.init(document.getElementById(this.id))
 

+ 43 - 28
imcs-ui/src/views/zuihou/largeScreen/twoDatasModel/Index.vue

@@ -35,7 +35,7 @@
   				<div class="modelTitle marginBottom15">车间产线运转评估</div>
   				<!-- Echarts仪表盘 -->
   				<div class="gaugeDiv">
-  					<gauge-grade :gaugeData="gaugeData" :width="gaudeWidth" :height="gaudeHeight"></gauge-grade>
+  					<gauge-grade :gaugeData="gaugeData" :width="gaudeWidth" :height="gaudeHeight" ref="gauge"></gauge-grade>
   				</div>
   			</div>
   			<!-- 车间产线 -->
@@ -67,13 +67,13 @@
 					  <el-col :span="8">
 					  	<div id="percenter2" class="percenter">
 					  		<el-progress type="circle" :percentage="percentages[1]" color="#5cb87a" :stroke-width="10" :width="100"></el-progress>
-					  		<span class="pcText">体类加工单元</span>
+					  		<span class="pcText">体类加工单元</span>
 					  	</div>
 					  </el-col>
 					  <el-col :span="8">
 					  	<div id="percenter3" class="percenter">
 					  		<el-progress type="circle" :percentage="percentages[2]" color="#6a5acd" :stroke-width="10" :width="100"></el-progress>
-					  		<span class="pcText">体类加工单元</span>
+					  		<span class="pcText">体类加工单元</span>
 					  	</div>
 					  </el-col>
 					</el-row>
@@ -248,11 +248,11 @@
 	  					<div class="modelTitle2">设备生产资源</div>
 	  				</li>
 	  				<li v-for="(item, index) in mashingOneList.data" :key="index">
-	  					<span class="mStatus">运行中</span>
-	  					<!--<span class="mAudit">{{item.productionStatus.text}}</span>-->
+	  					<span class="mStatus">{{ item.controlStatusCN}}</span>
+	  					<span class="mAudit">{{item.productionStatusCN}}</span>
 	  					<img class="mashingImg" :src="item.pic" v-lazy="item.pic"  />
 	  					<div class="mashingDiv">
-	  						<!--<div class="mashingCode">{{ item.model }}</div> -->
+	  						<!--<div class="mashingCode">{{ item.productionStatusCN }}</div>-->
 	  						<div class="mashingName">{{ item.name }}</div>
 	  					</div>
 	  				</li>
@@ -300,7 +300,7 @@
 				RUN_MODE: {}  //运行模式
 			},
 			incomplete: 0,
-	    	gaugeData: {value: randomFloor(40,100)/100, name: '效率'},
+	    	gaugeData: {value: 0.5, name:"效率"},
 	    	gaudeWidth: '100%',
 	    	gaudeHeight: '190px',
 	    	percentages: [randomFloor(10,100), randomFloor(20,100), randomFloor(30,100)],
@@ -407,7 +407,7 @@
 	  	// DOM加载后,加载
 	  	this.$nextTick(()=> {
 	  		// 加载数据
-	  		this.initPercentPie()
+	  		//this.initPercentPie()
 	  	})
 	  },
 	  // 销毁
@@ -494,12 +494,20 @@
 	        areaMgrApi.iconGroupList({resourceStatus:"1",group:0}).then(res => {
 				//console.log(res)
 				if (res.status == 200 && res.data.isSuccess) {
-				    this.mashingOneList = this.filterResource(res.data.data.iconGroupList[0])
-					this.mashingTwoList = this.filterResource(res.data.data.iconGroupList[1])
-					this.mashingThreeList = this.filterResource(res.data.data.iconGroupList[2])					
-					//计算产线利用率
-					this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
+				    this.mashingOneList = this.filterResource(res.data.data.iconGroupList[0])					
+					this.mashingTwoList = this.filterResource(res.data.data.iconGroupList[1])					
+					this.mashingThreeList = this.filterResource(res.data.data.iconGroupList[2])
 					
+					this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
+						  parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
+										
+					let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length					
+					this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
+										
+					this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}
+					this.$refs.gauge.dispose()
+					this.$refs.gauge.initChart(this.gaugeData)
+					 
 				}else{
                     this.$message({
 						message: "设备数据查询失败",
@@ -532,7 +540,7 @@
 	  		var option1 = {
 			    value: vals == null ? randomFloor(67,77) : vals[0],    //百分比,必填
 			    name:'智能保障系统利用率',		//必填
-			    name2:'未利用率',
+			    name2:'保障中心未利用率',
 			    title:'',
 			    backgroundColor: null,
 			    color:['#24a9ea','#DDDDDD'],
@@ -543,8 +551,8 @@
 				
 				var option2 = {
 			    value: vals == null ? randomFloor(49,59) : vals[1],	  //百分比,必填
-			    name:'体类加工利用率',				//必填
-			    name2:'未利用率',			//必填
+			    name:'体类加工利用率',				//必填
+			    name2:'框体未利用率',			//必填
 			    title:'',
 			    backgroundColor: null,
 			    color:['#13ce66','#DDDDDD'],
@@ -555,8 +563,8 @@
 				
 				var option3 = {
 			    value: vals == null ? randomFloor(49,69) : vals[2],	  //百分比,必填
-			    name:'体类加工利用率',				//必填
-			    name2:'未利用率',			//必填
+			    name:'体类加工利用率',				//必填
+			    name2:'舱体未利用率',			//必填
 			    title:'',
 			    backgroundColor: null,
 			    color:['#6a5acd','#DDDDDD'],
@@ -583,7 +591,7 @@
 			  if(data.type == 'PUSH_TYPE_DATA_SCREEN'){
 					this.$nextTick(()=> {
 						// 数据变更
-						this.initPercentPie([randomFloor(77,87), randomFloor(59,69), randomFloor(49,69)])
+						//this.initPercentPie([randomFloor(77,87), randomFloor(59,69), randomFloor(49,69)])
 						this.orderDatas = data.data.zoneMap.zoneData
 						this.runDatas = data.data.planMap.planData.records
 												
@@ -597,16 +605,23 @@
 							}   
 				        }
 						this.weibaoList = []
-						 this.weibaoList = data.data.repairMap.repairData.records 
-						 						 
+						this.weibaoList = data.data.repairMap.repairData.records 
+						 
 						 this.mashingOneList = this.filterResource(data.data.groupMap.iconGroupList[0])
 						 this.mashingTwoList = this.filterResource(data.data.groupMap.iconGroupList[1])
 						 this.mashingThreeList = this.filterResource(data.data.groupMap.iconGroupList[2])
 						 
+						 //计算设备利用率
+						 this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
+						  parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
+
+                         let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length; 
 						 this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)	
-						
-						 //this.$ref.runningTime.innerHmtl =  ((allDatas[0] + 5/360)/60).toFixed(1)
-                         
+											 
+						 this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}						 
+                         this.$refs.gauge.dispose()
+						 this.$refs.gauge.initChart(this.gaugeData)
+
 						 let datas = data.data.warnMap.warnData.records
 						 let that = this
 						 this.yujingList = datas.map((data)=>{						    
@@ -657,11 +672,12 @@
 				
 		// 过滤设备数据
 		filterResource(mashingList){		   
-		   let arr = mashingList.data.filter((data) => {		       
+		   let arr = mashingList.data.filter((data) => {			   		       
 			   return data.name.indexOf("接驳位") <0 && data.name.indexOf("托板") < 0 && data.name.indexOf("上下料站") < 0 
-			          && data.name.indexOf("线边库") <0
+			          && data.name.indexOf("线边库") <0 && data.name.indexOf("立库") <0
            });
 		   mashingList.data = arr
+		   mashingList.runData = arr.filter((data)=> { return data.productionStatusCN=="生产中"});
 		   return mashingList
 		},
 	    
@@ -711,8 +727,7 @@
 	    // 获取列表数据
 	    getTabList(){
 	    	lineBoardAPI.getBigScreenList({}).then(res => {
-	    		res = res.data 
-	    		// console.log("神抽狗资源:", res)
+	    		res = res.data	    		
 	    		if(res.isSuccess){
 	    			this.tabDownData.list = res.data.list
 	    			// 给资源赋值id

+ 9 - 5
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/components/Edit.vue

@@ -64,8 +64,10 @@
 	      		:label="item.fieldName+':'"
 	      		:prop="item.identifier"
 	      		:rules="{required: item.requireFlag=='1' ? true : false, message: $t('rules.require'), trigger: 'blur'}"
-	      	>
-	      		<el-select v-model="tenant[item.identifier]" :disabled="item.readonly == '1' ? true : false" :placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
+	      	>			  
+			<el-select v-model="tenant[item.identifier]" 
+			 :disabled=" item.identifier == 'zone_id' ? zoneEdit:(item.readonly == '1' ? true : false)"
+			 :placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
 				    <el-option
 				      v-for="(obj, index) in commList[item.identifier]"
 				      :key="index"
@@ -138,6 +140,7 @@ export default {
     	commList: {key: 1}, // 动态的数据对象,比如表单中的select、cascader、radio、checkbox等需要数据的控件
     	filedList: [], // 字段数据
       tenant: this.initTenant(),
+	  zoneEdit: true,
       screenWidth: 0,
       width: this.initWidth(),
       confirmDisabled: false,
@@ -198,6 +201,7 @@ export default {
     	}
       // 字典表
       this.dicts = dicts
+	  this.zoneEdit = this.type=='edit' ? false: true
     },
     close () {
       this.$emit('close')
@@ -303,9 +307,9 @@ export default {
     		if(res.isSuccess){
     			// 初始化,表单的数据
 				if(fieldObj.identifier=="meterial_id" || fieldObj.identifier=="tray_id"){
-				   //数据权限过滤	
-				   let role = this.$store.state.account.user.roles.indexOf('舱体')<0 ? "舱体" : (this.$store.state.account.user.roles.indexOf('框体')<0 ? "框体": null);
-                    if(role!=null){						
+				   //数据权限过滤
+                    let role =  this.$store.state.account.user.roles.indexOf('舱体')<0 && this.$store.state.account.user.roles.indexOf('框体')<0 ? null : (this.$store.state.account.user.roles.indexOf('舱体')<0? "舱体":"框体")
+					if(role!=null){						
 						res.data = res.data.filter(item=>{							
 							return item.name.indexOf(role) < 0;
 						}) 						

+ 1 - 0
imcs-ui/src/views/zuihou/prepareProductMgr/frockMgr/components/Edit.vue

@@ -14,6 +14,7 @@
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
+           :disabled="this.type=='edit'"
           style="width: 50%"
         >
           <el-option

+ 1 - 0
imcs-ui/src/views/zuihou/prepareProductMgr/material/components/Edit.vue

@@ -14,6 +14,7 @@
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
+		   :disabled="this.type=='edit'"
           style="width: 50%"
         >
           <el-option

+ 1 - 0
imcs-ui/src/views/zuihou/prepareProductMgr/trayMgr/components/Edit.vue

@@ -14,6 +14,7 @@
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
+           :disabled="this.type=='edit'"
           style="width: 50%"
         >
           <el-option