|
|
@@ -1,87 +1,168 @@
|
|
1
|
1
|
<template>
|
|
2
|
|
- <div>
|
|
3
|
|
- <el-dialog title="邮件内容" :visible="emailVidable" @close="cancel" center
|
|
4
|
|
- :distroy-on-close="true">
|
|
5
|
|
- <div>
|
|
6
|
|
- <el-form>
|
|
7
|
|
- <el-col :span="24">
|
|
8
|
|
- <el-form-item label="邮件主题:" label-width="100px">
|
|
9
|
|
- <div>主题</div>
|
|
10
|
|
- </el-form-item>
|
|
11
|
|
- </el-col>
|
|
12
|
|
- <el-col :span="12">
|
|
13
|
|
- <el-form-item label="收件人:" label-width="100px">
|
|
14
|
|
- <div>收件人</div>
|
|
15
|
|
- </el-form-item>
|
|
16
|
|
- </el-col>
|
|
17
|
|
- <el-col :span="12">
|
|
18
|
|
- <el-form-item label="发件人:" label-width="100px">
|
|
19
|
|
- <div>发件人</div>
|
|
20
|
|
- </el-form-item>
|
|
21
|
|
- </el-col>
|
|
22
|
|
- <el-col :span="24">
|
|
23
|
|
- <el-form-item label="邮件附件:" label-width="100px">
|
|
24
|
|
- <div style="color: blue; cursor: pointer" @click="viewAttachments">附件</div>
|
|
25
|
|
- </el-form-item>
|
|
26
|
|
- </el-col>
|
|
27
|
|
- <el-col :span="24">
|
|
28
|
|
- <el-form-item label="邮件正文:" label-width="100px">
|
|
29
|
|
- <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="sendData"></el-input>
|
|
30
|
|
- </el-form-item>
|
|
31
|
|
- </el-col>
|
|
32
|
|
- </el-form>
|
|
33
|
|
-
|
|
34
|
|
- </div>
|
|
35
|
|
- <div slot="footer" class="dialog-footer">
|
|
36
|
|
- <el-button @click="cancel" class="endbutton1" round><span>取 消</span></el-button>
|
|
37
|
|
- <el-button @click="submitSend" class="endbutton1" type="primary" round><span>确 认</span></el-button>
|
|
38
|
|
- </div>
|
|
39
|
|
- </el-dialog>
|
|
40
|
|
- </div>
|
|
|
2
|
+ <div>
|
|
|
3
|
+ <el-dialog
|
|
|
4
|
+ title="邮件内容"
|
|
|
5
|
+ :visible="emailVidable"
|
|
|
6
|
+ @close="cancel"
|
|
|
7
|
+ center
|
|
|
8
|
+ :distroy-on-close="true"
|
|
|
9
|
+ >
|
|
|
10
|
+ <div>
|
|
|
11
|
+ <el-form>
|
|
|
12
|
+ <el-col :span="24">
|
|
|
13
|
+ <el-form-item label="邮件主题:" label-width="100px">
|
|
|
14
|
+ <div>{{ emailRow.mailSubject }}</div>
|
|
|
15
|
+ </el-form-item>
|
|
|
16
|
+ </el-col>
|
|
|
17
|
+ <el-col :span="12">
|
|
|
18
|
+ <el-form-item label="收件人:" label-width="100px">
|
|
|
19
|
+ <div>{{ emailRow.mailAddress }}</div>
|
|
|
20
|
+ </el-form-item>
|
|
|
21
|
+ </el-col>
|
|
|
22
|
+ <el-col :span="12">
|
|
|
23
|
+ <el-form-item label="发件人:" label-width="100px">
|
|
|
24
|
+ <div>{{ emailRow.mailFromAddress }}</div>
|
|
|
25
|
+ </el-form-item>
|
|
|
26
|
+ </el-col>
|
|
|
27
|
+ <el-col :span="24">
|
|
|
28
|
+ <el-form-item label="邮件附件:" label-width="100px">
|
|
|
29
|
+ <div
|
|
|
30
|
+ style="color: blue; cursor: pointer"
|
|
|
31
|
+ v-for="(item, index) in emailRow.caseAttachList"
|
|
|
32
|
+ :key="index"
|
|
|
33
|
+ @click="viewAttachments(item.annexPath)"
|
|
|
34
|
+ >
|
|
|
35
|
+ {{ item.annexName }}
|
|
|
36
|
+ </div>
|
|
|
37
|
+ </el-form-item>
|
|
|
38
|
+ </el-col>
|
|
|
39
|
+ <el-col :span="24">
|
|
|
40
|
+ <el-form-item label="邮件上传:" label-width="100px">
|
|
|
41
|
+ <el-upload
|
|
|
42
|
+ class="upload-demo"
|
|
|
43
|
+ accept=".doc,.docx,.pdf"
|
|
|
44
|
+ ref="upload"
|
|
|
45
|
+ :action="UploadUrl()"
|
|
|
46
|
+ :headers="headers"
|
|
|
47
|
+ :data="filedata"
|
|
|
48
|
+ :on-preview="handlePreview"
|
|
|
49
|
+ :on-remove="handleRemove"
|
|
|
50
|
+ :limit="1"
|
|
|
51
|
+ :on-change="beforeUpload"
|
|
|
52
|
+ :on-success="handlSuccess"
|
|
|
53
|
+ :file-list="fileList"
|
|
|
54
|
+ >
|
|
|
55
|
+ <el-button
|
|
|
56
|
+ slot="trigger"
|
|
|
57
|
+ size="small"
|
|
|
58
|
+ type="primary"
|
|
|
59
|
+ >选取文件</el-button
|
|
|
60
|
+ >
|
|
|
61
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
62
|
+ 只能上传.doc,docx,pdf文件
|
|
|
63
|
+ </div>
|
|
|
64
|
+ </el-upload>
|
|
|
65
|
+ </el-form-item>
|
|
|
66
|
+ </el-col>
|
|
|
67
|
+ <el-col :span="24">
|
|
|
68
|
+ <el-form-item label="邮件正文:" label-width="100px">
|
|
|
69
|
+ <el-input
|
|
|
70
|
+ type="textarea"
|
|
|
71
|
+ :rows="4"
|
|
|
72
|
+ placeholder="请输入内容"
|
|
|
73
|
+ v-model="sendData"
|
|
|
74
|
+ ></el-input>
|
|
|
75
|
+ </el-form-item>
|
|
|
76
|
+ </el-col>
|
|
|
77
|
+ </el-form>
|
|
|
78
|
+ </div>
|
|
|
79
|
+ <div slot="footer" class="dialog-footer">
|
|
|
80
|
+ <el-button @click="cancel" class="endbutton1" round
|
|
|
81
|
+ ><span>取 消</span></el-button
|
|
|
82
|
+ >
|
|
|
83
|
+ <el-button @click="submitSend" class="endbutton1" type="primary" round
|
|
|
84
|
+ ><span>确 认</span></el-button
|
|
|
85
|
+ >
|
|
|
86
|
+ </div>
|
|
|
87
|
+ </el-dialog>
|
|
|
88
|
+ </div>
|
|
41
|
89
|
</template>
|
|
42
|
90
|
|
|
43
|
91
|
<script>
|
|
44
|
92
|
import {
|
|
45
|
|
- updateSendContent,update
|
|
|
93
|
+ updateSendContent,
|
|
|
94
|
+ update,
|
|
46
|
95
|
} from "@/api/deliveryRecord/deliveryRecord.js";
|
|
|
96
|
+import { getToken } from "@/utils/auth";
|
|
47
|
97
|
export default {
|
|
48
|
|
- props: ["emailVidable", "emailRow","queryParams"],
|
|
49
|
|
- data() {
|
|
50
|
|
- return {
|
|
51
|
|
- sendData:'',
|
|
52
|
|
- fileURL: window.location.origin + "/API",
|
|
53
|
|
- };
|
|
|
98
|
+ props: ["emailVidable", "emailRow", "queryParams"],
|
|
|
99
|
+ data() {
|
|
|
100
|
+ return {
|
|
|
101
|
+ sendData: "",
|
|
|
102
|
+ fileURL: window.location.origin + "/API",
|
|
|
103
|
+ headers: {
|
|
|
104
|
+ Authorization: "Bearer " + getToken(),
|
|
|
105
|
+ },
|
|
|
106
|
+ filedata: {
|
|
|
107
|
+ annexType: 13,
|
|
|
108
|
+ },
|
|
|
109
|
+ fileList: [],
|
|
|
110
|
+ files:[],
|
|
|
111
|
+ };
|
|
|
112
|
+ },
|
|
|
113
|
+ watch: {
|
|
|
114
|
+ emailVidable(val) {
|
|
|
115
|
+ if (val) {
|
|
|
116
|
+ console.log(this.emailRow);
|
|
|
117
|
+ this.sendData = this.emailRow.mailContent;
|
|
|
118
|
+ }
|
|
54
|
119
|
},
|
|
55
|
|
- watch: {
|
|
56
|
|
- emailVidable(val){
|
|
57
|
|
- if(val){
|
|
58
|
|
- this.sendData = this.emailRow.mailContent;
|
|
59
|
|
- }
|
|
60
|
|
- }
|
|
|
120
|
+ },
|
|
|
121
|
+ methods: {
|
|
|
122
|
+ cancel() {
|
|
|
123
|
+ this.$emit("cancelEmail");
|
|
61
|
124
|
},
|
|
62
|
|
- methods: {
|
|
63
|
|
- cancel() {
|
|
64
|
|
- this.$emit("cancelEmail");
|
|
65
|
|
- },
|
|
66
|
|
- submitSend() {
|
|
67
|
|
- console.log(this.emailRow.mailContent)
|
|
68
|
|
- this.updateSendContentFn({
|
|
69
|
|
- id:this.emailRow.id,
|
|
70
|
|
- mailContent:this.sendData
|
|
71
|
|
- })
|
|
72
|
|
- },
|
|
73
|
|
- updateSendContentFn(data){
|
|
74
|
|
- update(data).then(res=>{
|
|
75
|
|
- this.$message.success('更新成功');
|
|
76
|
|
- this.$emit("cancelEmail");
|
|
77
|
|
- this.$emit('getList',this.queryParams);
|
|
78
|
|
- })
|
|
79
|
|
- },
|
|
80
|
|
- // 查看附件下载附件
|
|
81
|
|
- viewAttachments(val){
|
|
82
|
|
- window.open(this.fileURL + val);
|
|
83
|
|
- }
|
|
|
125
|
+ submitSend() {
|
|
|
126
|
+ console.log(this.emailRow.mailContent);
|
|
|
127
|
+ this.updateSendContentFn({
|
|
|
128
|
+ id: this.emailRow.id,
|
|
|
129
|
+ mailContent: this.sendData,
|
|
|
130
|
+ caseAttachList:[{annexId:this.files.annexId}],
|
|
|
131
|
+
|
|
|
132
|
+ });
|
|
|
133
|
+
|
|
84
|
134
|
},
|
|
|
135
|
+ updateSendContentFn(data) {
|
|
|
136
|
+ console.log(data)
|
|
|
137
|
+ update(data).then((res) => {
|
|
|
138
|
+
|
|
|
139
|
+ this.$message.success("更新成功");
|
|
|
140
|
+ this.$emit("cancelEmail");
|
|
|
141
|
+ this.$emit("getList", this.queryParams);
|
|
|
142
|
+ this.$refs.upload.clearFiles(); // 清除文件列表
|
|
|
143
|
+ });
|
|
|
144
|
+ },
|
|
|
145
|
+ // 查看附件下载附件
|
|
|
146
|
+ viewAttachments(val) {
|
|
|
147
|
+ window.open(this.fileURL + val);
|
|
|
148
|
+ },
|
|
|
149
|
+ /**上传地址*/
|
|
|
150
|
+ UploadUrl() {
|
|
|
151
|
+ return window.location.origin + "/API/common/upload";
|
|
|
152
|
+ },
|
|
|
153
|
+ handlePreview(file) {},
|
|
|
154
|
+ handleRemove(file, fileList) {},
|
|
|
155
|
+ beforeUpload(flie, fileList) {
|
|
|
156
|
+
|
|
|
157
|
+ },
|
|
|
158
|
+ handlSuccess(res, file) {
|
|
|
159
|
+
|
|
|
160
|
+ const fileSuccess = [{ annexId: res.annexId, annexType: res.annexType,annexName:res.newFileName,annexPath:res.fileName,onlyOfficeFileId:res.onlyOfficeFileId}]
|
|
|
161
|
+ this.emailRow.caseAttachList = fileSuccess
|
|
|
162
|
+ this.files = res
|
|
|
163
|
+ console.log(res)
|
|
|
164
|
+ },
|
|
|
165
|
+ },
|
|
85
|
166
|
};
|
|
86
|
167
|
</script>
|
|
87
|
168
|
|