Selaa lähdekoodia

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Frontend into gyj

gyj 2 vuotta sitten
vanhempi
commit
06cd25c936

+ 7
- 0
src/api/deliveryRecord/deliveryRecord.js Näytä tiedosto

@@ -18,6 +18,13 @@ export function smsList(data,params) {
18 18
         params:params
19 19
     })
20 20
 }
21
+
22
+// 更新邮件发送记录
23
+export function update(data) {
24
+    return request({
25
+        url: 'sendMailRecord/update',
26
+    })
27
+}
21 28
 // 分页查询短信
22 29
 export function recordList(data) {
23 30
     return request({

+ 79
- 27
src/views/deliveryRecord/components/emailEdits.vue Näytä tiedosto

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