2024-05-29 09:55:27 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<el-dialog title="邮件内容" :visible="emailVidable" @close="cancel" center :distroy-on-close="true">
|
2024-05-29 09:55:27 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<el-form>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="邮件主题:" label-width="100px">
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<div>{{ emailRow.mailSubject }}</div>
|
2024-05-29 09:55:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<el-col :span="12">
|
2024-05-29 09:55:27 +08:00
|
|
|
|
<el-form-item label="收件人:" label-width="100px">
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<div>{{ emailRow.mailAddress }}</div>
|
2024-05-29 09:55:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<el-col :span="12">
|
2024-05-29 09:55:27 +08:00
|
|
|
|
<el-form-item label="发件人:" label-width="100px">
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<div>{{ emailRow.mailFromAddress }}</div>
|
2024-05-29 09:55:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="邮件附件:" label-width="100px">
|
2024-05-30 18:00:30 +08:00
|
|
|
|
<div style="color: blue; cursor: pointer" v-for="(item, index) in emailRow.caseAttachList"
|
|
|
|
|
|
:key="index" @click="viewAttachments(item.annexPath)">
|
|
|
|
|
|
{{ item.annexName }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="附件上传:" label-width="100px">
|
|
|
|
|
|
<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" :on-change="beforeUpload"
|
|
|
|
|
|
:on-success="handlSuccess" :file-list="fileList">
|
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
|
只能上传.doc,docx,pdf文件
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-upload>
|
2024-05-29 09:55:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item label="邮件正文:" label-width="100px">
|
|
|
|
|
|
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="sendData"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button @click="cancel" class="endbutton1" round><span>取 消</span></el-button>
|
|
|
|
|
|
<el-button @click="submitSend" class="endbutton1" type="primary" round><span>确 认</span></el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
2024-05-30 18:00:30 +08:00
|
|
|
|
updateSendContent,
|
|
|
|
|
|
update,
|
2024-05-29 09:55:27 +08:00
|
|
|
|
} from "@/api/deliveryRecord/deliveryRecord.js";
|
2024-05-30 18:00:30 +08:00
|
|
|
|
import { getToken } from "@/utils/auth";
|
2024-05-29 09:55:27 +08:00
|
|
|
|
export default {
|
2024-05-30 18:00:30 +08:00
|
|
|
|
props: ["emailVidable", "emailRow", "queryParams"],
|
2024-05-29 09:55:27 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2024-05-30 18:00:30 +08:00
|
|
|
|
sendData: "",
|
2024-05-29 09:55:27 +08:00
|
|
|
|
fileURL: window.location.origin + "/API",
|
2024-05-30 18:00:30 +08:00
|
|
|
|
headers: {
|
|
|
|
|
|
Authorization: "Bearer " + getToken(),
|
|
|
|
|
|
},
|
|
|
|
|
|
filedata: {
|
|
|
|
|
|
annexType: 13,
|
|
|
|
|
|
},
|
|
|
|
|
|
fileList: [],
|
|
|
|
|
|
files: [],
|
2024-05-29 09:55:27 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
2024-05-30 18:00:30 +08:00
|
|
|
|
emailVidable(val) {
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
console.log(this.emailRow);
|
2024-05-29 09:55:27 +08:00
|
|
|
|
this.sendData = this.emailRow.mailContent;
|
|
|
|
|
|
}
|
2024-05-30 18:00:30 +08:00
|
|
|
|
},
|
2024-05-29 09:55:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
cancel() {
|
|
|
|
|
|
this.$emit("cancelEmail");
|
|
|
|
|
|
},
|
|
|
|
|
|
submitSend() {
|
2024-05-30 18:00:30 +08:00
|
|
|
|
console.log(this.emailRow.mailContent);
|
|
|
|
|
|
let caseAttachListParms = {};
|
|
|
|
|
|
if (this.files.annexId) {
|
|
|
|
|
|
caseAttachListParms = {
|
|
|
|
|
|
id: this.emailRow.id,
|
|
|
|
|
|
mailContent: this.sendData,
|
|
|
|
|
|
caseAttachList: [{ annexId: this.files.annexId }],
|
|
|
|
|
|
}
|
|
|
|
|
|
} else{
|
|
|
|
|
|
caseAttachListParms = {
|
|
|
|
|
|
id: this.emailRow.id,
|
|
|
|
|
|
mailContent: this.sendData,
|
|
|
|
|
|
caseAttachList: [],
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.updateSendContentFn(caseAttachListParms);
|
2024-05-29 09:55:27 +08:00
|
|
|
|
},
|
2024-05-30 18:00:30 +08:00
|
|
|
|
updateSendContentFn(data) {
|
|
|
|
|
|
update(data).then((res) => {
|
|
|
|
|
|
this.$message.success("更新成功");
|
2024-05-29 09:55:27 +08:00
|
|
|
|
this.$emit("cancelEmail");
|
2024-05-30 18:00:30 +08:00
|
|
|
|
this.$emit("getList", this.queryParams);
|
|
|
|
|
|
this.$refs.upload.clearFiles(); // 清除文件列表
|
|
|
|
|
|
});
|
2024-05-29 09:55:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 查看附件下载附件
|
2024-05-30 18:00:30 +08:00
|
|
|
|
viewAttachments(val) {
|
2024-05-29 09:55:27 +08:00
|
|
|
|
window.open(this.fileURL + val);
|
2024-05-30 18:00:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**上传地址*/
|
|
|
|
|
|
UploadUrl() {
|
|
|
|
|
|
return window.location.origin + "/API/evidence/upload";
|
|
|
|
|
|
},
|
|
|
|
|
|
handlePreview(file) { },
|
|
|
|
|
|
handleRemove(file, fileList) { },
|
|
|
|
|
|
beforeUpload(flie, fileList) {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
handlSuccess(res, file) {
|
|
|
|
|
|
const fileSuccess = [{ annexId: res.annexId, annexType: res.annexType, annexName: res.newFileName, annexPath: res.fileName, onlyOfficeFileId: res.onlyOfficeFileId }]
|
|
|
|
|
|
// this.emailRow.caseAttachList = fileSuccess
|
|
|
|
|
|
this.files = res
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
},
|
2024-05-29 09:55:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|