feat:管理页面把状态改为选择器
parent
bd01fe7776
commit
efe9110fe9
|
@ -5,7 +5,7 @@
|
||||||
"author": "若依",
|
"author": "若依",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
|
|
|
@ -42,3 +42,11 @@ export function delAttributeGroup(id) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function updateAttributeGroupState(id,states) {
|
||||||
|
return request({
|
||||||
|
url: '/product/attributeGroup/'+id+ '/' + states ,
|
||||||
|
method: 'put',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询拼团列表
|
||||||
|
export function listBuy(query) {
|
||||||
|
return request({
|
||||||
|
url: '/product/buy/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询拼团详细
|
||||||
|
export function getBuy(id) {
|
||||||
|
return request({
|
||||||
|
url: '/product/buy/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增拼团
|
||||||
|
export function addBuy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/product/buy',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改拼团
|
||||||
|
export function updateBuy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/product/buy/'+data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除拼团
|
||||||
|
export function delBuy(id) {
|
||||||
|
return request({
|
||||||
|
url: '/product/buy/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -50,6 +50,14 @@ export function updateCategory(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateCateStates(id,start) {
|
||||||
|
return request({
|
||||||
|
url: '/product/category/'+id + '/' + start,
|
||||||
|
method: 'put',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 删除品类信息
|
// 删除品类信息
|
||||||
export function delCategory(id) {
|
export function delCategory(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -34,7 +34,12 @@ export function updateRule(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function updateStatusRule(id,status) {
|
||||||
|
return request({
|
||||||
|
url: '/product/rule/'+id + '/' + status,
|
||||||
|
method: 'put',
|
||||||
|
})
|
||||||
|
}
|
||||||
// 删除商品规格
|
// 删除商品规格
|
||||||
export function delRule(id) {
|
export function delRule(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -83,7 +83,16 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="states">
|
<el-table-column label="状态" align="center" prop="states">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.states"/>
|
<!-- <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.states"/>-->
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.states"
|
||||||
|
active-value="Y"
|
||||||
|
inactive-value="N"
|
||||||
|
active-text="Y"
|
||||||
|
inactive-text="N"
|
||||||
|
@change="handleStateChange(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
@ -141,7 +150,7 @@
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<CheckAttribute v-model="form.attributeIdList"/>
|
<CheckAttribute v-model="form.attributeIdList" :checked-list="form.attributeIdList"/>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
@ -152,7 +161,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listAttributeGroup, getAttributeGroup, delAttributeGroup, addAttributeGroup, updateAttributeGroup } from "@/api/product/attributeGroup";
|
import {
|
||||||
|
listAttributeGroup,
|
||||||
|
getAttributeGroup,
|
||||||
|
delAttributeGroup,
|
||||||
|
addAttributeGroup,
|
||||||
|
updateAttributeGroup,
|
||||||
|
updateAttributeGroupState
|
||||||
|
} from "@/api/product/attributeGroup";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AttributeGroup",
|
name: "AttributeGroup",
|
||||||
|
@ -201,7 +217,15 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleStateChange(row){
|
||||||
|
this.reset();
|
||||||
|
var id = row.id;
|
||||||
|
var states = row.states;
|
||||||
|
updateAttributeGroupState(id,states).then(res => {
|
||||||
|
console.log(res.data)
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
})
|
||||||
|
},
|
||||||
/** 查询属性组列表 */
|
/** 查询属性组列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -256,6 +280,7 @@ export default {
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getAttributeGroup(id).then(response => {
|
getAttributeGroup(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.attributeIdList = response.data.attributeList
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改属性组";
|
this.title = "修改属性组";
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,308 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="外键,关联商品" prop="projectId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectId"
|
||||||
|
placeholder="请输入外键,关联商品"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.startTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.endTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最小成团人数" prop="minMembers">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.minMembers"
|
||||||
|
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>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<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:buy: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:buy: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:buy: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:buy:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="buyList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="主键" align="center" prop="id" />
|
||||||
|
<el-table-column label="外键,关联商品" align="center" prop="projectId" />
|
||||||
|
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="最小成团人数" align="center" prop="minMembers" />
|
||||||
|
<el-table-column label="活动状态" align="center" prop="status" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['product:buy:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['product:buy:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<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="projectId">
|
||||||
|
<el-input v-model="form.projectId" placeholder="请输入外键,关联商品" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.startTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.endTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最小成团人数" prop="minMembers">
|
||||||
|
<el-input v-model="form.minMembers" 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>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listBuy, getBuy, delBuy, addBuy, updateBuy } from "@/api/product/buy";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Buy",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 拼团表格数据
|
||||||
|
buyList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: null,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
minMembers: null,
|
||||||
|
status: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询拼团列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listBuy(this.queryParams).then(response => {
|
||||||
|
this.buyList = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
projectId: null,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
minMembers: null,
|
||||||
|
status: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
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
|
||||||
|
getBuy(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) {
|
||||||
|
updateBuy(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addBuy(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 delBuy(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('product/buy/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `buy_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -71,7 +71,17 @@
|
||||||
<el-table-column label="父级品类" align="center" prop="parentId" />
|
<el-table-column label="父级品类" align="center" prop="parentId" />
|
||||||
<el-table-column label="是否启用" align="center" prop="start">
|
<el-table-column label="是否启用" align="center" prop="start">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.start"/>
|
<!-- <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.start"/>-->
|
||||||
|
<el-switch
|
||||||
|
style="display: block"
|
||||||
|
v-model="scope.row.start"
|
||||||
|
active-value="Y"
|
||||||
|
inactive-value="N"
|
||||||
|
active-text="Y"
|
||||||
|
inactive-text="N"
|
||||||
|
@change="updateStates(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="介绍" align="center" prop="introduction" />
|
<el-table-column label="介绍" align="center" prop="introduction" />
|
||||||
|
@ -176,7 +186,7 @@ import {
|
||||||
delCategory,
|
delCategory,
|
||||||
addCategory,
|
addCategory,
|
||||||
updateCategory,
|
updateCategory,
|
||||||
parentCommonElement
|
parentCommonElement, updateCateStates
|
||||||
} from "@/api/product/category";
|
} from "@/api/product/category";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
@ -242,9 +252,10 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
||||||
'form.parentId': {
|
'form.parentId': {
|
||||||
handler(val){
|
handler(val){
|
||||||
if (val !== undefined && val !== 0){
|
if (val !== undefined && val !== 0 && val!=null){
|
||||||
parentCommonElement(val).then(response => {
|
parentCommonElement(val).then(response => {
|
||||||
this.attributeInfoList = response.data.attributeInfoList;
|
this.attributeInfoList = response.data.attributeInfoList;
|
||||||
this.attributeGroupList = response.data.attributeGroupList;
|
this.attributeGroupList = response.data.attributeGroupList;
|
||||||
|
@ -259,6 +270,14 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateStates(row){
|
||||||
|
var id = row.id;
|
||||||
|
var start = row.start;
|
||||||
|
updateCateStates(id,start).then(res =>{
|
||||||
|
console.log(res.data)
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
})
|
||||||
|
},
|
||||||
/** 查询品类信息列表 */
|
/** 查询品类信息列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
|
@ -77,7 +77,21 @@
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="规格状态" align="center" prop="status" />
|
<!-- <el-table-column label="规格状态" align="center" prop="status" />-->
|
||||||
|
<el-table-column label="是否启用" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
style="display: block"
|
||||||
|
v-model="scope.row.status"
|
||||||
|
active-value="Y"
|
||||||
|
inactive-value="N"
|
||||||
|
active-text="Y"
|
||||||
|
inactive-text="N"
|
||||||
|
@change="updateStates(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -165,7 +179,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRule, getRule, delRule, addRule, updateRule } from "@/api/product/rule";
|
import {listRule, getRule, delRule, addRule, updateRule, updateStatusRule} from "@/api/product/rule";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Rule",
|
name: "Rule",
|
||||||
|
@ -219,6 +233,14 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateStates(row){
|
||||||
|
var id = row.id;
|
||||||
|
var status = row.status;
|
||||||
|
updateStatusRule(id,status).then(res=>{
|
||||||
|
console.log(res.data)
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
})
|
||||||
|
},
|
||||||
removeRule(index){
|
removeRule(index){
|
||||||
this.form.ruleAttrList.splice(index, 1);
|
this.form.ruleAttrList.splice(index, 1);
|
||||||
},
|
},
|
||||||
|
@ -337,6 +359,7 @@ export default {
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getRule(id).then(response => {
|
getRule(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.ruleAttrList=response.data.ruleAttrList
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改商品规格";
|
this.title = "修改商品规格";
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue