24
24
<el-row :gutter =" 10" class =" mb8" >
25
25
<el-col :span =" 1.5" >
26
26
<el-button type =" primary" plain icon =" el-icon-plus" size =" mini" @click =" handleAdd"
27
- v-hasPermi =" ['system:dict:create']" >新增</el-button >
27
+ v-hasPermi =" ['system:dict:create']" >新增
28
+ </el-button >
28
29
</el-col >
29
30
<!-- <el-col :span="1.5">
30
31
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
33
34
<right-toolbar :showSearch.sync =" showSearch" @queryTable =" getList" ></right-toolbar >
34
35
</el-row >
35
36
36
- <el-table v-loading =" loading" :data =" dataList" >
37
- <el-table-column label =" 规格值id" align =" center" prop =" id" />
38
- <el-table-column label =" 规格值" align =" center" prop =" name" />
37
+ <el-table v-loading =" loading" :data =" dataList" >
38
+ <el-table-column label =" 规格值id" align =" center" prop =" id" />
39
+ <el-table-column label =" 规格值" align =" center" prop =" name" />
39
40
<el-table-column label =" 状态" align =" center" prop =" status" >
40
41
<template slot-scope="scope">
41
42
<dict-tag :type =" DICT_TYPE.COMMON_STATUS" :value =" scope.row.status" />
42
43
</template >
43
44
</el-table-column >
44
- <el-table-column label =" 备注" align =" center" prop =" remark" :show-overflow-tooltip =" true" />
45
+ <el-table-column label =" 备注" align =" center" prop =" remark" :show-overflow-tooltip =" true" />
45
46
<el-table-column label =" 创建时间" align =" center" prop =" createTime" width =" 180" >
46
47
<template slot-scope="scope">
47
48
<span >{{ parseTime(scope.row.createTime) }}</span >
50
51
<el-table-column label =" 操作" align =" center" class-name =" small-padding fixed-width" >
51
52
<template slot-scope="scope">
52
53
<el-button size =" mini" type =" text" icon =" el-icon-edit" @click =" handleUpdate(scope.row)"
53
- v-hasPermi =" ['system:dict:update']" >修改</el-button >
54
+ v-hasPermi =" ['system:dict:update']" >修改
55
+ </el-button >
54
56
<el-button size =" mini" type =" text" icon =" el-icon-delete" @click =" handleDelete(scope.row)"
55
- v-hasPermi =" ['system:dict:delete']" >删除</el-button >
57
+ v-hasPermi =" ['system:dict:delete']" >删除
58
+ </el-button >
56
59
</template >
57
60
</el-table-column >
58
61
</el-table >
64
67
<el-dialog :title =" title" :visible.sync =" open" width =" 500px" append-to-body >
65
68
<el-form ref =" form" :model =" form" :rules =" rules" label-width =" 90px" >
66
69
<el-form-item label =" 规格值编码" >
67
- <el-input v-model =" form.propertyId" :disabled =" true" />
70
+ <el-input v-model =" form.propertyId" :disabled =" true" />
68
71
</el-form-item >
69
72
<el-form-item label =" 规格值" prop =" name" >
70
- <el-input v-model =" form.name" placeholder =" 请输入数据标签" />
73
+ <el-input v-model =" form.name" placeholder =" 请输入数据标签" />
71
74
</el-form-item >
72
75
<el-form-item label =" 状态" prop =" status" >
73
76
<el-radio-group v-model =" form.status" >
89
92
</template >
90
93
91
94
<script >
92
- import { getPropertyList , getPropertyValuePage , createPropertyValue , updatePropertyValue , getPropertyValue , deletePropertyValue } from ' @/api/mall/product/property'
93
- import { getProperty } from " @/api/mall/product/property" ;
95
+ import {
96
+ createPropertyValue ,
97
+ deletePropertyValue ,
98
+ getProperty ,
99
+ getPropertyList ,
100
+ getPropertyValue ,
101
+ getPropertyValuePage ,
102
+ updatePropertyValue
103
+ } from ' @/api/mall/product/property'
94
104
95
105
export default {
96
106
name: " PropertyValue" ,
@@ -127,10 +137,10 @@ export default {
127
137
// 表单校验
128
138
rules: {
129
139
name: [
130
- { required: true , message: " 规格值不能为空" , trigger: " blur" }
140
+ {required: true , message: " 规格值不能为空" , trigger: " blur" }
131
141
],
132
142
status: [
133
- { required: true , message: " 状态不能为空" , trigger: " blur" }
143
+ {required: true , message: " 状态不能为空" , trigger: " blur" }
134
144
]
135
145
},
136
146
@@ -210,7 +220,7 @@ export default {
210
220
});
211
221
},
212
222
/** 提交按钮 */
213
- submitForm : function () {
223
+ submitForm : function () {
214
224
this .$refs [" form" ].validate (valid => {
215
225
if (valid) {
216
226
if (this .form .id !== undefined ) {
@@ -232,23 +242,25 @@ export default {
232
242
/** 删除按钮操作 */
233
243
handleDelete (row ) {
234
244
const ids = row .id ;
235
- this .$modal .confirm (' 是否确认删除字典编码为"' + ids + ' "的数据项?' ).then (function () {
236
- return deletePropertyValue (ids);
237
- }).then (() => {
238
- this .getList ();
239
- this .$modal .msgSuccess (" 删除成功" );
240
- }).catch (() => {});
245
+ this .$modal .confirm (' 是否确认删除字典编码为"' + ids + ' "的数据项?' ).then (function () {
246
+ return deletePropertyValue (ids);
247
+ }).then (() => {
248
+ this .getList ();
249
+ this .$modal .msgSuccess (" 删除成功" );
250
+ }).catch (() => {
251
+ });
241
252
},
242
253
/** 导出按钮操作 */
243
254
handleExport () {
244
255
const queryParams = this .queryParams ;
245
256
this .$modal .confirm (' 是否确认导出所有数据项?' ).then (() => {
246
- this .exportLoading = true ;
247
- return exportData (queryParams);
248
- }).then (response => {
249
- this .$download .excel (response, ' 字典数据.xls' );
250
- this .exportLoading = false ;
251
- }).catch (() => {});
257
+ this .exportLoading = true ;
258
+ return exportData (queryParams);
259
+ }).then (response => {
260
+ this .$download .excel (response, ' 字典数据.xls' );
261
+ this .exportLoading = false ;
262
+ }).catch (() => {
263
+ });
252
264
}
253
265
}
254
266
};
0 commit comments