|
|
@@ -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>
|