Commit 0ab8053f authored by 高滢's avatar 高滢

feat(检测方案): 添加声明文件

parent a0adf02f
<template>
<div class="input-upload">
<el-input
v-bind="items"
:disabled="status"
v-model="model.value"
style="width: 50%"
placeholder="请输入"
@input="input"
/>
<div>
<div class="input-upload">
<el-input
v-bind="items"
:disabled="status"
v-model="model.value"
style="width: 50%"
placeholder="请输入"
@input="input"
/>
<el-upload
class="upload-demo"
:action="uploadImgUrl"
:on-preview="handlePreview"
v-model="model.file"
ref="fileUpload"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
accept=".pdf ,.doc ,.docx ,.xls, .xlsx"
:on-success="handleSuccess"
:on-exceed="handleExceed"
:headers="headers"
>
<el-button size="small" :disabled="status" type="primary"
<el-upload
class="upload-demo"
:action="uploadImgUrl"
v-model="model.file"
ref="fileUpload"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
accept=".pdf ,.doc ,.docx ,.xls, .xlsx"
:on-success="handleSuccess"
:on-exceed="handleExceed"
:headers="headers"
>
<el-button size="small" :disabled="status" type="primary"
>上传文件</el-button
>
<div slot="tip" class="el-upload__tip">
<div v-if="model.path">
<el-link :href="model.path">{{ model.name }}</el-link>
</div>
</div>
</el-upload>
</div>
<div v-if="prop=='chcek5'">
<el-upload
class="upload-demo"
:action="uploadImgUrl"
v-model="model.statementFile"
ref="fileUploadStatement"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
accept=".pdf ,.doc ,.docx ,.xls, .xlsx"
:on-success="handleSuccessFile"
:on-exceed="handleExceed"
:headers="headers"
>
<div slot="tip" class="el-upload__tip">
<div v-if="model.path">
<el-link :href="model.path">{{ model.name }}</el-link>
<el-button size="small" :disabled="status" type="text"
>当车企没有授权的第三方应用时,点击此处上传声明文件</el-button>
<div slot="tip" class="el-upload__tip">
<div v-if="model.statementPath">
<el-link :href="model.statementPath">{{ model.statementName }}</el-link>
</div>
</div>
</div>
</el-upload>
</el-upload>
</div>
</div>
</template>
<script>
......@@ -60,7 +83,10 @@ export default {
value: '',
file: '',
path: '',
name: ''
name: '',
statementFile:'',
statementPath:'',
statementName:'',
},
headers: {
Authorization: 'Bearer ' + this.$store.getters.token
......@@ -79,6 +105,7 @@ export default {
}
},
mounted() {
console.log('12121212222222',this.prop)
if (this.defaultValue) {
this.model = this.defaultValue
this.$emit('changeVal', { name: this.prop, val: this.result })
......@@ -105,20 +132,18 @@ export default {
value: '',
file: '',
path: '',
name: ''
name: '',
statementFile:'',
statementPath:'',
statementName:'',
}
},
setDefaultValue(val) {
this.value = val
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleSuccess(res, file) {
if (res.code === 200) {
console.log(this.model)
this.model.path = process.env.VUE_APP_IMAGE_API + res.url
this.model.name = res.originalFilename
this.$refs.fileUpload.clearFiles()
......@@ -127,6 +152,17 @@ export default {
this.$message.error('error')
}
},
handleSuccessFile(res, file) {
if (res.code === 200) {
console.log(this.model)
this.model.statementPath = process.env.VUE_APP_IMAGE_API + res.url
this.model.statementName = res.originalFilename
this.$refs.fileUploadStatement.clearFiles()
this.$message.success('上传成功')
} else {
this.$message.error('error')
}
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment