hanchaobo 2 лет назад
Родитель
Сommit
85d3a33414

+ 10
- 2
src/api/officialSeal/officialSeal.js Просмотреть файл

@@ -78,7 +78,7 @@ export function updateTemplate(data) {
78 78
     return request({
79 79
         url: '/deptIdentify/updateTemplate',
80 80
         method: 'post',
81
-        params: data
81
+        data: data
82 82
     })
83 83
 }
84 84
 // 删除模板
@@ -200,4 +200,12 @@ export function getTemplateInfoById(data) {
200 200
         method: 'get',
201 201
         params: data
202 202
     })
203
-}
203
+}
204
+// 查询模板详情
205
+export function getTemplateDetail(data) {
206
+    return request({
207
+        url: '/deptIdentify/getTemplateDetail',
208
+        method: 'get',
209
+        params: data
210
+    })
211
+}

+ 87
- 31
src/views/officialSeal/components/addTemplate.vue Просмотреть файл

@@ -6,12 +6,12 @@
6 6
                 <el-form-item label="模板名称" prop="temName">
7 7
                     <el-input v-model="ruleForm.temName"></el-input>
8 8
                 </el-form-item>
9
-                <el-form-item label="模板类型" prop="temType">
9
+                <!-- <el-form-item label="模板类型" prop="temType">
10 10
                     <el-select v-model="ruleForm.temType" placeholder="请选择">
11 11
                         <el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
12 12
                             :value="dict.value"></el-option>
13 13
                     </el-select>
14
-                </el-form-item>
14
+                </el-form-item> -->
15 15
                 <el-form-item label="机构名称" prop="identifyId">
16 16
                     <el-select v-model="ruleForm.identifyId" placeholder="请选择">
17 17
                         <el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id">
@@ -19,10 +19,20 @@
19 19
                     </el-select>
20 20
                 </el-form-item>
21 21
             </el-form>
22
-            <el-upload class="avatar-uploader" :before-upload="beforeUpload" :on-success="handleSuccess" ref="upload"
23
-                :action="UploadUrl()" :headers="headers" :data="filedata" :on-remove="handleRemove"
24
-                :on-change="handleChange" accept=".doc,.docx" :file-list="fileList" :auto-upload="false">
25
-                <el-button size="small" type="primary">选择模板文件</el-button>
22
+            <el-upload class="avatar-uploader" :on-success="handleSuccess" ref="upload" :action="UploadUrl()"
23
+                :headers="headers" :data="filedata" :on-remove="handleRemove" :on-change="handleChange" accept=".doc,.docx"
24
+                :file-list="fileList" :limit="1">
25
+                <el-button size="small" type="primary">选择调解申请书模板</el-button>
26
+            </el-upload>
27
+            <el-upload class="avatar-uploader" :on-success="handleSuccessA" ref="uploadA" :action="UploadUrl()"
28
+                :headers="headers" :data="filedataA" :on-remove="handleRemoveA" :on-change="handleChangeA"
29
+                accept=".doc,.docx" :file-list="fileListA" :limit="1">
30
+                <el-button size="small" type="primary">选择和解协议模板</el-button>
31
+            </el-upload>
32
+            <el-upload class="avatar-uploader" :on-success="handleSuccessB" ref="upload" :action="UploadUrl()"
33
+                :headers="headers" :data="filedataB" :on-remove="handleRemoveB" :on-change="handleChangeB"
34
+                accept=".doc,.docx" :file-list="fileListB" :limit="1">
35
+                <el-button size="small" type="primary">选择调解书模板</el-button>
26 36
             </el-upload>
27 37
             <div slot="footer" class="dialog-footer">
28 38
                 <el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
@@ -35,6 +45,7 @@
35 45
 import { getToken } from "@/utils/auth";
36 46
 import {
37 47
     deptIdentifyList,
48
+    insertTemplate
38 49
 } from "@/api/officialSeal/officialSeal.js";
