|
1
|
<template>
|
1
|
<template>
|
|
2
|
<div class="app-container">
|
2
|
<div class="app-container">
|
|
3
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
3
|
+ <el-form
|
|
|
|
4
|
+ :model="queryParams"
|
|
|
|
5
|
+ ref="queryForm"
|
|
|
|
6
|
+ size="small"
|
|
|
|
7
|
+ :inline="true"
|
|
|
|
8
|
+ v-show="showSearch"
|
|
|
|
9
|
+ label-width="68px"
|
|
|
|
10
|
+ >
|
|
4
|
<el-form-item label="模板编号" prop="templateno">
|
11
|
<el-form-item label="模板编号" prop="templateno">
|
|
5
|
<el-input
|
12
|
<el-input
|
|
6
|
v-model="queryParams.templateno"
|
13
|
v-model="queryParams.templateno"
|
|
@@ -26,8 +33,16 @@ |
|
@@ -26,8 +33,16 @@ |
|
26
|
/>
|
33
|
/>
|
|
27
|
</el-form-item>
|
34
|
</el-form-item>
|
|
28
|
<el-form-item>
|
35
|
<el-form-item>
|
|
29
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
30
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
36
|
+ <el-button
|
|
|
|
37
|
+ type="primary"
|
|
|
|
38
|
+ icon="el-icon-search"
|
|
|
|
39
|
+ size="mini"
|
|
|
|
40
|
+ @click="handleQuery"
|
|
|
|
41
|
+ >搜索</el-button
|
|
|
|
42
|
+ >
|
|
|
|
43
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
44
|
+ >重置</el-button
|
|
|
|
45
|
+ >
|
|
31
|
</el-form-item>
|
46
|
</el-form-item>
|
|
32
|
</el-form>
|
47
|
</el-form>
|
|
33
|
|
48
|
|
|
@@ -40,7 +55,8 @@ |
|
@@ -40,7 +55,8 @@ |
|
40
|
size="mini"
|
55
|
size="mini"
|
|
41
|
@click="handleAdd"
|
56
|
@click="handleAdd"
|
|
42
|
v-hasPermi="['system:contracttemplate:add']"
|
57
|
v-hasPermi="['system:contracttemplate:add']"
|
|
43
|
- >新增</el-button>
|
58
|
+ >新增</el-button
|
|
|
|
59
|
+ >
|
|
44
|
</el-col>
|
60
|
</el-col>
|
|
45
|
<el-col :span="1.5">
|
61
|
<el-col :span="1.5">
|
|
46
|
<el-button
|
62
|
<el-button
|
|
@@ -51,7 +67,8 @@ |
|
@@ -51,7 +67,8 @@ |
|
51
|
:disabled="single"
|
67
|
:disabled="single"
|
|
52
|
@click="handleUpdate"
|
68
|
@click="handleUpdate"
|
|
53
|
v-hasPermi="['system:contracttemplate:edit']"
|
69
|
v-hasPermi="['system:contracttemplate:edit']"
|
|
54
|
- >修改</el-button>
|
70
|
+ >修改</el-button
|
|
|
|
71
|
+ >
|
|
55
|
</el-col>
|
72
|
</el-col>
|
|
56
|
<el-col :span="1.5">
|
73
|
<el-col :span="1.5">
|
|
57
|
<el-button
|
74
|
<el-button
|
|
@@ -62,7 +79,8 @@ |
|
@@ -62,7 +79,8 @@ |
|
62
|
:disabled="multiple"
|
79
|
:disabled="multiple"
|
|
63
|
@click="handleDelete"
|
80
|
@click="handleDelete"
|
|
64
|
v-hasPermi="['system:contracttemplate:remove']"
|
81
|
v-hasPermi="['system:contracttemplate:remove']"
|
|
65
|
- >删除</el-button>
|
82
|
+ >删除</el-button
|
|
|
|
83
|
+ >
|
|
66
|
</el-col>
|
84
|
</el-col>
|
|
67
|
<el-col :span="1.5">
|
85
|
<el-col :span="1.5">
|
|
68
|
<el-button
|
86
|
<el-button
|
|
@@ -72,23 +90,41 @@ |
|
@@ -72,23 +90,41 @@ |
|
72
|
size="mini"
|
90
|
size="mini"
|
|
73
|
@click="handleExport"
|
91
|
@click="handleExport"
|
|
74
|
v-hasPermi="['system:contracttemplate:export']"
|
92
|
v-hasPermi="['system:contracttemplate:export']"
|
|
75
|
- >导出</el-button>
|
93
|
+ >导出</el-button
|
|
|
|
94
|
+ >
|
|
76
|
</el-col>
|
95
|
</el-col>
|
|
77
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
96
|
+ <right-toolbar
|
|
|
|
97
|
+ :showSearch.sync="showSearch"
|
|
|
|
98
|
+ @queryTable="getList"
|
|
|
|
99
|
+ ></right-toolbar>
|
|
78
|
</el-row>
|
100
|
</el-row>
|
|
79
|
|
101
|
|
|
80
|
- <el-table v-loading="loading" :data="contracttemplateList" @selection-change="handleSelectionChange">
|
102
|
+ <el-table
|
|
|
|
103
|
+ v-loading="loading"
|
|
|
|
104
|
+ :data="contracttemplateList"
|
|
|
|
105
|
+ @selection-change="handleSelectionChange"
|
|
|
|
106
|
+ >
|
|
81
|
<el-table-column type="selection" width="55" align="center" />
|
107
|
<el-table-column type="selection" width="55" align="center" />
|
|
82
|
<el-table-column label="模板编号" align="center" prop="templateno" />
|
108
|
<el-table-column label="模板编号" align="center" prop="templateno" />
|
|
83
|
<el-table-column label="模板名称" align="center" prop="templatename" />
|
109
|
<el-table-column label="模板名称" align="center" prop="templatename" />
|
|
84
|
- <el-table-column label="模板文件" align="center" prop="templatefile" >
|
110
|
+ <el-table-column label="模板文件" align="center" prop="templatefile">
|
|
85
|
<template slot-scope="scope">
|
111
|
<template slot-scope="scope">
|
|
86
|
- <a href="#" @click="showImage(scope.row.templatefile)" style="color: blue;cursor: pointer;">{{ scope.row.templatefile }}</a>
|
|
|
|
87
|
- </template>
|
112
|
+ <el-button type="text" icon="el-icon-document" @click="openFile(scope.row.templatefile)">
|
|
|
|
113
|
+ 打开文件
|
|
|
|
114
|
+ </el-button>
|
|
|
|
115
|
+ </template>
|
|
88
|
</el-table-column>
|
116
|
</el-table-column>
|
|
89
|
- <el-table-column label="模板类别" align="center" prop="templatecategory" />
|
|
|
|
90
|
- <!-- <el-table-column label="" align="center" prop="id" v-if="true"/> -->
|
|
|
|
91
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
117
|
+ <el-table-column
|
|
|
|
118
|
+ label="模板类别"
|
|
|
|
119
|
+ align="center"
|
|
|
|
120
|
+ prop="templatecategory"
|
|
|
|
121
|
+ />
|
|
|
|
122
|
+ <!-- <el-table-column label="" align="center" prop="id" v-if="true"/> -->
|
|
|
|
123
|
+ <el-table-column
|
|
|
|
124
|
+ label="操作"
|
|
|
|
125
|
+ align="center"
|
|
|
|
126
|
+ class-name="small-padding fixed-width"
|
|
|
|
127
|
+ >
|
|
92
|
<template slot-scope="scope">
|
128
|
<template slot-scope="scope">
|
|
93
|
<el-button
|
129
|
<el-button
|
|
94
|
size="mini"
|
130
|
size="mini"
|
|
@@ -96,29 +132,38 @@ |
|
@@ -96,29 +132,38 @@ |
|
96
|
icon="el-icon-edit"
|
132
|
icon="el-icon-edit"
|
|
97
|
@click="handleUpdate(scope.row)"
|
133
|
@click="handleUpdate(scope.row)"
|
|
98
|
v-hasPermi="['system:contracttemplate:edit']"
|
134
|
v-hasPermi="['system:contracttemplate:edit']"
|
|
99
|
- >修改</el-button>
|
135
|
+ >修改</el-button
|
|
|
|
136
|
+ >
|
|
100
|
<el-button
|
137
|
<el-button
|
|
101
|
size="mini"
|
138
|
size="mini"
|
|
102
|
type="text"
|
139
|
type="text"
|
|
103
|
icon="el-icon-delete"
|
140
|
icon="el-icon-delete"
|
|
104
|
@click="handleDelete(scope.row)"
|
141
|
@click="handleDelete(scope.row)"
|
|
105
|
v-hasPermi="['system:contracttemplate:remove']"
|
142
|
v-hasPermi="['system:contracttemplate:remove']"
|
|
106
|
- >删除</el-button>
|
143
|
+ >删除</el-button
|
|
|
|
144
|
+ >
|
|
107
|
</template>
|
145
|
</template>
|
|
108
|
</el-table-column>
|
146
|
</el-table-column>
|
|
109
|
</el-table>
|
147
|
</el-table>
|
|
110
|
- <!-- 在页面外部定义弹窗组件 -->
|
|
|
|
111
|
- <el-dialog :visible.sync="dialogVisible">
|
|
|
|
112
|
- <img :src="dialogImageUrl" alt="图片预览" style="width: 100%;">
|
|
|
|
113
|
-</el-dialog>
|
148
|
+ <!-- 在页面外部定义弹窗组件 -->
|
|
|
|
149
|
+ <el-dialog :visible.sync="dialogVisible">
|
|
|
|
150
|
+ <img :src="dialogImageUrl" alt="图片预览" style="width: 100%" />
|
|
|
|
151
|
+ </el-dialog>
|
|
114
|
<pagination
|
152
|
<pagination
|
|
115
|
- v-show="total>0"
|
153
|
+ v-show="total > 0"
|
|
116
|
:total="total"
|
154
|
:total="total"
|
|
117
|
:page.sync="queryParams.pageNum"
|
155
|
:page.sync="queryParams.pageNum"
|
|
118
|
:limit.sync="queryParams.pageSize"
|
156
|
:limit.sync="queryParams.pageSize"
|
|
119
|
@pagination="getList"
|
157
|
@pagination="getList"
|
|
120
|
/>
|
158
|
/>
|
|
121
|
|
159
|
|
|
|
|
160
|
+ <el-dialog :visible.sync="dialogVisible" title="文件预览" width="50%">
|
|
|
|
161
|
+ <vue-pdf :src="currentFile" />
|
|
|
|
162
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
163
|
+ <el-button @click="dialogVisible = false">关闭</el-button>
|
|
|
|
164
|
+ </span>
|
|
|
|
165
|
+ </el-dialog>
|
|
|
|
166
|
+
|
|
122
|
<!-- 添加或修改【请填写功能名称】对话框 -->
|
167
|
<!-- 添加或修改【请填写功能名称】对话框 -->
|
|
123
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
168
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
124
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
169
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
@@ -129,14 +174,52 @@ |
|
@@ -129,14 +174,52 @@ |
|
129
|
<el-input v-model="form.templatename" placeholder="请输入模板名称" />
|
174
|
<el-input v-model="form.templatename" placeholder="请输入模板名称" />
|
|
130
|
</el-form-item>
|
175
|
</el-form-item>
|
|
131
|
<el-form-item label="模板文件" prop="templatefile">
|
176
|
<el-form-item label="模板文件" prop="templatefile">
|
|
132
|
- <file-upload v-model="form.templatefile"/>
|
177
|
+ <!-- <file-upload v-model="form.templatefile"/> -->
|
|
|
|
178
|
+ <el-upload
|
|
|
|
179
|
+ class="upload-demo"
|
|
|
|
180
|
+ ref="upload"
|
|
|
|
181
|
+ :accept="'application/pdf'"
|
|
|
|
182
|
+ :before-upload="beforeUpload"
|
|
|
|
183
|
+ :action="this.url"
|
|
|
|
184
|
+ :headers="this.headers"
|
|
|
|
185
|
+ :on-preview="handlePreview"
|
|
|
|
186
|
+ :on-remove="handleRemove"
|
|
|
|
187
|
+ :on-change="handleChange"
|
|
|
|
188
|
+ :file-list="this.fileList"
|
|
|
|
189
|
+ :auto-upload="false"
|
|
|
|
190
|
+ :limit="1"
|
|
|
|
191
|
+ :multiple="false"
|
|
|
|
192
|
+ :on-success="handleSuccess"
|
|
|
|
193
|
+ :before-remove="beforeRemove"
|
|
|
|
194
|
+ :on-exceed="handleExceed"
|
|
|
|
195
|
+ name="files"
|
|
|
|
196
|
+ >
|
|
|
|
197
|
+ <el-button slot="trigger" size="small" type="primary"
|
|
|
|
198
|
+ >选取文件</el-button
|
|
|
|
199
|
+ >
|
|
|
|
200
|
+ <el-button
|
|
|
|
201
|
+ style="margin-left: 10px"
|
|
|
|
202
|
+ size="small"
|
|
|
|
203
|
+ type="success"
|
|
|
|
204
|
+ @click="submitUpload"
|
|
|
|
205
|
+ >上传到服务器</el-button
|
|
|
|
206
|
+ >
|
|
|
|
207
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
|
208
|
+ 只能上传大小不超过 5MB 的 PDF 文件
|
|
|
|
209
|
+ </div>
|
|
|
|
210
|
+ </el-upload>
|
|
133
|
</el-form-item>
|
211
|
</el-form-item>
|
|
134
|
<el-form-item label="模板类别" prop="templatecategory">
|
212
|
<el-form-item label="模板类别" prop="templatecategory">
|
|
135
|
- <el-input v-model="form.templatecategory" placeholder="请输入模板类别" />
|
213
|
+ <el-input
|
|
|
|
214
|
+ v-model="form.templatecategory"
|
|
|
|
215
|
+ placeholder="请输入模板类别"
|
|
|
|
216
|
+ />
|
|
136
|
</el-form-item>
|
217
|
</el-form-item>
|
|
137
|
</el-form>
|
218
|
</el-form>
|
|
138
|
<div slot="footer" class="dialog-footer">
|
219
|
<div slot="footer" class="dialog-footer">
|
|
139
|
- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
220
|
+ <el-button :loading="buttonLoading" type="primary" @click="submitForm"
|
|
|
|
221
|
+ >确 定</el-button
|
|
|
|
222
|
+ >
|
|
140
|
<el-button @click="cancel">取 消</el-button>
|
223
|
<el-button @click="cancel">取 消</el-button>
|
|
141
|
</div>
|
224
|
</div>
|
|
142
|
</el-dialog>
|
225
|
</el-dialog>
|
|
@@ -144,14 +227,32 @@ |
|
@@ -144,14 +227,32 @@ |
|
144
|
</template>
|
227
|
</template>
|
|
145
|
|
228
|
|
|
146
|
<script>
|
229
|
<script>
|
|
147
|
-import { listContracttemplate, getContracttemplate, delContracttemplate, addContracttemplate, updateContracttemplate } from "@/api/compliancemanagement/contracttemplate";
|
|
|
|
148
|
-
|
230
|
+import {
|
|
|
|
231
|
+ listContracttemplate,
|
|
|
|
232
|
+ getContracttemplate,
|
|
|
|
233
|
+ delContracttemplate,
|
|
|
|
234
|
+ addContracttemplate,
|
|
|
|
235
|
+ updateContracttemplate,
|
|
|
|
236
|
+} from "@/api/compliancemanagement/contracttemplate";
|
|
|
|
237
|
+import { getToken } from "@/utils/auth";
|
|
|
|
238
|
+import VuePdf from 'vue-pdf';
|
|
|
|
239
|
+import axios from "axios";
|
|
149
|
export default {
|
240
|
export default {
|
|
|
|
241
|
+ components: {
|
|
|
|
242
|
+ VuePdf
|
|
|
|
243
|
+ },
|
|
150
|
name: "Contracttemplate",
|
244
|
name: "Contracttemplate",
|
|
151
|
data() {
|
245
|
data() {
|
|
152
|
return {
|
246
|
return {
|
|
153
|
- dialogVisible: false,
|
|
|
|
154
|
- dialogImageUrl: '',
|
247
|
+ dialogVisible: false,
|
|
|
|
248
|
+ currentFile: '',
|
|
|
|
249
|
+ // 设置上传的请求头部
|
|
|
|
250
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
251
|
+ // 上传的地址
|
|
|
|
252
|
+ url: process.env.VUE_APP_BASE_API + "/common/uploads",
|
|
|
|
253
|
+ fileList: [],
|
|
|
|
254
|
+ dialogVisible: false,
|
|
|
|
255
|
+ dialogImageUrl: "",
|
|
155
|
// 按钮loading
|
256
|
// 按钮loading
|
|
156
|
buttonLoading: false,
|
257
|
buttonLoading: false,
|
|
157
|
// 遮罩层
|
258
|
// 遮罩层
|
|
@@ -182,39 +283,95 @@ export default { |
|
@@ -182,39 +283,95 @@ export default { |
|
182
|
templatecategory: undefined,
|
283
|
templatecategory: undefined,
|
|
183
|
},
|
284
|
},
|
|
184
|
// 表单参数
|
285
|
// 表单参数
|
|
185
|
- form: {},
|
286
|
+ form: {
|
|
|
|
287
|
+ },
|
|
|
|
288
|
+ file: [],
|
|
186
|
// 表单校验
|
289
|
// 表单校验
|
|
187
|
rules: {
|
290
|
rules: {
|
|
188
|
templateno: [
|
291
|
templateno: [
|
|
189
|
- { required: true, message: "模板编号不能为空", trigger: "blur" }
|
292
|
+ { required: true, message: "模板编号不能为空", trigger: "blur" },
|
|
190
|
],
|
293
|
],
|
|
191
|
templatename: [
|
294
|
templatename: [
|
|
192
|
- { required: true, message: "模板名称不能为空", trigger: "blur" }
|
295
|
+ { required: true, message: "模板名称不能为空", trigger: "blur" },
|
|
193
|
],
|
296
|
],
|
|
194
|
templatefile: [
|
297
|
templatefile: [
|
|
195
|
- { required: true, message: "模板文件不能为空", trigger: "blur" }
|
298
|
+ { required: true, message: "模板文件不能为空,请上传", trigger: "blur" },
|
|
196
|
],
|
299
|
],
|
|
197
|
templatecategory: [
|
300
|
templatecategory: [
|
|
198
|
- { required: true, message: "模板类别不能为空", trigger: "blur" }
|
301
|
+ { required: true, message: "模板类别不能为空", trigger: "blur" },
|
|
199
|
],
|
302
|
],
|
|
200
|
- id: [
|
|
|
|
201
|
- { required: true, message: "不能为空", trigger: "blur" }
|
|
|
|
202
|
- ],
|
|
|
|
203
|
- }
|
303
|
+ id: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
|
304
|
+ },
|
|
204
|
};
|
305
|
};
|
|
205
|
},
|
306
|
},
|
|
206
|
created() {
|
307
|
created() {
|
|
207
|
this.getList();
|
308
|
this.getList();
|
|
208
|
},
|
309
|
},
|
|
209
|
methods: {
|
310
|
methods: {
|
|
210
|
- showImage(imageUrl) {
|
|
|
|
211
|
- this.dialogImageUrl = imageUrl;
|
|
|
|
212
|
- this.dialogVisible = true;
|
311
|
+ openFile(filePath) {
|
|
|
|
312
|
+ console.log(filePath)
|
|
|
|
313
|
+ this.currentFile = filePath;
|
|
|
|
314
|
+ this.dialogVisible = true;
|
|
|
|
315
|
+
|
|
|
|
316
|
+ },
|
|
|
|
317
|
+ beforeUpload(file) {
|
|
|
|
318
|
+ const isPDF = file.type === 'application/pdf';
|
|
|
|
319
|
+ const isLt5M = file.size / 1024 / 1024 < 5;
|
|
|
|
320
|
+
|
|
|
|
321
|
+ if (!isPDF) {
|
|
|
|
322
|
+ this.$message.error('只能上传 PDF 文件');
|
|
|
|
323
|
+ return false;
|
|
|
|
324
|
+ }
|
|
|
|
325
|
+ if (!isLt5M) {
|
|
|
|
326
|
+ this.$message.error('上传文件大小不能超过 5MB');
|
|
|
|
327
|
+ return false;
|
|
|
|
328
|
+ }
|
|
|
|
329
|
+
|
|
|
|
330
|
+ // 如果需要其他处理,可以在这里添加
|
|
|
|
331
|
+
|
|
|
|
332
|
+ return true; // 返回 true 允许上传
|
|
213
|
},
|
333
|
},
|
|
|
|
334
|
+ handleChange(file, fileList) {
|
|
|
|
335
|
+ this.fileList = fileList;
|
|
|
|
336
|
+ },
|
|
|
|
337
|
+ handleSuccess(response, file, fileList) {
|
|
|
|
338
|
+ // response 是上传成功后的响应数据
|
|
|
|
339
|
+ // 可以从中获取文件地址或文件名
|
|
|
|
340
|
+ // 假设后端返回的数据结构中有一个字段 url 表示文件地址
|
|
|
|
341
|
+ const fileUrl = response.data.fileNames;
|
|
|
|
342
|
+
|
|
|
|
343
|
+ // 将文件地址或文件名赋值给表单的字段
|
|
|
|
344
|
+ this.form.templatefile =fileUrl;
|
|
|
|
345
|
+ },
|
|
|
|
346
|
+ handleRemove(file, fileList) {
|
|
|
|
347
|
+ this.form.templatefile=''
|
|
|
|
348
|
+ console.log(file, fileList);
|
|
|
|
349
|
+ },
|
|
|
|
350
|
+ handlePreview(file) {
|
|
|
|
351
|
+ console.log(file);
|
|
|
|
352
|
+ },
|
|
|
|
353
|
+ handleExceed(files, fileList) {
|
|
|
|
354
|
+ this.$message.warning(
|
|
|
|
355
|
+ `当前限制上传 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
|
356
|
+ files.length + fileList.length
|
|
|
|
357
|
+ } 个文件`
|
|
|
|
358
|
+ );
|
|
|
|
359
|
+ },
|
|
|
|
360
|
+ beforeRemove(file, fileList) {
|
|
|
|
361
|
+ this.fileList = fileList;
|
|
|
|
362
|
+ if (file && file.status==="success") {
|
|
|
|
363
|
+ return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
|
364
|
+ }
|
|
|
|
365
|
+
|
|
|
|
366
|
+ },
|
|
|
|
367
|
+ showImage(imageUrl) {
|
|
|
|
368
|
+ this.dialogImageUrl = imageUrl;
|
|
|
|
369
|
+ this.dialogVisible = true;
|
|
|
|
370
|
+ },
|
|
214
|
/** 查询【请填写功能名称】列表 */
|
371
|
/** 查询【请填写功能名称】列表 */
|
|
215
|
getList() {
|
372
|
getList() {
|
|
216
|
this.loading = true;
|
373
|
this.loading = true;
|
|
217
|
- listContracttemplate(this.queryParams).then(response => {
|
374
|
+ listContracttemplate(this.queryParams).then((response) => {
|
|
218
|
this.contracttemplateList = response.rows;
|
375
|
this.contracttemplateList = response.rows;
|
|
219
|
this.total = response.total;
|
376
|
this.total = response.total;
|
|
220
|
this.loading = false;
|
377
|
this.loading = false;
|
|
@@ -236,7 +393,7 @@ export default { |
|
@@ -236,7 +393,7 @@ export default { |
|
236
|
createBy: undefined,
|
393
|
createBy: undefined,
|
|
237
|
createTime: undefined,
|
394
|
createTime: undefined,
|
|
238
|
updateBy: undefined,
|
395
|
updateBy: undefined,
|
|
239
|
- updateTime: undefined
|
396
|
+ updateTime: undefined,
|
|
240
|
};
|
397
|
};
|
|
241
|
this.resetForm("form");
|
398
|
this.resetForm("form");
|
|
242
|
},
|
399
|
},
|
|
@@ -252,9 +409,9 @@ export default { |
|
@@ -252,9 +409,9 @@ export default { |
|
252
|
},
|
409
|
},
|
|
253
|
// 多选框选中数据
|
410
|
// 多选框选中数据
|
|
254
|
handleSelectionChange(selection) {
|
411
|
handleSelectionChange(selection) {
|
|
255
|
- this.ids = selection.map(item => item.id)
|
|
|
|
256
|
- this.single = selection.length!==1
|
|
|
|
257
|
- this.multiple = !selection.length
|
412
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
413
|
+ this.single = selection.length !== 1;
|
|
|
|
414
|
+ this.multiple = !selection.length;
|
|
258
|
},
|
415
|
},
|
|
259
|
/** 新增按钮操作 */
|
416
|
/** 新增按钮操作 */
|
|
260
|
handleAdd() {
|
417
|
handleAdd() {
|
|
@@ -266,35 +423,48 @@ export default { |
|
@@ -266,35 +423,48 @@ export default { |
|
266
|
handleUpdate(row) {
|
423
|
handleUpdate(row) {
|
|
267
|
this.loading = true;
|
424
|
this.loading = true;
|
|
268
|
this.reset();
|
425
|
this.reset();
|
|
269
|
- const id = row.id || this.ids
|
|
|
|
270
|
- getContracttemplate(id).then(response => {
|
426
|
+ const id = row.id || this.ids;
|
|
|
|
427
|
+ getContracttemplate(id).then((response) => {
|
|
271
|
this.loading = false;
|
428
|
this.loading = false;
|
|
272
|
this.form = response.data;
|
429
|
this.form = response.data;
|
|
273
|
this.open = true;
|
430
|
this.open = true;
|
|
274
|
this.title = "修改";
|
431
|
this.title = "修改";
|
|
275
|
});
|
432
|
});
|
|
276
|
},
|
433
|
},
|
|
|
|
434
|
+ submitUpload() {
|
|
|
|
435
|
+ // 手动触发上传操作
|
|
|
|
436
|
+ // this.$refs.upload.submit()
|
|
|
|
437
|
+ // 构建 FormData 对象
|
|
|
|
438
|
+ this.$refs.upload.submit()
|
|
|
|
439
|
+ },
|
|
277
|
/** 提交按钮 */
|
440
|
/** 提交按钮 */
|
|
278
|
submitForm() {
|
441
|
submitForm() {
|
|
279
|
- this.$refs["form"].validate(valid => {
|
442
|
+ console.log("文件名:", this.form.templatefile);
|
|
|
|
443
|
+ this.$refs["form"].validate((valid) => {
|
|
280
|
if (valid) {
|
444
|
if (valid) {
|
|
281
|
this.buttonLoading = true;
|
445
|
this.buttonLoading = true;
|
|
282
|
if (this.form.id != null) {
|
446
|
if (this.form.id != null) {
|
|
283
|
- updateContracttemplate(this.form).then(response => {
|
|
|
|
284
|
- this.$modal.msgSuccess("修改成功");
|
|
|
|
285
|
- this.open = false;
|
|
|
|
286
|
- this.getList();
|
|
|
|
287
|
- }).finally(() => {
|
|
|
|
288
|
- this.buttonLoading = false;
|
|
|
|
289
|
- });
|
447
|
+ updateContracttemplate(this.form)
|
|
|
|
448
|
+ .then((response) => {
|
|
|
|
449
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
|
450
|
+ this.open = false;
|
|
|
|
451
|
+ this.fileList = [];
|
|
|
|
452
|
+ this.getList();
|
|
|
|
453
|
+ })
|
|
|
|
454
|
+ .finally(() => {
|
|
|
|
455
|
+ this.buttonLoading = false;
|
|
|
|
456
|
+ });
|
|
290
|
} else {
|
457
|
} else {
|
|
291
|
- addContracttemplate(this.form).then(response => {
|
|
|
|
292
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
293
|
- this.open = false;
|
|
|
|
294
|
- this.getList();
|
|
|
|
295
|
- }).finally(() => {
|
|
|
|
296
|
- this.buttonLoading = false;
|
|
|
|
297
|
- });
|
458
|
+ addContracttemplate(this.form)
|
|
|
|
459
|
+ .then((response) => {
|
|
|
|
460
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
|
461
|
+ this.open = false;
|
|
|
|
462
|
+ this.fileList = [];
|
|
|
|
463
|
+ this.getList();
|
|
|
|
464
|
+ })
|
|
|
|
465
|
+ .finally(() => {
|
|
|
|
466
|
+ this.buttonLoading = false;
|
|
|
|
467
|
+ });
|
|
298
|
}
|
468
|
}
|
|
299
|
}
|
469
|
}
|
|
300
|
});
|
470
|
});
|
|
@@ -302,24 +472,32 @@ export default { |
|
@@ -302,24 +472,32 @@ export default { |
|
302
|
/** 删除按钮操作 */
|
472
|
/** 删除按钮操作 */
|
|
303
|
handleDelete(row) {
|
473
|
handleDelete(row) {
|
|
304
|
const ids = row.id || this.ids;
|
474
|
const ids = row.id || this.ids;
|
|
305
|
- this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(() => {
|
|
|
|
306
|
- this.loading = true;
|
|
|
|
307
|
- return delContracttemplate(ids);
|
|
|
|
308
|
- }).then(() => {
|
|
|
|
309
|
- this.loading = false;
|
|
|
|
310
|
- this.getList();
|
|
|
|
311
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
312
|
- }).catch(() => {
|
|
|
|
313
|
- }).finally(() => {
|
|
|
|
314
|
- this.loading = false;
|
|
|
|
315
|
- });
|
475
|
+ this.$modal
|
|
|
|
476
|
+ .confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?')
|
|
|
|
477
|
+ .then(() => {
|
|
|
|
478
|
+ this.loading = true;
|
|
|
|
479
|
+ return delContracttemplate(ids);
|
|
|
|
480
|
+ })
|
|
|
|
481
|
+ .then(() => {
|
|
|
|
482
|
+ this.loading = false;
|
|
|
|
483
|
+ this.getList();
|
|
|
|
484
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
485
|
+ })
|
|
|
|
486
|
+ .catch(() => {})
|
|
|
|
487
|
+ .finally(() => {
|
|
|
|
488
|
+ this.loading = false;
|
|
|
|
489
|
+ });
|
|
316
|
},
|
490
|
},
|
|
317
|
/** 导出按钮操作 */
|
491
|
/** 导出按钮操作 */
|
|
318
|
handleExport() {
|
492
|
handleExport() {
|
|
319
|
- this.download('system/contracttemplate/export', {
|
|
|
|
320
|
- ...this.queryParams
|
|
|
|
321
|
- }, `contracttemplate_${new Date().getTime()}.xlsx`)
|
|
|
|
322
|
- }
|
|
|
|
323
|
- }
|
493
|
+ this.download(
|
|
|
|
494
|
+ "system/contracttemplate/export",
|
|
|
|
495
|
+ {
|
|
|
|
496
|
+ ...this.queryParams,
|
|
|
|
497
|
+ },
|
|
|
|
498
|
+ `contracttemplate_${new Date().getTime()}.xlsx`
|
|
|
|
499
|
+ );
|
|
|
|
500
|
+ },
|
|
|
|
501
|
+ },
|
|
324
|
};
|
502
|
};
|
|
325
|
</script> |
503
|
</script> |