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

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

yejian016332 преди 3 години
родител
ревизия
af97d85547

+ 2 - 2
imcs-ui/package.json

@@ -93,13 +93,13 @@
     "less-loader": "^5.0.0",
     "lint-staged": "8.1.5",
     "mockjs": "1.0.1-beta3",
-    "node-sass": "^4.14.1",
+    "node-sass": "^6.0.1",
     "plop": "2.3.0",
     "pug": "^3.0.2",
     "pug-plain-loader": "^1.1.0",
     "qs": "^6.10.2",
     "runjs": "^4.3.2",
-    "sass-loader": "^7.1.0",
+    "sass-loader": "^10.0.1",
     "script-ext-html-webpack-plugin": "2.1.3",
     "script-loader": "0.7.2",
     "serve-static": "^1.13.2",

+ 61 - 0
imcs-ui/src/api/Dispatch.js

@@ -0,0 +1,61 @@
+import axiosApi from './AxiosApi.js'
+
+const apiList = {
+  page: {
+    url: `/authority/dispatchRecord/page`,
+    method: 'POST'
+  },
+  pageException: {
+    url: `/authority/dispatchException/page`,
+    method: 'POST'
+  },
+  save: {
+    url: `/authority/dispatchException`,
+    method: 'POST'
+  },
+  update: {
+    url: `/authority/dispatchException`,
+    method: 'PUT'
+  },
+  delete: {
+    url: `/authority/dispatchException`,
+    method: 'DELETE'
+  },
+  preview: {
+    method: 'POST',
+    url: `/authority/dispatch/preview`
+  }
+}
+
+export default {
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  pageException (data) {
+    return axiosApi({
+      ...apiList.pageException,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.update,
+      data
+    })
+  },
+  delete (data) {
+    return axiosApi({
+      ...apiList.delete,
+      data
+    })
+  }
+}

+ 301 - 297
imcs-ui/src/lang/zh/resource.js

