Преглед на файлове

调整抽检模块页面功能

oyq28 преди 3 години
родител
ревизия
a87ef5ac8e

+ 18 - 4
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/MyDraw.vue

@@ -182,6 +182,7 @@ export default {
     	expands: [], // 展开行的key
     	qiyongStatus: [], //状态
     	statusList: [], // 启用状态
+      workpieceId: [],
     	queryParams: initQueryParams({}),
     	selection: [],
     	loading: false,
@@ -316,7 +317,8 @@ export default {
     setTenant (val) {
     	if(val){
     		this.tenant = { ...val }
-    	}
+    	}      
+      this.getWorkpiece()
       this.fetch()
     },
     close () {
@@ -407,6 +409,18 @@ export default {
         this.addViewTitle = "选择抽检工序"
         this.addViewVisible = true
     },    
+    //获取工件ID
+    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) {               
+               res.data.records.forEach(item =>{
+                  this.workpieceId.push(item.id);
+               });               
+            }
+       });
+    },
     // 获取列表数据-函数
     fetch (params = {}) {
       this.loading = true
@@ -416,7 +430,7 @@ export default {
       this.queryParams.size = params.size ? params.size : this.queryParams.size
 			// 必须传的参数
       this.queryParams.model.planId = this.tenant.id     
-
+     
 			// 测试数据,真实数据,请使用page
       inspectionApi.page(this.queryParams).then(response => {      
         const res = response.data	        
@@ -425,11 +439,11 @@ export default {
         	this.tableData.total = this.tenant.planBomNum;
           //console.log(this.tenant)          
           this.tableData.records = []
-          let workpieceIdArr = this.tenant.workpieceIds.split(',')
+          //let workpieceIdArr = this.tenant.workpieceIds.split(',')
           //只显示未加工完成的零件
           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:workpieceIdArr[i], hasChildren:false
+                startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:this.workpieceId[i], hasChildren:false
             }            
             if(res.data.records.length > 0){
                plan.children = []

+ 16 - 4
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/ViewResult.vue

@@ -163,6 +163,7 @@ export default {
     	expands: [], // 展开行的key
     	qiyongStatus: [], //状态
     	statusList: [], // 启用状态
+      workpieceId: [],
     	queryParams: initQueryParams({}),
     	selection: [],
     	loading: false,
@@ -250,6 +251,7 @@ export default {
     	if(val){        
     		this.tenant = { ...val }
     	}
+      this.getWorkpiece()
       this.fetch()
     },
     close () {
@@ -263,7 +265,18 @@ export default {
       // 清空列表选中的数据
       this.$refs.table.clearSelection()
     },
-    
+    //获取工件ID
+    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) {               
+               res.data.records.forEach(item =>{
+                  this.workpieceId.push(item.id);
+               });               
+            }
+       });
+    },    
     // 获取列表数据-函数
     fetch (params = {}) {
       this.loading = true
@@ -283,11 +296,10 @@ export default {
         	// 总数
         	this.tableData.total = this.tenant.planBomNum;
           //console.log(this.tenant)          
-          this.tableData.records = []
-          let workpieceIdArr = this.tenant.workpieceIds.split(',')
+          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:workpieceIdArr[i], hasChildren:false
+                startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:this.workpieceId[i], hasChildren:false
             }            
             if(res.data.records.length > 0){
                plan.children = []