Selaa lähdekoodia

新增前端抽检模块功能

oyq28 3 vuotta sitten
vanhempi
commit
f935625f1d

+ 144 - 0
imcs-ui/src/api/runManageCenter/inspection.js

@@ -0,0 +1,144 @@
+/*********************** 【计划管理】API ********************/
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+	getList: {
+	    method: 'POST',
+	    url: `/authority/inspection/all`
+	},
+  getProcedureList: {
+    method: 'POST',
+    url: `/authority/inspection/procedure`
+  },
+  getWorkpiece: {
+    method: 'POST',
+    url: `/authority/workpiece/page`
+  },
+  page: {
+    method: 'POST',
+    url: `/authority/inspection/page`
+  },
+  pageList: {
+    method: 'POST',
+    url: `/authority/inspection/pageList`
+  },
+  update: {
+    method: 'POST',
+    url: `/authority/inspection/update`
+  },
+  save: {
+    method: 'POST',
+    url: `/authority/inspection/save`
+  },  
+  checkField: {
+    method: 'POST',
+    url: `/authority/inspection/check`
+  },
+    
+  get: {
+    method: 'POST',
+    url: `/authority/inspection/get`
+  },
+  
+  list: {
+    method: 'POST',
+    url: `/authority/inspection/query`
+  },  
+  preview: {
+    method: 'POST',
+    url: `/authority/inspection/preview`
+  },
+  
+  export: {
+    method: 'POST',
+    url: `/authority/inspection/export`
+  },
+  
+  import: {
+    method: 'POST',
+    url: `/authority/inspection/import`
+  }
+  
+}
+
+export default {
+	getList (data) {
+    return axiosApi({
+      ...apiList.getList,
+      data
+    })
+  },
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  pageList (data) {
+    return axiosApi({
+      ...apiList.pageList,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  }, 
+  get (data) {
+    return axiosApi({
+      ...apiList.get,
+      data
+    })
+  },
+  getProcedureList (data) {
+    return axiosApi({
+      ...apiList.getProcedureList,
+      data
+    })
+  },
+  getWorkpiece(data){
+    return axiosApi({
+      ...apiList.getWorkpiece,
+      data
+    })
+  },
+  list (data) {
+    return axiosApi({
+      ...apiList.list,
+      data
+    })
+  },
+  check (code) {
+    return axiosApi({
+      method: 'GET',
+      url: `/authority/inspection/check/${code}`
+    })
+  },
+  checkField (data) {
+    return axiosApi({
+      ...apiList.checkField,
+      data
+    })
+  },
+  preview (data) {
+    return axiosApi({
+      ...apiList.preview,
+      data
+    })
+  },
+  export (data) {
+    return axiosApi({
+      ...apiList.export,
+      responseType: "blob",
+      data
+    })
+  },
+  import (data) {
+    return axiosApi({
+      ...apiList.import,
+      data
+    })
+  }
+}

+ 2 - 0
imcs-ui/src/lang/zh/runCenter.js

@@ -6,6 +6,7 @@ export default {
 			lit: '个',
 			chouqian: '我要抽检',
 			addBtn: '增加抽检',
+			viewResult: '抽检结果',
 			selectPro: '选择零件',
 			shelvesCount: '新增外部订单',
 			storgeCount: '待审核订单',
@@ -216,6 +217,7 @@ export default {
 			},
 			// 【订单管理-草稿-新增/修改-选择产品】
 			orderSldPro: {
+				id: '零件ID',
 				bomAlias: '产品代号',
 				name: '零件名称',
 				partsAlias: '零件代号',

+ 205 - 0
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/AddInspection.vue

@@ -0,0 +1,205 @@
+<template>
+  <el-dialog 
+  	:close-on-click-modal="false" 
+  	:close-on-press-escape="false" 
+  	:title="title" 
+  	:append-to-body="true"
+  	:visible.sync="isVisible" 
+  	:width="width" 
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">      
+      <el-form-item label='选择工序'>
+        <template>
+          <div v-if="procedureList.length>0">         
+            <div v-for="procedure in procedureList" :key="procedure.id">
+                <el-radio v-model="tenant.procedureId" :label="procedure.id" border>{{procedure.no}} {{procedure.name}}</el-radio>
+            </div>            
+          </div>
+          <div class="hint" v-else><span>没有可以选择的工序</span></div>
+				</template>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// 【抽检管理】-API
+import inspectionApi from "@/api/runManageCenter/inspection"
+
+export default {
+  name: 'addInspection',
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      type: 'add',
+      procedureList: [],
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      dicts:{
+        NATION: {}
+      },
+      roles: [],
+      rules: {
+        name: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ]
+      }
+    }
+  },  
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initTenant () {
+      return {       
+        bomId: '',        
+        orderId: '',
+        planId: '',
+        procedureId: '',
+        zoneId: '',
+        result: '',
+        report: '',
+        workpieceId: ''
+      }
+    },
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 991) {
+        return '90%'
+      } else if (this.screenWidth < 1400) {
+        return '45%'
+      } else {
+        return '800px'
+      }
+    },
+    setTenant (val, dicts) {
+    	if(val){        
+        for(let key in val){
+          if(this.tenant[key]!=null){
+            this.tenant[key] = val[key]
+          }
+        }
+        //console.log(this.tenant)
+    		this.tenant.planId = val.id        
+      }
+      // 字典表
+      this.dicts = dicts      
+      this.getProcedures({bomId: this.tenant.bomId,workpieceId:this.tenant.workpieceId})
+    },
+    close () {
+      this.$emit('close')
+    },
+    reset () {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate()
+      this.$refs.form.resetFields()
+      this.tenant = this.initTenant()
+    },
+    submitForm () {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.confirmDisabled = true
+          //console.log(this.tenant)
+          this.save()
+        }
+      })
+    },
+    getProcedures (params = {}) {
+        inspectionApi.getProcedureList(params).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+             this.procedureList = res.data
+          }
+        });
+    },
+    save () {
+      inspectionApi.save(this.tenant)
+        .then((response) => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.isVisible = false
+            this.$message({
+              message: this.$t('tips.createSuccess'),
+              type: 'success'
+            })
+            // 通知列表
+	          this.$emit("success");
+	          // 通知列表-并关闭弹出框
+	          this.$emit("close");
+          }
+        }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+    }
+
+  }
+}
+</script>
+<style lang="scss" >
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+}
+.avatar {
+  width: 100px;
+  height: 100px;
+  display: block;
+}
+.checkUsed{
+	display: inline-block;
+	margin-left: 10px;
+	color: #1890ff;
+}
+.hint {
+  margin-left:30px;  
+  display: block;
+  height:40px;
+  color: #1890ff;
+  font-weight: blod;
+}
+</style>

