dev
parent
07c218af6d
commit
b50f4d3b4c
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询品牌信息列表
|
||||
export function listAttrInfo(query) {
|
||||
return request({
|
||||
url: '/product/attrInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询品牌信息详细
|
||||
export function getAttrInfo(id) {
|
||||
return request({
|
||||
url: '/product/attrInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增品牌信息
|
||||
export function addAttrInfo(data) {
|
||||
return request({
|
||||
url: '/product/attrInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改品牌信息
|
||||
export function updateAttrInfo(data) {
|
||||
return request({
|
||||
url: '/product/attrInfo/'+data.id,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除品牌信息
|
||||
export function delAttrInfo(id) {
|
||||
return request({
|
||||
url: '/product/attrInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -29,7 +29,7 @@ export function addInfo(data) {
|
|||
// 修改商品信息
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/product/info/'+data.id,
|
||||
url: '/product/info',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
|
|
@ -1,23 +1,38 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="组名称" prop="name">
|
||||
<el-form-item label="规格" prop="ruleId">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入组名称"
|
||||
v-model="queryParams.ruleId"
|
||||
placeholder="请输入规格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="states">
|
||||
<el-select v-model="queryParams.states" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="类目名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入类目名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格值" prop="attrValue">
|
||||
<el-input
|
||||
v-model="queryParams.attrValue"
|
||||
placeholder="请输入规格值"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="乐观锁" prop="revision">
|
||||
<el-input
|
||||
v-model="queryParams.revision"
|
||||
placeholder="请输入乐观锁"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -33,7 +48,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['product:attributeGroup:add']"
|
||||
v-hasPermi="['product:attrInfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -44,7 +59,7 @@
|
|||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['product:attributeGroup:edit']"
|
||||
v-hasPermi="['product:attrInfo:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -55,7 +70,7 @@
|
|||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['product:attributeGroup:remove']"
|
||||
v-hasPermi="['product:attrInfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -65,28 +80,25 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['product:attributeGroup:export']"
|
||||
v-hasPermi="['product:attrInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-table v-loading="loading" :data="attributeGroupList" @selection-change="handleSelectionChange">
|
||||
<el-card>
|
||||
<i class="el-icon-tickets">商品规格详情数据列表</i>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="规格名称" align="center" prop="name" />
|
||||
<el-table-column label="组内属性" align="center" prop="attributeInfoList" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="attributeInfo in scope.row.attributeInfoList">
|
||||
{{attributeInfo.name}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="states">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.states"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="规格" align="center" prop="ruleId" />
|
||||
<el-table-column label="类目名称" align="center" prop="name" />
|
||||
<el-table-column label="规格值" align="center" prop="attrValue" />
|
||||
<el-table-column label="乐观锁" align="center" prop="revision" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -94,14 +106,14 @@
|
|||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:attributeGroup:edit']"
|
||||
v-hasPermi="['product:info:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:attributeGroup:remove']"
|
||||
v-hasPermi="['product:attrInfo:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -115,48 +127,36 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改属性组对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<!-- 添加或修改商品规格详情对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="组名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入组名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="states">
|
||||
<el-radio-group v-model="form.states">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<CheckAttribute v-model="form.attributeIdList"/>
|
||||
<el-form-item label="规格" prop="ruleId">
|
||||
<el-input v-model="form.ruleId" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类目名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入类目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格值" prop="attrValue">
|
||||
<el-input v-model="form.attrValue" placeholder="请输入规格值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="乐观锁" prop="revision">
|
||||
<el-input v-model="form.revision" placeholder="请输入乐观锁" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAttributeGroup, getAttributeGroup, delAttributeGroup, addAttributeGroup, updateAttributeGroup } from "@/api/product/attributeGroup";
|
||||
import { listAttrInfo, getAttrInfo, delAttrInfo, addAttrInfo, updateAttrInfo } from "@/api/product/attrInfo";
|
||||
|
||||
export default {
|
||||
name: "AttributeGroup",
|
||||
dicts: ['sys_yes_no'],
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -171,8 +171,8 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 属性组表格数据
|
||||
attributeGroupList: [],
|
||||
// 商品规格详情表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -181,19 +181,15 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ruleId: null,
|
||||
name: null,
|
||||
states: null
|
||||
attrValue: null,
|
||||
revision: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "组名称不能为空", trigger: "blur" }
|
||||
],
|
||||
states: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -201,12 +197,11 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
/** 查询属性组列表 */
|
||||
/** 查询商品规格详情列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listAttributeGroup(this.queryParams).then(response => {
|
||||
this.attributeGroupList = response.data.rows;
|
||||
listAttrInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -220,12 +215,15 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
ruleId: null,
|
||||
name: null,
|
||||
states: null,
|
||||
remark: null,
|
||||
attributeIdList: [],
|
||||
attrValue: null,
|
||||
revision: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.checkedAttributeList = []
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -248,16 +246,16 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加属性组";
|
||||
this.title = "添加商品规格详情";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getAttributeGroup(id).then(response => {
|
||||
getAttrInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改属性组";
|
||||
this.title = "修改商品规格详情";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -265,13 +263,13 @@ export default {
|
|||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateAttributeGroup(this.form).then(response => {
|
||||
updateAttrInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addAttributeGroup(this.form).then(response => {
|
||||
addAttrInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -283,8 +281,8 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除属性组编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delAttributeGroup(ids);
|
||||
this.$modal.confirm('是否确认删除商品规格详情编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delAttrInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
@ -292,9 +290,9 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('product/attributeGroup/export', {
|
||||
this.download('product/attrInfo/export', {
|
||||
...this.queryParams
|
||||
}, `attributeGroup_${new Date().getTime()}.xlsx`)
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
<el-table v-loading="loading" :data="attributeGroupList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="规格名称" align="center" prop="name" />
|
||||
<el-table-column label="组名称" align="center" prop="name" />
|
||||
<el-table-column label="组内属性" align="center" prop="attributeInfoList" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="attributeInfo in scope.row.attributeInfoList">
|
||||
|
@ -241,7 +241,7 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
|
@ -283,13 +283,12 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除属性组编号为"' + ids + '"的数据项?').then(function () {
|
||||
this.$modal.confirm('是否确认删除属性组编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delAttributeGroup(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
|
@ -1,125 +1,21 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryProductReq" ref="queryProductReq" size="small" :inline="true">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryProductReq.productName"
|
||||
placeholder="商品名称"
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品货号:">
|
||||
<el-input
|
||||
v-model="queryProductReq.productNumber"
|
||||
placeholder="商品货号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类:">
|
||||
<el-cascader :options="options" v-model="queryProductReq.typeId"
|
||||
:show-all-levels="false"
|
||||
:props="{muliple:true,emitPath:false,value:'value',label:'label'}"
|
||||
filterable clearable></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<el-select v-model="queryProductReq.brandId" placeholder="请选择品牌" clearable>
|
||||
<el-option v-for="item in brand" :label="item.brandName" :value="item.id" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上架状态:" prop="status">
|
||||
<el-select
|
||||
v-model="queryProductReq.productStatus"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
label="上架"
|
||||
value="1"
|
||||
/>
|
||||
<el-option
|
||||
label="下架"
|
||||
value="2"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态:" prop="status">
|
||||
<el-select
|
||||
v-model="queryProductReq.productExamine"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
label="审核通过"
|
||||
value="1"
|
||||
/>
|
||||
<el-option
|
||||
label="未审核"
|
||||
value="2"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['product:info:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['product:info:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['product:info:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['product:info:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询结果</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8" style="float: right">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
@ -127,274 +23,223 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:role:add']"
|
||||
v-hasPermi="['product:info:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['product:info:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['product:info:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['product:info:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-table :data="arr" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.$index +1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="图片"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.imagesUrl" width="100px" height="100px" alt="图片损坏"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="名称"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.productName }}</span><br>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="性别/成绩"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">性别:¥{{ scope.row.purSex }}</span><br>
|
||||
<span style="margin-left: 10px">成绩:{{ scope.row.purScore }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="货号"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.productNumber }}</span><br>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="单位"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.productUnit }}</span><br>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="标签"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
优秀:<el-switch
|
||||
v-model="scope.row.productStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch><br>
|
||||
良好:<el-switch
|
||||
v-model="scope.row.productNew"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch><br>
|
||||
不及格:<el-switch
|
||||
v-model="scope.row.productRecommended"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="审核状态"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.productExamine==0?'待审核':scope.row.productExamine==1?'通过':'驳回'}}</span><br>
|
||||
<el-link type="primary">审核详情</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="商品名称" align="center" prop="name" />
|
||||
<el-table-column label="商品描述" align="center" prop="productDesc" />
|
||||
<el-table-column label="商品类型" align="center" prop="type" />
|
||||
<el-table-column label="冗余字段" align="center" prop="typeIds" />
|
||||
<el-table-column label="商品主图" align="center" prop="img" />
|
||||
<el-table-column label="商品轮播图" align="center" prop="carouselImages" />
|
||||
<el-table-column label="商品评论数" align="center" prop="commentCount" />
|
||||
<el-table-column label="商品收藏人气" align="center" prop="collectCount" />
|
||||
<el-table-column label="品牌信息" align="center" prop="brand" />
|
||||
<el-table-column label="商品状态" align="center" prop="status" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="搜索关键字" align="center" prop="keywords" />
|
||||
<el-table-column label="规格信息" align="center" prop="ruleId" />
|
||||
<el-table-column label="乐观锁" align="center" prop="revision" />
|
||||
<el-table-column label="0:添加商品信息 1:添加规格信息 2:添加描述信息" align="center" prop="step" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleDetails(scope.row.id)">查看</el-button>
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:info:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleEdit(scope.row)">编辑</el-button><br>
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleLogs(scope.$index, scope.row)">日志</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)">删除</el-button>
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:info:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 详情对话框-->
|
||||
<el-dialog title="详情查看" :visible.sync="dialogFormVisible">
|
||||
<div style="display: flex;">
|
||||
<div style="flex: 1;">
|
||||
<img :src="productVo.imagesUrl" width="200px" height="200px" alt="图片损坏" style="margin-right: 20px;">
|
||||
</div>
|
||||
<div style="flex: 2;">
|
||||
<el-form :model="productVo">
|
||||
<el-form-item :label-width="formLabelWidth" label="活动名称">
|
||||
<el-input v-model="productVo.productName" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="品牌名称">
|
||||
<el-input v-model="productVo.brandName" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="产品信息">
|
||||
<el-input v-model="productVo.productInformation" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="详情标题">
|
||||
<el-input v-model="productVo.detailsTitle" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="详情信息">
|
||||
<el-input v-model="productVo.detailsInformation" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="销售价格">
|
||||
<el-input v-model="productVo.salePrice" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="促销价格">
|
||||
<el-input v-model="productVo.promotionPrice" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="服务名称">
|
||||
<el-input v-model="productVo.serviceName" autocomplete="off" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改商品信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品描述" prop="productDesc">
|
||||
<el-input v-model="form.productDesc" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="冗余字段" prop="typeIds">
|
||||
<el-input v-model="form.typeIds" placeholder="请输入冗余字段" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品主图" prop="img">
|
||||
<el-input v-model="form.img" placeholder="请输入商品主图" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品轮播图" prop="carouselImages">
|
||||
<el-input v-model="form.carouselImages" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品评论数" prop="commentCount">
|
||||
<el-input v-model="form.commentCount" placeholder="请输入商品评论数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品收藏人气" prop="collectCount">
|
||||
<el-input v-model="form.collectCount" placeholder="请输入商品收藏人气" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌信息" prop="brand">
|
||||
<el-input v-model="form.brand" placeholder="请输入品牌信息" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="搜索关键字" prop="keywords">
|
||||
<el-input v-model="form.keywords" placeholder="请输入搜索关键字" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格信息" prop="ruleId">
|
||||
<el-input v-model="form.ruleId" placeholder="请输入规格信息" />
|
||||
</el-form-item>
|
||||
<el-form-item label="乐观锁" prop="revision">
|
||||
<el-input v-model="form.revision" placeholder="请输入乐观锁" />
|
||||
</el-form-item>
|
||||
<el-form-item label="0:添加商品信息 1:添加规格信息 2:添加描述信息" prop="step">
|
||||
<el-input v-model="form.step" placeholder="请输入0:添加商品信息 1:添加规格信息 2:添加描述信息" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listInfo,getInfo,delInfo} from "@/api/product/info";
|
||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/info";
|
||||
|
||||
export default {
|
||||
name: "product",
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
dialogTableVisible: false,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
showSearch: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
brandName: null,
|
||||
options: [{
|
||||
value: '',
|
||||
label: '',
|
||||
children: [{
|
||||
value: '',
|
||||
label: '',
|
||||
}]
|
||||
}],
|
||||
brand:[],
|
||||
queryProductReq:{
|
||||
pageNum:1,
|
||||
pageSize:10
|
||||
},
|
||||
arr:[],
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品信息表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
step: null
|
||||
},
|
||||
productVo:{}
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getBrand();
|
||||
this.getType();
|
||||
},
|
||||
methods: {
|
||||
/**查看详情**/
|
||||
handleDetails(id) {
|
||||
getInfo(id).then(
|
||||
response => {
|
||||
this.productVo = response.data
|
||||
this.dialogFormVisible = true;
|
||||
}
|
||||
)
|
||||
},
|
||||
/**修改**/
|
||||
handleEdit(row) {
|
||||
this.$router.push({path: '/product/update', query: {product: row}})
|
||||
},
|
||||
/**删除**/
|
||||
handleDelete(id) {
|
||||
this.$confirm('确认删除此消息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 用户点击了确定按钮,执行删除操作
|
||||
delInfo(id).then(response => {
|
||||
this.$message.success(response.msg || '删除成功');
|
||||
this.getList();
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message || '删除失败');
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户点击了取消按钮,不执行任何操作
|
||||
});
|
||||
},
|
||||
/**添加跳转其他页面**/
|
||||
handleAdd() {
|
||||
this.open = true;
|
||||
this.title = "添加";
|
||||
},
|
||||
/**查询品牌表**/
|
||||
getBrand() {
|
||||
listInfo(this.brandName).then(
|
||||
response => {
|
||||
console.log(response)
|
||||
this.brand = response.data
|
||||
}
|
||||
)
|
||||
},
|
||||
/**查询类型**/
|
||||
getType() {
|
||||
listInfo().then(response => {
|
||||
if (response && response.data && response.data.length > 0) {
|
||||
const firstCategory = response.data[0]; // 假设取第一个分类作为父级
|
||||
this.options = [{
|
||||
value: firstCategory.id,
|
||||
label: firstCategory.name,
|
||||
children: firstCategory.childrenList.map(child => ({
|
||||
value: child.id,
|
||||
label: child.name
|
||||
}))
|
||||
}];
|
||||
} else {
|
||||
console.error('响应数据不完整或为空');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('查询分类出错:', error);
|
||||
});
|
||||
},
|
||||
/** 查询商品列表 */
|
||||
/** 查询商品信息列表 */
|
||||
getList() {
|
||||
listInfo(this.queryProductReq).then(
|
||||
response => {
|
||||
console.log(response)
|
||||
this.arr = response.data.list
|
||||
}
|
||||
)
|
||||
this.loading = true;
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
productDesc: null,
|
||||
type: null,
|
||||
typeIds: null,
|
||||
img: null,
|
||||
carouselImages: null,
|
||||
commentCount: null,
|
||||
collectCount: null,
|
||||
brand: null,
|
||||
status: null,
|
||||
unit: null,
|
||||
keywords: null,
|
||||
ruleId: null,
|
||||
revision: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
step: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
@ -403,22 +248,67 @@ export default {
|
|||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.roleId)
|
||||
this.single = selection.length != 1
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加商品信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除商品信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('product/info/export', {
|
||||
...this.queryParams
|
||||
}, `pur_${new Date().getTime()}.xlsx`)
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="规格名称" prop="name">
|
||||
<el-input
|
||||
|
@ -68,7 +69,13 @@
|
|||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<i class="el-icon-tickets">商品规格数据列表</i>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
|
@ -110,18 +117,18 @@
|
|||
<el-form-item label="规格名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入规格名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="规格详情" prop="ruleAttr">
|
||||
<el-input v-model="form.ruleAttr" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="乐观锁" prop="revision">
|
||||
<el-input v-model="form.revision" placeholder="请输入乐观锁" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -159,7 +159,6 @@
|
|||
|
||||
<script>
|
||||
import { listType, getType, delType, addType, updateType } from "@/api/product/type";
|
||||
import {addRule, updateRule} from "@/api/product/rule";
|
||||
|
||||
export default {
|
||||
name: "Type",
|
||||
|
@ -262,25 +261,25 @@ export default {
|
|||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.catId != null) {
|
||||
updateType(this.form.data).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const catIds = row.catId || this.ids;
|
||||
|
|
Loading…
Reference in New Issue