Browse Source

增加导出明细功能

java8
赵宏斌 4 months ago
parent
commit
2703a0537f
  1. 323
      src/views/modules/eam/eamMaintenanceModel.vue
  2. 323
      src/views/modules/eam/eamPropertiesModel.vue

323
src/views/modules/eam/eamMaintenanceModel.vue

@ -42,6 +42,7 @@
<el-button v-if="!authSearch" @click="getDataList()">查询</el-button>
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
<el-button @click="exportDetailExcel()" type="primary" style="margin-left: 2px">{{'导出明细'}}</el-button>
<!-- <download-excel-->
<!-- :fields="fields()"-->
<!-- :data="exportData"-->
@ -807,6 +808,314 @@
columnWidth: 70,
},
],
columnExport: [
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1BuDesc',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'buDesc',
headerAlign: "center",
align: "center",
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CodeNo',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'codeNo',
headerAlign: "center",
align: "center",
columnLabel: '维保模板编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CodeDesc',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'codeDesc',
headerAlign: "center",
align: "left",
columnLabel: '维保模板名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1Active',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'active',
headerAlign: "center",
align: "center",
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1IsUse',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'isUse',
headerAlign: "center",
align: "center",
columnLabel: '是否被用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CreatedDate',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'createdDate',
headerAlign: "center",
align: "center",
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CreatedBy',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'createdBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1UpdateDate',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1UpdateBy',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemNo',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemNo',
headerAlign: "center",
align: "left",
columnLabel: '维保项目编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 82,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemDesc',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: '维保项目名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:106,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemRemark',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemRemark',
headerAlign: "center",
align: "left",
columnLabel: '维保方法说明',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 298,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ValueType',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '检测值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2DefaultValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'defaultValue',
headerAlign: "center",
align: "right",
columnLabel: '参照值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2MaxValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'maxValue',
headerAlign: "center",
align: "right",
columnLabel: '最大值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2MinValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'minValue',
headerAlign: "center",
align: "right",
columnLabel: '最小值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ValueChooseFlag',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'valueChooseFlag',
headerAlign: "center",
align: "center",
columnLabel: '是否值可选',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
}
],
levelList: [],
chooseModalData: {
site: '',
@ -993,6 +1302,20 @@
dropColumns: [],//dropColumns: ["netWeight"]
});
},
async exportDetailExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/pms/eam/exportEamPropertiesTemplateAndItem",
columnMapping: this.columnExport,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
//excel
// async createExportData () {

323
src/views/modules/eam/eamPropertiesModel.vue

@ -42,6 +42,7 @@
<el-button v-if="!authSearch" @click="getDataList()">查询</el-button>
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
<el-button @click="exportDetailExcel()" type="primary" style="margin-left: 2px">{{'导出明细'}}</el-button>
<!-- <download-excel-->
<!-- :fields="fields()"-->
<!-- :data="exportData"-->
@ -784,6 +785,314 @@
columnWidth: 80,
},
],
columnExport: [
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1BuDesc',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'buDesc',
headerAlign: "center",
align: "center",
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CodeNo',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'codeNo',
headerAlign: "center",
align: "center",
columnLabel: '维保模板编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CodeDesc',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'codeDesc',
headerAlign: "center",
align: "left",
columnLabel: '维保模板名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1Active',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'active',
headerAlign: "center",
align: "center",
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1IsUse',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'isUse',
headerAlign: "center",
align: "center",
columnLabel: '是否被用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CreatedDate',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'createdDate',
headerAlign: "center",
align: "center",
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1CreatedBy',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'createdBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1UpdateDate',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table1UpdateBy',
tableId: "101003002Table1",
tableName: "维保模板表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemNo',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemNo',
headerAlign: "center",
align: "left",
columnLabel: '维保项目编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 82,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemDesc',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: '维保项目名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:106,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ItemRemark',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'itemRemark',
headerAlign: "center",
align: "left",
columnLabel: '维保方法说明',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 298,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ValueType',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '检测值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2DefaultValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'defaultValue',
headerAlign: "center",
align: "right",
columnLabel: '参照值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2MaxValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'maxValue',
headerAlign: "center",
align: "right",
columnLabel: '最大值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2MinValue',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'minValue',
headerAlign: "center",
align: "right",
columnLabel: '最小值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 65,
},
{
userId: this.$store.state.user.name,
functionId: 101003002,
serialNumber: '101003002Table2ValueChooseFlag',
tableId: "101003002Table2",
tableName: "维保项目表",
columnProp: 'valueChooseFlag',
headerAlign: "center",
align: "center",
columnLabel: '是否值可选',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
}
],
levelList: [],
chooseModalData: {
site: '',
@ -969,6 +1278,20 @@
dropColumns: [],//dropColumns: ["netWeight"]
});
},
async exportDetailExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/pms/eam/exportEamPropertiesTemplateAndItem",
columnMapping: this.columnExport,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
//excel
// async createExportData () {

Loading…
Cancel
Save