王克恕 4 år sedan
förälder
incheckning
d3c8756ea1

+ 16 - 0
imcs-ui/src/api/resourceProductMgr/programCenter.js

@@ -59,6 +59,13 @@ const apiList = {
     method: 'POST',
     url: `/authority/program/implementProgram`
   },
+  
+  // 【刀具下拉】数据
+  toolList: {
+    method: 'POST',
+    url: `/authority/customizeCuttingTool/query`
+  },
+  
   list: {
     method: 'POST',
     url: `/authority/program/query`
@@ -156,6 +163,15 @@ export default {
       data
     })
   },
+  
+  // 【刀具下拉】数据
+  toolList (data) {
+    return axiosApi({
+      ...apiList.toolList,
+      data
+    })
+  },
+  
   list (data) {
     return axiosApi({
       ...apiList.list,

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

@@ -50,6 +50,8 @@ export default {
 			armFixtureConf: '机械手臂取夹具',
 			armMeterialConf: '机械手臂抓取原料',
 			delayFlag: '不满足,推后执行',
+			addProgram: '设备程序',
+			toolMgr: '刀具管理',
 			meterialCodeIgnore: {
 				yes: '是',
 				no: '否'
@@ -107,7 +109,13 @@ export default {
 			groupPrority: '优先级',
 			pgType: '位置程序类型',
 			auditStatus: '审核状态',
-			qiyongStatus: '启用状态'
+			qiyongStatus: '启用状态',
+			auditStatuss: {
+				zero: '新建零件',
+				one: '待审核',
+				two: '审核通过',
+				three: '审核不通过'
+			}
 		},
 		// 按钮的名称
 	  	buttons: {

+ 29 - 26
imcs-ui/src/lang/zh/resource.js

@@ -135,37 +135,37 @@ export default {
 				model: '型号',
 				category: '分类',
 				zoneName: '所属产线',
-        programSynTime: '同步时间',
-        programNum: '程序数量',
+        		programSynTime: '同步时间',
+        		programNum: '程序数量',
 				nums: '工作位置数量',
 				isProgram: '是否需要程序',
 				linkStatus: "连接状态",
 				controlStatus: '控制状态',
 				productionStatus: '生产状态'
 			},
-      //【维保计划管理】列表table字段名称
-      repair:{
-			  select:'选择设备',
-			  code: '设备编号',
-        productionresourceName: '设备名称',
-        lineDesc: '所在产线',
-        countdown: '维修倒计时进度',
-        repairStartTime: '维保开始时间',
-        repairEndTime: '下次维保时间',
-        repairStatus: '维修状态',
-        status: '启用状态',
-        createUserDesc: '操作人',
-        weight:'排序',
-        createTime: '创建时间',
-        updateTime: '更新时间',
-        remark: '备注',
-        maintenanceTime: '维保日期',
-        maintenanceContent: '维保内容',
-        maintenanceStatus: '维保后设备状态',
-        maintenanceUser: '维保人',
-        maintenanceCreateTime: '提交日期',
-
-      },
+      		//【维保计划管理】列表table字段名称
+	      	repair:{
+				select:'选择设备',
+				code: '设备编号',
+		        productionresourceName: '设备名称',
+		        lineDesc: '所在产线',
+		        countdown: '维修倒计时进度',
+		        repairStartTime: '维保开始时间',
+		        repairEndTime: '下次维保时间',
+		        repairStatus: '维修状态',
+		        status: '启用状态',
+		        createUserDesc: '操作人',
+		        weight:'排序',
+		        createTime: '创建时间',
+		        updateTime: '更新时间',
+		        remark: '备注',
+		        maintenanceTime: '维保日期',
+		        maintenanceContent: '维保内容',
+		        maintenanceStatus: '维保后设备状态',
+		        maintenanceUser: '维保人',
+		        maintenanceCreateTime: '提交日期',
+	
+	      	},
 			// 【设备位置管理】列表table字段名称
 			eqPosition: {
 				no: '位置编号',
@@ -213,11 +213,14 @@ export default {
 				toolNums: '刀具数量',
 				version: '版本',
 				status: '状态',
-        synTime: '同步时间'
+        		synTime: '同步时间'
 			},
 			// 【程序中心-新增-刀具】列表table字段名称
 			programTool: {
 				specification: '刀具规格',
+				toolName: '刀具名称',
+				useTime: '使用时间(分钟)',
+				count: '数量',
 				model: '型号',
 				brand: '品牌',
 				usageTime: '使用时间',

+ 4 - 4
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/Index.vue

@@ -3,10 +3,10 @@
     <div class="filter-container">
     	<span>
 	    	<el-radio-group v-model="queryParams.model.auditStatus">
-		      <el-radio-button label="2">审核通过</el-radio-button>
-		      <el-radio-button label="1">待审核</el-radio-button>
-		      <el-radio-button label="3">审核不通过</el-radio-button>
-		      <el-radio-button label="0">新建零件</el-radio-button>
+		      <el-radio-button label="2">{{$t("prepare.searchForm.auditStatuss.two")}}</el-radio-button>
+		      <el-radio-button label="1">{{$t("prepare.searchForm.auditStatuss.one")}}</el-radio-button>
+		      <el-radio-button label="3">{{$t("prepare.searchForm.auditStatuss.three")}}</el-radio-button>
+		      <el-radio-button label="0">{{$t("prepare.searchForm.auditStatuss.zero")}}</el-radio-button>
 		    </el-radio-group>
 	    </span>
 	    <span style="margin-left: 15px;">

+ 154 - 34
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/programForm/components/ProgramncMgr.vue

@@ -48,18 +48,63 @@
 		      	<el-form-item :label='$t("resource.form.pgContent")+":"' prop="pgContent">
 		        	<el-input v-model="pgContent" :readOnly="true" type="textarea" :rows="6" style="width: 100%;"/>
 		      	</el-form-item>
-		      	<!-- 刀具解析结果 -->
+		      	<!-- 刀具管理 -->
 		      	<div>
-		      	<h2 class="editTitle">{{$t("prepare.common.toolfx")}}</h2>
+			      	<h2 class="editTitle">{{$t("prepare.common.toolMgr")}}
+			      		<!-- 新增 -->
+			      		<el-button type="primary" size="small" icon="el-icon-plus" circle @click="addRes"></el-button>
+			      	</h2>
 		      		<el-table
-				      :data="toolList"
-				      style="width: 100%"
+				      	:data="toolList"
+				      	style="width: 100%"
 				    >
-				      <el-table-column prop="specification" :label='$t("resource.table.programTool.specification")'></el-table-column>
-				      <el-table-column prop="model" :label='$t("resource.table.programTool.model")'></el-table-column>
-				      <el-table-column prop="brand" :label='$t("resource.table.programTool.brand")'></el-table-column>
-				      <el-table-column prop="usageTime" :label='$t("resource.table.programTool.usageTime")'></el-table-column>
-				      <el-table-column prop="duration" :label='$t("resource.table.programTool.duration")'></el-table-column>
+				      	<el-table-column prop="toolId" :label='$t("resource.table.programTool.toolName")'>
+					      	<template slot-scope="{ row }">
+					      		<el-select v-model="row.toolId" :placeholder='$t("common.pleaseEnter")'>
+								    <el-option
+								      	v-for="item in toolSelectList"
+								      	:key="item.id"
+								      	:label="item.cuttingToolName"
+								      	:value="item.id">
+								    </el-option>
+								</el-select>
+					      	</template>
+				      	</el-table-column>
+				      	<el-table-column prop="useTime" :label='$t("resource.table.programTool.useTime")'>
+					      	<template slot-scope="{ row }">
+					      		<el-input v-model="row.useTime" :placeholder='$t("common.pleaseEnter")'/>
+					      	</template>
+				      	</el-table-column>
+				      	<!--<el-table-column prop="count" :label='$t("resource.table.programTool.count")'>
+					      	<template slot-scope="{ row }">
+					      		<el-input-number v-model="row.count" :min="1" :max="999999999" label="数量"></el-input-number>
+					      	</template>
+				      	</el-table-column>-->
+				      	<!-- 操作 -->
+				      	<el-table-column
+					        :label="$t('table.operation')"
+					        fixed="right"
+					        align="center"
+					        column-key="operation"
+					        width="80px"
+				      	>
+					        <template slot-scope="{ row }">
+					        	<el-tooltip v-if="type != 'add'" class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
+						          <i
+						            class="el-icon-edit table-operation"
+						            style="color: #2db7f5;"
+						            @click="edit(row)"
+						          />
+						        </el-tooltip>
+					          	<el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
+							        <i
+							            class="el-icon-delete table-operation"
+							            style="color: #f50;"
+							            @click="singleDelete(row)"
+							        />
+					          	</el-tooltip>
+					        </template>
+				      	</el-table-column>
 				    </el-table>
 		      	</div>
 		      
@@ -99,6 +144,7 @@ export default {
     	tableData: [],
     	eqList: [], // 设备下拉类别数据
     	toolList: [], // 刀具列表
+    	toolSelectList: [{id: '110001', cuttingToolName: '刀具1'}, {id: '211001', cuttingToolName: '刀具2'}], // 刀具下拉数据
     	pgContent: '',  // 程序内容
       	type: 'add',
       	tenant: this.initTenant(),
@@ -134,6 +180,9 @@ export default {
 		if(!!this.programId){
 			this.getProgram(this.programId)
 		}
+		
+		// 初始化,刀具下拉
+		this.getToolList();
 	},
 	watch: {
 		programId(val){
@@ -167,13 +216,24 @@ export default {
       })()
     }
   },
-  methods: {
-  	// 文件列表移除文件时的钩子
-  	handleRemove(file, fileList) {
-	    console.log("删除事件:", file, fileList);
-	    // 还原数据
-	    this.resetFile()
-	},
+  	methods: {
+	  	// 文件列表移除文件时的钩子
+	  	handleRemove(file, fileList) {
+		    console.log("删除事件:", file, fileList);
+		    // 还原数据
+		    this.resetFile()
+		},
+	
+		// 初始化,【刀具下拉】
+		getToolList(){
+			programCenterApi.toolList().then(res => {
+	    		res = res.data
+	    		// console.log("【刀具下拉】下拉数据:", res)
+	    		if(res.isSuccess){
+	    			this.toolSelectList = res.data
+	    		}
+	    	})
+		},
 	
 	  // 点击文件列表中已上传的文件时的钩子
 	  handlePreview(file) {
@@ -275,8 +335,8 @@ export default {
 	  			submittedFileName: val.name,
 	  			filePath: val.url,
 	  			runTime: val.runTime,
-	  			toolList: val.toolList,
-	  			toolNums: val.toolList ? val.toolList.length : 0
+	  			// toolList: val.toolList,
+	  			// toolNums: val.toolList ? val.toolList.length : 0
     		};
     		// 如果附件存在 /
     		let pid = val.programId || val.id;
@@ -290,39 +350,99 @@ export default {
     	}
     },
     
+    // 【新增】按钮-事件
+    addRes(){
+      this.toolList.push({
+      	key: "WKS_"+ Math.random(),
+      	toolId: '',
+      	toolName: '',
+      	useTime: '',
+      	count: null,
+      	isEdit: true
+      })
+    },
+    
+    // 【删除】按钮事件
+    singleDelete(row){
+    	this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+      	}).then(() => {
+	      	// 过滤符合条件的数据
+	      	let arr = this.toolList.filter(item => item.key != row.key || item.id != row.id)
+	      	// 给数据排序
+	    		arr.forEach((item, index) => {
+	    			item.positionSort = index + 1
+	    		})
+	      	// 给新的数据赋值
+    		this.toolList = arr;
+
+      	}).catch(() => {})
+    },
+    
+    // 【修改】按钮事件
+    edit(row){
+    	let list = new Array();
+    	this.toolList.forEach((item, index) => {
+    		// 当前编辑行
+    		if(!!item.id && item.id == row.id){
+    			item.isEdit = true
+    		}
+    		list.push(item)
+    	})
+    	// 赋值给当前
+    	this.toolList = list
+    },
+    
     close () {
       this.$emit('close')
     },
     
     reset () {
-    	console.log("清空了多少次!!!!!");
-      // 先清除校验,再清除表单,不然有奇怪的bug
-      this.$refs.form.clearValidate()
-      this.$refs.form.resetFields()
-      this.tenant = this.initTenant()
-      // 【刀具】清空
-      this.toolList = []
-      // 【程序内容】清空
-      this.pgContent = ''
-      // 清空上传附件
-      this.fileList = []
+    	// console.log("清空了多少次!!!!!");
+      	// 先清除校验,再清除表单,不然有奇怪的bug
+      	this.$refs.form.clearValidate()
+      	this.$refs.form.resetFields()
+      	this.tenant = this.initTenant()
+      	// 【刀具】清空
+      	this.toolList = []
+      	// 【程序内容】清空
+      	this.pgContent = ''
+      	// 清空上传附件
+      	this.fileList = []
     },
     submitForm () {
       this.$refs.form.validate((valid) => {
-      	console.log("Form的数据123:", this.tenant, valid);
         if (valid) {
+        	//添加数据
+        	this.tenant.toolList = this.toolList;
         	let obj = {...this.tenant, ...this.fileObj};
+        	// 添加【刀具管理】
+        	if(obj.toolList && obj.toolList.length > 0){
+        		let arr = [];
+        		obj.toolList.map(item => {
+        			let target = this.toolSelectList.filter(obj => obj.id = item.toolId)[0];
+        			// 把刀具名称带出来
+        			item.toolName = target.cuttingToolName;
+        			// 添加数据
+        			arr.push(item);
+        		});
+        		obj.toolList = arr;
+        	}
         	// 把生产资源id,分开
 	        if(!!obj.resourceIds){
 	          	let arr = this.tenant.resourceIds.split(",");
 	          	obj.resourceId = arr[0];   // 设备id
 	          	obj.name = arr[1];   // 设备名称
 	        }
-	        // console.log("Form最终数据:", obj);
 	        if(this.type == "add") {
 	        	// 添加关键字
 	        	obj.keys = ''+ Math.random();
 	        }
+	        // console.log("Form最终数据:", obj);
+	        // return false;
         	// 恢复按钮
           	this.confirmDisabled = true;
       		// 传值父组件
@@ -357,7 +477,7 @@ export default {
     			// [程序内容]字段的值
 		  		this.pgContent = obj.content
 		  		// [刀具]列表
-		  		this.toolList = obj.toolList
+		  		// this.toolList = obj.toolList
 		  		// 附件数据
 		  		this.fileList = [{
 		  			name: obj.name,
@@ -370,8 +490,8 @@ export default {
 	  			this.fileObj.submittedFileName = obj.name
 	  			this.fileObj.filePath  = obj.url
 	  			this.fileObj.runTime = obj.runTime
-	  			this.fileObj.toolList = obj.toolList
-	  			this.fileObj.toolNums = obj.toolList ? obj.toolList.length : 0
+	  			// this.fileObj.toolList = obj.toolList
+	  			// this.fileObj.toolNums = obj.toolList ? obj.toolList.length : 0
     		}
     	})
     }

+ 380 - 380
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/programForm/index.vue

@@ -1,381 +1,381 @@
-<template>
-  <div class="">
-    <!-- 按钮功能 -->
-    <div class="itemDiv">
-			<span class="titleSmall">{{$t("prepare.common.program")}}</span>
-			<el-radio-group :disabled="showRadio" v-model="radio" @change="radioChange" style="margin-right: 15px;">
-			    <el-radio label="1">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
-			    <el-radio label="2">{{$t("prepare.common.idNeed.need")}}</el-radio>
-			</el-radio-group>
-			<el-button :disabled="showButton" type="primary" icon="el-icon-plus" size="small" @click="addProgram" circle></el-button>
-		</div>
-		<!-- Table数据 -->
-		<el-table
-			v-if="radio != '1'"
-      ref="table"
-      v-loading="loading"
-      :data="tableData"
-      border
-      fit
-      style="width: 100%;"
-      highlight-current-row
-      header-row-class-name="technologTable"
-		  @current-change="handleCurrentChange"
-	  >
-  		<!-- 序号 -->
-    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
-	      <template slot-scope="scope">
-	        <div>
-	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
-	        </div>
-	      </template>
-      </el-table-column>
-      <!-- 设备 -->
-    	<el-table-column prop="name" :label='$t("prepare.table.program.name")' align="center" width="220px" :show-overflow-tooltip="true">
-    		<template slot-scope="{ row }">
-    			<div v-if="type == 'view'">{{row.name}}</div>
-    			<div v-else>
-    				<el-button type="text" @click="edit(row)">{{row.name}}</el-button>
-    			</div>
-    		</template>
-    	</el-table-column>
-    	<!-- 托盘夹具组 -->
-    	<!--<el-table-column prop="groupSort" :label='$t("prepare.table.program.groupSort")' align="center" width="120px"></el-table-column>-->
-    	<!-- 位置程序类型 -->
-      <!--<el-table-column prop="programType" :label='$t("prepare.table.program.programType")' align="center" width="130px">
-      	<template slot-scope="{ row }">
-      		<span>{{row.programType == "1" ? $t("prepare.common.programType.type1") : (row.programType == "2" ? $t("prepare.common.programType.type2") : $t("prepare.common.programType.type3"))}}</span>
-      	</template>
-      </el-table-column>-->
-      <!-- 程序加工位置 -->
-      <!--<el-table-column prop="positions" :label='$t("prepare.table.program.positions")' width="160px"></el-table-column>-->
-      <!-- 优先级 -->
-      <!--<el-table-column prop="prority" :label='$t("prepare.table.program.prority")' width="70px"></el-table-column>-->
-      <!-- 加工时间 -->
-      <el-table-column prop="workTime" :label='$t("prepare.table.program.addTime")' width="180px" align="center"></el-table-column>
-      <!-- 程序名称 -->
-      <el-table-column prop="submittedFileName" :label='$t("prepare.table.program.submittedFileName")' align="center"></el-table-column>
-      <!-- 操作 -->
-      <el-table-column
-      	v-if="type == 'view' ? false : true"
-        :label="$t('table.operation')"
-        fixed="right"
-        align="center"
-        column-key="operation"
-        width="60px"
-      >
-        <template slot-scope="{ row }">
-        	<!--<el-tooltip class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-edit table-operation"
-	            style="color: #2db7f5;"
-	            @click="edit(row)"
-	          />
-	        </el-tooltip>-->
-          <el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-delete table-operation"
-	            style="color: #f50;"
-	            @click="domDelete(row)"
-	          />
-          </el-tooltip>
-        </template>
-      </el-table-column>
-    </el-table>
-				    
-    <pagination
-      v-show="tableData.total > 0"
-      :limit.sync="queryParams.size"
-      :page.sync="queryParams.current"
-      :total="Number(tableData.total)"
-      @pagination="fetch"
-    />
-    
-    <tenant-edit
-      ref="edit"
-      :dialog-visible="dialog.isVisible"
-      :title="dialog.title"
-      @close="editClose"
-      @success="editSuccess"
-    />
-    <tenant-view
-      ref="view"
-      :dialog-visible="tenantViewVisible"
-      @close="viewClose"
-    />
-    
-    <programnc-mgr 
-    	ref="programnc" 
-    	:dialog-visible="dialogProg.isVisible"
-      :title="dialogProg.title"
-    	@close="editProgClose" 
-    	@success="editProgSuccess"
-    ></programnc-mgr>
-    <!--<el-dialog
-		  title="添加NC程序"
-		  :visible.sync="dialogProgram"
-		  width="750px"
-		  :append-to-body="true"
-		>
-		  
-		</el-dialog>-->
-  </div>
-</template>
-
-<script>
-	import TenantEdit from "./components/Edit"
-	import TenantView from "./components/View"
-	import Pagination from "@/components/Pagination"
-	// 【程序管理】组件
-	import ProgramncMgr from "./components/ProgramncMgr"
-	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
-	export default {
-	  name: "ProgramForm",
-	  components: { Pagination, TenantEdit, TenantView, ProgramncMgr },
-	  props: {
-	  	type: String
-	  },
-	  data () {
-	    return {
-	    	dialogProgram: false,
-	    	currentRow: null,
-	    	radio: '2',
-	    	audioStatus: [],
-	      dialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      dialogProg: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      preview: {
-	        isVisible: false,
-	        context: ''
-	      },
-	      tenantViewVisible: false,
-	      tableKey: 0,
-	      queryParams: initQueryParams({}),
-	      selection: [],
-	      loading: false,
-	      // 新增和修改的设备[设备]数据-来自·(可执行设备(位置))
-	      selectedEq: [],
-	      // 新增和修改的设备[夹具组]数据-来自·(托盘夹具组)
-	      selectedTray: [],
-	      tableData: [/*
-	      	{id:"100", name: "1", name2: 'cs200', name3: '1', name4: '整体程序', name5: "1,2", name6: '30', name7: '60'},
-	      	{id:"101", name: "2", name2: 'ct100', name3: '2', name4: '独立程序', name5: "1", name6: '20', name7: '80'},
-	      	{id:"102", name: "3", name2: '西门子Z4', name3: '1', name4: '整体程序', name5: "2", name6: '10', name7: '55'},
-	      	{id:"103", name: "4", name2: '西门子Z5', name3: '2', name4: '组合程序', name5: "2,3", name6: '3', name7: '230'}
-	      */]
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-		},
-	  computed: {
-	  	showRadio(){
-		   	return this.type == "view" ? true : false
-		  },
-		  showButton(){
-		  	let flag = false
-		  	if(this.type == "view"){
-		  		flag = true
-		  	}else{
-		  		flag = this.radio == '1' ? true : false
-		  	}
-		  	return flag
-		  }
-	  },
-	  mounted () {
-	    
-	  },
-	  methods: {
-	  	// 【Radio】按钮值变化-事件
-	  	radioChange(val){
-      	if(val == '1'){
-      		// 清除数据
-		  		this.tableData = []
-      	}
-	  	},
-	  	// 【删除】按钮-事件
-	  	domDelete(row){
-	  		this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	    		// 过滤我们需要的数据
-		  		let list = this.tableData.filter(item => {
-		  			let f1 = item.keys || item.id;
-		  			let f2 = row.keys || row.id;
-		  			return f1 != f2
-		  		});
-		  		// 重新赋值
-		  		this.tableData = list;
-	      }).catch(() => {})
-	  	},
-	  	// table的当前行,变化-事件
-	  	handleCurrentChange(val) {
-		    this.currentRow = val;
-		  },
-		  
-		  // 【程序管理】按钮-事件
-	  	addProgram(){
-	  		this.dialogProg.title = this.$t("common.add");
-	  		this.$refs.programnc.type = "add";
-	  		this.$refs.programnc.setTenant(false, this.selectedEq);
-	  		// 打开弹出框
-	  		this.dialogProg.isVisible = true;
-	  	},
-  	
-		  // 【程序管理-取消】按钮-事件
-	  	editProgClose(){
-	  		this.dialogProg.isVisible = false;
-	  	},
-	  	
-	  	// 【程序管理-确定】按钮-事件
-	  	editProgSuccess(obj, type){
-	  		if(type == "add") {
-	  			// 给选择的数据,赋值
-	  			this.tableData.push(obj);
-	  		} else {
-	  			let arr = [];
-	  			this.tableData.map(item => {
-	  				let f1 = item.keys || item.id;
-	  				let f2 = obj.keys || obj.id;
-	  				if (f1 == f2){
-	  					arr.push(obj);
-	  				} else {
-	  					arr.push(item);
-	  				}
-	  			});
-	  			this.tableData = arr;
-	  		}
-	  	},
-	  	
-	    viewClose () {
-	      this.tenantViewVisible = false
-	    },
-	    editClose () {
-	      this.dialog.isVisible = false
-	    },
-	    editSuccess (obj, flag) {
-	    	let objData = JSON.parse(obj)
-	    	console.log("程序传的值:", objData)
-	    	if(flag == "add"){
-	    		// 新增时候,添加唯一值
-	    		objData.key = ''+ Math.random()
-	    		this.tableData.push(objData)
-	    	}else{
-	    		// console.log("in的值:", objData)
-	    		// console.log("当前选择的数据:", this.currentRow)
-	    		let list = []
-	    		this.tableData.map(item => {
-	    			// key是唯一的,
-	    			if(item.key == this.currentRow.key){
-	    				item.name = objData.name
-	    				item.resourceId = objData.resourceId
-	    				item.resourceIds = objData.resourceIds
-	    				item.trayPositionId = objData.trayPositionId
-	    				item.positions = objData.positions
-	    				item.programGroupList = objData.programGroupList
-	    				item.programType = objData.programType
-	    				item.groupSort = objData.groupSort   // 组序
-	    				item.prority = objData.prority
-	    				// 托盘的id
-	    				item.procedureTrayGroupId = objData.procedureTrayGroupId
-	    			}
-	    		})
-	    	}
-	    },
-	    
-	    onSelectChange (selection) {
-	      this.selection = selection
-	    },
-	    
-	    search () {
-	      this.fetch({
-	        ...this.queryParams
-	      })
-	    },
-	    
-	    reset () {
-	      this.queryParams = initQueryParams({})
-	      this.$refs.table.clearSort()
-	      this.$refs.table.clearFilter()
-	      this.search()
-	    },
-	    
-	    add () {
-	      this.$refs.edit.type = "add"
-	      this.$refs.edit.setTenant(false, this.selectedEq, this.selectedTray)
-	      this.dialog.title = this.$t("common.add")
-	      this.dialog.isVisible = true
-	    },
-	    clearSelections () {
-	      this.$refs.table.clearSelection()
-	    },
-	    delete (ids) {
-	    	
-	    },
-	    view (row) {
-	      this.$refs.view.setTenant(row)
-	      this.tenantViewVisible = true
-	    },
-	    // 【修改】表头上Btn-事件
-	    editOne() {
-	    	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.edit(this.selection[0]);
-	    },
-	    
-	    // [NC程序]修改-事件
-	    edit (row) {
-	      this.$refs.programnc.setTenant(row, this.selectedEq)
-	      this.$refs.programnc.type = "edit"
-	      this.dialogProg.title = this.$t("common.edit")
-	      // 打开弹出框
-	  		this.dialogProg.isVisible = true;
-	    },
-	    
-	    fetch (params = {}) {
-	    	
-	    }
-	  }
-	}
-</script>
-<style>
-</style>
-<style lang="scss" scoped>
-	.titleSmall{
-		position: relative;
-		padding-left: 10px;
-		margin-right: 15px;
-	}
-	.titleSmall:before{
-		content: '';
-		position: absolute;
-		background: #1890ff;
-		width: 5px;
-		height: 90%;
-		left: 0;
-		top: 1px;
-	}
-	.itemDiv{
-		margin: 10px 0;
-	}
+<template>
+  <div class="">
+    <!-- 按钮功能 -->
+    <div class="itemDiv">
+			<span class="titleSmall">{{$t("prepare.common.program")}}</span>
+			<el-radio-group :disabled="showRadio" v-model="radio" @change="radioChange" style="margin-right: 15px;">
+			    <el-radio label="1">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
+			    <el-radio label="2">{{$t("prepare.common.idNeed.need")}}</el-radio>
+			</el-radio-group>
+			<el-button :disabled="showButton" type="primary" icon="el-icon-plus" size="small" @click="addProgram" circle></el-button>
+		</div>
+		<!-- Table数据 -->
+		<el-table
+			v-if="radio != '1'"
+      ref="table"
+      v-loading="loading"
+      :data="tableData"
+      border
+      fit
+      style="width: 100%;"
+      highlight-current-row
+      header-row-class-name="technologTable"
+		  @current-change="handleCurrentChange"
+	  >
+  		<!-- 序号 -->
+    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+	      <template slot-scope="scope">
+	        <div>
+	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+	        </div>
+	      </template>
+      </el-table-column>
+      <!-- 设备 -->
+    	<el-table-column prop="name" :label='$t("prepare.table.program.name")' align="center" width="220px" :show-overflow-tooltip="true">
+    		<template slot-scope="{ row }">
+    			<div v-if="type == 'view'">{{row.name}}</div>
+    			<div v-else>
+    				<el-button type="text" @click="edit(row)">{{row.name}}</el-button>
+    			</div>
+    		</template>
+    	</el-table-column>
+    	<!-- 托盘夹具组 -->
+    	<!--<el-table-column prop="groupSort" :label='$t("prepare.table.program.groupSort")' align="center" width="120px"></el-table-column>-->
+    	<!-- 位置程序类型 -->
+      <!--<el-table-column prop="programType" :label='$t("prepare.table.program.programType")' align="center" width="130px">
+      	<template slot-scope="{ row }">
+      		<span>{{row.programType == "1" ? $t("prepare.common.programType.type1") : (row.programType == "2" ? $t("prepare.common.programType.type2") : $t("prepare.common.programType.type3"))}}</span>
+      	</template>
+      </el-table-column>-->
+      <!-- 程序加工位置 -->
+      <!--<el-table-column prop="positions" :label='$t("prepare.table.program.positions")' width="160px"></el-table-column>-->
+      <!-- 优先级 -->
+      <!--<el-table-column prop="prority" :label='$t("prepare.table.program.prority")' width="70px"></el-table-column>-->
+      <!-- 加工时间 -->
+      <el-table-column prop="workTime" :label='$t("prepare.table.program.addTime")' width="180px" align="center"></el-table-column>
+      <!-- 程序名称 -->
+      <el-table-column prop="submittedFileName" :label='$t("prepare.table.program.submittedFileName")' align="center"></el-table-column>
+      <!-- 操作 -->
+      <el-table-column
+      	v-if="type == 'view' ? false : true"
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+        width="60px"
+      >
+        <template slot-scope="{ row }">
+        	<!--<el-tooltip class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
+	          <i
+	            class="el-icon-edit table-operation"
+	            style="color: #2db7f5;"
+	            @click="edit(row)"
+	          />
+	        </el-tooltip>-->
+          <el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
+	          <i
+	            class="el-icon-delete table-operation"
+	            style="color: #f50;"
+	            @click="domDelete(row)"
+	          />
+          </el-tooltip>
+        </template>
+      </el-table-column>
+    </el-table>
+				    
+    <pagination
+      v-show="tableData.total > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+    />
+    
+    <tenant-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+    <tenant-view
+      ref="view"
+      :dialog-visible="tenantViewVisible"
+      @close="viewClose"
+    />
+    
+    <programnc-mgr 
+    	ref="programnc" 
+    	:dialog-visible="dialogProg.isVisible"
+      :title="dialogProg.title"
+    	@close="editProgClose" 
+    	@success="editProgSuccess"
+    ></programnc-mgr>
+    <!--<el-dialog
+		  title="添加NC程序"
+		  :visible.sync="dialogProgram"
+		  width="750px"
+		  :append-to-body="true"
+		>
+		  
+		</el-dialog>-->
+  </div>
+</template>
+
+<script>
+	import TenantEdit from "./components/Edit"
+	import TenantView from "./components/View"
+	import Pagination from "@/components/Pagination"
+	// 【程序管理】组件
+	import ProgramncMgr from "./components/ProgramncMgr"
+	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
+	export default {
+	  name: "ProgramForm",
+	  components: { Pagination, TenantEdit, TenantView, ProgramncMgr },
+	  props: {
+	  	type: String
+	  },
+	  data () {
+	    return {
+	    	dialogProgram: false,
+	    	currentRow: null,
+	    	radio: '2',
+	    	audioStatus: [],
+	      dialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      dialogProg: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      preview: {
+	        isVisible: false,
+	        context: ''
+	      },
+	      tenantViewVisible: false,
+	      tableKey: 0,
+	      queryParams: initQueryParams({}),
+	      selection: [],
+	      loading: false,
+	      // 新增和修改的设备[设备]数据-来自·(可执行设备(位置))
+	      selectedEq: [],
+	      // 新增和修改的设备[夹具组]数据-来自·(托盘夹具组)
+	      selectedTray: [],
+	      tableData: [/*
+	      	{id:"100", name: "1", name2: 'cs200', name3: '1', name4: '整体程序', name5: "1,2", name6: '30', name7: '60'},
+	      	{id:"101", name: "2", name2: 'ct100', name3: '2', name4: '独立程序', name5: "1", name6: '20', name7: '80'},
+	      	{id:"102", name: "3", name2: '西门子Z4', name3: '1', name4: '整体程序', name5: "2", name6: '10', name7: '55'},
+	      	{id:"103", name: "4", name2: '西门子Z5', name3: '2', name4: '组合程序', name5: "2,3", name6: '3', name7: '230'}
+	      */]
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+		},
+	  computed: {
+	  	showRadio(){
+		   	return this.type == "view" ? true : false
+		  },
+		  showButton(){
+		  	let flag = false
+		  	if(this.type == "view"){
+		  		flag = true
+		  	}else{
+		  		flag = this.radio == '1' ? true : false
+		  	}
+		  	return flag
+		  }
+	  },
+	  mounted () {
+	    
+	  },
+	  methods: {
+	  	// 【Radio】按钮值变化-事件
+	  	radioChange(val){
+      	if(val == '1'){
+      		// 清除数据
+		  		this.tableData = []
+      	}
+	  	},
+	  	// 【删除】按钮-事件
+	  	domDelete(row){
+	  		this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+	    		// 过滤我们需要的数据
+		  		let list = this.tableData.filter(item => {
+		  			let f1 = item.keys || item.id;
+		  			let f2 = row.keys || row.id;
+		  			return f1 != f2
+		  		});
+		  		// 重新赋值
+		  		this.tableData = list;
+	      }).catch(() => {})
+	  	},
+	  	// table的当前行,变化-事件
+	  	handleCurrentChange(val) {
+		    this.currentRow = val;
+		  },
+		  
+		  // 【程序管理】按钮-事件
+	  	addProgram(){
+	  		this.dialogProg.title = this.$t("prepare.common.addProgram"); // this.$t("common.add")
+	  		this.$refs.programnc.type = "add";
+	  		this.$refs.programnc.setTenant(false, this.selectedEq);
+	  		// 打开弹出框
+	  		this.dialogProg.isVisible = true;
+	  	},
+  	
+		  // 【程序管理-取消】按钮-事件
+	  	editProgClose(){
+	  		this.dialogProg.isVisible = false;
+	  	},
+	  	
+	  	// 【程序管理-确定】按钮-事件
+	  	editProgSuccess(obj, type){
+	  		if(type == "add") {
+	  			// 给选择的数据,赋值
+	  			this.tableData.push(obj);
+	  		} else {
+	  			let arr = [];
+	  			this.tableData.map(item => {
+	  				let f1 = item.keys || item.id;
+	  				let f2 = obj.keys || obj.id;
+	  				if (f1 == f2){
+	  					arr.push(obj);
+	  				} else {
+	  					arr.push(item);
+	  				}
+	  			});
+	  			this.tableData = arr;
+	  		}
+	  	},
+	  	
+	    viewClose () {
+	      this.tenantViewVisible = false
+	    },
+	    editClose () {
+	      this.dialog.isVisible = false
+	    },
+	    editSuccess (obj, flag) {
+	    	let objData = JSON.parse(obj)
+	    	console.log("程序传的值:", objData)
+	    	if(flag == "add"){
+	    		// 新增时候,添加唯一值
+	    		objData.key = ''+ Math.random()
+	    		this.tableData.push(objData)
+	    	}else{
+	    		// console.log("in的值:", objData)
+	    		// console.log("当前选择的数据:", this.currentRow)
+	    		let list = []
+	    		this.tableData.map(item => {
+	    			// key是唯一的,
+	    			if(item.key == this.currentRow.key){
+	    				item.name = objData.name
+	    				item.resourceId = objData.resourceId
+	    				item.resourceIds = objData.resourceIds
+	    				item.trayPositionId = objData.trayPositionId
+	    				item.positions = objData.positions
+	    				item.programGroupList = objData.programGroupList
+	    				item.programType = objData.programType
+	    				item.groupSort = objData.groupSort   // 组序
+	    				item.prority = objData.prority
+	    				// 托盘的id
+	    				item.procedureTrayGroupId = objData.procedureTrayGroupId
+	    			}
+	    		})
+	    	}
+	    },
+	    
+	    onSelectChange (selection) {
+	      this.selection = selection
+	    },
+	    
+	    search () {
+	      this.fetch({
+	        ...this.queryParams
+	      })
+	    },
+	    
+	    reset () {
+	      this.queryParams = initQueryParams({})
+	      this.$refs.table.clearSort()
+	      this.$refs.table.clearFilter()
+	      this.search()
+	    },
+	    
+	    add () {
+	      this.$refs.edit.type = "add"
+	      this.$refs.edit.setTenant(false, this.selectedEq, this.selectedTray)
+	      this.dialog.title = this.$t("common.add")
+	      this.dialog.isVisible = true
+	    },
+	    clearSelections () {
+	      this.$refs.table.clearSelection()
+	    },
+	    delete (ids) {
+	    	
+	    },
+	    view (row) {
+	      this.$refs.view.setTenant(row)
+	      this.tenantViewVisible = true
+	    },
+	    // 【修改】表头上Btn-事件
+	    editOne() {
+	    	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.edit(this.selection[0]);
+	    },
+	    
+	    // [NC程序]修改-事件
+	    edit (row) {
+	      this.$refs.programnc.setTenant(row, this.selectedEq)
+	      this.$refs.programnc.type = "edit"
+	      this.dialogProg.title = this.$t("common.edit")
+	      // 打开弹出框
+	  		this.dialogProg.isVisible = true;
+	    },
+	    
+	    fetch (params = {}) {
+	    	
+	    }
+	  }
+	}
+</script>
+<style>
+</style>
+<style lang="scss" scoped>
+	.titleSmall{
+		position: relative;
+		padding-left: 10px;
+		margin-right: 15px;
+	}
+	.titleSmall:before{
+		content: '';
+		position: absolute;
+		background: #1890ff;
+		width: 5px;
+		height: 90%;
+		left: 0;
+		top: 1px;
+	}
+	.itemDiv{
+		margin: 10px 0;
+	}
 </style>