39 50
 export default {
40 51
     props: ["uploadVisable", "uploadData", "queryParams"],
@@ -42,25 +53,38 @@ export default {
42 53
     data() {
43 54
         return {
44 55
             fileList: [],
56
+            fileListA: [],
57
+            fileListB: [],
45 58
             data: [],
46 59
             tempList: [],
47
-            isImg:false,
60
+            isImg: false,
48 61
             headers: {
49 62
                 Authorization: "Bearer " + getToken(),
50 63
             },
51
-            filedata: {},
64
+            filedata: {
65
+                annexType: 1
66
+            },
67
+            filedataA: {
68
+                annexType: 2
69
+            },
70
+            filedataB: {
71
+                annexType: 3
72
+            },
52 73
             flagBtn: false,
53 74
             ruleForm: {},
54 75
             rules: {
55 76
                 temName: [
56 77
                     { required: true, message: '请输入模板名称', trigger: 'blur' },
57 78
                 ],
58
-                temType: [
59
-                    { required: true, message: '请输入模板名称', trigger: 'blur' },
60
-                ],
79
+                // temType: [
80
+                //     { required: true, message: '请输入模板名称', trigger: 'blur' },
81
+                // ],
61 82
                 identifyId: [
62 83
                     { required: true, message: '请输入模板名称', trigger: 'blur' },
63 84
                 ]
85
+            },
86
+            submitForm: {
87
+                annexIds: []
64 88
             }
65 89
         };
66 90
     },
@@ -89,35 +113,67 @@ export default {
89 113
             this.isImg = file.type === '.doc' || '.docx'
90 114
         },
91 115
         UploadUrl() {
92
-            return window.location.origin + "/API/deptIdentify/insertTemplate";
116
+            return window.location.origin + "/API/deptIdentify/upload";
117
+        },
118
+        handleRemove(file, fileList) {
119
+            console.log(file, fileList);
120
+        },
121
+        handleSuccess(res) {
122
+            this.$message.success('上传成功');
123
+            console.log(res, "OOOOOOOOOOOOOOOOO");
124
+            this.submitForm.annexIds.push(res.annexId)
125
+        },
126
+
127
+        handleChangeA(file, fileList) {
128
+            this.isImg = file.type === '.doc' || '.docx'
129
+        },
130
+        UploadUrl() {
131
+            return window.location.origin + "/API/deptIdentify/upload";
132
+        },
133
+        handleRemoveA(file, fileList) {
134
+            console.log(file, fileList);
135
+        },
136
+        handleSuccessA(res) {
137
+            this.$message.success('上传成功');
138
+            this.submitForm.annexIds.push(res.annexId)
139
+        },
140
+
141
+        handleChangeB(file, fileList) {
142
+            this.isImg = file.type === '.doc' || '.docx'
143
+        },
144
+        UploadUrl() {
145
+            return window.location.origin + "/API/deptIdentify/upload";
146
+        },
147
+        handleRemoveB(file, fileList) {
148
+            console.log(file, fileList);
149
+        },
150
+        handleSuccessB(res) {
151
+            this.$message.success('上传成功');
152
+            this.submitForm.annexIds.push(res.annexId)
93 153
         },
94 154
         submitUpload() {
95 155
             this.$refs['ruleForm'].validate((valid) => {
96 156
                 if (valid) {
97
-                    this.filedata.identifyId = this.ruleForm.identifyId;
98
-                    this.filedata.temName = this.ruleForm.temName;
99
-                    if (this.isImg) {
100
-                        this.$refs.upload.submit();
101
-                    }else{
102
-                        this.$message.error('只能上传doc,docx格式的文件')
157
+                    if(this.submitForm.annexIds.length < 3){
158
+                        this.$message.error('三种类型模板必须上传');
159
+                        return
103 160
                     }
161
+                    this.submitForm.identifyId = this.ruleForm.identifyId;
162
+                    this.submitForm.temName = this.ruleForm.temName;
163
+                    insertTemplate(this.submitForm).then(res => {
164
+                        this.$message.success('新增成功');
165
+                        this.$emit("cancelUpload");
166
+                        this.$emit('getList', this.queryParams);
167
+                    })
104 168
                 }
105 169
             });
106 170
         },
107
-        handleRemove(file, fileList) {
108
-            console.log(file, fileList);
109
-        },
110
-        beforeUpload(file) {
111
-            // debugger
112
-            // this.isImg = file.type === '.doc' || '.docx'
113
-        },
114
-        handleSuccess() {
115
-            this.$message.success('上传成功');
116
-            this.$emit("cancelUpload");
117
-            this.$emit('getList', this.queryParams);
118
-        }
119 171
     },
120 172
 };
121 173
 </script>
122 174
   
123
-<style lang="scss" scoped></style>
175
+<style lang="scss" scoped>
176
+.avatar-uploader {
177
+    margin-bottom: 20px;
178
+}
179
+</style>

+ 124
- 45
src/views/officialSeal/components/editTemplate.vue Просмотреть файл

@@ -6,21 +6,44 @@
6 6
                 <el-form-item label="模板名称" prop="temName">
7 7
                     <el-input v-model="ruleForm.temName"></el-input>
8 8
                 </el-form-item>
9
-                <el-form-item label="模板类型" prop="temType">
9
+                <!-- <el-form-item label="模板类型" prop="temType">
10 10
                     <el-select v-model="ruleForm.temType" placeholder="请选择">
11 11
                         <el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
12 12
                             :value="dict.value"></el-option>
13 13
                     </el-select>
14
+                </el-form-item> -->
15
+                <el-form-item label="调节申请书模板" v-if="ruleForm.applicationFile.fileName">
16
+                    <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.applicationFile.temOrigPath)">{{
17
+                        ruleForm.applicationFile.fileName ? ruleForm.applicationFile.fileName : ""
18
+                    }}</span>
19
+                </el-form-item>
20
+                <el-form-item label="和解协议模板" v-if="ruleForm.agreementFile.fileName">
21
+                    <!-- <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.fileName
22
+                    }}</span> -->
23
+                    <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.agreementFile.temOrigPath)">{{
24
+                        ruleForm.agreementFile.fileName ? ruleForm.agreementFile.fileName : ""
25
+                    }}</span>
14 26
                 </el-form-item>
15
-                <el-form-item label="当前模板">
16
-                    <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.fileName
27
+                <el-form-item label="调解书模板" v-if="ruleForm.bookFile.fileName">
28
+                    <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.bookFile.temOrigPath)">{{
29
+                        ruleForm.bookFile.fileName ? ruleForm.bookFile.fileName : ""
17 30
                     }}</span>
18 31
                 </el-form-item>
19 32
             </el-form>
20
-            <el-upload class="avatar-uploader" :before-upload="beforeUpload" :on-success="handleSuccess" ref="upload"
21
-                :action="UploadUrl()" :headers="headers" :data="filedata" :on-remove="handleRemove"
22
-                :on-change="handleChange" accept=".doc,.docx" :file-list="fileList" :auto-upload="false">
23
-                <el-button size="small" type="primary">选择模板文件</el-button>
33
+            <el-upload class="avatar-uploader" :on-success="handleSuccess" ref="upload" :action="UploadUrl()"
34
+                :headers="headers" :data="filedata" :on-remove="handleRemove" :on-change="handleChange" accept=".doc,.docx"
35
+                :file-list="fileList" :limit="1">
36
+                <el-button size="small" type="primary">选择调解申请书模板</el-button>
37
+            </el-upload>
38
+            <el-upload class="avatar-uploader" :on-success="handleSuccessA" ref="uploadA" :action="UploadUrl()"
39
+                :headers="headers" :data="filedataA" :on-remove="handleRemoveA" :on-change="handleChangeA"
40
+                accept=".doc,.docx" :file-list="fileListA" :limit="1">
41
+                <el-button size="small" type="primary">选择和解协议模板</el-button>
42
+            </el-upload>
43
+            <el-upload class="avatar-uploader" :on-success="handleSuccessB" ref="upload" :action="UploadUrl()"
44
+                :headers="headers" :data="filedataB" :on-remove="handleRemoveB" :on-change="handleChangeB"
45
+                accept=".doc,.docx" :file-list="fileListB" :limit="1">
46
+                <el-button size="small" type="primary">选择调解书模板</el-button>
24 47
             </el-upload>
25 48
             <div slot="footer" class="dialog-footer">
26 49
                 <el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
@@ -31,37 +54,54 @@
31 54
 </template>
32 55
 <script>
33 56
 import { getToken } from "@/utils/auth";
34
-import { updateTemplate } from "@/api/officialSeal/officialSeal"
57
+import { updateTemplate, getTemplateDetail } from "@/api/officialSeal/officialSeal"
35 58
 export default {
36 59
     props: ["editVisable", "editData", "queryParams"],
37 60
     dicts: ["template_type"],
38 61
     data() {
39 62
         return {
40 63
             fileList: [],
64
+            fileListA: [],
65
+            fileListB: [],
41 66
             data: [],
42 67
             headers: {
43 68
                 Authorization: "Bearer " + getToken(),
44 69
             },
45 70
             isImg: true,
46
-            filedata: {},
71
+            filedata: {
72
+                annexType: 1
73
+            },
74
+            filedataA: {
75
+                annexType: 2
76
+            },
77
+            filedataB: {
78
+                annexType: 3
79
+            },
47 80
             flagBtn: false,
48
-            ruleForm: {},
81
+            ruleForm: {
82
+                agreementFile:{},
83
+                applicationFile:{},
84
+                bookFile:{}
85
+            },
49 86
             rules: {
50 87
                 temName: [
51 88
                     { required: true, message: '请输入模板名称', trigger: 'blur' },
52 89
                 ],
53
-                temType: [
54
-                    { required: true, message: '请输入模板名称', trigger: 'blur' },
55
-                ],
90
+            },
91
+            submitForm: {
92
+                annexIds: []
56 93
             }
57 94
         };
58 95
     },
59 96
     watch: {
60 97
         editData(val) {
61 98
             if (val) {
62
-                this.ruleForm = val;
63 99
                 this.fileList = [];
64
-                this.ruleForm.temType = this.ruleForm.temType + '';
100
+            }
101
+        },
102
+        editVisable(val){
103
+            if(val){
104
+                this.getTemplateDetailFn({ id: this.editData.id })
65 105
             }
66 106
         }
67 107
     },
@@ -77,51 +117,90 @@ export default {
77 117
         cancel() {
78 118
             this.$emit("cancelEdit");
79 119
         },
80
-        handleChange(file, fileList) {
81
-            this.isImg = file.type === '.doc' || '.docx';
82
-            this.fileList = fileList;
83
-        },
84 120
         UploadUrl() {
85 121
             return window.location.origin + "/API/deptIdentify/updateTemplate";
86 122
         },
123
+        /**根据id查看详情*/
124
+        getTemplateDetailFn(data) {
125
+            getTemplateDetail(data).then(res => {
126
+                this.ruleForm = res;
127
+                this.submitForm.annexIds = [this.ruleForm.agreementFile.fileId,this.ruleForm.applicationFile.fileId,this.ruleForm.bookFile.fileId]
128
+                console.log(this.submitForm.annexIds,"PPPPPPPPPPPPPPPPPPPPPPPP");
129
+            })
130
+        },
87 131
         submitUpload() {
88
-            let that = this;
89 132
             this.$refs['ruleForm'].validate((valid) => {
90 133
                 if (valid) {
91
-                    if (that.fileList.length > 0) {
92
-                        that.filedata.id = that.editData.id;
93
-                        that.filedata.temName = that.ruleForm.temName;
94
-                        if (that.isImg) {
95
-                            that.$refs.upload.submit();
96
-                        } else {
97
-                            that.$message.error('只能上传doc,docx格式的文件')
134
+                    this.$refs['ruleForm'].validate((valid) => {
135
+                        if (valid) {
136
+                            this.submitForm.identifyId = this.ruleForm.identifyId;
137
+                            this.submitForm.temName = this.ruleForm.temName;
138
+                            this.submitForm.id = this.ruleForm.id;
139
+                            console.log(this.submitForm.annexIds,'ooooooooooooooooooooooooooooo');
140
+                            updateTemplate(this.submitForm).then(res => {
141
+                                this.$message.success('修改成功');
142
+                                this.$emit("cancelEdit");
143
+                                this.$emit('getList', this.queryParams);
144
+                            })
98 145
                         }
99
-                    } else {
100
-                        updateTemplate({
101
-                            id: that.editData.id,
102
-                            temName: that.ruleForm.temName
103
-                        }).then(res => {
104
-                            that.$message.success('修改成功');
105
-                            that.$emit("cancelEdit");
106
-                            that.$emit('getList', that.queryParams);
107
-                        })
108
-                    }
146
+                    });
109 147
                 }
110 148
             });
111 149
         },
150
+        handleChange(file, fileList) {
151
+            this.isImg = file.type === '.doc' || '.docx'
152
+        },
153
+        UploadUrl() {
154
+            return window.location.origin + "/API/deptIdentify/upload";
155
+        },
112 156
         handleRemove(file, fileList) {
113 157
             console.log(file, fileList);
114 158
         },
115
-        beforeUpload(file) {
116
-            // this.isImg = file.type === '.doc' || '.docx'
159
+        handleSuccess(res) {
160
+            this.$message.success('上传成功');
161
+            // this.submitForm.annexIds.push(res.annexId);
162
+            this.submitForm.annexIds[1] = res.annexId;
117 163
         },
118
-        handleSuccess() {
119
-            this.$message.success('修改成功');
120
-            this.$emit("cancelEdit");
121
-            this.$emit('getList', this.queryParams);
122
-        }
164
+
165
+        handleChangeA(file, fileList) {
166
+            this.isImg = file.type === '.doc' || '.docx'
167
+        },
168
+        UploadUrl() {
169
+            return window.location.origin + "/API/deptIdentify/upload";
170
+        },
171
+        handleRemoveA(file, fileList) {
172
+            console.log(file, fileList);
173
+        },
174
+        handleSuccessA(res) {
175
+            this.$message.success('上传成功');
176
+            // this.submitForm.annexIds.push(res.annexId);
177
+            this.submitForm.annexIds[0] = res.annexId;
178
+        },
179
+
180
+        handleChangeB(file, fileList) {
181
+            this.isImg = file.type === '.doc' || '.docx'
182
+        },
183
+        UploadUrl() {
184
+            return window.location.origin + "/API/deptIdentify/upload";
185
+        },
186
+        handleRemoveB(file, fileList) {
187
+            console.log(file, fileList);
188
+        },
189
+        handleSuccessB(res) {
190
+            this.$message.success('上传成功');
191
+            // this.submitForm.annexIds.push(res.annexId);
192
+            this.submitForm.annexIds[3] = res.annexId;
193
+        },
194
+        // handleSuccess() {
195
+        //     this.$message.success('修改成功');
196
+        //     this.$emit("cancelEdit");
197
+        //     this.$emit('getList', this.queryParams);
198
+        // }
123 199
     },
124 200
 };
125 201
 </script>
126 202
   
127
-<style lang="scss" scoped></style>
203
+<style lang="scss" scoped>
204
+.avatar-uploader {
205
+    margin-bottom: 20px;
206
+}</style>

+ 2
- 2
vue.config.js Просмотреть файл

@@ -12,9 +12,9 @@ const name = process.env.VUE_APP_TITLE || '调解系统' // 网页标题
12 12
 const port = process.env.port || process.env.npm_config_port || 80 // 端口
13 13
 
14 14
 // const API = 'http://121.40.189.20:9001'  //生产
15
-const API = 'http://121.40.189.20:6001'  //测试
15
+// const API = 'http://121.40.189.20:6001'  //测试
16 16
 // const API = 'http://192.168.3.18:6001'  //B
17
-// const API = 'http://192.168.3.77:6001' //Q
17
+const API = 'http://172.16.0.237:6001' //Q
18 18
 // const API = 'http://172.16.1.17:6001' //w
19 19
 
20 20
 // vue.config.js 配置说明