소스 검색

解决抽检和工艺管理bug

oyq28 3 년 전
부모
커밋
8400784cce

+ 1 - 0
imcs-ui/src/lang/zh/prepare.js

@@ -200,6 +200,7 @@ export default {
 			tcVersion: {
 				no: '版本编号',
 				version: '版本号',
+				source: '版本来源',
 				auditStatus: '审核状态',
 				useStatus: '产品使用',
 				createTime: '新增时间',

+ 7 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/Index.vue

@@ -65,6 +65,12 @@
         <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
 	      <el-table-column prop="no" :label='$t("prepare.table.tcVersion.no")' width="120px" :show-overflow-tooltip="true"></el-table-column>
 	      <el-table-column prop="version" :label='$t("prepare.table.tcVersion.version")' width="90px"></el-table-column>
+        <el-table-column prop="source" :label='$t("prepare.table.tcVersion.source")' width="100px">
+          <template slot-scope="{ row }">
+	      	  <el-tag v-if="row.source == '1'">{{$t("runCenter.common.source.self")}}</el-tag>
+					  <el-tag v-if="row.source == '2'" >{{$t("runCenter.common.source.out")}}</el-tag>
+				  </template>
+        </el-table-column>
 	      <el-table-column prop="auditStatus" :label='$t("prepare.table.tcVersion.auditStatus")' align="center" width="100px">
 	      	<template slot-scope="{ row }">
 	      		<el-tag :type="tags[row.auditStatus]">
@@ -499,7 +505,7 @@ export default {
     	})
     },
     exportFile(row) {
-        this.queryParams.map.fileName = '导出工艺版本管理';
+        this.queryParams.map.fileName = '导出工艺流程卡';
         technologyVersionApi.export(this.queryParams).then(response => {
           downloadFile(response);
         });

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

@@ -61,7 +61,7 @@ export default {
       },
       roles: [],
       rules: {
-        vision: [
+        version: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
         ],
         source: [

+ 2 - 2
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/TechnologyEdit.vue

@@ -212,7 +212,7 @@ export default {
 	    rules: {
 	    },
 	    
-	    /*// 三坐标质检-参数
+	    // 三坐标质检-参数
 	    threeDimensionalConf: '0', // 默认不需要
 	    threeDimensionalPrograme: '', // 检测程序名
 	    // 三坐标偏置点检测
@@ -220,7 +220,7 @@ export default {
 	    threeDimensionalDeviationPrograme: '',
 	    // 工序抽检配置
 	    randomCheckConf: '0',
-	    threeDimensionalPrograme: ''*/
+	    threeDimensionalPrograme: ''
     }
   },
   // 监听数据的变化

+ 55 - 18
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/equipmentForm/components/Edit.vue

@@ -66,7 +66,11 @@
 	      <el-table-column prop="specification" :label='$t("resource.table.resours.specification")' width="160px"></el-table-column>-->
 	      <!-- 设备业务 -->
 	      <el-table-column prop="resourceBusinessId" :label='$t("resource.table.resours.resourceBusinessId")' width="200px">
-	      	<template slot-scope="{ row }">
+	      	  <template slot="header">			   
+			   <span>{{$t("resource.table.resours.resourceBusinessId")}}</span>
+			   <span class="star">*</span>	 
+			</template> 
+			  <template slot-scope="{ row }">
 	      		<el-select v-model="row.resourceBusinessId" :placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
 					    <el-option
 					      v-for="(obj, index) in row.businessList"
@@ -129,6 +133,7 @@ export default {
     return {
     	queryParams: initQueryParams({}),
     	selection: [],
+		selectionList: [],
     	loading: false,
     	tableKey: 0,
       type: 'add',
@@ -153,7 +158,7 @@ export default {
   	// 产线下拉数据
   	this.getLineList();
   	// 加载列表数据
-  	this.fetch()
+  	//this.fetch()
 	},
   computed: {
     isVisible: {
@@ -256,15 +261,7 @@ export default {
     },
     initTenant () {
       return {
-      	model: '',
-        name: '',
-        category: {
-          key: ''
-        },
-        brand: {
-          key: ''
-        },
-        status: '1'
+      
       }
     },
     initWidth () {
@@ -277,10 +274,12 @@ export default {
         return '800px'
       }
     },
-    setTenant (val) {
+    setTenant (val, selectionList) {		
     	if(val){
     		this.tenant = { ...val }
     	}
+        this.selectionList = selectionList
+		this.fetch()		
     },
     close () {
       this.$emit('close')
@@ -295,14 +294,37 @@ export default {
       this.fetch();
     },
     submitForm () {
+       if(!this.selection.length){
+          this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	      return
+	   } 	 
+
+	    let bool = true
     	this.selection.forEach(item => {
-    		// 页面需要参数: resourceId
+    		// 页面需要参数: resourceId			
+			if(item.businessList!=null && item.businessList.length>0){
+               if(item.resourceBusinessId==null){
+				   bool = false
+			   }
+			}
     		item.resourceId = item.id
     	})
-    	// 把选择的数据提交到父组件
-    	this.$emit("success", this.selection)
-    	// 关闭弹出框
-    	this.isVisible = false
+        if(bool){
+			 // 把选择的数据提交到父组件
+    	    this.$emit("success", this.selection)
+    	    // 关闭弹出框
+    	    this.isVisible = false
+		}else{
+			this.$message({
+	          	message: "未选择可执行的程序",
+	          	type: "warning"
+	        })		
+			return false
+		}
+    
     },
     fetch (params = {}) {
 	      this.loading = true;
@@ -319,10 +341,20 @@ export default {
 	          this.tableData = res.data
 	          if(this.tableData.data && this.tableData.data.length > 0){
 	          	// 设置图片,放大属性
-	          	this.tableData.data.forEach((item, index) => {
+	          	    this.tableData.data.forEach((item, index) => {
 		        		// item.url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg';
 		        		item.srcList = [item.pic];
 		        	})
+					if(this.selectionList.length>0){
+						this.selectionList.forEach(selection=>{
+						   let row = this.tableData.data.find(item => selection.resourceId == item.id)
+						   if(row!=null){
+                               this.$refs.table.toggleRowSelection(row, true)
+						       row.resourceBusinessId = selection.resourceBusinessId
+						   }
+						});
+					}
+					//console.log(this.tableData.data)
 	          }
 	        }
 	        // eslint-disable-next-line no-return-assign
@@ -361,4 +393,9 @@ export default {
 	margin-left: 10px;
 	color: #1890ff;
 }
+.star {
+	color: #F56C6C;
+	font-size: 14px;
+	margin-right: 4px;
+ }
 </style>

+ 6 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/equipmentForm/index.vue

@@ -14,6 +14,7 @@
 	      fit
 	      header-row-class-name="technologTable"
 	      style="width: 100%;"
+		  @selection-change="onSelectChange"
 	    >
 	    	<!-- 编号 -->
 	      <el-table-column prop="code" :label='$t("prepare.table.eqPosion.code")' align="center" width="120px"></el-table-column>
@@ -46,7 +47,7 @@
 	      <!-- 优先级 -->
 	      <el-table-column prop="prority" :label='$t("prepare.table.eqPosion.prority")' width="180px" align="center">
 	      	<template slot-scope="{ row }">
-	      		<el-input-number v-model="row.prority" :min="0" :max="999999999" :label='$t("common.pleaseEnter")' size="small"></el-input-number>
+	      		<el-input-number v-model="row.prority" :min="0" :max="100" :label='$t("common.pleaseEnter")' size="small"></el-input-number>
 	      	</template>
 	      </el-table-column>
 	      <!-- 操作 -->
@@ -147,6 +148,9 @@
 		    	this.$emit("setProgram", list)
 	      }).catch(() => {})
 	  	},
+		onSelectChange (selection) {
+	      this.selection = selection
+	    },  
 	  	// 【新增-修改】弹出框,关闭
 	  	editClose () {
 	      this.dialog.isVisible = false
@@ -196,6 +200,7 @@
 	    add () {
 	      this.$refs.edit.type = "add"
 	      this.dialog.title = this.$t("prepare.common.selectEq")
+		  this.$refs.edit.setTenant(false, this.tableData)
 	      this.dialog.isVisible = true
 	    },
 	    clearSelections () {

+ 27 - 7
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/programForm/components/ProgramncMgr.vue

@@ -42,8 +42,8 @@
 		      	</el-form-item>
 		      	<!-- 加工时间 -->
 			    <el-form-item :label='$t("resource.form.workTime")+":"' prop="workTime">
-			        <el-input v-model="tenant.workTime" :placeholder='$t("common.pleaseEnter")' style="width: 50%;"/>&nbsp;&nbsp;分钟
-			    </el-form-item>
+			        <el-input-number v-model="tenant.workTime" :min="1" :max="1000" ></el-input-number>分钟
+				</el-form-item>
 		      	<!-- 程序内容 -->
 		      	<el-form-item :label='$t("resource.form.pgContent")+":"' prop="pgContent">
 		        	<el-input v-model="pgContent" :readOnly="true" type="textarea" :rows="6" style="width: 100%;"/>
@@ -59,7 +59,11 @@
 				      	style="width: 100%"
 				    >
 				      	<el-table-column prop="toolId" :label='$t("resource.table.programTool.toolName")'>
-					      	<template slot-scope="{ row }">
+					      	<template slot="header">			   
+			   					<span>{{$t("resource.table.programTool.toolName")}}</span>
+			   					<span class="star">*</span>	 
+							</template> 
+							<template slot-scope="{ row }">
 					      		<el-select v-model="row.toolId" :placeholder='$t("common.pleaseEnter")'>
 								    <el-option
 								      	v-for="item in toolSelectList"
@@ -71,8 +75,12 @@
 					      	</template>
 				      	</el-table-column>
 				      	<el-table-column prop="useTime" :label='$t("resource.table.programTool.useTime")'>
-					      	<template slot-scope="{ row }">
-					      		<el-input-number v-model="row.useTime" :min="0" :max="999999999" label='$t("common.pleaseEnter")'></el-input-number>
+					      	<template slot="header">			   
+			   					<span>{{$t("resource.table.programTool.useTime")}}</span>
+			   					<span class="star">*</span>	 
+							</template>
+							<template slot-scope="{ row }">
+					      		<el-input-number v-model="row.useTime" :min="1" :max="999999999" label='$t("common.pleaseEnter")'></el-input-number>
 					      	</template>
 				      	</el-table-column>
 				      	<!--<el-table-column prop="count" :label='$t("resource.table.programTool.count")'>
@@ -168,9 +176,16 @@ export default {
 	      	resourceIds: [
 	        	{ required: true, message: this.$t("rules.require"), trigger: 'change' }
 	        ],
-	        filePath1: [
+	        filePath: [
 	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-	        ]
+	        ],
+			workTime: [
+				{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+			],
+			toolId: [
+				{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+			]
+
       	}
     }
   },
@@ -535,4 +550,9 @@ export default {
 	padding-bottom: 15px;
 	border-bottom: 1px solid #CCCCCC;
 }
+.star {
+	color: #F56C6C;
+	font-size: 14px;
+	margin-right: 4px;
+ }
 </style>

+ 21 - 13
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/technologyMgr/index.vue

@@ -34,13 +34,13 @@
 			   <span class="star">*</span>	 
 			</template>  
       		<template slot-scope="{ row }">				  
-          		<el-input-number v-model="row.sort" :min="0" :max="100" :placeholder='$t("common.pleaseEnter")'></el-input-number>
+          		<el-input-number v-model="row.sort" :min="1" :max="100" :placeholder='$t("common.pleaseEnter")'></el-input-number>
            </template>
       	</el-table-column>
       	<el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.identifier" :label='item.fieldName' :show-overflow-tooltip="true" :width="item.formControlsType == 'inputNumber' ? '200px' : '180px'">
       		<template slot="header">			   
 			   <span>{{ item.fieldName }}</span>
-			   <span class="star">*</span>	 
+			   <span v-if="item.identifier!='remark'" class="star">*</span>	 
 			</template>
 			<template slot-scope="{ row }">
       				<!-- 如果是【文本框】-->
@@ -74,7 +74,7 @@
       					v-if="item.formControlsType == 'inputNumber' && item.showStatus == '1'"
 	    					:key="item.id"
 	    				>
-	    					<el-input-number v-model="row[item.identifier]" :disabled="item.readonly == '1' ? true : false" :min="0" :max="999999999"></el-input-number>
+	    					<el-input-number v-model="row[item.identifier]" :disabled="item.readonly == '1' ? true : false" :min="1" :max="999999"></el-input-number>
       				</div>
       				
       				<!-- 如果是【开关】-->
@@ -201,6 +201,8 @@ export default {
   data () {
     return {
     	confirmDisabled: false,
+		validateMsg: "",
+		titleMap: {sort:"排序"},
     	qiyongStatus: [], //状态
     	audioStatus: [],
       dialog: {
@@ -275,13 +277,16 @@ export default {
   			versionId: this.processModeling.id,
   			bomId: this.processModeling.bomId,
   			procedureList: this.tableData.data  // 新增的数据
-  		}
+  		}			  
 				
 		for(let i=0; i< this.tableData.data.length; i++){
 			let item = this.tableData.data[i];
 			for(let property in item){
-			  if(item[property] ==null || item[property]==""){
-				  this.confirmDisabled = true
+			  if(property == "remark") continue;
+			 			 			  
+			  if( typeof item[property] == "undefined" || item[property] ==null || item[property] ==""){
+				  this.confirmDisabled = true				  
+				  this.validateMsg="第"+(i+1)+"行的"+this.titleMap[property]+"列数据为空";
 				  break;
 			  }
 		    }
@@ -291,10 +296,11 @@ export default {
 		}
         if(this.confirmDisabled){
 			 this.$message({
-            	message: "数据非空验证失败!",
+            	message:  this.validateMsg,
             	type: "warning"
           	  })
 			this.confirmDisabled = false	
+			this.validateMsg = ""
 			return false
 		}
 
@@ -319,11 +325,12 @@ export default {
   		this.$emit("close")
   	},
   	// 【新增】按钮-事件(前端新增)
-  	add(){
-			this.tableData.data.push({
-				'key': ''+ Math.random(),
-				'isAdd': true
-			})
+  	add(){		   
+		let obj = {}		
+		for(let key in this.titleMap){
+           obj[key] = "";
+		}				
+		this.tableData.data.push(obj)
   	},
   	// 【删除】按钮-事件(前端删除)
   	domDelete(row){
@@ -387,11 +394,12 @@ export default {
 			    		let str = "radio,checkbox,select,cascader"
 			    		if(str.indexOf(item.formControlsType) > -1 ){
 				  			// 加载响应的数据
-				  			this.getCommList(item)
+				  			this.getCommList(item)							 
 				  		}
 			    		if(index == leng){
 			    			this.isEnd = true
 			    		}
+						this.titleMap[item.identifier] = item.fieldName
     				})
     			}
         }

+ 9 - 8
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/MyDraw.vue

@@ -55,7 +55,7 @@
 				          align="center"
 				          :show-overflow-tooltip="true"
 				        />
-                 <!-- 质检结果 -->
+                 <!-- 质检结果 
                 <el-table-column
 				          prop="result"
 				          label="质检结果"
@@ -67,14 +67,14 @@
                     <span v-if="row.result==1">合格</span>
                     <span v-if="row.result==2">不合格</span>
 				          </template>
-                </el-table-column>
-                 <!-- 质检报告 -->
+                </el-table-column> -->
+                 <!-- 质检报告 
                 <el-table-column
 				          prop="report"
 				          label="质检报告"
 				          align="center"
 				          :show-overflow-tooltip="true"
-				        />
+				        /> -->
 						 	</el-table>
 					 	</div>
 	    		</template>
@@ -412,15 +412,16 @@ export default {
         this.addViewVisible = true
     },    
     //获取工件ID
-    async getWorkpiece(){
+    async getWorkpiece(){        
         let params = {current:1, size:1000, model:{planId: this.tenant.id}} 
         await inspectionApi.getWorkpiece(params).then(response => {
             const res = response.data           
-            if (res.isSuccess) {               
+            if (res.isSuccess) {      
+              this.workpieceId = []         
                res.data.records.forEach(item =>{
-                  this.workpieceId.push(item.id);
+                  this.workpieceId.push(item.id)
                }); 
-               this.fetch();              
+               this.fetch()            
             }
        });
     },

+ 52 - 34
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/ViewResult.vue

@@ -58,7 +58,7 @@
                    <template slot-scope="{ row }">
 				            <span v-if="row.result==0">待定</span>
                     <span v-if="row.result==1">合格</span>
-                    <span v-if="row.result==2">不合格</span>
+                    <span v-if="row.result==2" style="color:red">不合格</span>
 				          </template>
                 </el-table-column>
                  <!-- 质检报告 -->
@@ -67,12 +67,20 @@
 				          label="质检报告"
 				          align="center"
 				          :show-overflow-tooltip="true"
-				        />
+				        >
+                 <template slot-scope="{ row }">
+                    <i v-if="row.result>0"
+                     @click="downloadFile(row)"
+                     class="el-icon-download table-operation"
+                    style="color: #f50;"
+                    v-hasPermission="['file:download']"
+                    /> 
+                 </template>
+                </el-table-column>
 						 	</el-table>
 					 	</div>
 	    		</template>
-	    	</el-table-column>
-	      <el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
+	    	</el-table-column>	      
 	      <!-- 零件唯一码 -->
         <el-table-column
           prop="id"
@@ -97,13 +105,13 @@
           :label="$t(&quot;runCenter.table.orderSldPro.name&quot;)"
           align="center"
         />
-        <!-- 零部件编号 -->
+        <!-- 零部件编号 
         <el-table-column
           prop="partsAlias"
           :label="$t(&quot;runCenter.table.orderSldPro.partsAlias&quot;)"
           align="center"
           width="120px"
-        />        
+        /> -->       
         <!-- 计划开始日期 -->
         <el-table-column
           prop="startTime"
@@ -144,7 +152,7 @@ import inspectionApi from "@/api/runManageCenter/inspection"
 // 【分页】组件
 import Pagination from "@/components/Pagination"
 // 【共通】函数
-import { initQueryParams } from '@/utils/commons'
+import {downloadFile, initQueryParams } from '@/utils/commons'
 export default {
   name: 'ViewResult',
   components: { Pagination },
@@ -251,13 +259,18 @@ export default {
     	if(val){        
     		this.tenant = { ...val }
     	}
-      this.getWorkpiece()
-      this.fetch()
+      this.getWorkpiece()      
     },
     close () {
       this.$emit('close')
     },
-    
+    downloadFile(row) {
+        this.queryParams.map.fileName = '下载抽检报表'+row.report
+        this.queryParams.model.id = row.id
+        inspectionApi.export(this.queryParams).then(response => {
+          downloadFile(response);
+       });
+    },    
     // 【重置】按钮-事件
     reset () {
     	// 初始化表单
@@ -270,10 +283,12 @@ export default {
         let params = {current:1, size:1000, model:{planId: this.tenant.id}} 
         await inspectionApi.getWorkpiece(params).then(response => {
             const res = response.data           
-            if (res.isSuccess) {               
+            if (res.isSuccess) {     
+               this.workpieceId=[]          
                res.data.records.forEach(item =>{
                   this.workpieceId.push(item.id);
-               });               
+               });           
+               this.fetch()    
             }
        });
     },    
@@ -287,34 +302,37 @@ export default {
 			// 必须传的参数			 
       //this.queryParams.model.orderId = this.tenant.orderId
       this.queryParams.model.planId = this.tenant.id       
-
+      
 			// 测试数据,真实数据,请使用page
       inspectionApi.page(this.queryParams).then(response => {
       	const res = response.data              
         if (res.isSuccess) {
-          //console.log(res.data.records)
-        	// 总数
-        	this.tableData.total = this.tenant.planBomNum;
-          //console.log(this.tenant)          
-          this.tableData.records = []          
-          for(let i=Number(this.tenant.completeNum); i<this.tableData.total; i++){
-            let plan = {bomName:this.tenant.bomDesc, partsNo:this.tenant.partsNo,partsAlias:this.tenant.partsAlias,
-                startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:this.workpieceId[i], hasChildren:false
-            }            
+            this.tableData.records = []
             if(res.data.records.length > 0){
-               plan.children = []
-               res.data.records.forEach(item =>{
-                  if(plan.id == item.workpieceId){
-                     let workpiece = {procedureNo:item.procedureNo, procedureName:item.procedureName,
-                         result: item.result, report:item.report
-                     }
-                     plan.children.push(workpiece)
-                     plan.hasChildren = true
-                  }
-               });                 
+               let planMap = new Map();
+               res.data.records.forEach(item =>{ 
+                   let plan = {bomName:this.tenant.bomDesc, partsNo:this.tenant.partsNo,partsAlias:this.tenant.partsAlias,
+                    startTime:this.tenant.startTime, endTime:this.tenant.endTime, hasChildren:false
+                   }
+                   let workpiece = {procedureNo:item.procedureNo, procedureName:item.procedureName,
+                         result: item.result, report:item.report }
+                   let planObj = planMap.get(item.workpieceId);
+                   if(planObj==null){
+                      plan.id = item.workpieceId
+                      plan.children = [workpiece]
+                      plan.hasChildren = true
+                      planMap.set(item.workpieceId, plan)
+                   }else{
+                      planObj.children.push(workpiece)
+                      planMap.set(item.workpieceId, planObj)
+                   }                               
+               });     
+               
+               planMap.forEach((value)=>{
+                  this.tableData.records.push(value)
+               });         
             } 
-            this.tableData.records.push(plan)      
-          }
+            this.tableData.total = this.tableData.records.length 
         }
         // eslint-disable-next-line no-return-assign
       }).finally(() => this.loading = false)