合同档案文件上传

main
cyl 1 year ago
parent 1103a82da4
commit 72ec737b1a

@ -345,7 +345,12 @@
width="1000px" width="1000px"
append-to-body append-to-body
> >
<el-form ref="form" :model="form" :rules="rules" label-width="98px"> <el-upload class="upload-demo" drag :limit="1" :action="uploadUrl" :file-list="fileList" :headers="headers"
:on-success="handleSuccess" name="multipartFile" :multiple="false" :accept="imgType">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
<el-form ref="form" :model="form" :rules="rules" label-width="98px" style="margin-top: 20px">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="业务实体" prop="company"> <el-form-item label="业务实体" prop="company">
@ -485,9 +490,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="附件"> <!-- <el-form-item label="附件">
<fileUpload v-model="form.contractAttachment" /> <fileUpload v-model="form.contractAttachment" />
</el-form-item> </el-form-item> -->
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="处理结果" prop="handleResult"> <el-form-item label="处理结果" prop="handleResult">
@ -573,6 +578,7 @@ import { listSimpleDepts } from "@/api/system/dept";
import { listSimplePosts } from "@/api/system/post"; import { listSimplePosts } from "@/api/system/post";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getAccessToken, getTenantId } from "@/utils/auth";
export default { export default {
name: "ElectronicContracts", name: "ElectronicContracts",
@ -589,6 +595,15 @@ export default {
value: "pId", value: "pId",
multiple: false, multiple: false,
}, },
imgType: ".jpeg, .jpg, .png .doc, .xls, .txt, .pdf, .png, .ofd ",
uploadUrl:
process.env.VUE_APP_BASE_API +
"/admin-api/accounting/attachment/upload", //
headers: {
Authorization: "Bearer " + getAccessToken(),
"tenant-id": getTenantId(),
}, //
fileList: [], //
getFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/", getFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/",
imgs: null, imgs: null,
// //
@ -743,6 +758,11 @@ export default {
handleCompanyChange(val) { handleCompanyChange(val) {
this.form.companyId = val.id; this.form.companyId = val.id;
this.form.company = val.organizationName; this.form.company = val.organizationName;
},
//
handleSuccess(res) {
console.log(res);
this.form.contractAttachment = res.data.url;
}, },
/** /**
* 文件预览 * 文件预览

Loading…
Cancel
Save