| | |
| | | <span style="margin-left: 5px">合同附件</span> |
| | | </div> |
| | | </template> |
| | | <div class="annex-view"> |
| | | <div v-if="file_id === 0" class="annex-view"> |
| | | <div @click="addAnnexClick"> |
| | | <el-upload |
| | | class="upload-demo" |
| | |
| | | </el-upload> |
| | | </div> |
| | | </div> |
| | | <div v-if="file_name && file_name.length > 0" class="file-content"> |
| | | <!-- v-if="file_name && file_name.length > 0" --> |
| | | <div v-else class="file-content"> |
| | | <div>{{ file_name }}</div> |
| | | <div> |
| | | <el-button type="text">预览</el-button> |
| | | <el-button type="text">下载</el-button> |
| | | <el-button type="text">删除</el-button> |
| | | <el-button type="text" @click="previewClick" style="margin-left: 10px">预览</el-button> |
| | | <el-button type="text" @click="downloadClick">下载</el-button> |
| | | <el-button type="text" @click="delContractClick">删除</el-button> |
| | | </div> |
| | | <div ref="file"></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | createContract, |
| | | updateSupplier, |
| | | getIndustryList, |
| | | previewContract |
| | | getSupplierTypeList, |
| | | deleteContract |
| | | // previewContract |
| | | } from "@/api/supplierManage/supplier" |
| | | import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" |
| | | import { getSupplierTypeList } from "@/api/supplierManage/supplier" |
| | | import { getMemberListFromGrpc } from "@/api/common/other" |
| | | import download from "downloadjs" |
| | | // import { renderAsync } from "docx-preview" |
| | | // import axios from "axios" |
| | | export default { |
| | | name: "AddSupplierDialog", |
| | | props: { |
| | |
| | | infomation: {} |
| | | }, |
| | | fileList: [], |
| | | file_name: "", |
| | | file_id: this.addCommonConfig.infomation.fileId |
| | | file_name: this.addCommonConfig.infomation.file_name, |
| | | file_id: this.addCommonConfig.infomation.fileId, |
| | | previewUrl: "", |
| | | loading: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getIndustryList() |
| | | this.getMemberList() |
| | | if (this.editConfig.title === "修改") { |
| | | this.previewContract() |
| | | // this.previewContract() |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | this.industryOptions = res.data.data.list |
| | | }) |
| | | }, |
| | | // 合同附件信息 |
| | | async previewContract() { |
| | | await previewContract({ |
| | | id: 1 |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | }) |
| | | }, |
| | | handleClose() { |
| | |
| | | name: data.name || "", |
| | | number: data.number || "", |
| | | phone: data.phone || "", |
| | | responsiblePersonId: data.responsiblePersonId || 0, |
| | | responsiblePersonName: data.responsiblePersonName || "", |
| | | status: data.status || 0, |
| | | supplierType: data.supplierType || "", |
| | | url: data.url || "" |
| | |
| | | handleExceed(files, fileList) { |
| | | console.log(fileList) |
| | | this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件`) |
| | | }, |
| | | // 下载合同 |
| | | downloadClick() { |
| | | let url = "/api/con/downloadContract?id=" + this.file_id |
| | | download(url, "", "") |
| | | }, |
| | | // 删除合同 |
| | | delContractClick() { |
| | | deleteContract({ |
| | | id: this.file_id |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.$message.success(res.msg) |
| | | this.file_id = 0 |
| | | }) |
| | | }, |
| | | // 预览合同 |
| | | async previewClick() { |
| | | this.previewUrl = "/api/con/previewContract?id=" + this.file_id |
| | | if (this.file_name.includes("pdf")) { |
| | | window.open(this.previewUrl, "_blank") |
| | | } else { |
| | | let routeUrl = this.$router.resolve({ |
| | | path: "/PreviewFile", |
| | | query: { |
| | | //要传的参数 |
| | | previewUrl: this.previewUrl |
| | | } |
| | | }) |
| | | window.open(routeUrl.href, "_blank") |
| | | } |
| | | } |
| | | } |
| | | } |