@@ -1,297 +1,301 @@
-/**************** 【生产資源中心】菜单  **************/
-export default {
-	resource: {
-		// 本模型下的共通
-		common: {
-			aduio: '审核产品',
-			selectAdd: '选择设备',
-			peizhi: '生产资源配置',
-			toolList: '刀具列表',
-			programList: '程序列表',
-			jiankong: '监控方式',
-			setJiankong: '设置监控',
-			jiankongRecord: '监控记录',
-			noJiank: '无监控',
-			jiankongTime: '监控使用寿命',
-			jiankongNums: '监控使用次数',
-			seconds: '分钟',
-			nums: '次',
-			mimm: 'm/s',
-			jichuang: '机床',
-			jxsbi: '机械手臂',
-			agv: 'AGV',
-			users: '使用',
-			history: '历史',
-			eqDelete: '从设备删除',
-			zhixingPg: '执行程序',
-			maxWorkHours: '小时',
-			displayStatus: '是否显示',
-			stopTaskHours: '小时(不派任务)',
-			eqCenter: {
-				allCount: '设备总数',
-				supervisionCount: '系统监管',
-				independentCount: '独立运行',
-				onlineCount: '在线',
-				offlineCount: '离线',
-				workCount: '生产中',
-				freeCount: '空闲',
-				waitCount: '等待配送资源',
-				exceptionCount: '异常',
-				anArea: '按产线',
-				anType: '按分类',
-				waitTask: '待完成任务',
-				detail: '详情',
-				geKuwei: '个库位'
-			}
-		},
-		// 列表搜索表单名称
-		searchForm: {
-			programName: '产品名称',
-			startEndTime: '时间',
-			guige: '规格',
-			xinghao: '型号',
-			jichuang: '所在机床',
-			resourceName: '资源名称',
-			linkStatus: '在线状态',
-			eqName: '设备名称',
-			name: '名称',
-			no: '编号',
-			isCNC: '包含CNC程序',
-			isDao: '包含刀具库',
-			idJindu: '具备进度条',
-			isStatus: '具备状态',
-			isProStaus: '产线控制状态',
-			maxTime: '每日最多加工',
-			baoyang: '临近保养',
-			isAutoCode: '是否工序设备'
-		},
-		// 按钮的名称
-	  	buttons: {
-	  		equipment: '设备管理',
-	  		position: '设备位置管理',
-	  		setBtn: '设置控制状态',
-	  		work: '工作位置管理',
-	  		setting: '配置',
-	  		hardware: '硬件配置',
-	  		linkLine: '关联边线库',
-	  		tongbu: '同步刀具',
-	  		tongbEq: '同步到设备',
-	  		tongbSk: '同步数控程序',
-			mode:  '模式',
-			autoCode: '设备业务自动化节点',
-			detailConf: '详情配置'
-	  	},
-	  	// 列表的cell名称
-		table: {
-			// 【生产单元管理】列表table字段名称
-			area: {
-				no: '编号',
-				name: '产线名称',
-				nums: '资源数量',
-				layoutMap: '布局图',
-				resources: '包含生产资源',
-				mode: '产线模式',  
-				remark: '备注',
-				status: '启用状态',
-				createUser: '操作人',
-				updateTime: '修改时间'
-			},
-			// 【设备管理】列表table字段名称
-			equipment: {
-				no: '编号',
-				pic: '主图',
-				name: '设备名称',
-				brand: '品牌',
-				specification: '规格',
-				model: '型号',
-			},
-			// 【选择设备】列表table字段名称
-			selectQm: {
-				no: '编号',
-				pic: '主图',
-				name: '设备名称',
-				brand: '品牌',
-				specification: '规格',
-				model: '型号',
-				zoneName: '已被选的生产单元',
-			},
-			// 【生产资源管理】列表table字段名称
-			resours: {
-				no: '编号',
-				pic: '主图',
-				name: '设备名称',
-				brand: '品牌',
-				specification: '规格',
-				capitalNo: '资产编号',
-			    capitalName: '资产名称',
-				capitalType: '资产类别',
-			    modeSpecification: '型号规格',
-				capitalPrice: '资产原值',
-				productionDate: '出厂年月',
-				productionNo: '出厂编号',
-				manufacturer: '制造厂家',
-				model: '型号',
-				category: '分类',
-				zoneName: '所属区域',
-				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字段名称
-			eqPosition: {
-				no: '位置编号',
-				name: '名称',
-				pointId: '点位ID',
-				status: '锁定状态'
-			},
-			// 【设备刀具管理-设备列表】列表table字段名称
-			eqList: {
-				name: '设备名称',
-				name2: '设备编号',
-				name3: '设备类似',
-				name4: '所属生产单元',
-				name5: '设备连接状态',
-				name6: '同步时间',
-				name7: '刀库刀具数量'
-			},
-			// 【设备刀具管理-刀具列表】列表table字段名称
-			toolList: {
-				specification: '刀具规格',
-				model: '型号',
-				brand: '品牌',
-				no: '刀库刀具编号',
-				stopBits: '停止位',
-				useStatus: '使用状态',
-				monitorWay: '监控方式',
-				rateUseLife: '额定使用寿命/次',
-				leftUseLife: '剩余使用次数/次',
-				warnLimit: '预警极限',
-				synTime: '同步时间'
-			},
-			// 【设备刀具管理-监控记录】列表table字段名称
-			jkRecord: {
-				rateUseLife: '额定使用寿命/次',
-				leftUseLife: '剩余使用寿命/次',
-				warnLimit: '预警极限',
-				synTime: '同步时间'
-			},
-			// 【程序中心-本地库】列表table字段名称
-			program: {
-				no: '程序编号',
-				name: '程序名称',
-				runTime: '运行时间',
-				size: '大小',
-				toolNums: '刀具数量',
-				version: '版本',
-				status: '状态',
-				updateTime: '更新时间'
-			},
-			// 【程序中心-新增-刀具】列表table字段名称
-			programTool: {
-				specification: '刀具规格',
-				model: '型号',
-				brand: '品牌',
-				usageTime: '使用时间',
-				duration: '持续时间'
-			},
-			// 【程序管理】列表table字段名称
-			pgMgr: {
-				bomName: '产品',
-				version: '工艺版本号',
-				procedureNo: '工序号',
-				resourceName: '设备名称',
-				programName: '程序名称',
-				runTime: '运行时长',
-				createTime: '新增时间',
-				updateTime: '更新时间',
-				createUserDesc: '操作'
-			},
-			// 【程序执行任务】列表table字段名称
-			pgTask: {
-				programNo: '程序编号',
-				programName: '程序名称',
-				version: '版本号',
-				resourceName: '设备名称',
-				resourceCode: '设备编号',
-				runStatus: '状态',
-				actualRunTime: '额定运行时间',
-				startTime: '开始时间',
-				runTime: '运行时间',
-				endTime: '结束时间',
-				createUserDesc: '操作人'
-			}
-		},
-		// 表单数据名称
-		form: {
-			positionName: '位置名称',
-			relationStorage: '关联库位',
-			isLock: '是否锁定',
-			pointId: '点位ID',
-			selectLink: '选择线边库货架',
-			userTime: '额定使用寿命',
-			warninhTime: '报警寿命',
-			userNums: '额定使用次数',
-			warninhNums: '报警次数',
-			prority: '优先级',
-			workTime: '加工时间',
-			pg: '程序',
-			pgNo: '程序编号',
-			pgName: '程序名称',
-			pgVision: '版本号',
-			pgEq: '适合设备',
-			pgUpload: '上传程序',
-			pgTime: '运行时间',
-			pgSize: '程序大小',
-			pgContent: '程序内容',
-			pgTool: '刀具',
-			workbench_num: '工作台数量',
-			hand_num: '手臂数量',
-			cache_storge_num: '缓存库数量',
-			max_speed: '最大移动速度',
-			tray_num: '可放子盘数量',
-			arm: '手抓',
-			armName: '手抓名称',
-			rouJiagong: '产线类型'
-		},
-		// 表单验证规则提示信息
-		rules: {
-		},
-		// 提示或者显示信息
-		tips:{
-			tongbTips: '同步成功!',
-			zhixingTips: '执行程序成功!',
-			areaTips: '删除区域管理数据后,会将区域管理数据全部删除,确认删除?',
-			fileTips: '只能上传TEXT文件!',
-			deletePg: '是否【从设备删除】数据,确认删除?',
-			zxTips: '是否【执行程序】数据,确认执行?',
-			taskTips: '删除程序执行任务数据后,会将程序执行任务数据全部删除,确认删除?',
-			resourTips: '删除生产资源数据后,会将生产资源数据全部删除,确认删除?',
-			hardware: '该硬件不需要配置!'
-		}
-	}
-}
+/**************** 【生产資源中心】菜单  **************/
+export default {
+	resource: {
+		// 本模型下的共通
+		common: {
+			aduio: '审核产品',
+			selectAdd: '选择设备',
+			peizhi: '生产资源配置',
+			toolList: '刀具列表',
+			programList: '程序列表',
+			jiankong: '监控方式',
+			setJiankong: '设置监控',
+			jiankongRecord: '监控记录',
+			noJiank: '无监控',
+			jiankongTime: '监控使用寿命',
+			jiankongNums: '监控使用次数',
+			seconds: '分钟',
+			nums: '次',
+			mimm: 'm/s',
+			jichuang: '机床',
+			jxsbi: '机械手臂',
+			agv: 'AGV',
+			users: '使用',
+			history: '历史',
+			eqDelete: '从设备删除',
+			zhixingPg: '执行程序',
+			maxWorkHours: '小时',
+			displayStatus: '是否显示',
+			stopTaskHours: '小时(不派任务)',
+			eqCenter: {
+				allCount: '设备总数',
+				supervisionCount: '系统监管',
+				independentCount: '独立运行',
+				onlineCount: '在线',
+				offlineCount: '离线',
+				workCount: '生产中',
+				freeCount: '空闲',
+				waitCount: '等待配送资源',
+				exceptionCount: '异常',
+				anArea: '按产线',
+				anType: '按分类',
+				waitTask: '待完成任务',
+				detail: '详情',
+				geKuwei: '个库位'
+			}
+		},
+		// 列表搜索表单名称
+		searchForm: {
+			programName: '产品名称',
+			startEndTime: '时间',
+			guige: '规格',
+			xinghao: '型号',
+			jichuang: '所在机床',
+			resourceName: '资源名称',
+			linkStatus: '在线状态',
+			eqName: '设备名称',
+			name: '名称',
+			no: '编号',
+			isCNC: '包含CNC程序',
+			isDao: '包含刀具库',
+			idJindu: '具备进度条',
+			isStatus: '具备状态',
+			isProStaus: '产线控制状态',
+			maxTime: '每日最多加工',
+			baoyang: '临近保养',
+			isAutoCode: '是否工序设备'
+		},
+		// 按钮的名称
+	  	buttons: {
+	  		equipment: '设备管理',
+	  		position: '设备位置管理',
+	  		setBtn: '设置控制状态',
+	  		work: '工作位置管理',
+	  		setting: '配置',
+	  		hardware: '硬件配置',
+	  		linkLine: '关联边线库',
+	  		tongbu: '同步刀具',
+	  		tongbEq: '同步到设备',
+	  		tongbSk: '同步数控程序',
+        upload: '上传程序',
+			mode:  '模式',
+			autoCode: '设备业务自动化节点',
+			detailConf: '详情配置'
+	  	},
+	  	// 列表的cell名称
+		table: {
+			// 【生产单元管理】列表table字段名称
+			area: {
+				no: '编号',
+				name: '产线名称',
+				nums: '资源数量',
+				layoutMap: '布局图',
+				resources: '包含生产资源',
+				mode: '产线模式',
+				remark: '备注',
+				status: '启用状态',
+				createUser: '操作人',
+				updateTime: '修改时间'
+			},
+			// 【设备管理】列表table字段名称
+			equipment: {
+				no: '编号',
+				pic: '主图',
+				name: '设备名称',
+				brand: '品牌',
+				specification: '规格',
+				model: '型号',
+			},
+			// 【选择设备】列表table字段名称
+			selectQm: {
+				no: '编号',
+				pic: '主图',
+				name: '设备名称',
+				brand: '品牌',
+				specification: '规格',
+				model: '型号',
+				zoneName: '已被选的生产单元',
+			},
+			// 【生产资源管理】列表table字段名称
+			resours: {
+				no: '编号',
+				pic: '主图',
+				name: '设备名称',
+				brand: '品牌',
+				specification: '规格',
+				capitalNo: '资产编号',
+			    capitalName: '资产名称',
+				capitalType: '资产类别',
+			    modeSpecification: '型号规格',
+				capitalPrice: '资产原值',
+				productionDate: '出厂年月',
+				productionNo: '出厂编号',
+				manufacturer: '制造厂家',
+				model: '型号',
+				category: '分类',
+				zoneName: '所属产线',
+        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字段名称
+			eqPosition: {
+				no: '位置编号',
+				name: '名称',
+				pointId: '点位ID',
+				status: '锁定状态'
+			},
+			// 【设备刀具管理-设备列表】列表table字段名称
+			eqList: {
+				name: '设备名称',
+				name2: '设备编号',
+				name3: '设备类似',
+				name4: '所属生产单元',
+				name5: '设备连接状态',
+				name6: '同步时间',
+				name7: '刀库刀具数量'
+			},
+			// 【设备刀具管理-刀具列表】列表table字段名称
+			toolList: {
+				specification: '刀具规格',
+				model: '型号',
+				brand: '品牌',
+				no: '刀库刀具编号',
+				stopBits: '停止位',
+				useStatus: '使用状态',
+				monitorWay: '监控方式',
+				rateUseLife: '额定使用寿命/次',
+				leftUseLife: '剩余使用次数/次',
+				warnLimit: '预警极限',
+				synTime: '同步时间'
+			},
+			// 【设备刀具管理-监控记录】列表table字段名称
+			jkRecord: {
+				rateUseLife: '额定使用寿命/次',
+				leftUseLife: '剩余使用寿命/次',
+				warnLimit: '预警极限',
+				synTime: '同步时间'
+			},
+			// 【程序中心-本地库】列表table字段名称
+			program: {
+				no: '程序编号',
+				name: '程序名称',
+				runTime: '运行时间',
+				size: '大小',
+				toolNums: '刀具数量',
+				version: '版本',
+				status: '状态',
+				updateTime: '更新时间'
+			},
+			// 【程序中心-新增-刀具】列表table字段名称
+			programTool: {
+				specification: '刀具规格',
+				model: '型号',
+				brand: '品牌',
+				usageTime: '使用时间',
+				duration: '持续时间'
+			},
+			// 【程序管理】列表table字段名称
+			pgMgr: {
+				bomName: '产品',
+				version: '工艺版本号',
+				procedureNo: '工序号',
+				resourceName: '设备名称',
+				programName: '程序名称',
+				runTime: '运行时长',
+				createTime: '新增时间',
+				updateTime: '更新时间',
+				createUserDesc: '操作'
+			},
+			// 【程序执行任务】列表table字段名称
+			pgTask: {
+				programNo: '程序编号',
+				programName: '程序名称',
+				version: '版本号',
+				resourceName: '设备名称',
+				resourceCode: '设备编号',
+				runStatus: '状态',
+				actualRunTime: '额定运行时间',
+				startTime: '开始时间',
+				runTime: '运行时间',
+				endTime: '结束时间',
+				createUserDesc: '操作人'
+			}
+		},
+		// 表单数据名称
+		form: {
+			positionName: '位置名称',
+			relationStorage: '关联库位',
+			isLock: '是否锁定',
+			pointId: '点位ID',
+			selectLink: '选择线边库货架',
+			userTime: '额定使用寿命',
+			warninhTime: '报警寿命',
+			userNums: '额定使用次数',
+			warninhNums: '报警次数',
+			prority: '优先级',
+			workTime: '加工时间',
+			pg: '程序',
+			pgNo: '程序编号',
+			pgName: '程序名称',
+			pgVision: '版本号',
+			pgEq: '适合设备',
+			pgUpload: '上传程序',
+			pgTime: '运行时间',
+			pgSize: '程序大小',
+			pgContent: '程序内容',
+			pgTool: '刀具',
+			workbench_num: '工作台数量',
+			hand_num: '手臂数量',
+			cache_storge_num: '缓存库数量',
+			max_speed: '最大移动速度',
+			tray_num: '可放子盘数量',
+			arm: '手抓',
+			armName: '手抓名称',
+      target_resource: '目标设备',
+			rouJiagong: '产线类型'
+		},
+		// 表单验证规则提示信息
+		rules: {
+		},
+		// 提示或者显示信息
+		tips:{
+			tongbTips: '同步成功!',
+			zhixingTips: '执行程序成功!',
+			areaTips: '删除区域管理数据后,会将区域管理数据全部删除,确认删除?',
+			fileTips: '只能上传TEXT文件!',
+			deletePg: '是否【从设备删除】数据,确认删除?',
+			zxTips: '是否【执行程序】数据,确认执行?',
+			taskTips: '删除程序执行任务数据后,会将程序执行任务数据全部删除,确认删除?',
+			resourTips: '删除生产资源数据后,会将生产资源数据全部删除,确认删除?',
+			hardware: '该硬件不需要配置!'
+		}
+	}
+}

+ 7 - 5
imcs-ui/src/views/zuihou/dispatchMgr/dispatchRecord/Index.vue

@@ -18,7 +18,9 @@
           type="datetimerange"
           range-separator="至"
           start-placeholder="开始时间"
-          end-placeholder="结束时间" >
+          end-placeholder="结束时间" 
+          value-format="yyyy-MM-dd HH:mm:ss"
+          >
         </el-date-picker>
       </span>
       <span style="margin-left: 15px">
@@ -107,7 +109,7 @@
 
 <script>
 import Pagination from "@/components/Pagination";
-import areaMgrApi from "@/api/resourceProductMgr/areaMgr";
+import dispatchMgrApi from "@/api/Dispatch";
 
 import elDragDialog from "@/directive/el-drag-dialog";
 import { initDicts, initQueryParams } from "@/utils/commons";
@@ -168,15 +170,15 @@ export default {
     fetch(params = {}) {
       this.loading = true;
       if (this.queryParams.timeRange) {
-        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
-        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+        this.queryParams.map.distributeTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.distributeTime_ed = this.queryParams.timeRange[1];
       }
 
       this.queryParams.current = params.current
         ? params.current
         : this.queryParams.current;
       this.queryParams.size = params.size ? params.size : this.queryParams.size;
-      areaMgrApi
+      dispatchMgrApi
         .page(this.queryParams)
         .then((response) => {
           const res = response.data;

+ 6 - 6
imcs-ui/src/views/zuihou/dispatchMgr/exception/Index.vue

@@ -146,13 +146,13 @@
 
 <script>
 import Pagination from "@/components/Pagination";
-import areaMgrApi from "@/api/resourceProductMgr/areaMgr";
+import dispatchMgrApi from "@/api/Dispatch";
 
 import elDragDialog from "@/directive/el-drag-dialog";
 import { initDicts, initQueryParams } from "@/utils/commons";
 import { convertEnum } from "@/utils/utils";
 export default {
-  name: "dispatchRecordMgr",
+  name: "dispatchExceptionMgr",
   directives: { elDragDialog },
   components: { Pagination },
   props: {},
@@ -213,16 +213,16 @@ export default {
     fetch(params = {}) {
       this.loading = true;
       if (this.queryParams.timeRange) {
-        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
-        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+        this.queryParams.map.operationTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.operationTime_ed = this.queryParams.timeRange[1];
       }
 
       this.queryParams.current = params.current
         ? params.current
         : this.queryParams.current;
       this.queryParams.size = params.size ? params.size : this.queryParams.size;
-      areaMgrApi
-        .page(this.queryParams)
+      dispatchMgrApi
+        .pageException(this.queryParams)
         .then((response) => {
           const res = response.data;
           if (res.isSuccess) {

+ 79 - 37
imcs-ui/src/views/zuihou/resourceProductMgr/equipmentProgramMgr/Index.vue

@@ -26,14 +26,15 @@
 	      </el-button>
       </span>
     </div>
-    
+
     <!-- 功能按钮 -->
     <el-row class="filter-container">
     	<el-col>
     		<el-button type="primary" icon="el-icon-connection" size="medium" @click="synchronousTool">{{$t("resource.buttons.tongbSk")}}</el-button>
+        <el-button type="primary" icon="el-icon-connection" size="medium" @click="editUpload">{{$t("resource.buttons.upload")}}</el-button>
     	</el-col>
     </el-row>
-    
+
     <!-- 【设备】列表数据 -->
     <!-- 列表数据 -->
     <el-table
@@ -60,9 +61,9 @@
       <el-table-column prop="pic" :label='$t("resource.table.resours.pic")' align="center" width="150px">
       	<template slot-scope="{ row }">
       		<div v-if="row.pic" class="demo-image__preview">
-					  <el-image 
+					  <el-image
 					    style="width: 100px; height: 60px"
-					    :src="row.pic" 
+					    :src="row.pic"
 					    :preview-src-list="row.srcList">
 					  </el-image>
 					</div>
@@ -71,34 +72,36 @@
       </el-table-column>
       <el-table-column prop="name" :label='$t("resource.table.resours.name")' :show-overflow-tooltip="true" width="180px"></el-table-column>
       <el-table-column prop="code" :label='$t("resource.table.resours.no")' :show-overflow-tooltip="true" width="100px"></el-table-column>
-      <el-table-column prop="brand" :label='$t("resource.table.resours.brand")' width="100px"></el-table-column>
-      <el-table-column prop="specification" :label='$t("resource.table.resours.specification")' width="180px"></el-table-column>
-      <el-table-column prop="model" :label='$t("resource.table.resours.model")'></el-table-column>
-      <el-table-column prop="category.data" :label='$t("resource.table.resours.category")' width="100px"></el-table-column>
+<!--      <el-table-column prop="brand" :label='$t("resource.table.resours.brand")' width="100px"></el-table-column>-->
+<!--      <el-table-column prop="specification" :label='$t("resource.table.resours.specification")' width="180px"></el-table-column>-->
+<!--      <el-table-column prop="model" :label='$t("resource.table.resours.model")'></el-table-column>-->
+<!--      <el-table-column prop="category.data" :label='$t("resource.table.resours.category")' width="100px"></el-table-column>-->
       <el-table-column prop="zoneName" :label='$t("resource.table.resours.zoneName")' width="180px"></el-table-column>
-      <el-table-column prop="nums" :label='$t("resource.table.resours.nums")' width="120px"></el-table-column>
-      <el-table-column prop="cncProgram" :label='$t("resource.table.resours.isProgram")' width="110px" align="center">
-      	<template slot-scope="{ row }">
-      		<el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">
-      			{{row.cncProgram == '1' ? '是' : '否'}}
-      		</el-tag>
-      	</template>
-      </el-table-column>
+<!--      <el-table-column prop="nums" :label='$t("resource.table.resours.nums")' width="120px"></el-table-column>-->
+<!--      <el-table-column prop="cncProgram" :label='$t("resource.table.resours.isProgram")' width="110px" align="center">-->
+<!--      	<template slot-scope="{ row }">-->
+<!--      		<el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">-->
+<!--      			{{row.cncProgram == '1' ? '是' : '否'}}-->
+<!--      		</el-tag>-->
+<!--      	</template>-->
+<!--      </el-table-column>-->
       <el-table-column prop="linkStatus" :label='$t("resource.table.resours.linkStatus")' width="180px" align="center">
       	<template slot-scope="{ row }">
       		<div class="statusDiv" :style="'background:'+ row.linkStatus.background">{{row.linkStatus.text}}</div>
       	</template>
       </el-table-column>
-      <el-table-column prop="controlStatus" :label='$t("resource.table.resours.controlStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.controlStatus.background">{{row.controlStatus.text}}</div>
-      	</template>
-      </el-table-column>
-      <el-table-column prop="productionStatus" :label='$t("resource.table.resours.productionStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.productionStatus.background">{{row.productionStatus.text}}</div>
-      	</template>
-      </el-table-column>
+      <el-table-column prop="programSynTime" :label='$t("resource.table.resours.programSynTime")' width="180px"></el-table-column>
+      <el-table-column prop="programNum" :label='$t("resource.table.resours.programNum")' width="180px"></el-table-column>
+<!--      <el-table-column prop="controlStatus" :label='$t("resource.table.resours.controlStatus")' width="180px" align="center">-->
+<!--      	<template slot-scope="{ row }">-->
+<!--      		<div class="statusDiv" :style="'background:'+ row.controlStatus.background">{{row.controlStatus.text}}</div>-->
+<!--      	</template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column prop="productionStatus" :label='$t("resource.table.resours.productionStatus")' width="180px" align="center">-->
+<!--      	<template slot-scope="{ row }">-->
+<!--      		<div class="statusDiv" :style="'background:'+ row.productionStatus.background">{{row.productionStatus.text}}</div>-->
+<!--      	</template>-->
+<!--      </el-table-column>-->
     </el-table>
     <pagination
       v-show="tableData.count > 0"
@@ -197,6 +200,15 @@
       :dialog-visible="tenantViewVisible"
       @close="viewClose"
     />
+
+    <!-- 上传附件 -->
+    <tenant-upload
+      ref="upload"
+      :dialog-visible="dialogUpload.isVisible"
+      :title="dialogUpload.title"
+      @close="editUploadClose"
+      @success="editUploadSuccess"
+    />
     <el-dialog
       v-el-drag-dialog
       :close-on-click-modal="false"
@@ -218,6 +230,7 @@
 	import Pagination2 from "@/components/Pagination"
 	import TenantEdit from "./components/Edit"
 	import TenantView from "./components/View"
+  import TenantUpload from "./components/Upload"
 	// 【程序中心】-API
 	import programCenterApi from "@/api/resourceProductMgr/programCenter"
 	// 【设备管理】-API
@@ -228,7 +241,7 @@
 	export default {
 	  name: "WarehouseTypeMgr",
 	  directives: { elDragDialog },
-	  components: { Pagination, Pagination2, TenantEdit, TenantView },
+	  components: { Pagination, Pagination2, TenantEdit, TenantView,TenantUpload },
 	  props: {
 	  },
 	  data () {
@@ -242,6 +255,10 @@
 	        isVisible: false,
 	        context: ''
 	      },
+        dialogUpload: {
+          isVisible: false,
+          title: ""
+        },
 	      tenantViewVisible: false,
 	      tableKey: 0,
 	      queryParams: initQueryParams({}),
@@ -285,7 +302,7 @@
       }
 	  },
 	  mounted () {
-	    
+
 	  },
 	  methods: {
 	  	// 【同步数控程序】按钮-事件
@@ -302,7 +319,7 @@
 	  			resourceIdList.push(item.id)
 	  		})
 	  		programCenterApi.synchronousNumericalProgram({resourceIdList}).then(res => {
-	  			res = res.data 
+	  			res = res.data
 	  			// console.log("同步数控程序】: ", res)
 	  			if(res.isSuccess){
 	  				this.$message({
@@ -312,6 +329,24 @@
 	  			}
 	  		})
 	  	},
+
+
+      // 上传框弹出
+      editUpload(){
+        if (this.selection.length!=1) {
+          this.$message({
+            message: this.$t("tips.mustOne"),
+            type: "warning"
+          })
+          return
+        }
+        let row = this.selection[0];
+        this.$refs.upload.setTenant(row, this.dicts)
+        this.$refs.upload.type = "upload"
+        this.dialogUpload.title = this.$t("resource.buttons.upload")
+        this.dialogUpload.isVisible = true
+
+      },
 	  	// 【从设备删除】按钮-事件
 	  	equipmentDelete(row){
 	  		this.$confirm(this.$t("resource.tips.deletePg"), this.$t("common.tips"), {
@@ -370,9 +405,16 @@
 	    editClose () {
 	      this.dialog.isVisible = false
 	    },
+      editUploadClose (){
+        this.dialogUpload.isVisible = false
+      },
 	    editSuccess () {
 	      this.search()
 	    },
+      editUploadSuccess(){
+        this.search()
+      },
+
 	    // 当选择项发生变化时会触发该事件
 	    onSelectChange (selection) {
 	    	// console.log("当选择项发生变化时会触发该事件:", this.selection)
@@ -413,7 +455,7 @@
 	        })
 	        return
 	      }
-	
+
 	      this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
 	      	distinguishCancelAndClose: true,
 	        confirmButtonText: this.$t("common.confirm"),
@@ -480,12 +522,12 @@
 	        this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
 	        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
 	      }
-	
+
 	      this.queryParams.current = params.current ? params.current : this.queryParams.current
 	      this.queryParams.size = params.size ? params.size : this.queryParams.size
 	      // 固定参数(采集的生产资源)
 	      this.queryParams.resourceStatus = "1"
-		  this.queryParams.name = "%smu50%"		  
+		  this.queryParams.name = "%smu50%"
 	      equipmentMgrApi.getPageList(this.queryParams).then(response => {
 	        const res = response.data
 	        if (res.isSuccess) {
@@ -507,7 +549,7 @@
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading = false)
-	     
+
 	    },
 	    cellClick (row, column) {
 	      if (column['columnKey'] === "operation") {
@@ -533,10 +575,10 @@
 	        this.queryParams2.map.createTime_st = this.queryParams2.timeRange[0]
 	        this.queryParams2.map.createTime_ed = this.queryParams2.timeRange[1]
 	      }
-	
+
 	      this.queryParams2.current = params.current ? params.current : this.queryParams2.current
 	      this.queryParams2.size = params.size ? params.size : this.queryParams2.size
-	      
+
 	      // 传【设备】id数组
 	      let resourceIdList = []
 	      if(this.selection && this.selection.length > 0){
@@ -552,7 +594,7 @@
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading2 = false)
-	     
+
 	    },
 	    cellClick2 (row, column) {
 	      if (column['columnKey'] === "operation") {
@@ -565,7 +607,7 @@
 	          this.$refs.table2.toggleRowSelection(row)
 	        }
 	      })
-	
+
 	      if (!flag) {
 	        this.$refs.table2.toggleRowSelection(row, true)
 	      }

+ 356 - 0
imcs-ui/src/views/zuihou/resourceProductMgr/equipmentProgramMgr/components/Upload.vue

@@ -0,0 +1,356 @@
+<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" :disabled="formDisabled" :rules="rules" label-position="right" label-width="130px">
+      <el-form-item :label='$t("resource.form.target_resource")+":"' prop="no">
+        <el-input v-model="tenant.no"  readonly="readonly" />
+      </el-form-item>
+      <el-form-item :label='$t("resource.form.pgUpload")+":"' prop="filePath">
+        <el-input v-model="tenant.filePath" :readOnly="true" :placeholder='$t("common.pleaseEnter")'/>
+        <el-upload
+          accept=".txt"
+          class="upload-demo"
+          :headers="headers"
+          :action="action"
+          :data="fileOtherData"
+          :on-preview="handlePreview"
+          :on-remove="handleRemove"
+          :before-remove="beforeRemove"
+          :on-success="handleSuccess"
+          :on-error='handleError'
+          :on-progress="handlePropress"
+          multiple
+          :limit="1"
+          :on-exceed="handleExceed"
+          :file-list="fileList">
+          <el-button size="small" type="primary">{{$t("common.upload")}}</el-button>
+          <div slot="tip" class="el-upload__tip">{{$t("resource.tips.fileTips")}}</div>
+        </el-upload>
+      </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 programCenterApi from "@/api/resourceProductMgr/programCenter"
+  // 【设备(生产资源)】-API
+  import productionResourcesMgrApi from "@/api/resourceProductMgr/productionResourcesMgr"
+  import db from "@/utils/localstorage";
+  import {Base64} from 'js-base64';
+  export default {
+    name: 'TenantEdit',
+    props: {
+      dialogVisible: {
+        type: Boolean,
+        default: false
+      },
+      title: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        formDisabled: false,
+        tableData: [],
+        eqList: [], // 设备下拉类别数据
+        toolList: [], // 刀具列表
+        pgContent: '',  // 程序内容
+        type: 'add',
+        tenant: this.initTenant(),
+        screenWidth: 0,
+        width: this.initWidth(),
+        confirmDisabled: false,
+        dicts:{
+          NATION: {}
+        },
+        // 附件上传
+        action: `${process.env.VUE_APP_BASE_API}/file/attachment/upload`,
+        // 附件其它参数
+        fileOtherData: {
+          bizId: "",
+          bizType: "PROGRAM"
+        },
+        // 附件的值
+        fileList: [/*
+      	{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'},
+      	{name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}
+      */],
+        roles: [],
+        rules: {
+          filePath: [
+            { required: true, message: this.$t("rules.require"), trigger: 'blur' }
+          ],
+          version: [
+            { required: true, message: this.$t("rules.require"), trigger: 'blur' }
+          ]
+        }
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+      // 加载【设备】列表数据
+      this.equmentList()
+    },
+    computed: {
+      headers() {
+        return {
+          token: 'Bearer ' + db.get("TOKEN", ""),
+          tenant: db.get("TENANT", "") || "",
+          Authorization: `Basic ${Base64.encode(`${process.env.VUE_APP_CLIENT_ID}:${process.env.VUE_APP_CLIENT_SECRET}`)}`
+        };
+      },
+      isVisible: {
+        get () {
+          return this.dialogVisible
+        },
+        set () {
+          this.close()
+          this.reset()
+        }
+      }
+    },
+    mounted () {
+      window.onresize = () => {
+        return (() => {
+          this.width = this.initWidth()
+        })()
+      }
+    },
+    methods: {
+      // 文件列表移除文件时的钩子
+      handleRemove(file, fileList) {
+        console.log("删除事件:", file, fileList);
+        // 还原数据
+        this.resetFile()
+      },
+      // 点击文件列表中已上传的文件时的钩子
+      handlePreview(file) {
+        console.log("上传之前事件:",file);
+      },
+      // 文件超出个数限制时的钩子
+      handleExceed(files, fileList) {
+        this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
+      },
+      // 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。
+      beforeRemove(file, fileList) {
+        return this.$confirm(`确定移除 ${ file.name }?`);
+      },
+      // 文件上传成功时的钩子
+      handleSuccess(response, file, fileList){
+        console.log("文件上传成功!", response)
+        if(response.isSuccess){
+          // [上传程序]字段的值
+          this.tenant.filePath = response.data.url
+          // [程序大小]字段的值
+          this.tenant.size = response.data.size
+          // 查询【程序】信息
+          this.getProgram(response.data.filename)
+        }
+      },
+      // 文件上传失败时的钩子
+      handleError(err, file, fileList){
+        console.log("文件上传失败~", err)
+      },
+      // 文件上传时的钩子
+      handlePropress(event, file, fileList){
+        console.log("文件上传~", event)
+      },
+      initTenant () {
+        return {
+          id: '',
+          no: '',
+          name: '',
+          filePath: '',
+          size: null,
+          runTime: null
+        }
+      },
+      resetFile(){
+        // [上传程序]字段的值
+        this.tenant.filePath = ''
+        // [程序大小]字段的值
+        this.tenant.size = null
+        // [运行时间]字段的值
+        this.tenant.runTime = null
+        // [程序内容]字段的值
+        this.pgContent = ''
+      },
+      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){
+          this.tenant = { ...val }
+          //赋值
+          this.tenant.no = val.name
+          // 如果附件存在 /
+          if(!!val.filePath){
+            let arr = val.filePath.split("/");
+            // 查询【程序】信息
+            this.getProgram(arr[arr.length -1])
+          }
+        }
+        // 字典表
+        this.dicts = dicts
+      },
+      close () {
+        this.$emit('close')
+      },
+      reset () {
+        // 先清除校验,再清除表单,不然有奇怪的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的数据:", this.tenant)
+          // return false
+          if (valid) {
+            this.confirmDisabled = true
+            if (this.type === 'add') {
+              this.save()
+            } else {
+              this.update()
+            }
+          } else {
+            return false
+          }
+        })
+      },
+      save () {
+        programCenterApi.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
+        })
+      },
+      update () {
+        programCenterApi.update(this.tenant)
+          .then((response) => {
+            const res = response.data
+            if (res.isSuccess) {
+              this.isVisible = false
+              this.$message({
+                message: this.$t('tips.updateSuccess'),
+                type: 'success'
+              })
+              // 通知列表
+              this.$emit("success");
+              // 通知列表-并关闭弹出框
+              this.$emit("close");
+            }
+          }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+      },
+      // 【设备】下拉数据
+      equmentList() {
+        productionResourcesMgrApi.getList({cncProgram: '1'}).then(res => {
+          res = res.data
+          // console.log("【设备】下拉数据:", res)
+          if(res.isSuccess){
+            this.eqList = res.data
+          }
+        })
+      },
+      // 根据[文件名]获取文件内容
+      getProgram(fileName){
+        programCenterApi.getUploadFile({fileName: fileName}).then(res => {
+          res = res.data
+          console.log("根据[文件名]:", res)
+          if(res.isSuccess){
+            const obj = res.data
+            // [运行时间]字段的值
+            this.tenant.runTime = obj.runTime
+            // [程序内容]字段的值
+            this.pgContent = obj.content
+            // [刀具]列表
+            this.toolList = obj.toolList
+            // 附件数据
+            this.fileList = [{
+              name: obj.name,
+              url: obj.url
+            }]
+          }
+        })
+      }
+
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .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;
+  }
+  .editTitle{
+    font-size: 17px;
+    padding-bottom: 15px;
+    border-bottom: 1px solid #CCCCCC;
+  }
+</style>