Commit 1580530c956d9b5b9cdebb13985dbbc6afcdf40e
1 parent
a05bd173
Exists in
dev
feat:气瓶导入功能
Showing
6 changed files
with
249 additions
and
4 deletions
Show diff stats
frontend/front/src/api/gasRecord.js
@@ -29,5 +29,12 @@ export function getGasBottleInfoDetail(params) { | @@ -29,5 +29,12 @@ export function getGasBottleInfoDetail(params) { | ||
29 | params | 29 | params |
30 | }) | 30 | }) |
31 | } | 31 | } |
32 | - | 32 | +//气瓶档案导入模板下载接口 |
33 | +export function getGasBottleTemplate() { | ||
34 | + return request({ | ||
35 | + url: `${context.bpmModel}/manage/qpxx/v1/bottleBatchImportTemplate`, | ||
36 | + method: 'post', | ||
37 | + responseType: 'blob' | ||
38 | + }) | ||
39 | +} | ||
33 | 40 |
frontend/front/src/components/dataTemplate/TemplatePreview.vue
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | <member-info-dialog ref="memberInfoDialog" @handleRefresh="handleRefresh"></member-info-dialog> | 17 | <member-info-dialog ref="memberInfoDialog" @handleRefresh="handleRefresh"></member-info-dialog> |
18 | <gas-cylinder-archives-dialog ref="gascylinderarchivesdialog"></gas-cylinder-archives-dialog> | 18 | <gas-cylinder-archives-dialog ref="gascylinderarchivesdialog"></gas-cylinder-archives-dialog> |
19 | <real-name-audit-dialog ref="realNameAuditDialog" @handleRefresh="handleRefresh"></real-name-audit-dialog> | 19 | <real-name-audit-dialog ref="realNameAuditDialog" @handleRefresh="handleRefresh"></real-name-audit-dialog> |
20 | + <gas-bottle-import-dialog ref="gasBottleImportDialog" @handleRefresh="handleRefresh"></gas-bottle-import-dialog> | ||
20 | </div> | 21 | </div> |
21 | 22 | ||
22 | 23 | ||
@@ -28,9 +29,11 @@ import placeOrderDialog from "../dialog/placeOrderDialog"; | @@ -28,9 +29,11 @@ import placeOrderDialog from "../dialog/placeOrderDialog"; | ||
28 | import MemberInfoDialog from "../dialog/memberInfoDialog"; | 29 | import MemberInfoDialog from "../dialog/memberInfoDialog"; |
29 | import GasCylinderArchivesDialog from "../dialog/gasCylinderArchivesDialog"; | 30 | import GasCylinderArchivesDialog from "../dialog/gasCylinderArchivesDialog"; |
30 | import RealNameAuditDialog from "@/components/dialog/realNameAuditDialog"; | 31 | import RealNameAuditDialog from "@/components/dialog/realNameAuditDialog"; |
32 | +import GasBottleImportDialog from "@/components/dialog/gasBottleImportDialog"; | ||
31 | export default { | 33 | export default { |
32 | name: 'TemplatePreview', | 34 | name: 'TemplatePreview', |
33 | components: { | 35 | components: { |
36 | + GasBottleImportDialog, | ||
34 | RealNameAuditDialog, | 37 | RealNameAuditDialog, |
35 | GasCylinderArchivesDialog, | 38 | GasCylinderArchivesDialog, |
36 | MemberInfoDialog, | 39 | MemberInfoDialog, |
@@ -116,6 +119,10 @@ export default { | @@ -116,6 +119,10 @@ export default { | ||
116 | showRealNameAuditDialog(row){ | 119 | showRealNameAuditDialog(row){ |
117 | this.$refs.realNameAuditDialog.open(row); | 120 | this.$refs.realNameAuditDialog.open(row); |
118 | }, | 121 | }, |
122 | + //气瓶导入功能弹窗 | ||
123 | + showGasBottleImportDialog(row){ | ||
124 | + this.$refs.gasBottleImportDialog.open(row); | ||
125 | + }, | ||
119 | showMemberInfoDialog(row){ | 126 | showMemberInfoDialog(row){ |
120 | console.log('打印row', row); | 127 | console.log('打印row', row); |
121 | this.$refs.memberInfoDialog.open(row); | 128 | this.$refs.memberInfoDialog.open(row); |
frontend/front/src/components/dialog/gasBottleImportDialog.vue
0 → 100644
@@ -0,0 +1,179 @@ | @@ -0,0 +1,179 @@ | ||
1 | +<template> | ||
2 | + <div class="dialogSty"> | ||
3 | + <el-dialog | ||
4 | + :title="upload.title" | ||
5 | + :visible.sync="upload.open" | ||
6 | + width="400px" | ||
7 | + append-to-body | ||
8 | + > | ||
9 | + <el-row> | ||
10 | + <el-form label-width="90px" :model="queryForm" :rules="queryFormRules" ref="queryForm" > | ||
11 | + <el-form-item label="所属企业:" prop="qyId"> | ||
12 | + <el-select v-model="queryForm.qyId" style="width: 100%;" @change="handleQyChange" placeholder="请选择"> | ||
13 | + <el-option v-for="item in qyOption" :key="item.qyId" :label="item.qymc" :value="item.qyId"> | ||
14 | + </el-option> | ||
15 | + </el-select> | ||
16 | + </el-form-item> | ||
17 | + <el-form-item label="所属气站:" prop="qzId"> | ||
18 | + <el-select v-model="queryForm.qzId" style="width: 100%;" placeholder="请选择"> | ||
19 | + <el-option v-for="item in qzOption" :key="item.qzId" :label="item.qzmc" :value="item.qzId"> | ||
20 | + </el-option> | ||
21 | + </el-select> | ||
22 | + </el-form-item> | ||
23 | + </el-form> | ||
24 | + </el-row> | ||
25 | + <el-upload | ||
26 | + ref="upload" | ||
27 | + accept=".xlsx, .xls" | ||
28 | + multiple | ||
29 | + :action="upload.action" | ||
30 | + drag | ||
31 | + :data="uploadObj" | ||
32 | + :on-success="handleFileSuccess" | ||
33 | + :auto-upload="false" | ||
34 | + :headers="upload.headers" | ||
35 | + :on-error="handleFileError" | ||
36 | + > | ||
37 | + <!-- :disabled="upload.isUploading" --> | ||
38 | + <!-- :on-progress="handleFileUploadProgress" --> | ||
39 | + <i class="el-icon-upload"></i> | ||
40 | + <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> | ||
41 | + <div class="el-upload__tip" slot="tip"> | ||
42 | + <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link> | ||
43 | + </div> | ||
44 | + <div class="el-upload__tip" style="color: red;" slot="tip"> | ||
45 | + 提示:仅允许导入“xls”或“xlsx”格式文件! | ||
46 | + </div> | ||
47 | + </el-upload> | ||
48 | + <div slot="footer" class="dialog-footer"> | ||
49 | + <el-button @click="upload.open = false">取 消</el-button> | ||
50 | + <el-button type="primary" @click="submitDeliveryForm('queryForm')" | ||
51 | + >确 定</el-button | ||
52 | + > | ||
53 | + </div> | ||
54 | + </el-dialog> | ||
55 | + </div> | ||
56 | +</template> | ||
57 | + | ||
58 | +<script> | ||
59 | +import {getGasBottleTemplate } from '@/api/gasRecord' | ||
60 | +import download from "@/mixins/download"; | ||
61 | +import {getCurrentEnterpriseAndStation} from "@/api/common"; | ||
62 | +export default { | ||
63 | + name: "gasBottleImportDialog", | ||
64 | + mixins: [ download ], | ||
65 | + data(){ | ||
66 | + return{ | ||
67 | + queryFormRules:{ | ||
68 | + qyId:[ | ||
69 | + {required:true,message:'请选择所属企业',trigger:'change'} | ||
70 | + ], | ||
71 | + qzId:[ | ||
72 | + {required:true,message:'请选择所属气站',trigger:'change'} | ||
73 | + ], | ||
74 | + }, | ||
75 | + qyOption:[], | ||
76 | + qzOption:[], | ||
77 | + allOption:[], | ||
78 | + //上传文件携带的参数 | ||
79 | + uploadObj: { | ||
80 | + czId:"", | ||
81 | + }, | ||
82 | + queryForm:{ | ||
83 | + qyId:'', | ||
84 | + qzId:'' | ||
85 | + }, | ||
86 | + // 发货导入参数 | ||
87 | + upload: { | ||
88 | + // 是否显示弹出层(会员导入) | ||
89 | + open: false, | ||
90 | + action:'', | ||
91 | + // 弹出层标题(会员导入) | ||
92 | + title: "", | ||
93 | + // 是否禁用上传 | ||
94 | + // isUploading: false, | ||
95 | + // 设置上传的请求头部 | ||
96 | + headers: { | ||
97 | + Authorization: "Bearer " + this.$store.state.user.accessToken, | ||
98 | + }, | ||
99 | + // 上传的地址 | ||
100 | + // url: process.env.VUE_APP_BASE_API + "/fm/importUser/importData" | ||
101 | + }, | ||
102 | + } | ||
103 | + }, | ||
104 | + async created() { | ||
105 | + await this.getEnterpriseAndStationList(); | ||
106 | + console.log('打印this.$store.getters',this.$store); | ||
107 | + this.upload.action = `${window.context.portal}/manage/qpxx/v1/bottleBatchImport`; | ||
108 | + }, | ||
109 | + methods:{ | ||
110 | + open(row){ | ||
111 | + console.log('打印row',row); | ||
112 | + this.upload.open = true; | ||
113 | + this.queryForm.qzId = ''; | ||
114 | + this.queryForm.qyId = ''; | ||
115 | + this.upload.title ='导入气瓶信息'; | ||
116 | + }, | ||
117 | + //获取企业和气站数据 | ||
118 | + async getEnterpriseAndStationList(){ | ||
119 | + await getCurrentEnterpriseAndStation().then((res)=>{ | ||
120 | + console.log('打印当前气站和企业信息数据====',res); | ||
121 | + const { value } = res; | ||
122 | + if(value.length>0){ | ||
123 | + this.allOption = value; | ||
124 | + this.qyOption = value?value.map((item)=>{ | ||
125 | + return { | ||
126 | + qyId:item.qyId, | ||
127 | + qymc:item.qymc | ||
128 | + } | ||
129 | + }):[]; | ||
130 | + console.log('打印 this.qyOption ', this.qyOption ); | ||
131 | + console.log('打印 this.allOption ', this.allOption ); | ||
132 | + } | ||
133 | + }) | ||
134 | + }, | ||
135 | + //选择企业的数据 | ||
136 | + handleQyChange(val){ | ||
137 | + this.qzOption =[]; | ||
138 | + this.queryForm.qzId =''; | ||
139 | + this.qzOption = this.allOption.filter((item)=>item.qyId == val)[0].qzxxList; | ||
140 | + }, | ||
141 | + submitDeliveryForm(formName) { | ||
142 | + this.$refs[formName].validate((valid) => { | ||
143 | + if (valid) { | ||
144 | + this.uploadObj.czId = this.queryForm.qzId; | ||
145 | + this.$refs.upload.submit(); | ||
146 | + } else { | ||
147 | + console.log('error submit!!'); | ||
148 | + return false; | ||
149 | + } | ||
150 | + }); | ||
151 | + }, | ||
152 | + //文件上传失败处理 | ||
153 | + handleFileError(err, file, fileList) { | ||
154 | + this.$message.error("上传失败,请重新上传!"); | ||
155 | + }, | ||
156 | + // 文件上传成功处理 | ||
157 | + handleFileSuccess(response, file, fileList) { | ||
158 | + this.upload.open = false; | ||
159 | + this.$refs.upload.clearFiles(); | ||
160 | + this.$message.success("导入成功"); | ||
161 | + this.$emit('handleRefresh'); | ||
162 | + }, | ||
163 | + /** 下载模板操作 */ | ||
164 | + async importTemplate() { | ||
165 | + await getGasBottleTemplate().then((response) => { | ||
166 | + console.log("response", response); | ||
167 | + this.handleDownload(response, "气瓶信息导入模板"); | ||
168 | + }); | ||
169 | + }, | ||
170 | + } | ||
171 | +} | ||
172 | +</script> | ||
173 | + | ||
174 | +<style lang="scss" scoped> | ||
175 | +.dialogSty{ | ||
176 | + | ||
177 | +} | ||
178 | + | ||
179 | +</style> |
@@ -0,0 +1,41 @@ | @@ -0,0 +1,41 @@ | ||
1 | +export default { | ||
2 | + methods: { | ||
3 | + // 下载类型对应 | ||
4 | + // xls: ‘application/vnd.ms-excel’, | ||
5 | + // xlsx: ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’, | ||
6 | + // doc: ‘application/msword’, | ||
7 | + // docx: ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’, | ||
8 | + // pdf: ‘application/pdf’ | ||
9 | + // 文件下载 | ||
10 | + handleDownload(response, name) { | ||
11 | + let link = document.createElement('a') | ||
12 | + if (name) { | ||
13 | + link.download = name | ||
14 | + } | ||
15 | + link.style.display = 'none' | ||
16 | + const blob = new Blob([response.data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}) | ||
17 | + link.href = URL.createObjectURL(blob) | ||
18 | + // 触发点击 | ||
19 | + document.body.appendChild(link) | ||
20 | + link.click() | ||
21 | + // 然后移除a标签 | ||
22 | + document.body.removeChild(link) | ||
23 | + }, | ||
24 | + // 文件pdf下载 | ||
25 | + handlePdfDownload(response, name) { | ||
26 | + let link = document.createElement('a') | ||
27 | + if (name) { | ||
28 | + link.download = name | ||
29 | + } | ||
30 | + link.style.display = 'none' | ||
31 | + const blob = new Blob([response.data], {type: "application/pdf"}) | ||
32 | + link.href = URL.createObjectURL(blob) | ||
33 | + // 触发点击 | ||
34 | + document.body.appendChild(link) | ||
35 | + link.click() | ||
36 | + // 然后移除a标签 | ||
37 | + document.body.removeChild(link) | ||
38 | + } | ||
39 | + }, | ||
40 | + | ||
41 | +} |
frontend/manage/src/api/controlsConfig.js
@@ -1194,7 +1194,20 @@ export const advanceComponents = [ | @@ -1194,7 +1194,20 @@ export const advanceComponents = [ | ||
1194 | isAddPosition: true, | 1194 | isAddPosition: true, |
1195 | locationPath: '', | 1195 | locationPath: '', |
1196 | locationName: '', | 1196 | locationName: '', |
1197 | - labelAlign: '' | 1197 | + labelAlign: '', |
1198 | + longitudeName: '', | ||
1199 | + longitudePath: '', | ||
1200 | + latitudeName: '', | ||
1201 | + latitudePath: '', | ||
1202 | + provinceName: '', | ||
1203 | + provincePath: '', | ||
1204 | + cityName: '', | ||
1205 | + cityPath: '', | ||
1206 | + districtName: '', | ||
1207 | + districtPath: '', | ||
1208 | + streetName: '', | ||
1209 | + streetPath: '', | ||
1210 | + | ||
1198 | } | 1211 | } |
1199 | }, | 1212 | }, |
1200 | { | 1213 | { |
frontend/manage/src/components/form/dataTemplate/ManageSetting.vue
@@ -3040,7 +3040,6 @@ export default { | @@ -3040,7 +3040,6 @@ export default { | ||
3040 | }, | 3040 | }, |
3041 | showPostion(row) { | 3041 | showPostion(row) { |
3042 | let disableBtn = [ | 3042 | let disableBtn = [ |
3043 | - 'js', | ||
3044 | 'add', | 3043 | 'add', |
3045 | 'import', | 3044 | 'import', |
3046 | 'switch', | 3045 | 'switch', |
@@ -3064,7 +3063,6 @@ export default { | @@ -3064,7 +3063,6 @@ export default { | ||
3064 | }, | 3063 | }, |
3065 | showPostionline(row) { | 3064 | showPostionline(row) { |
3066 | let disableBtn = [ | 3065 | let disableBtn = [ |
3067 | - 'js', | ||
3068 | 'add', | 3066 | 'add', |
3069 | 'import', | 3067 | 'import', |
3070 | 'switch', | 3068 | 'switch', |