+ 117 - 110
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/MyDraw.vue

@@ -9,34 +9,13 @@
   	top="50px"
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
-    	<div class="filter-container">
-	    	<!--<span>
-	    		<span>{{$t("prepare.searchForm.productName")}}:</span>
-	    		<el-input v-model="queryParams.model.name" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-	    	</span>
-	      <span style="margin-left: 15px;">
-	    		<span>{{$t("prepare.searchForm.model")}}:</span>
-	    		<el-input v-model="queryParams.model.model" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-	    	</span>
-	      <span style="margin-left: 15px;">
-		      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
-		        {{ $t("table.search") }}
-		      </el-button>
-		      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
-		        {{ $t("table.reset") }}
-		      </el-button>
-	      </span>-->
+    	<div class="filter-container">	    	
 	      <!-- 增加抽检 -->
-	      <el-button type="primary" icon="el-icon-plus" size="medium" @click="addChoujian()">
+	      <el-button type="primary" icon="el-icon-plus" size="medium" @click="addInspection()">
 		        {{ $t("runCenter.common.addBtn") }}
 		      </el-button>
     	</div>
 
-	    <!-- 列表数据
-	    	:expand-row-keys="expands"
-	      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-	      row-key="id"
-	    -->
 	    <el-table
 	      :key="tableKey"
 	      ref="table"
@@ -45,7 +24,8 @@
 	      border
 	      fit
 	      highlight-current-row
-	      style="width: 100%;"
+	      style="width: 100%;" 
+        row-key="id"              
 	      @selection-change="onSelectChange"
 	      @cell-click="cellClick"
 	    >
@@ -59,19 +39,39 @@
 						 	>
 						 		<!-- 工序号 -->
 				        <el-table-column
-				          prop="id"
-				          :label="$t(&quot;runCenter.table.orderSldPro.partsNo&quot;)"
+				          prop="procedureNo"
+				          label="工序号"
 				          align="center"
 				          :show-overflow-tooltip="true"
 				        >
 				          <template slot-scope="{ row }">
