提交 | 用户 | 时间
|
bf64f6
|
1 |
<template> |
A |
2 |
<div class="app-container"> |
|
3 |
<el-card class="box-card"> |
|
4 |
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
fb3e08
|
5 |
<el-form-item label-width="120" label="供应商名称" prop="remarks"> |
A |
6 |
<el-input |
|
7 |
v-model="queryParams.remarks" |
|
8 |
placeholder="请输入供应商名称" |
|
9 |
clearable |
|
10 |
@keyup.enter.native="handleQuery" |
|
11 |
/> |
|
12 |
</el-form-item> |
bf64f6
|
13 |
<el-form-item label="厂商代码" prop="mfCode"> |
A |
14 |
<el-input |
|
15 |
v-model="queryParams.mfCode" |
|
16 |
placeholder="请输入厂商代码" |
|
17 |
clearable |
|
18 |
@keyup.enter.native="handleQuery" |
|
19 |
/> |
|
20 |
</el-form-item> |
fb3e08
|
21 |
<el-form-item label-width="120" label="产品类型代码" prop="proTypeCode"> |
bf64f6
|
22 |
<el-input |
A |
23 |
v-model="queryParams.proTypeCode" |
|
24 |
placeholder="请输入产品类型代码" |
|
25 |
clearable |
|
26 |
@keyup.enter.native="handleQuery" |
|
27 |
/> |
|
28 |
</el-form-item> |
|
29 |
<el-form-item style="float: right"> |
|
30 |
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
31 |
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
32 |
</el-form-item> |
|
33 |
</el-form> |
|
34 |
</el-card> |
|
35 |
|
|
36 |
<el-card style="margin-top: 10px" class="box-card"> |
|
37 |
<el-row :gutter="10" class="mb8"> |
|
38 |
<el-col :span="1.5"> |
|
39 |
<el-button |
|
40 |
type="primary" |
|
41 |
plain |
|
42 |
icon="el-icon-plus" |
|
43 |
size="mini" |
|
44 |
@click="handleAdd" |
|
45 |
v-hasPermi="['da:psConf:add']" |
|
46 |
>新增</el-button> |
|
47 |
</el-col> |
|
48 |
<el-col :span="1.5"> |
|
49 |
<el-button |
|
50 |
type="success" |
|
51 |
plain |
|
52 |
icon="el-icon-edit" |
|
53 |
size="mini" |
|
54 |
:disabled="single" |
|
55 |
@click="handleUpdate" |
|
56 |
v-hasPermi="['da:psConf:edit']" |
|
57 |
>修改</el-button> |
|
58 |
</el-col> |
|
59 |
<el-col :span="1.5"> |
|
60 |
<el-button |
|
61 |
type="danger" |
|
62 |
plain |
|
63 |
icon="el-icon-delete" |
|
64 |
size="mini" |
|
65 |
:disabled="multiple" |
|
66 |
@click="handleDelete" |
|
67 |
v-hasPermi="['da:psConf:remove']" |
|
68 |
>删除</el-button> |
|
69 |
</el-col> |
|
70 |
<el-col :span="1.5"> |
|
71 |
<el-button |
|
72 |
type="warning" |
|
73 |
plain |
|
74 |
icon="el-icon-download" |
|
75 |
size="mini" |
|
76 |
@click="handleExport" |
|
77 |
v-hasPermi="['da:psConf:export']" |
|
78 |
>导出</el-button> |
|
79 |
</el-col> |
|
80 |
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
81 |
</el-row> |
|
82 |
|
|
83 |
<el-table border v-loading="loading" :data="psConfList" @selection-change="handleSelectionChange"> |
|
84 |
<el-table-column type="selection" width="55" align="center" /> |
7402d6
|
85 |
<el-table-column label="供应商识别码" align="center" prop="spareField1"> |
C |
86 |
</el-table-column> |
|
87 |
<el-table-column label="供应商名称" align="center" prop="remarks"> |
|
88 |
</el-table-column> |
bf64f6
|
89 |
<el-table-column label="厂商代码" align="center" prop="mfCode"> |
A |
90 |
</el-table-column> |
|
91 |
<el-table-column label="产品类型代码" align="center" prop="proTypeCode"> |
|
92 |
</el-table-column> |
|
93 |
<el-table-column label="电池类型代码" align="center" prop="batteryTypeCode"> |
|
94 |
</el-table-column> |
|
95 |
<el-table-column label="规格代码" align="center" prop="specificationsCode"> |
|
96 |
</el-table-column> |
|
97 |
<el-table-column label="追溯信息代码" align="center" prop="traceInfoCode"> |
|
98 |
</el-table-column> |
|
99 |
<el-table-column label="生产日期代码" align="center" prop="proDateCode"> |
|
100 |
</el-table-column> |
|
101 |
<el-table-column label="序列号" align="center" prop="sfcCode"> |
|
102 |
</el-table-column> |
7402d6
|
103 |
<el-table-column label="状态 (启用1,禁用0)" align="center" prop="state"> |
bf64f6
|
104 |
</el-table-column> |
7402d6
|
105 |
|
C |
106 |
<!-- <el-table-column label="预留字段2" align="center" prop="spareField2"> |
bf64f6
|
107 |
</el-table-column> |
A |
108 |
<el-table-column label="创建用户" align="center" prop="createUser"> |
|
109 |
</el-table-column> |
|
110 |
<el-table-column label="更改用户" align="center" prop="updateUser"> |
7402d6
|
111 |
</el-table-column>--> |
bf64f6
|
112 |
<el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width"> |
A |
113 |
<template slot-scope="scope"> |
|
114 |
<el-button |
|
115 |
size="mini" |
|
116 |
type="success" |
|
117 |
plain |
|
118 |
style="width: 72px" |
|
119 |
icon="el-icon-edit" |
|
120 |
@click="handleUpdate(scope.row)" |
|
121 |
v-hasPermi="['da:psConf:edit']" |
|
122 |
>修改</el-button> |
|
123 |
<el-button |
|
124 |
size="mini" |
|
125 |
type="danger" |
|
126 |
plain |
|
127 |
style="width: 72px" |
|
128 |
icon="el-icon-delete" |
|
129 |
@click="handleDelete(scope.row)" |
|
130 |
v-hasPermi="['da:psConf:remove']" |
|
131 |
>删除</el-button> |
|
132 |
</template> |
|
133 |
</el-table-column> |
|
134 |
</el-table> |
|
135 |
</el-card> |
|
136 |
|
|
137 |
<pagination |
|
138 |
v-show="total>0" |
|
139 |
:total="total" |
|
140 |
:page.sync="queryParams.pageNum" |
|
141 |
:limit.sync="queryParams.pageSize" |
|
142 |
@pagination="getList" |
|
143 |
/> |
|
144 |
|
|
145 |
<!-- 添加或修改1P1S配置对话框 --> |
7402d6
|
146 |
<el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="600px" append-to-body> |
bf64f6
|
147 |
<span slot="title"> |
A |
148 |
<i class="el-icon-s-order"></i> |
|
149 |
{{titleName}} |
|
150 |
</span> |
7402d6
|
151 |
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
C |
152 |
<el-form-item label="供应商识别码" prop="spareField1"> |
|
153 |
<el-input v-model="form.spareField1" placeholder="请输入供应商识别码" /> |
|
154 |
</el-form-item> |
|
155 |
<el-form-item label="供应商名称" prop="remarks"> |
|
156 |
<el-input v-model="form.remarks" placeholder="请输入供应商名称" /> |
|
157 |
</el-form-item> |
bf64f6
|
158 |
<el-form-item label="厂商代码" prop="mfCode"> |
A |
159 |
<el-input v-model="form.mfCode" placeholder="请输入厂商代码" /> |
|
160 |
</el-form-item> |
|
161 |
<el-form-item label="产品类型代码" prop="proTypeCode"> |
|
162 |
<el-input v-model="form.proTypeCode" placeholder="请输入产品类型代码" /> |
|
163 |
</el-form-item> |
|
164 |
<el-form-item label="电池类型代码" prop="batteryTypeCode"> |
|
165 |
<el-input v-model="form.batteryTypeCode" placeholder="请输入电池类型代码" /> |
|
166 |
</el-form-item> |
|
167 |
<el-form-item label="规格代码" prop="specificationsCode"> |
|
168 |
<el-input v-model="form.specificationsCode" placeholder="请输入规格代码" /> |
|
169 |
</el-form-item> |
|
170 |
<el-form-item label="追溯信息代码" prop="traceInfoCode"> |
|
171 |
<el-input v-model="form.traceInfoCode" placeholder="请输入追溯信息代码" /> |
|
172 |
</el-form-item> |
7402d6
|
173 |
<!-- <el-form-item label="生产日期代码" prop="proDateCode"> |
C |
174 |
<el-input v-model="form.proDateCode" placeholder="请输入生产日期代码(不填)" /> |
|
175 |
</el-form-item>--> |
bf64f6
|
176 |
<el-form-item label="序列号" prop="sfcCode"> |
7402d6
|
177 |
<el-input v-model="form.sfcCode" placeholder="请输入序列号"/> |
bf64f6
|
178 |
</el-form-item> |
7402d6
|
179 |
<el-form-item label="状态" prop="state"> |
C |
180 |
<el-input v-model="form.state" placeholder="请输入状态 (启用1,禁用0)" /> |
bf64f6
|
181 |
</el-form-item> |
7402d6
|
182 |
|
C |
183 |
<!-- <el-form-item label="预留字段2" prop="spareField2"> |
bf64f6
|
184 |
<el-input v-model="form.spareField2" placeholder="请输入预留字段2" /> |
A |
185 |
</el-form-item> |
|
186 |
<el-form-item label="创建用户" prop="createUser"> |
|
187 |
<el-input v-model="form.createUser" placeholder="请输入创建用户" /> |
|
188 |
</el-form-item> |
|
189 |
<el-form-item label="更改用户" prop="updateUser"> |
|
190 |
<el-input v-model="form.updateUser" placeholder="请输入更改用户" /> |
7402d6
|
191 |
</el-form-item>--> |
bf64f6
|
192 |
</el-form> |
A |
193 |
<div slot="footer" class="dialog-footer"> |
|
194 |
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
195 |
<el-button @click="cancel">取 消</el-button> |
|
196 |
</div> |
|
197 |
</el-dialog> |
|
198 |
</div> |
|
199 |
</template> |
|
200 |
|
|
201 |
<script> |
|
202 |
import { listPsConf, getPsConf, delPsConf, addPsConf, updatePsConf } from "@/api/main/da/psConf/psConf"; |
|
203 |
|
|
204 |
export default { |
|
205 |
name: "PsConf", |
|
206 |
data() { |
|
207 |
return { |
|
208 |
// 遮罩层 |
|
209 |
loading: true, |
|
210 |
titleName: "", |
|
211 |
// 选中数组 |
|
212 |
ids: [], |
|
213 |
// 非单个禁用 |
|
214 |
single: true, |
|
215 |
// 非多个禁用 |
|
216 |
multiple: true, |
|
217 |
// 显示搜索条件 |
|
218 |
showSearch: true, |
|
219 |
// 总条数 |
|
220 |
total: 0, |
|
221 |
// 1P1S配置表格数据 |
|
222 |
psConfList: [], |
|
223 |
// 弹出层标题 |
|
224 |
title: "", |
|
225 |
// 是否显示弹出层 |
|
226 |
open: false, |
|
227 |
// 查询参数 |
|
228 |
queryParams: { |
|
229 |
pageNum: 1, |
|
230 |
pageSize: 10, |
|
231 |
mfCode: null, |
|
232 |
proTypeCode: null, |
|
233 |
batteryTypeCode: null, |
|
234 |
specificationsCode: null, |
|
235 |
traceInfoCode: null, |
|
236 |
proDateCode: null, |
|
237 |
sfcCode: null, |
|
238 |
state: null, |
|
239 |
remarks: null, |
|
240 |
spareField1: null, |
|
241 |
spareField2: null, |
|
242 |
createUser: null, |
|
243 |
updateUser: null, |
|
244 |
}, |
|
245 |
// 表单参数 |
|
246 |
form: {}, |
|
247 |
// 表单校验 |
|
248 |
rules: { |
|
249 |
id: [ |
|
250 |
{ required: true, message: "主键id不能为空", trigger: "blur" } |
|
251 |
], |
|
252 |
} |
|
253 |
}; |
|
254 |
}, |
|
255 |
created() { |
|
256 |
this.getList(); |
|
257 |
}, |
|
258 |
methods: { |
|
259 |
/** 查询1P1S配置列表 */ |
|
260 |
getList() { |
|
261 |
this.loading = true; |
|
262 |
listPsConf(this.queryParams).then(response => { |
|
263 |
this.psConfList = response.rows; |
|
264 |
this.total = response.total; |
|
265 |
this.loading = false; |
|
266 |
}); |
|
267 |
}, |
|
268 |
// 取消按钮 |
|
269 |
cancel() { |
|
270 |
this.open = false; |
|
271 |
this.reset(); |
|
272 |
}, |
|
273 |
// 表单重置 |
|
274 |
reset() { |
|
275 |
this.form = { |
|
276 |
id: null, |
|
277 |
mfCode: null, |
|
278 |
proTypeCode: null, |
|
279 |
batteryTypeCode: null, |
|
280 |
specificationsCode: null, |
|
281 |
traceInfoCode: null, |
|
282 |
proDateCode: null, |
|
283 |
sfcCode: null, |
|
284 |
state: null, |
|
285 |
remarks: null, |
|
286 |
spareField1: null, |
|
287 |
spareField2: null, |
|
288 |
createUser: null, |
|
289 |
createTime: null, |
|
290 |
updateUser: null, |
|
291 |
updateTime: null |
|
292 |
}; |
|
293 |
this.resetForm("form"); |
|
294 |
}, |
|
295 |
/** 搜索按钮操作 */ |
|
296 |
handleQuery() { |
|
297 |
this.queryParams.pageNum = 1; |
|
298 |
this.getList(); |
|
299 |
}, |
|
300 |
/** 重置按钮操作 */ |
|
301 |
resetQuery() { |
|
302 |
this.resetForm("queryForm"); |
|
303 |
this.handleQuery(); |
|
304 |
}, |
|
305 |
// 多选框选中数据 |
|
306 |
handleSelectionChange(selection) { |
|
307 |
this.ids = selection.map(item => item.id) |
|
308 |
this.single = selection.length!==1 |
|
309 |
this.multiple = !selection.length |
|
310 |
}, |
|
311 |
/** 新增按钮操作 */ |
|
312 |
handleAdd() { |
|
313 |
this.reset(); |
|
314 |
this.open = true; |
|
315 |
this.titleName = "添加1P1S配置"; |
|
316 |
}, |
|
317 |
/** 修改按钮操作 */ |
|
318 |
handleUpdate(row) { |
|
319 |
this.reset(); |
|
320 |
const id = row.id || this.ids |
|
321 |
getPsConf(id).then(response => { |
|
322 |
this.form = response.data; |
|
323 |
this.open = true; |
|
324 |
this.titleName = "修改1P1S配置"; |
|
325 |
}); |
|
326 |
}, |
|
327 |
/** 提交按钮 */ |
|
328 |
submitForm() { |
|
329 |
this.$refs["form"].validate(valid => { |
|
330 |
if (valid) { |
|
331 |
if (this.form.id != null) { |
|
332 |
updatePsConf(this.form).then(response => { |
|
333 |
this.$modal.msgSuccess("修改成功"); |
|
334 |
this.open = false; |
|
335 |
this.getList(); |
|
336 |
}); |
|
337 |
} else { |
|
338 |
addPsConf(this.form).then(response => { |
|
339 |
this.$modal.msgSuccess("新增成功"); |
|
340 |
this.open = false; |
|
341 |
this.getList(); |
|
342 |
}); |
|
343 |
} |
|
344 |
} |
|
345 |
}); |
|
346 |
}, |
|
347 |
/** 删除按钮操作 */ |
|
348 |
handleDelete(row) { |
|
349 |
const ids = row.id || this.ids; |
|
350 |
this.$modal.confirm('是否确认删除1P1S配置编号为"' + ids + '"的数据项?').then(function() { |
|
351 |
return delPsConf(ids); |
|
352 |
}).then(() => { |
|
353 |
this.getList(); |
|
354 |
this.$modal.msgSuccess("删除成功"); |
|
355 |
}).catch(() => {}); |
|
356 |
}, |
|
357 |
/** 导出按钮操作 */ |
|
358 |
handleExport() { |
|
359 |
this.download('da/psConf/export', { |
|
360 |
...this.queryParams |
|
361 |
}, `psConf_${new Date().getTime()}.xlsx`) |
|
362 |
} |
|
363 |
} |
|
364 |
}; |
|
365 |
</script> |