文件上传 #48

Merged
hhlxayunmei merged 1 commits from hhl into dev 2023-09-27 07:49:55 +00:00
2 changed files with 97 additions and 23 deletions
Showing only changes of commit d0bf9a1c73 - Show all commits
@@ -32,15 +32,21 @@
<el-descriptions-item label="申请人主张违约金">{{
form.claimLiquidDamag
}}</el-descriptions-item>
<el-descriptions-item label="申请人案件证据资料">{{
form.aaa
}}</el-descriptions-item>
<el-descriptions-item label="被申请人案件证据资料">{{
form.aaa
}}</el-descriptions-item>
<el-descriptions-item label="裁决书附件">{{
form.aaa
}}</el-descriptions-item>
<el-descriptions-item label="申请人案件证据资料">
<span @click="toFile(2)">
<a href="#">{{ applicantFile }}</a>
</span>
</el-descriptions-item>
<el-descriptions-item label="被申请人案件证据资料">
<span @click="toFile(6)">
<a href="#">{{ respondentFile }}</a>
</span>
</el-descriptions-item>
<el-descriptions-item label="裁决书附件">
<span @click="toFile(3)">
<a href="#">{{ awardFile }}</a>
</span>
</el-descriptions-item>
</el-descriptions>
<el-form
ref="form"
@@ -208,6 +214,12 @@ export default {
},
],
},
applicantFile: "", //申请人
applicantPath: "", //申请人
respondentFile: "", //被申请人
respondentPath: "", //被申请人
awardFile: "", //裁决书
awardPath: "", //裁决书
};
},
watch: {
@@ -218,12 +230,40 @@ export default {
this.form = this.detailform;
this.arbitrateRecord = this.form.arbitrateRecord;
console.log(this.form, "this.form");
this.evidenceFile(this.form);
}, 1000);
}
},
},
},
methods: {
// 申请人裁决书
evidenceFile(val) {
if (val) {
val.caseAttachList.forEach((item) => {
if ((item.annexType = 2)) {
this.applicantFile = item.annexName;
this.applicantPath = item.annexPath;
} else if ((item.annexType = 6)) {
this.respondentFile = item.annexName;
this.respondenPath = item.annexPath;
} else if ((item.annexType = 3)) {
this.awardFile = item.annexName;
this.awardPath = item.annexPath;
}
});
}
},
toFile(val) {
let headPath = window.location.origin + "/API";
if (val == 2) {
window.open(headPath + this.applicantPath, "_black");
} else if (val == 6) {
window.open(headPath + this.respondenPath, "_black");
} else if (val == 3) {
window.open(headPath + this.awardPath, "_black");
}
},
// 校验裁决书
verificationArbitrateRecordFn(parms) {
verificationArbitrateRecord(parms).then((res) => {
@@ -283,4 +323,7 @@ export default {
.esign {
border: 1px solid;
}
a {
color: blue;
}
</style>
@@ -119,6 +119,7 @@
ref="fileupload"
:action="UploadUrl()"
:on-success="handlSuccess"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:data="filedata"
:headers="headers"
@@ -137,9 +138,17 @@
<el-col :span="12">
<el-form-item
label="申请人案件证据资料:"
v-if="flag == '0' && caseAttachList.length > 0"
v-if="
flag == '0' &&
caseAttachList.length > 0 &&
applicateArr.length > 0
"
>
<a href=""></a>
<div v-for="(item, index) in applicateArr" :key="index">
<a href="#" @click="toFile(item, index)" style="color: blue">
{{ item }}
</a>
</div>
</el-form-item>
</el-col>
<!-- 仅详情展示 案件质证环节以后显示被申请人证据-->
@@ -147,11 +156,16 @@
<el-form-item
label="被申请人案件证据资料:"
prop="respondentEvidence"
v-if="flag == '0' && caseAttachList.length > 0"
v-if="
flag == '0' && caseAttachList.length > 0 && quiltArr.length > 0
"
>
<a href="#" @click="toFile" style="color: blue">{{
caseAttachList[0].annexName
}}</a>
<div v-for="(item, index) in quiltArr" :key="index">
<a href="#" @click="toFile(item, index)" style="color: blue">
{{ item }}
</a>
</div>
<!-- <el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
@@ -762,7 +776,11 @@ export default {
},
],
},
// annexId: '',
caseAttachListArr: [],
fileList: [],
applicateArr: [],
quiltArr: [],
};
},
watch: {
@@ -774,6 +792,15 @@ export default {
setTimeout(() => {
this.form2.paymentArr = this.initpaymentArr;
this.form3.paymentArr1 = this.initpaymentArr1;
console.log(this.caseAttachList, "caseAttachList");
this.caseAttachList.forEach((item) => {
if (item.annexType == 2) {
this.applicateArr.push(item.annexName);
}
if (item.annexType == 6) {
this.quiltArr.push(item.annexName);
}
});
}, 1000);
}
if (this.flag == "2") {
@@ -817,7 +844,9 @@ export default {
},
// 文件上传成功
handlSuccess(res, file) {
console.log(res, file);
this.caseAttachListArr.push({
annexId: res.data.annexId,
});
},
// 文件超出个数限制时的钩子
handleExceed(files, fileList) {
@@ -831,6 +860,12 @@ export default {
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
},
handleRemove(file, fileList) {
(this.caseAttachListArr = []),
fileList.forEach((item) => {
this.caseAttachListArr.push({ annexId: item.response.data.annexId });
});
},
// 取消
cancel() {
this.$emit("cancel");
@@ -918,11 +953,7 @@ export default {
...this.form2.paymentArr,
...this.form3.paymentArr1,
];
this.formData.caseAttachList = [
{
annexId: 106,
},
];
this.formData.caseAttachList = [...this.caseAttachListArr];
if (this.formData.id) {
editCaseApply({
...this.formData,
@@ -954,9 +985,9 @@ export default {
});
},
// 详情显示,展示案件文件
toFile() {
toFile(item, index) {
window.open(
window.location.origin + "/API" + this.caseAttachList[0].annexPath,
window.location.origin + "/API" + this.caseAttachList[index].annexPath,
"_black"
);
},