From 1580530c956d9b5b9cdebb13985dbbc6afcdf40e Mon Sep 17 00:00:00 2001 From: guojuan <2715201989@qq.com> Date: Fri, 13 Sep 2024 09:33:32 +0800 Subject: [PATCH] feat:气瓶导入功能 --- frontend/front/src/api/gasRecord.js | 9 ++++++++- frontend/front/src/components/dataTemplate/TemplatePreview.vue | 7 +++++++ frontend/front/src/components/dialog/gasBottleImportDialog.vue | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/front/src/mixins/download.js | 41 +++++++++++++++++++++++++++++++++++++++++ frontend/manage/src/api/controlsConfig.js | 15 ++++++++++++++- frontend/manage/src/components/form/dataTemplate/ManageSetting.vue | 2 -- 6 files changed, 249 insertions(+), 4 deletions(-) create mode 100644 frontend/front/src/components/dialog/gasBottleImportDialog.vue create mode 100644 frontend/front/src/mixins/download.js diff --git a/frontend/front/src/api/gasRecord.js b/frontend/front/src/api/gasRecord.js index 7ddcc84..d76cd78 100644 --- a/frontend/front/src/api/gasRecord.js +++ b/frontend/front/src/api/gasRecord.js @@ -29,5 +29,12 @@ export function getGasBottleInfoDetail(params) { params }) } - +//气瓶档案导入模板下载接口 +export function getGasBottleTemplate() { + return request({ + url: `${context.bpmModel}/manage/qpxx/v1/bottleBatchImportTemplate`, + method: 'post', + responseType: 'blob' + }) +} diff --git a/frontend/front/src/components/dataTemplate/TemplatePreview.vue b/frontend/front/src/components/dataTemplate/TemplatePreview.vue index 88115d8..ee65f54 100644 --- a/frontend/front/src/components/dataTemplate/TemplatePreview.vue +++ b/frontend/front/src/components/dataTemplate/TemplatePreview.vue @@ -17,6 +17,7 @@ + @@ -28,9 +29,11 @@ import placeOrderDialog from "../dialog/placeOrderDialog"; import MemberInfoDialog from "../dialog/memberInfoDialog"; import GasCylinderArchivesDialog from "../dialog/gasCylinderArchivesDialog"; import RealNameAuditDialog from "@/components/dialog/realNameAuditDialog"; +import GasBottleImportDialog from "@/components/dialog/gasBottleImportDialog"; export default { name: 'TemplatePreview', components: { + GasBottleImportDialog, RealNameAuditDialog, GasCylinderArchivesDialog, MemberInfoDialog, @@ -116,6 +119,10 @@ export default { showRealNameAuditDialog(row){ this.$refs.realNameAuditDialog.open(row); }, + //气瓶导入功能弹窗 + showGasBottleImportDialog(row){ + this.$refs.gasBottleImportDialog.open(row); + }, showMemberInfoDialog(row){ console.log('打印row', row); this.$refs.memberInfoDialog.open(row); diff --git a/frontend/front/src/components/dialog/gasBottleImportDialog.vue b/frontend/front/src/components/dialog/gasBottleImportDialog.vue new file mode 100644 index 0000000..6558707 --- /dev/null +++ b/frontend/front/src/components/dialog/gasBottleImportDialog.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/frontend/front/src/mixins/download.js b/frontend/front/src/mixins/download.js new file mode 100644 index 0000000..70a22c4 --- /dev/null +++ b/frontend/front/src/mixins/download.js @@ -0,0 +1,41 @@ +export default { + methods: { + // 下载类型对应 + // xls: ‘application/vnd.ms-excel’, + // xlsx: ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’, + // doc: ‘application/msword’, + // docx: ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’, + // pdf: ‘application/pdf’ + // 文件下载 + handleDownload(response, name) { + let link = document.createElement('a') + if (name) { + link.download = name + } + link.style.display = 'none' + const blob = new Blob([response.data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}) + link.href = URL.createObjectURL(blob) + // 触发点击 + document.body.appendChild(link) + link.click() + // 然后移除a标签 + document.body.removeChild(link) + }, + // 文件pdf下载 + handlePdfDownload(response, name) { + let link = document.createElement('a') + if (name) { + link.download = name + } + link.style.display = 'none' + const blob = new Blob([response.data], {type: "application/pdf"}) + link.href = URL.createObjectURL(blob) + // 触发点击 + document.body.appendChild(link) + link.click() + // 然后移除a标签 + document.body.removeChild(link) + } + }, + +} diff --git a/frontend/manage/src/api/controlsConfig.js b/frontend/manage/src/api/controlsConfig.js index 011d1c8..15450bf 100644 --- a/frontend/manage/src/api/controlsConfig.js +++ b/frontend/manage/src/api/controlsConfig.js @@ -1194,7 +1194,20 @@ export const advanceComponents = [ isAddPosition: true, locationPath: '', locationName: '', - labelAlign: '' + labelAlign: '', + longitudeName: '', + longitudePath: '', + latitudeName: '', + latitudePath: '', + provinceName: '', + provincePath: '', + cityName: '', + cityPath: '', + districtName: '', + districtPath: '', + streetName: '', + streetPath: '', + } }, { diff --git a/frontend/manage/src/components/form/dataTemplate/ManageSetting.vue b/frontend/manage/src/components/form/dataTemplate/ManageSetting.vue index 6e0e57c..e6db445 100644 --- a/frontend/manage/src/components/form/dataTemplate/ManageSetting.vue +++ b/frontend/manage/src/components/form/dataTemplate/ManageSetting.vue @@ -3040,7 +3040,6 @@ export default { }, showPostion(row) { let disableBtn = [ - 'js', 'add', 'import', 'switch', @@ -3064,7 +3063,6 @@ export default { }, showPostionline(row) { let disableBtn = [ - 'js', 'add', 'import', 'switch', -- libgit2 0.21.2