Skip to content

Commit 42e2717

Browse files
committed
feature(管理后台): 商品列表
1 parent 91655b1 commit 42e2717

File tree

3 files changed

+469
-238
lines changed

3 files changed

+469
-238
lines changed

src/views/mall/product/property/value.vue

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
<el-row :gutter="10" class="mb8">
2525
<el-col :span="1.5">
2626
<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>
2829
</el-col>
2930
<!-- <el-col :span="1.5">
3031
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
@@ -33,15 +34,15 @@
3334
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
3435
</el-row>
3536

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"/>
3940
<el-table-column label="状态" align="center" prop="status">
4041
<template slot-scope="scope">
4142
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
4243
</template>
4344
</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"/>
4546
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
4647
<template slot-scope="scope">
4748
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -50,9 +51,11 @@
5051
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
5152
<template slot-scope="scope">
5253
<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>
5456
<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>
5659
</template>
5760
</el-table-column>
5861
</el-table>
@@ -64,10 +67,10 @@
6467
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
6568
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
6669
<el-form-item label="规格值编码">
67-
<el-input v-model="form.propertyId" :disabled="true" />
70+
<el-input v-model="form.propertyId" :disabled="true"/>
6871
</el-form-item>
6972
<el-form-item label="规格值" prop="name">
70-
<el-input v-model="form.name" placeholder="请输入数据标签" />
73+
<el-input v-model="form.name" placeholder="请输入数据标签"/>
7174
</el-form-item>
7275
<el-form-item label="状态" prop="status">
7376
<el-radio-group v-model="form.status">
@@ -89,8 +92,15 @@
8992
</template>
9093

9194
<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'
94104
95105
export default {
96106
name: "PropertyValue",
@@ -127,10 +137,10 @@ export default {
127137
// 表单校验
128138
rules: {
129139
name: [
130-
{ required: true, message: "规格值不能为空", trigger: "blur" }
140+
{required: true, message: "规格值不能为空", trigger: "blur"}
131141
],
132142
status: [
133-
{ required: true, message: "状态不能为空", trigger: "blur" }
143+
{required: true, message: "状态不能为空", trigger: "blur"}
134144
]
135145
},
136146
@@ -210,7 +220,7 @@ export default {
210220
});
211221
},
212222
/** 提交按钮 */
213-
submitForm: function() {
223+
submitForm: function () {
214224
this.$refs["form"].validate(valid => {
215225
if (valid) {
216226
if (this.form.id !== undefined) {
@@ -232,23 +242,25 @@ export default {
232242
/** 删除按钮操作 */
233243
handleDelete(row) {
234244
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+
});
241252
},
242253
/** 导出按钮操作 */
243254
handleExport() {
244255
const queryParams = this.queryParams;
245256
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+
});
252264
}
253265
}
254266
};

0 commit comments

Comments
 (0)