-				            <span>{{ row.id }}</span>
+				            <span>{{ row.procedureNo }}</span>
 				          </template>
 				        </el-table-column>
 				        <!-- 工序名称 -->
 				        <el-table-column
-				          prop="name"
-				          :label="$t(&quot;runCenter.table.orderSldPro.bomAlias&quot;)"
+				          prop="procedureName"
+				          label="工序名称"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        />
+                 <!-- 质检结果 -->
+                <el-table-column
+				          prop="result"
+				          label="质检结果"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        >
+                   <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>
+				          </template>
+                </el-table-column>
+                 <!-- 质检报告 -->
+                <el-table-column
+				          prop="report"
+				          label="质检报告"
 				          align="center"
 				          :show-overflow-tooltip="true"
 				        />
@@ -80,54 +80,51 @@
 	    		</template>
 	    	</el-table-column>
 	      <el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
-	      <!-- 零件唯一码 -->
-        <el-table-column
+	      <el-table-column
           prop="id"
+          :label="$t(&quot;runCenter.table.orderSldPro.id&quot;)"
+          align="center"
+          :show-overflow-tooltip="true"
+          width="160px"
+        >
+        </el-table-column>        
+        <!-- 零件唯一码 -->
+        <el-table-column
+          prop="partsNo"
           :label="$t(&quot;runCenter.table.orderSldPro.partsNo&quot;)"
           align="center"
           :show-overflow-tooltip="true"
-          width="150px"
+          width="120px"
         >
-          <template slot-scope="{ row }">
-            <span>{{ row.id }}</span>
-          </template>
         </el-table-column>
         <!-- 零件名称 -->
         <el-table-column
-          prop="name"
+          prop="bomName"
           :label="$t(&quot;runCenter.table.orderSldPro.name&quot;)"
           align="center"
         />
         <!-- 零部件编号 -->
         <el-table-column
-          prop="address"
+          prop="partsAlias"
           :label="$t(&quot;runCenter.table.orderSldPro.partsAlias&quot;)"
           align="center"
-          width="150px"
-        />
-        <!-- 数量 -->
-        <el-table-column
-          prop="name"
-          :label="$t(&quot;runCenter.table.orderSldPro.bomAlias&quot;)"
-          align="center"
-          :show-overflow-tooltip="true"
           width="120px"
-        />
+        />        
         <!-- 计划开始日期 -->
         <el-table-column
-          prop="date"
-          :label="$t(&quot;runCenter.table.orderSldPro.bomAlias&quot;)"
+          prop="startTime"
+          label="计划开始时间"
           align="center"
           :show-overflow-tooltip="true"
-          width="120px"
+          width="150px"
         />
         <!-- 计划完成日期 -->
         <el-table-column
-          prop="date"
-          :label="$t(&quot;runCenter.table.orderSldPro.bomAlias&quot;)"
+          prop="endTime"
+          label="计划完成时间"
           align="center"
           :show-overflow-tooltip="true"
-          width="120px"
+          width="150px"
         />
         
 	    </el-table>
@@ -141,6 +138,14 @@
 	      @pagination="fetch"
 	    />
 
+      <!-- [抽检结果]的组件 -->
+	    <add-inspection
+      		ref="addView"
+      		:dialog-visible="addViewVisible"
+			    :title="addViewTitle"
+      		@close="addViewClose"
+    	/>
+
     </el-form>
     <div slot="footer" class="dialog-footer">
       <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
@@ -149,17 +154,19 @@
   </el-dialog>
 </template>
 <script>
+// 【抽检管理】-API
+import inspectionApi from "@/api/runManageCenter/inspection"
 // 【夹具管理】-API
 import trayMgrApi from "@/api/prepareProductMgr/trayMgr"
+// 【新增抽检】组件
+import AddInspection from "./AddInspection"
 // 【分页】组件
 import Pagination from "@/components/Pagination"
