|
...
|
...
|
@@ -109,9 +109,8 @@ |
|
|
|
<el-table-column label="模板名称" align="center" prop="templatename" />
|
|
|
|
<el-table-column label="模板文件" align="center" prop="templatefile">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button type="text" icon="el-icon-document" @click="openFile(scope.row.templatefile)">
|
|
|
|
打开文件
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<img src="@/assets/images/PDF.png" @click="openFile(scope.row.templatefile)" width="40px" height="auto" style="cursor: pointer"/>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
...
|
...
|
@@ -157,7 +156,7 @@ |
|
|
|
@pagination="getList"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-dialog :visible.sync="dialogVisible" title="文件预览" width="50%">
|
|
|
|
<el-dialog :visible.sync="dialogVisible" title="合同预览" width="50%">
|
|
|
|
<vue-pdf :src="currentFile" />
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
|
...
|
...
|
@@ -250,6 +249,7 @@ export default { |
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
// 上传的地址
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/common/uploads",
|
|
|
|
urlhead: "http://joycart.zgftlm.com",
|
|
|
|
fileList: [],
|
|
|
|
dialogVisible: false,
|
|
|
|
dialogImageUrl: "",
|
|
...
|
...
|
@@ -309,8 +309,9 @@ export default { |
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
openFile(filePath) {
|
|
|
|
console.log(filePath)
|
|
|
|
this.currentFile = filePath;
|
|
|
|
|
|
|
|
this.currentFile = this.urlhead+filePath;
|
|
|
|
console.log(this.currentFile)
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
|
|
|
},
|
|
...
|
...
|
@@ -339,7 +340,6 @@ export default { |
|
|
|
// 可以从中获取文件地址或文件名
|
|
|
|
// 假设后端返回的数据结构中有一个字段 url 表示文件地址
|
|
|
|
const fileUrl = response.data.fileNames;
|
|
|
|
|
|
|
|
// 将文件地址或文件名赋值给表单的字段
|
|
|
|
this.form.templatefile =fileUrl;
|
|
|
|
},
|
...
|
...
|
|