调解书上传 #115

Merged
hanchaobo merged 2 commits from hcb into dev 2024-04-30 05:47:50 +00:00
@@ -98,12 +98,12 @@
<!-- v-if="!mediationType" --> <!-- v-if="!mediationType" -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="上传调解书"> <el-form-item label="上传调解书">
<el-upload class="upload-demo" accept=".doc,.docx" ref="upload" :action="UploadUrl()" <el-upload class="upload-demo" accept=".doc,.docx,.pdf" ref="upload" :action="UploadUrl()"
:headers="headers" :data="filedata" :on-preview="handlePreview" :on-remove="handleRemove" :limit="1" :headers="headers" :data="filedata" :on-preview="handlePreview" :on-remove="handleRemove" :limit="2"
:on-change="beforeUpload" :on-success="handlSuccess" :file-list="fileList"> :on-change="beforeUpload" :on-success="handlSuccess" :file-list="fileList">
<el-button slot="trigger" size="small" :disabled="!isSecretaryRole" type="primary">选取文件</el-button> <el-button slot="trigger" size="small" :disabled="!isSecretaryRole" type="primary">选取文件</el-button>
<!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button> --> <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button> -->
<div slot="tip" class="el-upload__tip">只能上传.doc,docx文件</div> <div slot="tip" class="el-upload__tip">只能上传.doc,docx,pdf文件</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -178,6 +178,7 @@ export default {
}, },
watch: { watch: {
mediationVisable(val) { mediationVisable(val) {
this.attachList = [];
this.formData.mediaResult = 1; this.formData.mediaResult = 1;
this.formData.sealFlag = 1; this.formData.sealFlag = 1;
this.recordArr = []; this.recordArr = [];
@@ -221,7 +222,8 @@ export default {
handlePreview(file) { handlePreview(file) {
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let updatedArray = this.attachList.filter(item => item.annexId != file.response.annexId);
this.attachList = updatedArray;
}, },
beforeUpload(flie, fileList) { beforeUpload(flie, fileList) {
this.fileList = fileList; this.fileList = fileList;
@@ -229,7 +231,7 @@ export default {
handlSuccess(res, file) { handlSuccess(res, file) {
this.codes = res.code this.codes = res.code
console.log(res) console.log(res)
this.attachList = [{ annexId: res.annexId,annexType:res.annexType}]; this.attachList.push({ annexId: res.annexId,annexType:res.annexType});
// this.$set(this.mediationData, "attachList", {annexId:res.annexId}); // this.$set(this.mediationData, "attachList", {annexId:res.annexId});
}, },
/** 获取案件详情信息 */ /** 获取案件详情信息 */
@@ -319,6 +321,8 @@ export default {
this.$emit("cancelMediation"); this.$emit("cancelMediation");
this.$emit("getList", this.queryParams); this.$emit("getList", this.queryParams);
this.loadingSubmit = false; this.loadingSubmit = false;
}).catch(err=>{
this.loadingSubmit = false;
}); });
}, },
cancel() { cancel() {
@@ -352,6 +356,7 @@ export default {
id: this.mediationData.id, id: this.mediationData.id,
caseFlowId: this.mediationData.caseFlowId, caseFlowId: this.mediationData.caseFlowId,
sealFlag:this.sealFlag, sealFlag:this.sealFlag,
attachList: this.attachList,
mediaResult: this.formData.mediaResult, mediaResult: this.formData.mediaResult,
} }
} }