-// 【BOM管理】-API
-import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
 // 【共通】函数
 import { initQueryParams } from '@/utils/commons'
 export default {
   name: 'MyDraw',
-  components: { Pagination },
+  components: { Pagination, AddInspection },
   props: {
     dialogVisible: {
       type: Boolean,
@@ -183,6 +190,8 @@ export default {
       tableData: {
         total: 0
       },
+      addViewVisible: false,
+      addViewTitle: '',
       tenant: this.initTenant(),
       screenWidth: 0,
       width: this.initWidth(),
@@ -196,9 +205,7 @@ export default {
     }
   },
   // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-  created() {
-  	// 加载列表数据
-  	this.fetch()
+  created() {  
   	// 调用常量-初始化值
   	this.qiyongStatus = this.$constWKS.AUDIOLIST;
   	this.statusList = this.$constWKS.STATUSORTHERLIST;
@@ -293,15 +300,7 @@ export default {
     },
     initTenant () {
       return {
-      	model: '',
-        name: '',
-        category: {
-          key: ''
-        },
-        brand: {
-          key: ''
-        },
-        status: '1'
+      	
       }
     },
     initWidth () {
@@ -318,11 +317,14 @@ export default {
     	if(val){
     		this.tenant = { ...val }
     	}
+      this.fetch()
     },
     close () {
       this.$emit('close')
     },
-    
+    addViewClose() {
+      this.addViewVisible = false;
+    },    
     // 【重置】按钮-事件
     reset () {
     	// 初始化表单
@@ -385,10 +387,26 @@ export default {
     },
     
     // 新增抽检-按钮事件
-    addChoujian() {
-    	console.log("新增抽检-按钮事件:");
-    },
-    
+    addInspection() {    	
+      if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	    	if (this.selection.length > 1) {
+	        this.$message({
+	          message: this.$t("tips.mustOne"),
+	          type: "warning"
+	        })
+	        return
+	      }     
+        this.tenant.workpieceId = this.selection[0].id       
+        this.$refs.addView.setTenant(this.tenant)
+        this.addViewTitle = "选择抽检工序"
+        this.addViewVisible = true
+    },    
     // 获取列表数据-函数
     fetch (params = {}) {
       this.loading = true
@@ -397,47 +415,36 @@ export default {
       this.queryParams.current = params.current ? params.current : this.queryParams.current
       this.queryParams.size = params.size ? params.size : this.queryParams.size
 			// 必须传的参数
-			this.queryParams.audit_status = '2'
+      this.queryParams.model.planId = this.tenant.id     
+
 			// 测试数据,真实数据,请使用page
-      bomMgrApi.page(this.queryParams).then(response => {
-      	const res = response.data
-        console.log("列表的数据111122233:", res)
+      inspectionApi.page(this.queryParams).then(response => {      
+        const res = response.data	        
         if (res.isSuccess) {
         	// 总数
-        	this.tableData.total = 4;
-        	// 数据
-        	this.tableData.records = [{
-		          id: 1,
-		          date: '2016-05-02',
-		          name: '王小虎',
-		          address: '上海市普陀区金沙江路 1518 弄'
-		        }, {
-		          id: 2,
-		          date: '2016-05-04',
-		          name: '王小虎',
-		          address: '上海市普陀区金沙江路 1517 弄'
-		        }, {
-		          id: 3,
-		          date: '2016-05-01',
-		          name: '王小虎',
-		          address: '上海市普陀区金沙江路 1519 弄',
-		          children: [{
-		              id: 31,
-		              date: '2016-05-01',
-		              name: '王小虎',
-		              address: '上海市普陀区金沙江路 1519 弄'
-		            }, {
-		              id: 32,
-		              date: '2016-05-01',
-		              name: '王小虎',
-		              address: '上海市普陀区金沙江路 1519 弄'
-		          }]
-		        }, {
-		          id: 4,
-		          date: '2016-05-03',
-		          name: '王小虎',
-		          address: '上海市普陀区金沙江路 1516 弄'
-		        }];
+        	this.tableData.total = this.tenant.planBomNum;
+          //console.log(this.tenant)          
+          this.tableData.records = []
+          let workpieceIdArr = this.tenant.workpieceIds.split(',')
+          for(let i=0; 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
+            }            
+            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 
+                  }
+               });                 
+            } 
+            this.tableData.records.push(plan)      
+          }
+         
         }
         // eslint-disable-next-line no-return-assign
       }).finally(() => this.loading = false)

+ 52 - 15
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/SchedPlan.vue

@@ -23,7 +23,12 @@
 		    <!-- 交货日期 -->
 		    <el-table-column prop="deliveryTime" label='交货日期' :show-overflow-tooltip="true" width="160"></el-table-column>
 		    <!-- 来源 -->
-		    <el-table-column prop="source" label='来源' :show-overflow-tooltip="true" width="150"></el-table-column>
+		    <el-table-column prop="source" label='来源' :show-overflow-tooltip="true" width="100">
+                <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'" type="success">{{$t("runCenter.common.source.out")}}</el-tag>
+				</template>
+			</el-table-column>
 	      	<!-- 计划编号 -->
 	      	<el-table-column prop="planNo" label='计划编号' :show-overflow-tooltip="true" width="160"></el-table-column>
 	      	<!-- 零件名称 -->
@@ -31,11 +36,19 @@
 	      	<!-- 零部件编号 -->
 	      	<el-table-column prop="partsNo" label='零部件编号' :show-overflow-tooltip="true" width="150"></el-table-column>
 	      	<!-- 数量 -->
-	      	<el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="120"></el-table-column>
+	      	<el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="80"></el-table-column>
 	      	<!-- 计划开始日期 -->
-		    <el-table-column prop="pdeliveryTimeStart" label='计划开始日期' :show-overflow-tooltip="true" width="160"></el-table-column>
+		    <el-table-column prop="startTime" label='计划开始日期' :show-overflow-tooltip="true" width="160">
+				<template slot-scope="{ row }">
+                     {{ row.startTime.substring(0, 10)}}
+				</template>		
+			</el-table-column>
 	      	<!-- 计划完成日期 -->
-		    <el-table-column prop="pdeliveryTimeEnd" label='计划完成日期' :show-overflow-tooltip="true" width="160"></el-table-column>
+		    <el-table-column prop="endTime" label='计划完成日期' :show-overflow-tooltip="true" width="160">
+				 <template slot-scope="{ row }">
+                     {{ row.endTime.substring(0, 10)}}
+				</template> 
+			</el-table-column>
 		    <!-- 进度 -->
 		    <el-table-column prop="process" label='进度' :show-overflow-tooltip="true" width="200">
 		      	<template slot-scope="scope">
@@ -43,25 +56,27 @@
 				</template>
 		    </el-table-column>
 		    <!-- 生产中 -->
-		    <el-table-column prop="prority" label='生产中' :show-overflow-tooltip="true" width="120"></el-table-column>
+		    <el-table-column prop="produceNum" label='生产中' :show-overflow-tooltip="true" width="80"></el-table-column>
 		    <!-- 已完成 -->
-		    <el-table-column prop="completeNum" label='已完成' :show-overflow-tooltip="true" width="120"></el-table-column>
-		    <!-- 抽检结果 -->
-		    <el-table-column prop="zoenDesc" label='抽检结果' :show-overflow-tooltip="true" width="120"></el-table-column>
+		    <el-table-column prop="completeNum" label='已完成' :show-overflow-tooltip="true" width="80"></el-table-column>		    
 		    <!-- 创建时间 -->
-		    <el-table-column prop="createTime" :label='$t("runCenter.table.plan.createTime")' width="160px"></el-table-column>
+		    <el-table-column prop="createTime" :label='$t("runCenter.table.plan.createTime")' width="150px"></el-table-column>
 		    <!-- 操作 -->
 	      	<el-table-column
 		        :label="$t('table.operation')"
 		        fixed="right"
 		        align="center"
 		        column-key="operation"
-		        width="100px"
+		        width="200px"
 		    >
 		        <template slot-scope="{ row }">
 		        	<el-tooltip class="item" :content='$t("runCenter.common.chouqian")' effect="dark" placement="top-start">
-			          <a @click="myDraw(row)" style="color: #2db7f5;">{{ $t("runCenter.common.chouqian") }}</a>
-		          </el-tooltip>
+			            <a @click="myDraw(row)" style="color: #2db7f5;">{{ $t("runCenter.common.chouqian") }}</a>
+		            </el-tooltip>
+					<!-- 抽检结果 -->
+					<el-tooltip class="item" :content='$t("runCenter.common.viewResult")' effect="dark" placement="top-start">
+						<a @click="ViewResult(row)" style="color: #2db7f5;">{{ $t("runCenter.common.viewResult") }}</a>
+					</el-tooltip>
 		        </template>
 		    </el-table-column>
 	    </el-table>
@@ -75,7 +90,7 @@
 	      @pagination="fetch"
 	    />
 
-	    <!-- [我的抽]的组件 -->
+	    <!-- [我的抽]的组件 -->
 	    <my-draw
 	      ref="edit"
 	      :dialog-visible="dialog.isVisible"
@@ -83,13 +98,23 @@
 	      @close="editClose"
 	      @success="editSuccess"
 	    />
+
+		<!-- [抽检结果]的组件 -->
+	    <view-result
+      		ref="result"
+      		:dialog-visible="tenantViewVisible"
+			:title="tenantViewTitle"
+      		@close="viewClose"
+    	/>
   	</div>
 </template>
 
 
 <script>
-	// 选择【我的抽签】组件
+	// 选择【我的抽】组件
 	import MyDraw from "./MyDraw"
+	// 选择【抽检结果】组件
+	import ViewResult from "./ViewResult"
 	// 【分页】组件
 	import Pagination from "@/components/Pagination"
 	// 【仓库类型管理】-API
@@ -102,7 +127,7 @@
 	import { initQueryParams } from '@/utils/commons'
 export default {
   name: 'PprogTask',
-  components: { Pagination, MyDraw },
+  components: { Pagination, MyDraw, ViewResult },
   props: {
   },
   data () {
@@ -111,6 +136,8 @@ export default {
 	        isVisible: false,
 	        title: ""
 	    },
+		tenantViewVisible: false,
+		tenantViewTitle: "",
     	titleData: [],  // table的动态表头数据
     	qiyongStatus: [], //状态
     	queryParams: initQueryParams({}),
@@ -278,10 +305,17 @@ export default {
     // 【我的抽签】按钮-事件
     myDraw(row) {
     	this.$refs.edit.type = "edit"
+		this.$refs.edit.setTenant(row)
 	    this.dialog.title = this.$t("runCenter.common.addBtn")
 	    this.dialog.isVisible = true
     },
 
+	ViewResult(row) {		
+    	this.$refs.result.setTenant(row)
+		this.tenantViewTitle = "查看抽检结果"
+	    this.tenantViewVisible = true
+    },
+
     // 【我的抽签-修改】弹出框,关闭
   	editClose () {
       this.dialog.isVisible = false
@@ -295,6 +329,9 @@ export default {
     	// 去除数组中重复的数据
     	// this.tableData = arrReduce(list, "id")
     },
+    viewClose () {
+	      this.tenantViewVisible = false
+	},	
   }
 }
 </script>

+ 343 - 0
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/ViewResult.vue

@@ -0,0 +1,343 @@
+<template>
+  <el-dialog
+  	:close-on-click-modal="false"
+  	:close-on-press-escape="false"
+  	:title="title"
+  	:append-to-body="true"
+  	:visible.sync="isVisible"
+  	width="960px"
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">    	
+	    <el-table
+	      :key="tableKey"
+	      ref="table"
+	      v-loading="loading"
+	      :data="tableData.records"
+	      border
+	      fit
+	      highlight-current-row
+	      style="width: 100%;"
+        row-key="id"
+	      @selection-change="onSelectChange"
+	      @cell-click="cellClick"
+	    >
+	    	<el-table-column type="expand">
+	    		<template slot-scope="scope">
+	    			<div style="margin: 0 48px;">
+		    			<el-table
+						    :data="scope.row.children"
+						    style="width: 100%;margin-bottom: 20px;"
+						    border                
+						 	>
+						 		<!-- 工序号 -->
+				        <el-table-column
+				          prop="procedureNo"
+				          label="工序号"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        >
+				          <template slot-scope="{ row }">
+				            <span>{{ row.procedureNo }}</span>
+				          </template>
+				        </el-table-column>
+				        <!-- 工序名称 -->
+				        <el-table-column
+				          prop="procedureName"
+				          label="工序名称"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        />
+                 <!-- 质检结果 -->
+                <el-table-column
+				          prop="result"
+				          label="质检结果"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        >
+                   <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>
+				          </template>
+                </el-table-column>
+                 <!-- 质检报告 -->
+                <el-table-column
+				          prop="report"
+				          label="质检报告"
+				          align="center"
+				          :show-overflow-tooltip="true"
+				        />
+						 	</el-table>
+					 	</div>
+	    		</template>
+	    	</el-table-column>
+	      <el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
+	      <!-- 零件唯一码 -->
+        <el-table-column
+          prop="id"
+          :label="$t(&quot;runCenter.table.orderSldPro.id&quot;)"
+          align="center"
+          :show-overflow-tooltip="true"
+          width="160px"
+        >
+        </el-table-column>
+        <!-- 零件编号 -->
+        <el-table-column
+          prop="partsNo"
+          :label="$t(&quot;runCenter.table.orderSldPro.partsNo&quot;)"
+          align="center"
+          :show-overflow-tooltip="true"
+          width="120px"
+        >
+        </el-table-column>
+        <!-- 零件名称 -->
+        <el-table-column
+          prop="bomName"
+          :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"
+          label="计划开始时间"
+          align="center"
+          :show-overflow-tooltip="true"
+          width="150px"
+        />
+        <!-- 计划完成日期 -->
+        <el-table-column
+          prop="endTime"
+          label="计划完成时间"
+          align="center"
+          :show-overflow-tooltip="true"
+          width="150px"
+        />
+        
+	    </el-table>
+
+	    <!-- 【分页组件】-->
+	    <pagination
+	      v-show="tableData.total > 0"
+	      :limit.sync="queryParams.size"
+	      :page.sync="queryParams.current"
+	      :total="Number(tableData.total)"
+	      @pagination="fetch"
+	    />
+
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// 【夹具管理】-API
+import inspectionApi from "@/api/runManageCenter/inspection"
+// 【分页】组件
+import Pagination from "@/components/Pagination"
+// 【共通】函数
+import { initQueryParams } from '@/utils/commons'
+export default {
+  name: 'ViewResult',
+  components: { Pagination },
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+    	expands: [], // 展开行的key
+    	qiyongStatus: [], //状态
+    	statusList: [], // 启用状态
+    	queryParams: initQueryParams({}),
+    	selection: [],
+    	loading: false,
+    	tableKey: 0,
+      type: 'add',
+      tableData: {
+        total: 0
+      },
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      roles: [],
+      rules: {
+        name: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+  created() {  	
+  	// 调用常量-初始化值
+  	this.qiyongStatus = this.$constWKS.AUDIOLIST;
+  	this.statusList = this.$constWKS.STATUSORTHERLIST;
+	},
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    // Table的选择事件
+    onSelectChange (selection) {
+      this.selection = selection
+    },
+    getKey (row){
+      return row.id
+    },
+    cellClick (row, column) {
+      if (column['columnKey'] === "operation") {
+        return
+      }
+      let flag = false
+      this.selection.forEach((item) => {
+        if (item.id === row.id) {
+          flag = true
+          this.$refs.table.toggleRowSelection(row)
+        }
+      })
+
+      if (!flag) {
+        this.$refs.table.toggleRowSelection(row, true)
+      }
+    },
+    initTenant () {
+      return {
+      	
+      }
+    },
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 991) {
+        return '90%'
+      } else if (this.screenWidth < 1400) {
+        return '45%'
+      } else {
+        return '800px'
+      }
+    },
+    setTenant (val) {      
+    	if(val){        
+    		this.tenant = { ...val }
+    	}
+      this.fetch()
+    },
+    close () {
+      this.$emit('close')
+    },
+    
+    // 【重置】按钮-事件
+    reset () {
+    	// 初始化表单
+      this.queryParams = initQueryParams({})
+      // 清空列表选中的数据
+      this.$refs.table.clearSelection()
+    },
+    
+    // 获取列表数据-函数
+    fetch (params = {}) {
+      this.loading = true
+
+			// 分页信息
+      this.queryParams.current = params.current ? params.current : this.queryParams.current
+      this.queryParams.size = params.size ? params.size : this.queryParams.size
+			// 必须传的参数			 
+      //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 = []
+          let workpieceIdArr = this.tenant.workpieceIds.split(',')
+          for(let i=0; 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
+            }            
+            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
+                  }
+               });                 
+            } 
+            this.tableData.records.push(plan)      
+          }
+        }
+        // eslint-disable-next-line no-return-assign
+      }).finally(() => this.loading = false)
+
+    },
+  }
+}
+</script>
+<style lang="scss" >
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+}
+.avatar {
+  width: 100px;
+  height: 100px;
+  display: block;
+}
+.checkUsed{
+	display: inline-block;
+	margin-left: 10px;
+	color: #1890ff;
+}
+</style>