Commit 6a7c506e by dupengfei

下载附件对接接口页面显示问题修改(审计)

parent 8ad9bb30
......@@ -30,9 +30,9 @@
class="upload-demo"
action=""
:on-remove="handleRemove"
:on-change="handleChange"
:on-change="handleChangeSjTempFj"
:on-preview="handlerPreview"
:limit="3"
:auto-upload="false"
:file-list="fileList">
<el-button size="small" type="primary">证据上传</el-button>
</el-upload>
......@@ -129,6 +129,7 @@ import { getXqGlajList, getGzryZjSelect,getGzryZjUp,getGzryZjDown,getGzryZjDel }
import { getGzryBybh, updateAjGzry } from "@/api/caseFocusOnPerson/gzry";
import { addGzry } from "@/api/caseFocusOnPerson/gzry";
import utilTool from "@/utils/util.js";
import base from "@/api/base";
export default {
name: "callForm",
components: {
......@@ -153,7 +154,7 @@ export default {
url: `file/mb.xls`
}
},
formFieldZjxx:[
formFieldZjxx: [
{
name: "人民币现金(万元):",
id: "rmbxj",
......@@ -553,7 +554,7 @@ export default {
],
codeData: [], //线索来源字典
queryArr: [],
relatedCaseData: { rows: [], total: 0 },
relatedCaseData: {rows: [], total: 0},
row: 5,
options: [
{
......@@ -579,7 +580,7 @@ export default {
relatedCaseSelection: new Set(),
propSt: "gzry",
tableLoading: false,
[{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]
fileList: []
};
},
created () {
......@@ -593,10 +594,10 @@ export default {
handelSelectFj(){
getGzryZjSelect({
}).then(res => {
getGzryZjSelect({}).then(res => {
if(res.success == true){
this.fileList = res.data.rows;
}
})
},
......@@ -617,38 +618,41 @@ export default {
//console.log(file, fileList);
},
handleChange(file, fileList){
handleChangeSjTempFj(file, fileList){
console.log(file)
const param = new FormData();
param.append("file", file.raw);
getGzryZjUp({
file: file.raw
}).then(res => {
if (res.success == true){
this.$message({
showClose: true,
message: '上传成功'
});
const config = {
headers: { "Content-Type": "multipart/form-data" }
};
axios.post(`${base.alyIP}/temp/upload`, param, config).then(res => {
debugger
if (res.data.success == true){
this.$message.success("上传成功")
}
})
this.handelSelectFj();
});
},
//下载文件
handlerPreview(file) {
console.log(file)
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(file.url, file.name)
} else {
let link = document.createElement('a')
link.download = file.name
link.href = window.URL.createObjectURL(file.url)
link.click()
window.URL.revokeObjectURL(link.href)
}
}
let a = document.createElement('a');
let event = new MouseEvent('click');
a.download = file.name;
a.href = file.url;
a.dispatchEvent(event);
// a.href = file.url;
// a.download = file.name; // 下载后文件名
// a.style.display = 'none'
// document.body.appendChild(a)
// a.click() // 点击下载
// document.body.removeChild(a) // 下载完成移除元素
},
//初始化表单
initFields () {
var self = this;
......
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