diff --git a/.gitignore b/.gitignore index 78a0ead..b143adb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ package-lock.json *.ntvs* *.njsproj *.sln +dist.zip diff --git a/dist.zip b/dist.zip index d0b88a2..2488187 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/src/utils/curd.js b/src/utils/curd.js index e0c97db..aeaa3ab 100644 --- a/src/utils/curd.js +++ b/src/utils/curd.js @@ -408,8 +408,15 @@ function getBlob(url, cb) { xhr.responseType = 'blob' xhr.onload = function() { if (xhr.status === 200) { - const name = xhr.getResponseHeader('content-disposition').split('=')[1] - var filename = decodeURIComponent(name) + const disposition = xhr.getResponseHeader('content-disposition') + let filename = 'export.xlsx' + if (disposition && disposition.indexOf('=') > -1) { + const name = disposition.split('=')[1] + filename = decodeURIComponent(name) + } else { + const timestamp = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14) + filename = 'export_' + timestamp + '.xlsx' + } cb(xhr.response, filename) } } diff --git a/src/views/EquipmentOperationAnalysis/EquipmentAlarmStatistics/index.vue b/src/views/EquipmentOperationAnalysis/EquipmentAlarmStatistics/index.vue index f36c0cb..2f4b7d5 100644 --- a/src/views/EquipmentOperationAnalysis/EquipmentAlarmStatistics/index.vue +++ b/src/views/EquipmentOperationAnalysis/EquipmentAlarmStatistics/index.vue @@ -141,10 +141,16 @@ export default { const param = [ ['开始日期', this.dateTime[0]], ['结束日期', this.dateTime[1]], - ['电表号', this.meterCode || ''] + ['电表号', this.meterCode || ''], + ['PageCurrent', 1], + ['PageSize', 99999999], + ['PageCount', '1111', 'int', '1'], + ['ItemCount', '1111', 'int', '1'] ] - const Data = this.CreateData('2001', '能耗_日汇总_视图_分页查询', param) - this.exportExcel_NPOI(Data) + const exportData = JSON.parse(this.CreateData('2005', '能耗_日汇总_视图_分页查询', param)) + exportData.exportColumns = '电表号,开始电能,结束电能,结算日期,结算电能' + exportData.exportFileName = '设备能耗信息_' + this.exportExcel_NPOI(JSON.stringify(exportData)) }, // 分页处理 - 改变每页数量 diff --git a/src/views/ProductionAnalysis/OrderProgress/index.vue b/src/views/ProductionAnalysis/OrderProgress/index.vue index 1a63a33..09e2d6f 100644 --- a/src/views/ProductionAnalysis/OrderProgress/index.vue +++ b/src/views/ProductionAnalysis/OrderProgress/index.vue @@ -77,7 +77,10 @@ 订单列表 - 共 {{ filteredData.length }} 条 +
+ 共 {{ filteredData.length }} 条 + 导出 +
工位效率明细 + 导出 @@ -275,6 +276,16 @@ export default { top: '30', bottom: '50' }, + toolbox: { + right: 10, + top: 0, + feature: { + saveAsImage: { + title: '下载', + name: '工位效率分析_平均节拍对比' + } + } + }, xAxis: { type: 'category', data: stations, @@ -346,6 +357,16 @@ export default { data: ['过站数量', '合格数量'], top: 0 }, + toolbox: { + right: 10, + top: 0, + feature: { + saveAsImage: { + title: '下载', + name: '工位效率分析_产品吞吐量' + } + } + }, grid: { left: '50', right: '30', @@ -419,6 +440,20 @@ export default { resetSearch() { this.setDefaultDate() this.queryData() + }, + exportExcel() { + if (this.tableData.length === 0) { + this.$message.warning('暂无数据可导出') + return + } + const param = [ + ['开始时间', this.dateRange[0] + ' 00:00:00'], + ['结束时间', this.dateRange[1] + ' 23:59:59'] + ] + const exportData = JSON.parse(this.CreateData('2005', '生产分析_工位效率_统计_查询', param)) + exportData.exportColumns = '工位号,过站数量,平均节拍,最长节拍,最短节拍,合格数量,合格率' + exportData.exportFileName = '工位效率分析_' + this.exportExcel_NPOI(JSON.stringify(exportData)) } } } diff --git a/src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue b/src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue index 02c3806..2eb533c 100644 --- a/src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue +++ b/src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue @@ -467,8 +467,14 @@ export default { param[4] = ['工位号', this.stationNumberValue || ''] param[5] = ['订单号', this.orderNumberValue || ''] param[6] = ['合格标志', this.isQualifiedValue] - var Data = this.CreateData('2001', '质量数据查询_综合查询新', param) - this.exportExcel_NPOI(Data) + param[7] = ['PageCurrent', 1] + param[8] = ['PageSize', 99999999] + param[9] = ['PageCount', '1111', 'int', '1'] + param[10] = ['ItemCount', '1111', 'int', '1'] + var exportData = JSON.parse(this.CreateData('2005', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param)) + exportData.exportColumns = '工位号,订单号,发动机型号=型号,发动机号=总成编号,测量位置,测量项目,测量值,测量单位,上限值=值上限,下限值=值下限,生产日期,合格标志' + exportData.exportFileName = '质量数据查询_' + this.exportExcel_NPOI(JSON.stringify(exportData)) } else { this.$message.warning('暂无数据') } diff --git a/src/views/QualityAssurance/InquiryTransitInformation/index.vue b/src/views/QualityAssurance/InquiryTransitInformation/index.vue index 85cf734..393f9f7 100644 --- a/src/views/QualityAssurance/InquiryTransitInformation/index.vue +++ b/src/views/QualityAssurance/InquiryTransitInformation/index.vue @@ -306,8 +306,14 @@ export default { param[3] = ['订单号', this.orderNumberValue || ''] param[4] = ['工位号', this.stationNumberValue || ''] param[5] = ['工位号N', this.stationNumberValueN || ''] - var Data = this.CreateData('2001', '质量数据查询_测量数据发动机在线状态_报表_NEW新', param) - this.exportExcel_NPOI(Data) + param[6] = ['PageCurrent', 1] + param[7] = ['PageSize', 99999999] + param[8] = ['PageCount', '1111', 'int', '1'] + param[9] = ['ItemCount', '1111', 'int', '1'] + var exportData = JSON.parse(this.CreateData('2005', '质量数据查询_测量数据发动机在线状态_查询_NEW', param)) + exportData.exportColumns = '工位号,订单号,发动机号=产品编号,机型=型号,到达时间,离开时间,在线时间=在线时间(s),是否合格' + exportData.exportFileName = '过站信息查询_' + this.exportExcel_NPOI(JSON.stringify(exportData)) } else { this.$message.warning('暂无数据') } diff --git a/src/views/RecipeManagement/RecipeManagement/index.vue b/src/views/RecipeManagement/RecipeManagement/index.vue index c2b5c8b..ce73109 100644 --- a/src/views/RecipeManagement/RecipeManagement/index.vue +++ b/src/views/RecipeManagement/RecipeManagement/index.vue @@ -15,6 +15,8 @@ 新增机型 + 导出 + 导入 - @@ -84,8 +86,8 @@
- 确 定
+ + + + +
+ +
点击选择Excel文件或将文件拖到此处
+
支持 .xlsx 和 .xls 格式
+
+
+ {{ importFileName }} +
+ +
+
选择导入方式:
+ + + 增量导入 +
产品型号已存在则跳过,不存在则新增(推荐)
+
+ + 全量导入 +
先清空所有机型数据,再导入Excel中的全部数据(慎用)
+
+
+
+
+ 取 消 + 确定导入 +
+