add(ems/info):页面实现导入功能,但有bug

- 全部页面的模板下载报错
- 更新已有记录无效
- 导入后的日期格式不对,复制粘贴不行,格式化也不行,只有导出的完全不动再导入才能保证正确
boardTest
zch 2 months ago
parent 1c4d5d0ad3
commit c98918824b

@ -132,6 +132,16 @@
v-hasPermi="['ems/info:dailyFaultRecord:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:dailyFaultRecord:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -231,6 +241,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -291,11 +331,21 @@
{ key: 8, label: `故障发生时间`, visible: true },
{ key: 9, label: `处置完毕时间`, visible: true },
{ key: 10, label: `处置时长`, visible: true },
]
],
upload: {
title: "导入日常故障记录",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/dailyFaultRecord/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询日常故障记录列表 */
@ -396,6 +446,32 @@
this.download('ems/info/dailyFaultRecord/export', {
...this.queryParams
}, `dailyFaultRecord_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入日常故障记录";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/dailyFaultRecord/importTemplate', {
}, `日常故障记录数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -98,6 +98,16 @@
v-hasPermi="['ems/info:faultHandlingRecord:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:faultHandlingRecord:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -192,6 +202,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -252,11 +292,21 @@
{ key: 8, label: `处置时长,单位:分钟`, visible: true },
{ key: 9, label: `维修更换的主要元器件`, visible: true },
{ key: 10, label: `备注`, visible: true },
]
],
upload: {
title: "导入故障处置记录",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/faultHandlingRecord/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询故障处置记录列表 */
@ -357,6 +407,32 @@
this.download('ems/info/faultHandlingRecord/export', {
...this.queryParams
}, `faultHandlingRecord_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入故障处置记录";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/faultHandlingRecord/importTemplate', {
}, `故障处置记录数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -194,6 +194,16 @@
v-hasPermi="['ems/info:plcBufferBatteryLifecycle:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:plcBufferBatteryLifecycle:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -205,7 +215,11 @@
<el-table-column label="位置描述" align="center" prop="locationDescription" v-if="columns[3].visible"/>
<el-table-column label="来源" align="center" prop="source" v-if="columns[4].visible"/>
<el-table-column label="取电" align="center" prop="powerSource" v-if="columns[5].visible"/>
<el-table-column label="图片地址" align="center" prop="imageAddress" v-if="columns[6].visible"/>
<el-table-column label="图片地址" align="center" prop="imageAddress" width="100" v-if="columns[6].visible">
<template slot-scope="scope">
<image-preview :src="scope.row.imageAddress" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks" v-if="columns[7].visible"/>
<el-table-column label="第1次" align="center" prop="firstInstance" v-if="columns[8].visible"/>
<el-table-column label="第2次" align="center" prop="secondInstance" v-if="columns[9].visible"/>
@ -265,9 +279,9 @@
<el-form-item label="取电" prop="powerSource">
<el-input v-model="form.powerSource" placeholder="请输入取电" />
</el-form-item>
<el-form-item label="图片地址" prop="imageAddress">
<el-input v-model="form.imageAddress" placeholder="请输入图片地址" />
</el-form-item>
<el-form-item label="图片地址" prop="imageAddress">
<image-upload v-model="form.imageAddress"/>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
</el-form-item>
@ -385,6 +399,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -463,11 +507,21 @@
{ key: 17, label: `第10次`, visible: true },
{ key: 18, label: `第11次`, visible: true },
{ key: 19, label: `第12次`, visible: true },
]
],
upload: {
title: "导入行李系统PLC缓冲电池生命周期",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/plcBufferBatteryLifecycle/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询行李系统PLC缓冲电池生命周期列表 */
@ -577,6 +631,32 @@
this.download('ems/info/plcBufferBatteryLifecycle/export', {
...this.queryParams
}, `plcBufferBatteryLifecycle_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入行李系统PLC缓冲电池生命周期";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/plcBufferBatteryLifecycle/importTemplate', {
}, `PLC缓冲电池生命周期数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -198,6 +198,16 @@
v-hasPermi="['ems/info:securityDoorBatteryLifecycle:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:securityDoorBatteryLifecycle:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -214,8 +224,11 @@
</el-table-column>
<el-table-column label="电池类型" align="center" prop="batteryType" v-if="columns[5].visible">
</el-table-column>
<el-table-column label="图片地址" align="center" prop="imageAddress" v-if="columns[6].visible">
</el-table-column>
<el-table-column label="图片地址" align="center" prop="imageAddress" width="100" v-if="columns[6].visible">
<template slot-scope="scope">
<image-preview :src="scope.row.imageAddress" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks" v-if="columns[7].visible">
</el-table-column>
<el-table-column label="第1次" align="center" prop="firstInstance" v-if="columns[8].visible">
@ -288,9 +301,9 @@
<el-form-item label="电池类型" prop="batteryType">
<el-input v-model="form.batteryType" placeholder="请输入电池类型" />
</el-form-item>
<el-form-item label="图片地址" prop="imageAddress">
<el-input v-model="form.imageAddress" placeholder="请输入图片地址" />
</el-form-item>
<el-form-item label="图片地址" prop="imageAddress">
<image-upload v-model="form.imageAddress"/>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
</el-form-item>
@ -408,6 +421,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -486,11 +529,21 @@
{ key: 17, label: `第10次`, visible: true },
{ key: 18, label: `第11次`, visible: true },
{ key: 19, label: `第12次`, visible: true },
]
],
upload: {
title: "导入行李系统安全门铅酸电池生命周期",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/securityDoorBatteryLifecycle/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询行李系统安全门铅酸电池生命周期列表 */
@ -600,6 +653,32 @@
this.download('ems/info/securityDoorBatteryLifecycle/export', {
...this.queryParams
}, `securityDoorBatteryLifecycle_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入行李系统安全门铅酸电池生命周期";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/securityDoorBatteryLifecycle/importTemplate', {
}, `安全门电池生命周期数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -114,6 +114,16 @@
v-hasPermi="['ems/info:sparePartsInventory:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:sparePartsInventory:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -199,6 +209,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -257,11 +297,21 @@
{ key: 7, label: `入库数量`, visible: true },
{ key: 8, label: `剩余数量`, visible: true },
{ key: 9, label: `备注`, visible: true },
]
],
upload: {
title: "导入备件库记录",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/sparePartsInventory/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询备件库记录主列表 */
@ -361,6 +411,32 @@
this.download('ems/info/sparePartsInventory/export', {
...this.queryParams
}, `sparePartsInventory_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入备件库记录";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/sparePartsInventory/importTemplate', {
}, `备件库记录数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -82,6 +82,16 @@
v-hasPermi="['ems/info:sparePartsInventoryCheck:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:sparePartsInventoryCheck:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -147,6 +157,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -195,11 +235,21 @@
{ key: 2, label: `盘点名称`, visible: true },
{ key: 3, label: `盘点数量`, visible: true },
{ key: 4, label: `盘点日期`, visible: true },
]
],
upload: {
title: "导入备件盘点记录明细",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/sparePartsInventoryCheck/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询备件盘点记录明细列表 */
@ -294,7 +344,33 @@
this.download('ems/info/sparePartsInventoryCheck/export', {
...this.queryParams
}, `sparePartsInventoryCheck_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入备件盘点记录明细";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/sparePartsInventoryCheck/importTemplate', {
}, `备件盘点记录明细数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};
</script> -->
</script>

@ -9,10 +9,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="参照位置参考坐标或设备ID" prop="referenceLocation">
<el-form-item label="参照位置" prop="referenceLocation">
<el-input
v-model="queryParams.referenceLocation"
placeholder="请输入参照位置参考坐标或设备ID"
placeholder="请输入参照位置"
clearable
@keyup.enter.native="handleQuery"
/>
@ -202,6 +202,16 @@
v-hasPermi="['ems/info:sparePartsRegistration:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:sparePartsRegistration:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -209,12 +219,16 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键自增ID" align="center" prop="objid" v-if="columns[0].visible"/>
<el-table-column label="类型" align="center" prop="type" v-if="columns[1].visible"/>
<el-table-column label="参照位置参考坐标或设备ID" align="center" prop="referenceLocation" v-if="columns[2].visible"/>
<el-table-column label="参照位置" align="center" prop="referenceLocation" v-if="columns[2].visible"/>
<el-table-column label="位置描述" align="center" prop="locationDescription" v-if="columns[3].visible"/>
<el-table-column label="取电" align="center" prop="powerSource" v-if="columns[4].visible"/>
<el-table-column label="电池类型" align="center" prop="batteryType" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remarks" v-if="columns[6].visible"/>
<el-table-column label="图片位置" align="center" prop="imageLocation" v-if="columns[7].visible"/>
<el-table-column label="图片位置" align="center" prop="imageLocation" v-if="columns[7].visible">
<template slot-scope="scope">
<image-preview :src="scope.row.imageLocation":width="50" :height="50"></image-preview>
</template>
</el-table-column>
<el-table-column label="第1次" align="center" prop="firstInstance" v-if="columns[8].visible"/>
<el-table-column label="第2次" align="center" prop="secondInstance" v-if="columns[9].visible"/>
<el-table-column label="第3次" align="center" prop="thirdInstance" v-if="columns[10].visible"/>
@ -261,8 +275,8 @@
<el-form-item label="类型" prop="type">
<el-input v-model="form.type" placeholder="请输入类型" />
</el-form-item>
<el-form-item label="参照位置参考坐标或设备ID" prop="referenceLocation">
<el-input v-model="form.referenceLocation" placeholder="请输入参照位置参考坐标或设备ID" />
<el-form-item label="参照位置" prop="referenceLocation">
<el-input v-model="form.referenceLocation" placeholder="请输入参照位置" />
</el-form-item>
<el-form-item label="位置描述" prop="locationDescription">
<el-input v-model="form.locationDescription" placeholder="请输入位置描述" />
@ -277,7 +291,7 @@
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="图片位置" prop="imageLocation">
<el-input v-model="form.imageLocation" placeholder="请输入图片位置" />
<image-upload v-model="form.imageLocation" />
</el-form-item>
<el-form-item label="第1次" prop="firstInstance">
<el-date-picker
@ -393,6 +407,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -453,7 +497,7 @@
columns: [
{ key: 0, label: `主键自增ID`, visible: false },
{ key: 1, label: `类型`, visible: true },
{ key: 2, label: `参照位置参考坐标或设备ID`, visible: true },
{ key: 2, label: `参照位置`, visible: true },
{ key: 3, label: `位置描述`, visible: true },
{ key: 4, label: `取电`, visible: true },
{ key: 5, label: `电池类型`, visible: true },
@ -471,11 +515,21 @@
{ key: 17, label: `第10次`, visible: true },
{ key: 18, label: `第11次`, visible: true },
{ key: 19, label: `第12次`, visible: true },
]
],
upload: {
title: "导入动力能源部行输科废旧备件登记",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/sparePartsRegistration/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
},
methods: {
/** 查询动力能源部行输科废旧备件登记列表 */
@ -585,6 +639,32 @@
this.download('ems/info/sparePartsRegistration/export', {
...this.queryParams
}, `sparePartsRegistration_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入动力能源部行输科废旧备件登记";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/sparePartsRegistration/importTemplate', {
}, `备件登记数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -128,6 +128,16 @@
v-hasPermi="['ems/info:sparePartsUsageRecord:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:sparePartsUsageRecord:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -231,11 +241,31 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 数据导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSparePartsUsageRecord, getSparePartsUsageRecord, delSparePartsUsageRecord, addSparePartsUsageRecord, updateSparePartsUsageRecord } from "@/api/ems/info/sparePartsUsageRecord";
import { getToken } from "@/utils/auth";
export default {
name: "SparePartsUsageRecord",
@ -293,7 +323,22 @@
{ key: 9, label: `库管确认人`, visible: true },
{ key: 10, label: `库存表状态`, visible: true },
{ key: 11, label: `部门仓库`, visible: true },
]
],
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/ems/info/sparePartsUsageRecord/importData"
}
};
},
created() {
@ -399,6 +444,32 @@
this.download('ems/info/sparePartsUsageRecord/export', {
...this.queryParams
}, `sparePartsUsageRecord_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "备件使用记录导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/sparePartsUsageRecord/importTemplate', {
}, `sparePartsUsageRecord_template_${new Date().getTime()}.xlsx`);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -136,6 +136,16 @@
v-hasPermi="['ems/info:supervisionChecklist:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:supervisionChecklist:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -259,6 +269,36 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -331,11 +371,22 @@
{ key: 14, label: `工单变更内容`, visible: true },
{ key: 15, label: `本工单是否闭环`, visible: true },
{ key: 16, label: `备注`, visible: true },
]
],
upload: {
title: "导入动力能源部监督检查清单",
open: false,
url: "",
updateSupport: false,
isUploading: false,
headers: {
Authorization: "Bearer " + localStorage.getItem("token")
}
}
};
},
created() {
this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/supervisionChecklist/importData";
},
methods: {
/** 查询动力能源部监督检查清单列表 */
@ -442,6 +493,32 @@
this.download('ems/info/supervisionChecklist/export', {
...this.queryParams
}, `supervisionChecklist_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "导入动力能源部监督检查清单";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/supervisionChecklist/importTemplate', {
}, `监督检查清单数据模板_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};

@ -202,6 +202,16 @@
v-hasPermi="['ems/info:upsBatteryLifecycle:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['ems/info:upsBatteryLifecycle:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -397,11 +407,31 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listUpsBatteryLifecycle, getUpsBatteryLifecycle, delUpsBatteryLifecycle, addUpsBatteryLifecycle, updateUpsBatteryLifecycle } from "@/api/ems/info/upsBatteryLifecycle";
import { getToken } from "@/utils/auth";
export default {
name: "UpsBatteryLifecycle",
@ -477,7 +507,22 @@
{ key: 18, label: `第10次`, visible: true },
{ key: 19, label: `第11次`, visible: true },
{ key: 20, label: `第12次`, visible: true },
]
],
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/ems/info/upsBatteryLifecycle/importData"
}
};
},
created() {
@ -587,12 +632,38 @@
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ems/info/upsBatteryLifecycle/export', {
...this.queryParams
}, `upsBatteryLifecycle_${new Date().getTime()}.xlsx`)
}
}
/** 导出按钮操作 */
handleExport() {
this.download('ems/info/upsBatteryLifecycle/export', {
...this.queryParams
}, `upsBatteryLifecycle_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "UPS电池生命周期导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('ems/info/upsBatteryLifecycle/importTemplate', {
}, `upsBatteryLifecycle_template_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};
</script>

Loading…
Cancel
Save