|
@@ -68,10 +68,13 @@
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="24" :sm="8">
|
|
|
<a-form-item label="附件上传" class="upload">
|
|
|
- <a-upload :action="url.fileUpload" @change="aaa" v-model="formState.enclosure" list-type="picture">
|
|
|
+ <a-upload :action="url.fileUpload" @change="aaa" :default-file-list="fileList" list-type="picture" :beforeUpload="beforeFileUpload">
|
|
|
<a-button>
|
|
|
<a-icon type="upload"/>上传
|
|
|
</a-button>
|
|
|
+ <div v-if="defult == 'edit'">
|
|
|
+ <a @click="downloadFile">{{formState.enclosure}}</a>
|
|
|
+ </div>
|
|
|
</a-upload>
|
|
|
</a-form-item>
|
|
|
<!-- <a-form-model-item label="附件上传">
|
|
@@ -99,6 +102,7 @@ import {
|
|
|
} from '@api/oa/cd-certificate-management'
|
|
|
import JUpload from '@/components/jeecg/JUpload'
|
|
|
import moment from 'moment'
|
|
|
+import { downFile } from '@/api/manage'
|
|
|
|
|
|
export default {
|
|
|
name: 'AddCertificateManagement',
|
|
@@ -114,6 +118,7 @@ export default {
|
|
|
endDate:'',
|
|
|
beginDate:''
|
|
|
},
|
|
|
+ fileList:[],
|
|
|
confirmLoading: false,
|
|
|
enDate:'',
|
|
|
beDate:'',
|
|
@@ -136,9 +141,19 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ //下载
|
|
|
+ downloadFile(){
|
|
|
+ window.location.href =this.url.dowfile + this.formState.enclosure;
|
|
|
+ },
|
|
|
+ beforeFileUpload(file, fileList){
|
|
|
+ if(fileList.lenght >1 || this.fileList.length>=1){
|
|
|
+ this.$message.error('只可上传一个文件');
|
|
|
+ }
|
|
|
+ },
|
|
|
aaa(info) {
|
|
|
if(info.file.status !=='error'){
|
|
|
this.formState.enclosure = info.file.name
|
|
|
+ this.fileList.push(info.file.name)
|
|
|
}else{
|
|
|
this.formState.enclosure = ''
|
|
|
}
|
|
@@ -149,6 +164,7 @@ export default {
|
|
|
this.defult='add',
|
|
|
this.enDate=''
|
|
|
this.beDate=''
|
|
|
+ this.fileList =[]
|
|
|
},
|
|
|
handleSubmit(){
|
|
|
this.$refs.form.validate(valid => {
|