|
1
|
<template>
|
1
|
<template>
|
|
2
|
<div class="app-container">
|
2
|
<div class="app-container">
|
|
3
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
3
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
4
|
- <el-form-item label="单位编号" prop="orgcode">
|
4
|
+ <!-- <el-form-item label="单位编号" prop="orgcode">
|
|
5
|
<el-input
|
5
|
<el-input
|
|
6
|
v-model="queryParams.orgcode"
|
6
|
v-model="queryParams.orgcode"
|
|
7
|
placeholder="请输入单位编号"
|
7
|
placeholder="请输入单位编号"
|
|
8
|
clearable
|
8
|
clearable
|
|
9
|
@keyup.enter.native="handleQuery"
|
9
|
@keyup.enter.native="handleQuery"
|
|
10
|
/>
|
10
|
/>
|
|
11
|
- </el-form-item>
|
11
|
+ </el-form-item> -->
|
|
12
|
<el-form-item label="证书编号" prop="certificateNo">
|
12
|
<el-form-item label="证书编号" prop="certificateNo">
|
|
13
|
<el-input
|
13
|
<el-input
|
|
14
|
v-model="queryParams.certificateNo"
|
14
|
v-model="queryParams.certificateNo"
|
|
@@ -117,7 +117,12 @@ |
|
@@ -117,7 +117,12 @@ |
|
117
|
<span>{{ parseTime(scope.row.certificateValidityPeriod, '{y}-{m}-{d}') }}</span>
|
117
|
<span>{{ parseTime(scope.row.certificateValidityPeriod, '{y}-{m}-{d}') }}</span>
|
|
118
|
</template>
|
118
|
</template>
|
|
119
|
</el-table-column>
|
119
|
</el-table-column>
|
|
120
|
- <el-table-column label="证书附件" align="center" prop="certificateAttachment" />
|
120
|
+ <el-table-column label="证书附件" align="center" prop="certificateAttachment" >
|
|
|
|
121
|
+ <template slot-scope="scope">
|
|
|
|
122
|
+
|
|
|
|
123
|
+ <img src="@/assets/images/PDF.png" @click="openFile(scope.row.certificateAttachment)" width="40px" height="auto" style="cursor: pointer"/>
|
|
|
|
124
|
+ </template>
|
|
|
|
125
|
+ </el-table-column>
|
|
121
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
126
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
122
|
<template slot-scope="scope">
|
127
|
<template slot-scope="scope">
|
|
123
|
<el-button
|
128
|
<el-button
|
|
@@ -150,7 +155,7 @@ |
|
@@ -150,7 +155,7 @@ |
|
150
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
155
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
151
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
156
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
152
|
<el-form-item label="单位编号" prop="orgcode">
|
157
|
<el-form-item label="单位编号" prop="orgcode">
|
|
153
|
- <el-input v-model="form.orgcode" placeholder="请输入单位编号" />
|
158
|
+ <el-input v-model="this.orgcode" placeholder="请输入单位编号" :disabled="true"/>
|
|
154
|
</el-form-item>
|
159
|
</el-form-item>
|
|
155
|
<el-form-item label="证书编号" prop="certificateNo">
|
160
|
<el-form-item label="证书编号" prop="certificateNo">
|
|
156
|
<el-input v-model="form.certificateNo" placeholder="请输入证书编号" />
|
161
|
<el-input v-model="form.certificateNo" placeholder="请输入证书编号" />
|
|
@@ -161,21 +166,49 @@ |
|
@@ -161,21 +166,49 @@ |
|
161
|
<el-form-item label="发证时间" prop="issuanceDate">
|
166
|
<el-form-item label="发证时间" prop="issuanceDate">
|
|
162
|
<el-date-picker clearable
|
167
|
<el-date-picker clearable
|
|
163
|
v-model="form.issuanceDate"
|
168
|
v-model="form.issuanceDate"
|
|
164
|
- type="datetime"
|
|
|
|
165
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
166
|
placeholder="请选择发证时间">
|
169
|
placeholder="请选择发证时间">
|
|
167
|
</el-date-picker>
|
170
|
</el-date-picker>
|
|
168
|
</el-form-item>
|
171
|
</el-form-item>
|
|
169
|
<el-form-item label="证书有效期" prop="certificateValidityPeriod">
|
172
|
<el-form-item label="证书有效期" prop="certificateValidityPeriod">
|
|
170
|
<el-date-picker clearable
|
173
|
<el-date-picker clearable
|
|
171
|
v-model="form.certificateValidityPeriod"
|
174
|
v-model="form.certificateValidityPeriod"
|
|
172
|
- type="datetime"
|
|
|
|
173
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
174
|
placeholder="请选择证书有效期">
|
175
|
placeholder="请选择证书有效期">
|
|
175
|
</el-date-picker>
|
176
|
</el-date-picker>
|
|
176
|
</el-form-item>
|
177
|
</el-form-item>
|
|
177
|
<el-form-item label="证书附件" prop="certificateAttachment">
|
178
|
<el-form-item label="证书附件" prop="certificateAttachment">
|
|
178
|
- <el-input v-model="form.certificateAttachment" placeholder="请输入证书附件" />
|
179
|
+ <el-upload
|
|
|
|
180
|
+ class="upload-demo"
|
|
|
|
181
|
+ ref="upload"
|
|
|
|
182
|
+ :accept="'application/pdf'"
|
|
|
|
183
|
+ :before-upload="beforeUpload"
|
|
|
|
184
|
+ :action="this.url"
|
|
|
|
185
|
+ :headers="this.headers"
|
|
|
|
186
|
+ :on-preview="handlePreview"
|
|
|
|
187
|
+ :on-remove="handleRemove"
|
|
|
|
188
|
+ :on-change="handleChange"
|
|
|
|
189
|
+ :file-list="this.fileList"
|
|
|
|
190
|
+ :auto-upload="false"
|
|
|
|
191
|
+ :limit="1"
|
|
|
|
192
|
+ :multiple="false"
|
|
|
|
193
|
+ :on-success="handleSuccess"
|
|
|
|
194
|
+ :before-remove="beforeRemove"
|
|
|
|
195
|
+ :on-exceed="handleExceed"
|
|
|
|
196
|
+ name="files"
|
|
|
|
197
|
+ >
|
|
|
|
198
|
+ <el-button slot="trigger" size="small" type="primary"
|
|
|
|
199
|
+ >选取文件</el-button
|
|
|
|
200
|
+ >
|
|
|
|
201
|
+ <el-button
|
|
|
|
202
|
+ style="margin-left: 10px"
|
|
|
|
203
|
+ size="small"
|
|
|
|
204
|
+ type="success"
|
|
|
|
205
|
+ @click="submitUpload"
|
|
|
|
206
|
+ >上传到服务器</el-button
|
|
|
|
207
|
+ >
|
|
|
|
208
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
|
209
|
+ 只能上传大小不超过 5MB 的 PDF 文件
|
|
|
|
210
|
+ </div>
|
|
|
|
211
|
+ </el-upload>
|
|
179
|
</el-form-item>
|
212
|
</el-form-item>
|
|
180
|
</el-form>
|
213
|
</el-form>
|
|
181
|
<div slot="footer" class="dialog-footer">
|
214
|
<div slot="footer" class="dialog-footer">
|
|
@@ -187,12 +220,21 @@ |
|
@@ -187,12 +220,21 @@ |
|
187
|
</template>
|
220
|
</template>
|
|
188
|
|
221
|
|
|
189
|
<script>
|
222
|
<script>
|
|
190
|
-import { listOrginfoCertificate, getOrginfoCertificate, delOrginfoCertificate, addOrginfoCertificate, updateOrginfoCertificate } from "@/api/compliancemanagement/orginfoCertificate";
|
|
|
|
191
|
-
|
223
|
+import { listOrginfoCertificate, getOrginfoCertificate, delOrginfoCertificate, addOrginfoCertificate, updateOrginfoCertificate,selectByOrgnCode } from "@/api/compliancemanagement/orginfoCertificate";
|
|
|
|
224
|
+import { getToken } from "@/utils/auth";
|
|
|
|
225
|
+import VuePdf from 'vue-pdf';
|
|
192
|
export default {
|
226
|
export default {
|
|
193
|
name: "OrginfoCertificate",
|
227
|
name: "OrginfoCertificate",
|
|
194
|
data() {
|
228
|
data() {
|
|
195
|
return {
|
229
|
return {
|
|
|
|
230
|
+ // 设置上传的请求头部
|
|
|
|
231
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
232
|
+ // 上传的地址
|
|
|
|
233
|
+ url: process.env.VUE_APP_BASE_API + "/common/uploads",
|
|
|
|
234
|
+ // urlhead: "http://joycart.zgftlm.com",
|
|
|
|
235
|
+ urlhead:process.env.VUE_APP_BASE_API,
|
|
|
|
236
|
+ fileList: [],
|
|
|
|
237
|
+ file:[],
|
|
196
|
// 按钮loading
|
238
|
// 按钮loading
|
|
197
|
buttonLoading: false,
|
239
|
buttonLoading: false,
|
|
198
|
// 遮罩层
|
240
|
// 遮罩层
|
|
@@ -213,6 +255,7 @@ export default { |
|
@@ -213,6 +255,7 @@ export default { |
|
213
|
title: "",
|
255
|
title: "",
|
|
214
|
// 是否显示弹出层
|
256
|
// 是否显示弹出层
|
|
215
|
open: false,
|
257
|
open: false,
|
|
|
|
258
|
+ orgcode:'',
|
|
216
|
// 查询参数
|
259
|
// 查询参数
|
|
217
|
queryParams: {
|
260
|
queryParams: {
|
|
218
|
pageNum: 1,
|
261
|
pageNum: 1,
|
|
@@ -253,12 +296,25 @@ export default { |
|
@@ -253,12 +296,25 @@ export default { |
|
253
|
};
|
296
|
};
|
|
254
|
},
|
297
|
},
|
|
255
|
created() {
|
298
|
created() {
|
|
256
|
- this.getList();
|
299
|
+ // this.getList();
|
|
|
|
300
|
+ this.orgcode=this.$route.query.orgcode
|
|
|
|
301
|
+ this.getorgcode(this.orgcode);
|
|
|
|
302
|
+
|
|
257
|
},
|
303
|
},
|
|
258
|
methods: {
|
304
|
methods: {
|
|
|
|
305
|
+ //根据单位编号查询列表
|
|
|
|
306
|
+ getorgcode(orgcode){
|
|
|
|
307
|
+ console.log(orgcode)
|
|
|
|
308
|
+ selectByOrgnCode(orgcode).then(response =>{
|
|
|
|
309
|
+ console.log(response.data)
|
|
|
|
310
|
+ this.orginfoCertificateList = response.data
|
|
|
|
311
|
+ this.loading = false;
|
|
|
|
312
|
+ })
|
|
|
|
313
|
+ },
|
|
259
|
/** 查询单位证照表列表 */
|
314
|
/** 查询单位证照表列表 */
|
|
260
|
getList() {
|
315
|
getList() {
|
|
261
|
this.loading = true;
|
316
|
this.loading = true;
|
|
|
|
317
|
+ this.queryParams.orgcode=this.orgcode
|
|
262
|
listOrginfoCertificate(this.queryParams).then(response => {
|
318
|
listOrginfoCertificate(this.queryParams).then(response => {
|
|
263
|
this.orginfoCertificateList = response.rows;
|
319
|
this.orginfoCertificateList = response.rows;
|
|
264
|
this.total = response.total;
|
320
|
this.total = response.total;
|
|
@@ -305,14 +361,18 @@ export default { |
|
@@ -305,14 +361,18 @@ export default { |
|
305
|
},
|
361
|
},
|
|
306
|
/** 新增按钮操作 */
|
362
|
/** 新增按钮操作 */
|
|
307
|
handleAdd() {
|
363
|
handleAdd() {
|
|
|
|
364
|
+
|
|
308
|
this.reset();
|
365
|
this.reset();
|
|
|
|
366
|
+ this.form.orgcode=this.orgcode
|
|
309
|
this.open = true;
|
367
|
this.open = true;
|
|
310
|
this.title = "添加单位证照表";
|
368
|
this.title = "添加单位证照表";
|
|
311
|
},
|
369
|
},
|
|
312
|
/** 修改按钮操作 */
|
370
|
/** 修改按钮操作 */
|
|
313
|
handleUpdate(row) {
|
371
|
handleUpdate(row) {
|
|
314
|
this.loading = true;
|
372
|
this.loading = true;
|
|
|
|
373
|
+
|
|
315
|
this.reset();
|
374
|
this.reset();
|
|
|
|
375
|
+ this.form.orgcode=this.orgcode
|
|
316
|
const id = row.id || this.ids
|
376
|
const id = row.id || this.ids
|
|
317
|
getOrginfoCertificate(id).then(response => {
|
377
|
getOrginfoCertificate(id).then(response => {
|
|
318
|
this.loading = false;
|
378
|
this.loading = false;
|
|
@@ -366,7 +426,70 @@ export default { |
|
@@ -366,7 +426,70 @@ export default { |
|
366
|
this.download('compliancemanagement/orginfoCertificate/export', {
|
426
|
this.download('compliancemanagement/orginfoCertificate/export', {
|
|
367
|
...this.queryParams
|
427
|
...this.queryParams
|
|
368
|
}, `orginfoCertificate_${new Date().getTime()}.xlsx`)
|
428
|
}, `orginfoCertificate_${new Date().getTime()}.xlsx`)
|
|
|
|
429
|
+ },
|
|
|
|
430
|
+
|
|
|
|
431
|
+ openFile(filePath) {
|
|
|
|
432
|
+
|
|
|
|
433
|
+ this.currentFile = this.urlhead+filePath;
|
|
|
|
434
|
+ console.log(this.currentFile)
|
|
|
|
435
|
+ this.dialogVisible = true;
|
|
|
|
436
|
+
|
|
|
|
437
|
+ },
|
|
|
|
438
|
+ beforeUpload(file) {
|
|
|
|
439
|
+ const isPDF = file.type === 'application/pdf';
|
|
|
|
440
|
+ const isLt5M = file.size / 1024 / 1024 < 5;
|
|
|
|
441
|
+
|
|
|
|
442
|
+ if (!isPDF) {
|
|
|
|
443
|
+ this.$message.error('只能上传 PDF 文件');
|
|
|
|
444
|
+ return false;
|
|
|
|
445
|
+ }
|
|
|
|
446
|
+ if (!isLt5M) {
|
|
|
|
447
|
+ this.$message.error('上传文件大小不能超过 5MB');
|
|
|
|
448
|
+ return false;
|
|
369
|
}
|
449
|
}
|
|
|
|
450
|
+
|
|
|
|
451
|
+ // 如果需要其他处理,可以在这里添加
|
|
|
|
452
|
+
|
|
|
|
453
|
+ return true; // 返回 true 允许上传
|
|
|
|
454
|
+ },
|
|
|
|
455
|
+ handleChange(file, fileList) {
|
|
|
|
456
|
+ this.fileList = fileList;
|
|
|
|
457
|
+ },
|
|
|
|
458
|
+ handleSuccess(response, file, fileList) {
|
|
|
|
459
|
+ // response 是上传成功后的响应数据
|
|
|
|
460
|
+ // 可以从中获取文件地址或文件名
|
|
|
|
461
|
+ // 假设后端返回的数据结构中有一个字段 url 表示文件地址
|
|
|
|
462
|
+ const fileUrl = response.data.fileNames;
|
|
|
|
463
|
+ // 将文件地址或文件名赋值给表单的字段
|
|
|
|
464
|
+ this.form.certificateAttachment =fileUrl;
|
|
|
|
465
|
+ },
|
|
|
|
466
|
+ handleRemove(file, fileList) {
|
|
|
|
467
|
+ this.form.certificateAttachment=''
|
|
|
|
468
|
+ console.log(file, fileList);
|
|
|
|
469
|
+ },
|
|
|
|
470
|
+ handlePreview(file) {
|
|
|
|
471
|
+ console.log(file);
|
|
|
|
472
|
+ },
|
|
|
|
473
|
+ handleExceed(files, fileList) {
|
|
|
|
474
|
+ this.$message.warning(
|
|
|
|
475
|
+ `当前限制上传 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
|
476
|
+ files.length + fileList.length
|
|
|
|
477
|
+ } 个文件`
|
|
|
|
478
|
+ );
|
|
|
|
479
|
+ },
|
|
|
|
480
|
+ beforeRemove(file, fileList) {
|
|
|
|
481
|
+ this.fileList = fileList;
|
|
|
|
482
|
+ if (file && file.status==="success") {
|
|
|
|
483
|
+ return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
|
484
|
+ }
|
|
|
|
485
|
+
|
|
|
|
486
|
+ },
|
|
|
|
487
|
+ submitUpload() {
|
|
|
|
488
|
+ // 手动触发上传操作
|
|
|
|
489
|
+ // this.$refs.upload.submit()
|
|
|
|
490
|
+ // 构建 FormData 对象
|
|
|
|
491
|
+ this.$refs.upload.submit()
|
|
|
|
492
|
+ },
|
|
370
|
}
|
493
|
}
|
|
371
|
};
|
494
|
};
|
|
372
|
</script> |
495
|
</script> |