1、规格参数功能CRUD基本实现

2、删除代码生成的.vue文件
pull/254/head
xjs 4 years ago
parent 561024a571
commit f662493fd9

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 保存规格参数
export function addAttr(data) {
return request({
url: `/mall-product/product/attr/save`,
method: 'post',
data:data
})
}
// 修改规格参数
export function editAttr(data) {
return request({
url: `/mall-product/product/attr/update`,
method: 'put',
data:data
})
}
// 分页获取规格参数
export function getBaseAttrList(parms,catelogId) {
return request({
url: `/mall-product/product/attr/base/list/${catelogId}`,
method: 'get',
params:parms
})
}
// 删除规格参数
export function delAttr(ids) {
return request({
url: `/mall-product/product/attr/delete`,
method: 'delete',
data:ids
})
}
// 获取规格参数info信息
export function getAttr(attrId) {
return request({
url: `/mall-product/product/attr/info/${attrId}`,
method: 'get',
})
}

@ -0,0 +1,257 @@
<template>
<el-dialog
width="600px"
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
@closed="dialogClose"
>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="90px">
<el-form-item label="属性名" prop="attrName">
<el-input v-model="dataForm.attrName" placeholder="属性名"></el-input>
</el-form-item>
<el-form-item label="属性类型" prop="attrType">
<el-select v-model="dataForm.attrType" placeholder="请选择">
<el-option label="规格参数" :value="1"></el-option>
<el-option label="销售属性" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="值类型" prop="valueType">
<el-switch
v-model="dataForm.valueType"
active-text="允许多个值"
inactive-text="只能单个值"
active-color="#13ce66"
inactive-color="#ff4949"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<el-form-item label="可选值" prop="valueSelect">
<el-select
v-model="dataForm.valueSelect"
multiple
filterable
allow-create
placeholder="请输入内容"
></el-select>
</el-form-item>
<el-form-item label="属性图标" prop="icon">
<el-popover
placement="bottom-start"
width="460"
trigger="click"
@show="$refs['iconSelect'].reset()"
>
<IconSelect ref="iconSelect" @selected="selected"/>
<el-input slot="reference" :value="dataForm.icon" placeholder="属性图标" readonly>
<svg-icon
v-if="dataForm.icon"
slot="prefix"
:icon-class="dataForm.icon"
class="el-input__icon"
style="height: 32px;width: 16px;"
/>
<i v-else slot="prefix" class="el-icon-search el-input__icon"/>
</el-input>
</el-popover>
</el-form-item>
<el-form-item label="所属分类" prop="catelogId">
<category-cascader :catelogPath.sync="catelogPath"></category-cascader>
</el-form-item>
<el-form-item label="所属分组" prop="attrGroupId" v-if="type === 1">
<el-select ref="groupSelect" v-model="dataForm.attrGroupId" placeholder="请选择">
<el-option
v-for="item in attrGroups"
:key="item.attrGroupId"
:label="item.attrGroupName"
:value="item.attrGroupId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="可检索" prop="searchType" v-if="type === 1">
<el-switch
v-model="dataForm.searchType"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item>
<el-form-item label="快速展示" prop="showDesc" v-if="type === 1">
<el-switch
v-model="dataForm.showDesc"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item>
<el-form-item label="启用状态" prop="enable">
<el-switch
v-model="dataForm.enable"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
import CategoryCascader from '../../../components/mall/category-cascader'
import {getAttrGroupList} from "@/api/mall/product/attr-group";
import {addAttr, editAttr, getAttr} from "@/api/mall/product/attr";
import IconSelect from "@/components/IconSelect";
export default {
name: "attr-add-or-update",
data() {
return {
visible: false,
dataForm: {
attrName: "",
searchType: 0,
valueType: 1,
icon: "",
valueSelect: "",
attrType: 1,
enable: 1,
catelogId: "",
attrGroupId: "",
showDesc: 0
},
catelogPath: [],
attrGroups: [],
dataRule: {
attrName: [
{required: true, message: "属性名不能为空", trigger: "blur"}
],
searchType: [
{required: true, message: "是否需要检索不能为空", trigger: "blur"}
],
valueType: [
{required: true, message: "值类型不能为空", trigger: "blur"}
],
icon: [
{required: true, message: "属性图标不能为空", trigger: "blur"}
],
attrType: [
{required: true, message: "属性类型不能为空", trigger: "blur"}
],
enable: [
{required: true, message: "启用状态不能为空", trigger: "blur"}
],
catelogId: [
{required: true, message: "需要选择正确的三级分类数据", trigger: "blur"}
],
showDesc: [
{required: true, message: "快速展示不能为空", trigger: "blur"}
]
}
};
},
props: {
type: {
type: Number,
default: 1
}
},
watch: {
catelogPath(path) {
//
this.attrGroups = [];
this.dataForm.attrGroupId = "";
this.dataForm.catelogId = path[path.length - 1];
if (path && path.length === 3) {
let params = {
page: 1,
limit: 99999,
catelogId: path[path.length - 1],
}
getAttrGroupList(params).then(res => {
this.attrGroups = res.page.list
})
} else if (path.length === 0) {
this.dataForm.catelogId = "";
} else {
this.$message.error("请选择正确的分类");
this.dataForm.catelogId = "";
}
}
},
components: {CategoryCascader,IconSelect},
methods: {
init(id) {
this.dataForm.attrId = id;
this.dataForm.attrType = this.type;
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.attrId) {
getAttr(this.dataForm.attrId).then(res => {
this.dataForm.attrName = res.attr.attrName;
this.dataForm.searchType = res.attr.searchType;
this.dataForm.valueType = res.attr.valueType;
this.dataForm.icon = res.attr.icon;
this.dataForm.valueSelect = res.attr.valueSelect.split(";");
this.dataForm.attrType = res.attr.attrType;
this.dataForm.enable = res.attr.enable;
this.dataForm.catelogId = res.attr.catelogId;
this.dataForm.showDesc = res.attr.showDesc;
this.catelogPath = res.attr.catelogPath;
this.$nextTick(() => {
this.dataForm.attrGroupId = res.attr.attrGroupId;
});
})
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
let data = this.dataForm
data.valueSelect = this.dataForm.valueSelect.join(";")
if (!this.dataForm.attrId) {
addAttr(data).then(res => {
this.$modal.notifySuccess("添加成功")
this.visible = false;
this.$emit("refreshDataList");
})
} else {
editAttr(data).then(res => {
this.$modal.notifySuccess("修改成功")
this.visible = false;
this.$emit("refreshDataList");
})
}
}
});
},
dialogClose() {
this.catelogPath = [];
},
//
selected(name) {
this.dataForm.icon = name;
},
}
};
</script>

@ -13,7 +13,6 @@
<el-form-item>
<el-button-group>
<el-button @click="getDataList()"></el-button>
<el-button type="success" @click="getAllDataList()"></el-button>
<el-button
type="primary"
@click="addOrUpdateHandle()"
@ -134,10 +133,7 @@ export default {
this.getDataList(); //
}
},
getAllDataList() {
this.catId = 0;
this.getDataList();
},
//
getDataList() {
this.dataListLoading = true;
@ -188,7 +184,8 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dataForm={}
this.dataForm = {}
this.catId = 0
this.handleQuery();
},

@ -0,0 +1,249 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="6">
<category @tree-node-click="treenodeclick"></category>
</el-col>
<el-col :span="18">
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button @click="getDataList()"></el-button>
<el-button
type="primary"
@click="addOrUpdateHandle()"
>新增
</el-button>
<el-button
type="danger"
@click="deleteHandle()"
:disabled="dataListSelections.length <= 0"
>批量删除
</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="attrName" header-align="center" align="center" label="属性名"></el-table-column>
<el-table-column
v-if="attrtype === 1"
prop="searchType"
header-align="center"
align="center"
label="可检索"
>
<template slot-scope="scope">
<i class="el-icon-success" v-if="scope.row.searchType===1"></i>
<i class="el-icon-error" v-else></i>
</template>
</el-table-column>
<el-table-column prop="valueType" header-align="center" align="center" label="值类型">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.valueType===0"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="icon" header-align="center" align="center" label="图标"></el-table-column>
<el-table-column prop="valueSelect" header-align="center" align="center" label="可选值">
<template slot-scope="scope">
<el-tooltip placement="top">
<div slot="content">
<span v-for="(i,index) in scope.row.valueSelect.split(';')" :key="index">{{ i }}<br/></span>
</div>
<el-tag>{{ scope.row.valueSelect.split(";")[0] + " ..." }}</el-tag>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="enable" header-align="center" align="center" label="启用">
<template slot-scope="scope">
<i class="el-icon-success" v-if="scope.row.enable===1"></i>
<i class="el-icon-error" v-else></i>
</template>
</el-table-column>
<el-table-column prop="catelogName" header-align="center" align="center" label="所属分类"></el-table-column>
<el-table-column
v-if="attrtype === 1"
prop="groupName"
header-align="center"
align="center"
label="所属分组"
></el-table-column>
<el-table-column v-if="attrtype === 1" prop="showDesc" header-align="center" align="center" label="快速展示">
<template slot-scope="scope">
<i class="el-icon-success" v-if="scope.row.showDesc===1"></i>
<i class="el-icon-error" v-else></i>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.attrId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.attrId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
:type="attrtype"
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import Category from '../../../components/mall/category'
import AddOrUpdate from "./attr-add-or-update";
import {delAttr, getBaseAttrList} from "@/api/mall/product/attr";
export default {
components: {Category, AddOrUpdate},
name: "base-attr",
props: {
attrtype: {
type: Number,
default: 1
}
},
data() {
return {
catId: 0,
type: 1,
dataForm: {
key: ""
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
};
},
created() {
this.getDataList();
},
methods: {
//
treenodeclick(data, node, component) {
if (node.level === 3) {
this.catId = data.catId;
this.getDataList(); //
}
},
//
getDataList() {
this.dataListLoading = true;
let params = {
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
}
if (this.attrtype === 0) {
// todo sale
} else {
getBaseAttrList(params, this.catId).then(res => {
this.dataList = res.page.list;
this.totalPage = res.page.totalCount;
this.dataListLoading = false;
})
}
},
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
//
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.attrId;
});
this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
delAttr(ids).then(res => {
this.$modal.notifySuccess("删除成功")
this.getDataList();
})
});
},
/** 重置按钮操作 */
resetQuery() {
this.dataForm = {}
this.catId = 0
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.pageIndex = 1;
this.getDataList();
},
}
};
</script>
<style scoped>
</style>

@ -1,246 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="优惠卷类型[0->全场赠券1->会员赠券2->购物赠券3->注册赠券]" prop="couponType">
<el-input v-model="dataForm.couponType" placeholder="优惠卷类型[0->全场赠券1->会员赠券2->购物赠券3->注册赠券]"></el-input>
</el-form-item>
<el-form-item label="优惠券图片" prop="couponImg">
<el-input v-model="dataForm.couponImg" placeholder="优惠券图片"></el-input>
</el-form-item>
<el-form-item label="优惠卷名字" prop="couponName">
<el-input v-model="dataForm.couponName" placeholder="优惠卷名字"></el-input>
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="数量"></el-input>
</el-form-item>
<el-form-item label="金额" prop="amount">
<el-input v-model="dataForm.amount" placeholder="金额"></el-input>
</el-form-item>
<el-form-item label="每人限领张数" prop="perLimit">
<el-input v-model="dataForm.perLimit" placeholder="每人限领张数"></el-input>
</el-form-item>
<el-form-item label="使用门槛" prop="minPoint">
<el-input v-model="dataForm.minPoint" placeholder="使用门槛"></el-input>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-input v-model="dataForm.startTime" placeholder="开始时间"></el-input>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-input v-model="dataForm.endTime" placeholder="结束时间"></el-input>
</el-form-item>
<el-form-item label="使用类型[0->全场通用1->指定分类2->指定商品]" prop="useType">
<el-input v-model="dataForm.useType" placeholder="使用类型[0->全场通用1->指定分类2->指定商品]"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="发行数量" prop="publishCount">
<el-input v-model="dataForm.publishCount" placeholder="发行数量"></el-input>
</el-form-item>
<el-form-item label="已使用数量" prop="useCount">
<el-input v-model="dataForm.useCount" placeholder="已使用数量"></el-input>
</el-form-item>
<el-form-item label="领取数量" prop="receiveCount">
<el-input v-model="dataForm.receiveCount" placeholder="领取数量"></el-input>
</el-form-item>
<el-form-item label="可以领取的开始日期" prop="enableStartTime">
<el-input v-model="dataForm.enableStartTime" placeholder="可以领取的开始日期"></el-input>
</el-form-item>
<el-form-item label="可以领取的结束日期" prop="enableEndTime">
<el-input v-model="dataForm.enableEndTime" placeholder="可以领取的结束日期"></el-input>
</el-form-item>
<el-form-item label="优惠码" prop="code">
<el-input v-model="dataForm.code" placeholder="优惠码"></el-input>
</el-form-item>
<el-form-item label="可以领取的会员等级[0->不限等级,其他-对应等级]" prop="memberLevel">
<el-input v-model="dataForm.memberLevel" placeholder="可以领取的会员等级[0->不限等级,其他-对应等级]"></el-input>
</el-form-item>
<el-form-item label="发布状态[0-未发布1-已发布]" prop="publish">
<el-input v-model="dataForm.publish" placeholder="发布状态[0-未发布1-已发布]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponType: '',
couponImg: '',
couponName: '',
num: '',
amount: '',
perLimit: '',
minPoint: '',
startTime: '',
endTime: '',
useType: '',
note: '',
publishCount: '',
useCount: '',
receiveCount: '',
enableStartTime: '',
enableEndTime: '',
code: '',
memberLevel: '',
publish: ''
},
dataRule: {
couponType: [
{ required: true, message: '优惠卷类型[0->全场赠券1->会员赠券2->购物赠券3->注册赠券]不能为空', trigger: 'blur' }
],
couponImg: [
{ required: true, message: '优惠券图片不能为空', trigger: 'blur' }
],
couponName: [
{ required: true, message: '优惠卷名字不能为空', trigger: 'blur' }
],
num: [
{ required: true, message: '数量不能为空', trigger: 'blur' }
],
amount: [
{ required: true, message: '金额不能为空', trigger: 'blur' }
],
perLimit: [
{ required: true, message: '每人限领张数不能为空', trigger: 'blur' }
],
minPoint: [
{ required: true, message: '使用门槛不能为空', trigger: 'blur' }
],
startTime: [
{ required: true, message: '开始时间不能为空', trigger: 'blur' }
],
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'blur' }
],
useType: [
{ required: true, message: '使用类型[0->全场通用1->指定分类2->指定商品]不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
publishCount: [
{ required: true, message: '发行数量不能为空', trigger: 'blur' }
],
useCount: [
{ required: true, message: '已使用数量不能为空', trigger: 'blur' }
],
receiveCount: [
{ required: true, message: '领取数量不能为空', trigger: 'blur' }
],
enableStartTime: [
{ required: true, message: '可以领取的开始日期不能为空', trigger: 'blur' }
],
enableEndTime: [
{ required: true, message: '可以领取的结束日期不能为空', trigger: 'blur' }
],
code: [
{ required: true, message: '优惠码不能为空', trigger: 'blur' }
],
memberLevel: [
{ required: true, message: '可以领取的会员等级[0->不限等级,其他-对应等级]不能为空', trigger: 'blur' }
],
publish: [
{ required: true, message: '发布状态[0-未发布1-已发布]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/coupon/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponType = data.coupon.couponType
this.dataForm.couponImg = data.coupon.couponImg
this.dataForm.couponName = data.coupon.couponName
this.dataForm.num = data.coupon.num
this.dataForm.amount = data.coupon.amount
this.dataForm.perLimit = data.coupon.perLimit
this.dataForm.minPoint = data.coupon.minPoint
this.dataForm.startTime = data.coupon.startTime
this.dataForm.endTime = data.coupon.endTime
this.dataForm.useType = data.coupon.useType
this.dataForm.note = data.coupon.note
this.dataForm.publishCount = data.coupon.publishCount
this.dataForm.useCount = data.coupon.useCount
this.dataForm.receiveCount = data.coupon.receiveCount
this.dataForm.enableStartTime = data.coupon.enableStartTime
this.dataForm.enableEndTime = data.coupon.enableEndTime
this.dataForm.code = data.coupon.code
this.dataForm.memberLevel = data.coupon.memberLevel
this.dataForm.publish = data.coupon.publish
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/coupon/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponType': this.dataForm.couponType,
'couponImg': this.dataForm.couponImg,
'couponName': this.dataForm.couponName,
'num': this.dataForm.num,
'amount': this.dataForm.amount,
'perLimit': this.dataForm.perLimit,
'minPoint': this.dataForm.minPoint,
'startTime': this.dataForm.startTime,
'endTime': this.dataForm.endTime,
'useType': this.dataForm.useType,
'note': this.dataForm.note,
'publishCount': this.dataForm.publishCount,
'useCount': this.dataForm.useCount,
'receiveCount': this.dataForm.receiveCount,
'enableStartTime': this.dataForm.enableStartTime,
'enableEndTime': this.dataForm.enableEndTime,
'code': this.dataForm.code,
'memberLevel': this.dataForm.memberLevel,
'publish': this.dataForm.publish
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,271 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:coupon:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:coupon:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponType"
header-align="center"
align="center"
label="优惠卷类型[0->全场赠券1->会员赠券2->购物赠券3->注册赠券]">
</el-table-column>
<el-table-column
prop="couponImg"
header-align="center"
align="center"
label="优惠券图片">
</el-table-column>
<el-table-column
prop="couponName"
header-align="center"
align="center"
label="优惠卷名字">
</el-table-column>
<el-table-column
prop="num"
header-align="center"
align="center"
label="数量">
</el-table-column>
<el-table-column
prop="amount"
header-align="center"
align="center"
label="金额">
</el-table-column>
<el-table-column
prop="perLimit"
header-align="center"
align="center"
label="每人限领张数">
</el-table-column>
<el-table-column
prop="minPoint"
header-align="center"
align="center"
label="使用门槛">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="开始时间">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="结束时间">
</el-table-column>
<el-table-column
prop="useType"
header-align="center"
align="center"
label="使用类型[0->全场通用1->指定分类2->指定商品]">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="publishCount"
header-align="center"
align="center"
label="发行数量">
</el-table-column>
<el-table-column
prop="useCount"
header-align="center"
align="center"
label="已使用数量">
</el-table-column>
<el-table-column
prop="receiveCount"
header-align="center"
align="center"
label="领取数量">
</el-table-column>
<el-table-column
prop="enableStartTime"
header-align="center"
align="center"
label="可以领取的开始日期">
</el-table-column>
<el-table-column
prop="enableEndTime"
header-align="center"
align="center"
label="可以领取的结束日期">
</el-table-column>
<el-table-column
prop="code"
header-align="center"
align="center"
label="优惠码">
</el-table-column>
<el-table-column
prop="memberLevel"
header-align="center"
align="center"
label="可以领取的会员等级[0->不限等级,其他-对应等级]">
</el-table-column>
<el-table-column
prop="publish"
header-align="center"
align="center"
label="发布状态[0-未发布1-已发布]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './coupon-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/coupon/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/coupon/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,156 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="优惠券id" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="优惠券id"></el-input>
</el-form-item>
<el-form-item label="会员id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="会员id"></el-input>
</el-form-item>
<el-form-item label="会员名字" prop="memberNickName">
<el-input v-model="dataForm.memberNickName" placeholder="会员名字"></el-input>
</el-form-item>
<el-form-item label="获取方式[0->后台赠送1->主动领取]" prop="getType">
<el-input v-model="dataForm.getType" placeholder="获取方式[0->后台赠送1->主动领取]"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="使用状态[0->未使用1->已使用2->已过期]" prop="useType">
<el-input v-model="dataForm.useType" placeholder="使用状态[0->未使用1->已使用2->已过期]"></el-input>
</el-form-item>
<el-form-item label="使用时间" prop="useTime">
<el-input v-model="dataForm.useTime" placeholder="使用时间"></el-input>
</el-form-item>
<el-form-item label="订单id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="订单id"></el-input>
</el-form-item>
<el-form-item label="订单号" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="订单号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponId: '',
memberId: '',
memberNickName: '',
getType: '',
createTime: '',
useType: '',
useTime: '',
orderId: '',
orderSn: ''
},
dataRule: {
couponId: [
{ required: true, message: '优惠券id不能为空', trigger: 'blur' }
],
memberId: [
{ required: true, message: '会员id不能为空', trigger: 'blur' }
],
memberNickName: [
{ required: true, message: '会员名字不能为空', trigger: 'blur' }
],
getType: [
{ required: true, message: '获取方式[0->后台赠送1->主动领取]不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
useType: [
{ required: true, message: '使用状态[0->未使用1->已使用2->已过期]不能为空', trigger: 'blur' }
],
useTime: [
{ required: true, message: '使用时间不能为空', trigger: 'blur' }
],
orderId: [
{ required: true, message: '订单id不能为空', trigger: 'blur' }
],
orderSn: [
{ required: true, message: '订单号不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponhistory/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponId = data.couponHistory.couponId
this.dataForm.memberId = data.couponHistory.memberId
this.dataForm.memberNickName = data.couponHistory.memberNickName
this.dataForm.getType = data.couponHistory.getType
this.dataForm.createTime = data.couponHistory.createTime
this.dataForm.useType = data.couponHistory.useType
this.dataForm.useTime = data.couponHistory.useTime
this.dataForm.orderId = data.couponHistory.orderId
this.dataForm.orderSn = data.couponHistory.orderSn
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponhistory/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponId': this.dataForm.couponId,
'memberId': this.dataForm.memberId,
'memberNickName': this.dataForm.memberNickName,
'getType': this.dataForm.getType,
'createTime': this.dataForm.createTime,
'useType': this.dataForm.useType,
'useTime': this.dataForm.useTime,
'orderId': this.dataForm.orderId,
'orderSn': this.dataForm.orderSn
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,211 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:couponhistory:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:couponhistory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="优惠券id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="会员id">
</el-table-column>
<el-table-column
prop="memberNickName"
header-align="center"
align="center"
label="会员名字">
</el-table-column>
<el-table-column
prop="getType"
header-align="center"
align="center"
label="获取方式[0->后台赠送1->主动领取]">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="useType"
header-align="center"
align="center"
label="使用状态[0->未使用1->已使用2->已过期]">
</el-table-column>
<el-table-column
prop="useTime"
header-align="center"
align="center"
label="使用时间">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="订单id">
</el-table-column>
<el-table-column
prop="orderSn"
header-align="center"
align="center"
label="订单号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './couponhistory-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/couponhistory/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/couponhistory/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,102 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="优惠券id" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="优惠券id"></el-input>
</el-form-item>
<el-form-item label="产品分类id" prop="categoryId">
<el-input v-model="dataForm.categoryId" placeholder="产品分类id"></el-input>
</el-form-item>
<el-form-item label="产品分类名称" prop="categoryName">
<el-input v-model="dataForm.categoryName" placeholder="产品分类名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponId: '',
categoryId: '',
categoryName: ''
},
dataRule: {
couponId: [
{ required: true, message: '优惠券id不能为空', trigger: 'blur' }
],
categoryId: [
{ required: true, message: '产品分类id不能为空', trigger: 'blur' }
],
categoryName: [
{ required: true, message: '产品分类名称不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspucategoryrelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponId = data.couponSpuCategoryRelation.couponId
this.dataForm.categoryId = data.couponSpuCategoryRelation.categoryId
this.dataForm.categoryName = data.couponSpuCategoryRelation.categoryName
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspucategoryrelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponId': this.dataForm.couponId,
'categoryId': this.dataForm.categoryId,
'categoryName': this.dataForm.categoryName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,175 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:couponspucategoryrelation:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:couponspucategoryrelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="优惠券id">
</el-table-column>
<el-table-column
prop="categoryId"
header-align="center"
align="center"
label="产品分类id">
</el-table-column>
<el-table-column
prop="categoryName"
header-align="center"
align="center"
label="产品分类名称">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './couponspucategoryrelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/couponspucategoryrelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/couponspucategoryrelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,102 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="优惠券id" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="优惠券id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="spu_name" prop="spuName">
<el-input v-model="dataForm.spuName" placeholder="spu_name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
couponId: '',
spuId: '',
spuName: ''
},
dataRule: {
couponId: [
{ required: true, message: '优惠券id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
spuName: [
{ required: true, message: 'spu_name不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspurelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.couponId = data.couponSpuRelation.couponId
this.dataForm.spuId = data.couponSpuRelation.spuId
this.dataForm.spuName = data.couponSpuRelation.spuName
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/couponspurelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'couponId': this.dataForm.couponId,
'spuId': this.dataForm.spuId,
'spuName': this.dataForm.spuName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,175 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:couponspurelation:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:couponspurelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="优惠券id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="spuName"
header-align="center"
align="center"
label="spu_name">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './couponspurelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/couponspurelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/couponspurelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,174 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="名字" prop="name">
<el-input v-model="dataForm.name" placeholder="名字"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="pic">
<el-input v-model="dataForm.pic" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-input v-model="dataForm.startTime" placeholder="开始时间"></el-input>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-input v-model="dataForm.endTime" placeholder="结束时间"></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-input v-model="dataForm.status" placeholder="状态"></el-input>
</el-form-item>
<el-form-item label="点击数" prop="clickCount">
<el-input v-model="dataForm.clickCount" placeholder="点击数"></el-input>
</el-form-item>
<el-form-item label="广告详情连接地址" prop="url">
<el-input v-model="dataForm.url" placeholder="广告详情连接地址"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="发布者" prop="publisherId">
<el-input v-model="dataForm.publisherId" placeholder="发布者"></el-input>
</el-form-item>
<el-form-item label="审核者" prop="authId">
<el-input v-model="dataForm.authId" placeholder="审核者"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
pic: '',
startTime: '',
endTime: '',
status: '',
clickCount: '',
url: '',
note: '',
sort: '',
publisherId: '',
authId: ''
},
dataRule: {
name: [
{ required: true, message: '名字不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '图片地址不能为空', trigger: 'blur' }
],
startTime: [
{ required: true, message: '开始时间不能为空', trigger: 'blur' }
],
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '状态不能为空', trigger: 'blur' }
],
clickCount: [
{ required: true, message: '点击数不能为空', trigger: 'blur' }
],
url: [
{ required: true, message: '广告详情连接地址不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
publisherId: [
{ required: true, message: '发布者不能为空', trigger: 'blur' }
],
authId: [
{ required: true, message: '审核者不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/homeadv/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeAdv.name
this.dataForm.pic = data.homeAdv.pic
this.dataForm.startTime = data.homeAdv.startTime
this.dataForm.endTime = data.homeAdv.endTime
this.dataForm.status = data.homeAdv.status
this.dataForm.clickCount = data.homeAdv.clickCount
this.dataForm.url = data.homeAdv.url
this.dataForm.note = data.homeAdv.note
this.dataForm.sort = data.homeAdv.sort
this.dataForm.publisherId = data.homeAdv.publisherId
this.dataForm.authId = data.homeAdv.authId
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/homeadv/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'pic': this.dataForm.pic,
'startTime': this.dataForm.startTime,
'endTime': this.dataForm.endTime,
'status': this.dataForm.status,
'clickCount': this.dataForm.clickCount,
'url': this.dataForm.url,
'note': this.dataForm.note,
'sort': this.dataForm.sort,
'publisherId': this.dataForm.publisherId,
'authId': this.dataForm.authId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,223 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:homeadv:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:homeadv:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="名字">
</el-table-column>
<el-table-column
prop="pic"
header-align="center"
align="center"
label="图片地址">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="开始时间">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="结束时间">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
</el-table-column>
<el-table-column
prop="clickCount"
header-align="center"
align="center"
label="点击数">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
label="广告详情连接地址">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="publisherId"
header-align="center"
align="center"
label="发布者">
</el-table-column>
<el-table-column
prop="authId"
header-align="center"
align="center"
label="审核者">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './homeadv-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/homeadv/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/homeadv/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,138 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="专题名字" prop="name">
<el-input v-model="dataForm.name" placeholder="专题名字"></el-input>
</el-form-item>
<el-form-item label="专题标题" prop="title">
<el-input v-model="dataForm.title" placeholder="专题标题"></el-input>
</el-form-item>
<el-form-item label="专题副标题" prop="subTitle">
<el-input v-model="dataForm.subTitle" placeholder="专题副标题"></el-input>
</el-form-item>
<el-form-item label="显示状态" prop="status">
<el-input v-model="dataForm.status" placeholder="显示状态"></el-input>
</el-form-item>
<el-form-item label="详情连接" prop="url">
<el-input v-model="dataForm.url" placeholder="详情连接"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="专题图片地址" prop="img">
<el-input v-model="dataForm.img" placeholder="专题图片地址"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
title: '',
subTitle: '',
status: '',
url: '',
sort: '',
img: ''
},
dataRule: {
name: [
{ required: true, message: '专题名字不能为空', trigger: 'blur' }
],
title: [
{ required: true, message: '专题标题不能为空', trigger: 'blur' }
],
subTitle: [
{ required: true, message: '专题副标题不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '显示状态不能为空', trigger: 'blur' }
],
url: [
{ required: true, message: '详情连接不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
img: [
{ required: true, message: '专题图片地址不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubject/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeSubject.name
this.dataForm.title = data.homeSubject.title
this.dataForm.subTitle = data.homeSubject.subTitle
this.dataForm.status = data.homeSubject.status
this.dataForm.url = data.homeSubject.url
this.dataForm.sort = data.homeSubject.sort
this.dataForm.img = data.homeSubject.img
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubject/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'title': this.dataForm.title,
'subTitle': this.dataForm.subTitle,
'status': this.dataForm.status,
'url': this.dataForm.url,
'sort': this.dataForm.sort,
'img': this.dataForm.img
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,199 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:homesubject:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:homesubject:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="专题名字">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="专题标题">
</el-table-column>
<el-table-column
prop="subTitle"
header-align="center"
align="center"
label="专题副标题">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="显示状态">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
label="详情连接">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="img"
header-align="center"
align="center"
label="专题图片地址">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './homesubject-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/homesubject/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/homesubject/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="专题名字" prop="name">
<el-input v-model="dataForm.name" placeholder="专题名字"></el-input>
</el-form-item>
<el-form-item label="专题id" prop="subjectId">
<el-input v-model="dataForm.subjectId" placeholder="专题id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
subjectId: '',
spuId: '',
sort: ''
},
dataRule: {
name: [
{ required: true, message: '专题名字不能为空', trigger: 'blur' }
],
subjectId: [
{ required: true, message: '专题id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubjectspu/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.homeSubjectSpu.name
this.dataForm.subjectId = data.homeSubjectSpu.subjectId
this.dataForm.spuId = data.homeSubjectSpu.spuId
this.dataForm.sort = data.homeSubjectSpu.sort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/homesubjectspu/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'subjectId': this.dataForm.subjectId,
'spuId': this.dataForm.spuId,
'sort': this.dataForm.sort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:homesubjectspu:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:homesubjectspu:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="专题名字">
</el-table-column>
<el-table-column
prop="subjectId"
header-align="center"
align="center"
label="专题id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './homesubjectspu-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/homesubjectspu/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/homesubjectspu/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="会员等级id" prop="memberLevelId">
<el-input v-model="dataForm.memberLevelId" placeholder="会员等级id"></el-input>
</el-form-item>
<el-form-item label="会员等级名" prop="memberLevelName">
<el-input v-model="dataForm.memberLevelName" placeholder="会员等级名"></el-input>
</el-form-item>
<el-form-item label="会员对应价格" prop="memberPrice">
<el-input v-model="dataForm.memberPrice" placeholder="会员对应价格"></el-input>
</el-form-item>
<el-form-item label="可否叠加其他优惠[0-不可叠加优惠1-可叠加]" prop="addOther">
<el-input v-model="dataForm.addOther" placeholder="可否叠加其他优惠[0-不可叠加优惠1-可叠加]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
memberLevelId: '',
memberLevelName: '',
memberPrice: '',
addOther: ''
},
dataRule: {
skuId: [
{ required: true, message: 'sku_id不能为空', trigger: 'blur' }
],
memberLevelId: [
{ required: true, message: '会员等级id不能为空', trigger: 'blur' }
],
memberLevelName: [
{ required: true, message: '会员等级名不能为空', trigger: 'blur' }
],
memberPrice: [
{ required: true, message: '会员对应价格不能为空', trigger: 'blur' }
],
addOther: [
{ required: true, message: '可否叠加其他优惠[0-不可叠加优惠1-可叠加]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/memberprice/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.memberPrice.skuId
this.dataForm.memberLevelId = data.memberPrice.memberLevelId
this.dataForm.memberLevelName = data.memberPrice.memberLevelName
this.dataForm.memberPrice = data.memberPrice.memberPrice
this.dataForm.addOther = data.memberPrice.addOther
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/memberprice/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'memberLevelId': this.dataForm.memberLevelId,
'memberLevelName': this.dataForm.memberLevelName,
'memberPrice': this.dataForm.memberPrice,
'addOther': this.dataForm.addOther
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:memberprice:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:memberprice:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="memberLevelId"
header-align="center"
align="center"
label="会员等级id">
</el-table-column>
<el-table-column
prop="memberLevelName"
header-align="center"
align="center"
label="会员等级名">
</el-table-column>
<el-table-column
prop="memberPrice"
header-align="center"
align="center"
label="会员对应价格">
</el-table-column>
<el-table-column
prop="addOther"
header-align="center"
align="center"
label="可否叠加其他优惠[0-不可叠加优惠1-可叠加]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './memberprice-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/memberprice/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/memberprice/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="活动标题" prop="title">
<el-input v-model="dataForm.title" placeholder="活动标题"></el-input>
</el-form-item>
<el-form-item label="开始日期" prop="startTime">
<el-input v-model="dataForm.startTime" placeholder="开始日期"></el-input>
</el-form-item>
<el-form-item label="结束日期" prop="endTime">
<el-input v-model="dataForm.endTime" placeholder="结束日期"></el-input>
</el-form-item>
<el-form-item label="上下线状态" prop="status">
<el-input v-model="dataForm.status" placeholder="上下线状态"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="创建人" prop="userId">
<el-input v-model="dataForm.userId" placeholder="创建人"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
title: '',
startTime: '',
endTime: '',
status: '',
createTime: '',
userId: ''
},
dataRule: {
title: [
{ required: true, message: '活动标题不能为空', trigger: 'blur' }
],
startTime: [
{ required: true, message: '开始日期不能为空', trigger: 'blur' }
],
endTime: [
{ required: true, message: '结束日期不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '上下线状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
userId: [
{ required: true, message: '创建人不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillpromotion/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.title = data.seckillPromotion.title
this.dataForm.startTime = data.seckillPromotion.startTime
this.dataForm.endTime = data.seckillPromotion.endTime
this.dataForm.status = data.seckillPromotion.status
this.dataForm.createTime = data.seckillPromotion.createTime
this.dataForm.userId = data.seckillPromotion.userId
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillpromotion/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'title': this.dataForm.title,
'startTime': this.dataForm.startTime,
'endTime': this.dataForm.endTime,
'status': this.dataForm.status,
'createTime': this.dataForm.createTime,
'userId': this.dataForm.userId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:seckillpromotion:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:seckillpromotion:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="活动标题">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="开始日期">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="结束日期">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="上下线状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillpromotion-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillpromotion/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillpromotion/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="场次名称" prop="name">
<el-input v-model="dataForm.name" placeholder="场次名称"></el-input>
</el-form-item>
<el-form-item label="每日开始时间" prop="startTime">
<el-input v-model="dataForm.startTime" placeholder="每日开始时间"></el-input>
</el-form-item>
<el-form-item label="每日结束时间" prop="endTime">
<el-input v-model="dataForm.endTime" placeholder="每日结束时间"></el-input>
</el-form-item>
<el-form-item label="启用状态" prop="status">
<el-input v-model="dataForm.status" placeholder="启用状态"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
startTime: '',
endTime: '',
status: '',
createTime: ''
},
dataRule: {
name: [
{ required: true, message: '场次名称不能为空', trigger: 'blur' }
],
startTime: [
{ required: true, message: '每日开始时间不能为空', trigger: 'blur' }
],
endTime: [
{ required: true, message: '每日结束时间不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '启用状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillsession/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.seckillSession.name
this.dataForm.startTime = data.seckillSession.startTime
this.dataForm.endTime = data.seckillSession.endTime
this.dataForm.status = data.seckillSession.status
this.dataForm.createTime = data.seckillSession.createTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillsession/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'startTime': this.dataForm.startTime,
'endTime': this.dataForm.endTime,
'status': this.dataForm.status,
'createTime': this.dataForm.createTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:seckillsession:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:seckillsession:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="场次名称">
</el-table-column>
<el-table-column
prop="startTime"
header-align="center"
align="center"
label="每日开始时间">
</el-table-column>
<el-table-column
prop="endTime"
header-align="center"
align="center"
label="每日结束时间">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="启用状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillsession-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillsession/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillsession/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="活动场次id" prop="sessionId">
<el-input v-model="dataForm.sessionId" placeholder="活动场次id"></el-input>
</el-form-item>
<el-form-item label="订阅时间" prop="subcribeTime">
<el-input v-model="dataForm.subcribeTime" placeholder="订阅时间"></el-input>
</el-form-item>
<el-form-item label="发送时间" prop="sendTime">
<el-input v-model="dataForm.sendTime" placeholder="发送时间"></el-input>
</el-form-item>
<el-form-item label="通知方式[0-短信1-邮件]" prop="noticeType">
<el-input v-model="dataForm.noticeType" placeholder="通知方式[0-短信1-邮件]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
skuId: '',
sessionId: '',
subcribeTime: '',
sendTime: '',
noticeType: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
skuId: [
{ required: true, message: 'sku_id不能为空', trigger: 'blur' }
],
sessionId: [
{ required: true, message: '活动场次id不能为空', trigger: 'blur' }
],
subcribeTime: [
{ required: true, message: '订阅时间不能为空', trigger: 'blur' }
],
sendTime: [
{ required: true, message: '发送时间不能为空', trigger: 'blur' }
],
noticeType: [
{ required: true, message: '通知方式[0-短信1-邮件]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillskunotice/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.seckillSkuNotice.memberId
this.dataForm.skuId = data.seckillSkuNotice.skuId
this.dataForm.sessionId = data.seckillSkuNotice.sessionId
this.dataForm.subcribeTime = data.seckillSkuNotice.subcribeTime
this.dataForm.sendTime = data.seckillSkuNotice.sendTime
this.dataForm.noticeType = data.seckillSkuNotice.noticeType
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillskunotice/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'skuId': this.dataForm.skuId,
'sessionId': this.dataForm.sessionId,
'subcribeTime': this.dataForm.subcribeTime,
'sendTime': this.dataForm.sendTime,
'noticeType': this.dataForm.noticeType
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:seckillskunotice:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:seckillskunotice:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="sessionId"
header-align="center"
align="center"
label="活动场次id">
</el-table-column>
<el-table-column
prop="subcribeTime"
header-align="center"
align="center"
label="订阅时间">
</el-table-column>
<el-table-column
prop="sendTime"
header-align="center"
align="center"
label="发送时间">
</el-table-column>
<el-table-column
prop="noticeType"
header-align="center"
align="center"
label="通知方式[0-短信1-邮件]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillskunotice-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillskunotice/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillskunotice/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,138 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="活动id" prop="promotionId">
<el-input v-model="dataForm.promotionId" placeholder="活动id"></el-input>
</el-form-item>
<el-form-item label="活动场次id" prop="promotionSessionId">
<el-input v-model="dataForm.promotionSessionId" placeholder="活动场次id"></el-input>
</el-form-item>
<el-form-item label="商品id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="商品id"></el-input>
</el-form-item>
<el-form-item label="秒杀价格" prop="seckillPrice">
<el-input v-model="dataForm.seckillPrice" placeholder="秒杀价格"></el-input>
</el-form-item>
<el-form-item label="秒杀总量" prop="seckillCount">
<el-input v-model="dataForm.seckillCount" placeholder="秒杀总量"></el-input>
</el-form-item>
<el-form-item label="每人限购数量" prop="seckillLimit">
<el-input v-model="dataForm.seckillLimit" placeholder="每人限购数量"></el-input>
</el-form-item>
<el-form-item label="排序" prop="seckillSort">
<el-input v-model="dataForm.seckillSort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
promotionId: '',
promotionSessionId: '',
skuId: '',
seckillPrice: '',
seckillCount: '',
seckillLimit: '',
seckillSort: ''
},
dataRule: {
promotionId: [
{ required: true, message: '活动id不能为空', trigger: 'blur' }
],
promotionSessionId: [
{ required: true, message: '活动场次id不能为空', trigger: 'blur' }
],
skuId: [
{ required: true, message: '商品id不能为空', trigger: 'blur' }
],
seckillPrice: [
{ required: true, message: '秒杀价格不能为空', trigger: 'blur' }
],
seckillCount: [
{ required: true, message: '秒杀总量不能为空', trigger: 'blur' }
],
seckillLimit: [
{ required: true, message: '每人限购数量不能为空', trigger: 'blur' }
],
seckillSort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillskurelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.promotionId = data.seckillSkuRelation.promotionId
this.dataForm.promotionSessionId = data.seckillSkuRelation.promotionSessionId
this.dataForm.skuId = data.seckillSkuRelation.skuId
this.dataForm.seckillPrice = data.seckillSkuRelation.seckillPrice
this.dataForm.seckillCount = data.seckillSkuRelation.seckillCount
this.dataForm.seckillLimit = data.seckillSkuRelation.seckillLimit
this.dataForm.seckillSort = data.seckillSkuRelation.seckillSort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/seckillskurelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'promotionId': this.dataForm.promotionId,
'promotionSessionId': this.dataForm.promotionSessionId,
'skuId': this.dataForm.skuId,
'seckillPrice': this.dataForm.seckillPrice,
'seckillCount': this.dataForm.seckillCount,
'seckillLimit': this.dataForm.seckillLimit,
'seckillSort': this.dataForm.seckillSort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,199 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:seckillskurelation:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:seckillskurelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="promotionId"
header-align="center"
align="center"
label="活动id">
</el-table-column>
<el-table-column
prop="promotionSessionId"
header-align="center"
align="center"
label="活动场次id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="商品id">
</el-table-column>
<el-table-column
prop="seckillPrice"
header-align="center"
align="center"
label="秒杀价格">
</el-table-column>
<el-table-column
prop="seckillCount"
header-align="center"
align="center"
label="秒杀总量">
</el-table-column>
<el-table-column
prop="seckillLimit"
header-align="center"
align="center"
label="每人限购数量">
</el-table-column>
<el-table-column
prop="seckillSort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './seckillskurelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/seckillskurelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/seckillskurelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="spu_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="满多少" prop="fullPrice">
<el-input v-model="dataForm.fullPrice" placeholder="满多少"></el-input>
</el-form-item>
<el-form-item label="减多少" prop="reducePrice">
<el-input v-model="dataForm.reducePrice" placeholder="减多少"></el-input>
</el-form-item>
<el-form-item label="是否参与其他优惠" prop="addOther">
<el-input v-model="dataForm.addOther" placeholder="是否参与其他优惠"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
fullPrice: '',
reducePrice: '',
addOther: ''
},
dataRule: {
skuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
fullPrice: [
{ required: true, message: '满多少不能为空', trigger: 'blur' }
],
reducePrice: [
{ required: true, message: '减多少不能为空', trigger: 'blur' }
],
addOther: [
{ required: true, message: '是否参与其他优惠不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/skufullreduction/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.skuFullReduction.skuId
this.dataForm.fullPrice = data.skuFullReduction.fullPrice
this.dataForm.reducePrice = data.skuFullReduction.reducePrice
this.dataForm.addOther = data.skuFullReduction.addOther
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/skufullreduction/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'fullPrice': this.dataForm.fullPrice,
'reducePrice': this.dataForm.reducePrice,
'addOther': this.dataForm.addOther
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:skufullreduction:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:skufullreduction:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="fullPrice"
header-align="center"
align="center"
label="满多少">
</el-table-column>
<el-table-column
prop="reducePrice"
header-align="center"
align="center"
label="减多少">
</el-table-column>
<el-table-column
prop="addOther"
header-align="center"
align="center"
label="是否参与其他优惠">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skufullreduction-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/skufullreduction/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/skufullreduction/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="spu_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="满几件" prop="fullCount">
<el-input v-model="dataForm.fullCount" placeholder="满几件"></el-input>
</el-form-item>
<el-form-item label="打几折" prop="discount">
<el-input v-model="dataForm.discount" placeholder="打几折"></el-input>
</el-form-item>
<el-form-item label="折后价" prop="price">
<el-input v-model="dataForm.price" placeholder="折后价"></el-input>
</el-form-item>
<el-form-item label="是否叠加其他优惠[0-不可叠加1-可叠加]" prop="addOther">
<el-input v-model="dataForm.addOther" placeholder="是否叠加其他优惠[0-不可叠加1-可叠加]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
fullCount: '',
discount: '',
price: '',
addOther: ''
},
dataRule: {
skuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
fullCount: [
{ required: true, message: '满几件不能为空', trigger: 'blur' }
],
discount: [
{ required: true, message: '打几折不能为空', trigger: 'blur' }
],
price: [
{ required: true, message: '折后价不能为空', trigger: 'blur' }
],
addOther: [
{ required: true, message: '是否叠加其他优惠[0-不可叠加1-可叠加]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/skuladder/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.skuLadder.skuId
this.dataForm.fullCount = data.skuLadder.fullCount
this.dataForm.discount = data.skuLadder.discount
this.dataForm.price = data.skuLadder.price
this.dataForm.addOther = data.skuLadder.addOther
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/skuladder/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'fullCount': this.dataForm.fullCount,
'discount': this.dataForm.discount,
'price': this.dataForm.price,
'addOther': this.dataForm.addOther
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:skuladder:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:skuladder:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="fullCount"
header-align="center"
align="center"
label="满几件">
</el-table-column>
<el-table-column
prop="discount"
header-align="center"
align="center"
label="打几折">
</el-table-column>
<el-table-column
prop="price"
header-align="center"
align="center"
label="折后价">
</el-table-column>
<el-table-column
prop="addOther"
header-align="center"
align="center"
label="是否叠加其他优惠[0-不可叠加1-可叠加]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skuladder-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/skuladder/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/skuladder/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="成长积分" prop="growBounds">
<el-input v-model="dataForm.growBounds" placeholder="成长积分"></el-input>
</el-form-item>
<el-form-item label="购物积分" prop="buyBounds">
<el-input v-model="dataForm.buyBounds" placeholder="购物积分"></el-input>
</el-form-item>
<el-form-item label="优惠生效情况[1111四个状态位从右到左;0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠购物积分是否赠送【状态位0不赠送1赠送】]" prop="work">
<el-input v-model="dataForm.work" placeholder="优惠生效情况[1111四个状态位从右到左;0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠购物积分是否赠送【状态位0不赠送1赠送】]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
spuId: '',
growBounds: '',
buyBounds: '',
work: ''
},
dataRule: {
spuId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
growBounds: [
{ required: true, message: '成长积分不能为空', trigger: 'blur' }
],
buyBounds: [
{ required: true, message: '购物积分不能为空', trigger: 'blur' }
],
work: [
{ required: true, message: '优惠生效情况[1111四个状态位从右到左;0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠购物积分是否赠送【状态位0不赠送1赠送】]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/coupon/spubounds/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.spuId = data.spuBounds.spuId
this.dataForm.growBounds = data.spuBounds.growBounds
this.dataForm.buyBounds = data.spuBounds.buyBounds
this.dataForm.work = data.spuBounds.work
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/coupon/spubounds/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'spuId': this.dataForm.spuId,
'growBounds': this.dataForm.growBounds,
'buyBounds': this.dataForm.buyBounds,
'work': this.dataForm.work
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('coupon:spubounds:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('coupon:spubounds:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="growBounds"
header-align="center"
align="center"
label="成长积分">
</el-table-column>
<el-table-column
prop="buyBounds"
header-align="center"
align="center"
label="购物积分">
</el-table-column>
<el-table-column
prop="work"
header-align="center"
align="center"
label="优惠生效情况[1111四个状态位从右到左;0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠购物积分是否赠送【状态位0不赠送1赠送】]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './spubounds-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/coupon/spubounds/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/coupon/spubounds/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="create_time" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="create_time"></el-input>
</el-form-item>
<el-form-item label="改变的值(正负计数)" prop="changeCount">
<el-input v-model="dataForm.changeCount" placeholder="改变的值(正负计数)"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="积分来源[0-购物1-管理员修改]" prop="sourceType">
<el-input v-model="dataForm.sourceType" placeholder="积分来源[0-购物1-管理员修改]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
createTime: '',
changeCount: '',
note: '',
sourceType: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: 'create_time不能为空', trigger: 'blur' }
],
changeCount: [
{ required: true, message: '改变的值(正负计数)不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
sourceType: [
{ required: true, message: '积分来源[0-购物1-管理员修改]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/growthchangehistory/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.growthChangeHistory.memberId
this.dataForm.createTime = data.growthChangeHistory.createTime
this.dataForm.changeCount = data.growthChangeHistory.changeCount
this.dataForm.note = data.growthChangeHistory.note
this.dataForm.sourceType = data.growthChangeHistory.sourceType
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/growthchangehistory/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'createTime': this.dataForm.createTime,
'changeCount': this.dataForm.changeCount,
'note': this.dataForm.note,
'sourceType': this.dataForm.sourceType
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:growthchangehistory:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:growthchangehistory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="create_time">
</el-table-column>
<el-table-column
prop="changeCount"
header-align="center"
align="center"
label="改变的值(正负计数)">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="sourceType"
header-align="center"
align="center"
label="积分来源[0-购物1-管理员修改]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './growthchangehistory-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/growthchangehistory/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/growthchangehistory/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="create_time" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="create_time"></el-input>
</el-form-item>
<el-form-item label="变化的值" prop="changeCount">
<el-input v-model="dataForm.changeCount" placeholder="变化的值"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="来源[0->购物1->管理员修改;2->活动]" prop="sourceTyoe">
<el-input v-model="dataForm.sourceTyoe" placeholder="来源[0->购物1->管理员修改;2->活动]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
createTime: '',
changeCount: '',
note: '',
sourceTyoe: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: 'create_time不能为空', trigger: 'blur' }
],
changeCount: [
{ required: true, message: '变化的值不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
sourceTyoe: [
{ required: true, message: '来源[0->购物1->管理员修改;2->活动]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/integrationchangehistory/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.integrationChangeHistory.memberId
this.dataForm.createTime = data.integrationChangeHistory.createTime
this.dataForm.changeCount = data.integrationChangeHistory.changeCount
this.dataForm.note = data.integrationChangeHistory.note
this.dataForm.sourceTyoe = data.integrationChangeHistory.sourceTyoe
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/integrationchangehistory/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'createTime': this.dataForm.createTime,
'changeCount': this.dataForm.changeCount,
'note': this.dataForm.note,
'sourceTyoe': this.dataForm.sourceTyoe
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:integrationchangehistory:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:integrationchangehistory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="create_time">
</el-table-column>
<el-table-column
prop="changeCount"
header-align="center"
align="center"
label="变化的值">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="sourceTyoe"
header-align="center"
align="center"
label="来源[0->购物1->管理员修改;2->活动]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './integrationchangehistory-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/integrationchangehistory/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/integrationchangehistory/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,228 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="会员等级id" prop="levelId">
<el-input v-model="dataForm.levelId" placeholder="会员等级id"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="username">
<el-input v-model="dataForm.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="dataForm.password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item label="昵称" prop="nickname">
<el-input v-model="dataForm.nickname" placeholder="昵称"></el-input>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号码"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="头像" prop="header">
<el-input v-model="dataForm.header" placeholder="头像"></el-input>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input v-model="dataForm.gender" placeholder="性别"></el-input>
</el-form-item>
<el-form-item label="生日" prop="birth">
<el-input v-model="dataForm.birth" placeholder="生日"></el-input>
</el-form-item>
<el-form-item label="所在城市" prop="city">
<el-input v-model="dataForm.city" placeholder="所在城市"></el-input>
</el-form-item>
<el-form-item label="职业" prop="job">
<el-input v-model="dataForm.job" placeholder="职业"></el-input>
</el-form-item>
<el-form-item label="个性签名" prop="sign">
<el-input v-model="dataForm.sign" placeholder="个性签名"></el-input>
</el-form-item>
<el-form-item label="用户来源" prop="sourceType">
<el-input v-model="dataForm.sourceType" placeholder="用户来源"></el-input>
</el-form-item>
<el-form-item label="积分" prop="integration">
<el-input v-model="dataForm.integration" placeholder="积分"></el-input>
</el-form-item>
<el-form-item label="成长值" prop="growth">
<el-input v-model="dataForm.growth" placeholder="成长值"></el-input>
</el-form-item>
<el-form-item label="启用状态" prop="status">
<el-input v-model="dataForm.status" placeholder="启用状态"></el-input>
</el-form-item>
<el-form-item label="注册时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="注册时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
levelId: '',
username: '',
password: '',
nickname: '',
mobile: '',
email: '',
header: '',
gender: '',
birth: '',
city: '',
job: '',
sign: '',
sourceType: '',
integration: '',
growth: '',
status: '',
createTime: ''
},
dataRule: {
levelId: [
{ required: true, message: '会员等级id不能为空', trigger: 'blur' }
],
username: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
nickname: [
{ required: true, message: '昵称不能为空', trigger: 'blur' }
],
mobile: [
{ required: true, message: '手机号码不能为空', trigger: 'blur' }
],
email: [
{ required: true, message: '邮箱不能为空', trigger: 'blur' }
],
header: [
{ required: true, message: '头像不能为空', trigger: 'blur' }
],
gender: [
{ required: true, message: '性别不能为空', trigger: 'blur' }
],
birth: [
{ required: true, message: '生日不能为空', trigger: 'blur' }
],
city: [
{ required: true, message: '所在城市不能为空', trigger: 'blur' }
],
job: [
{ required: true, message: '职业不能为空', trigger: 'blur' }
],
sign: [
{ required: true, message: '个性签名不能为空', trigger: 'blur' }
],
sourceType: [
{ required: true, message: '用户来源不能为空', trigger: 'blur' }
],
integration: [
{ required: true, message: '积分不能为空', trigger: 'blur' }
],
growth: [
{ required: true, message: '成长值不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '启用状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '注册时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/member/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.levelId = data.member.levelId
this.dataForm.username = data.member.username
this.dataForm.password = data.member.password
this.dataForm.nickname = data.member.nickname
this.dataForm.mobile = data.member.mobile
this.dataForm.email = data.member.email
this.dataForm.header = data.member.header
this.dataForm.gender = data.member.gender
this.dataForm.birth = data.member.birth
this.dataForm.city = data.member.city
this.dataForm.job = data.member.job
this.dataForm.sign = data.member.sign
this.dataForm.sourceType = data.member.sourceType
this.dataForm.integration = data.member.integration
this.dataForm.growth = data.member.growth
this.dataForm.status = data.member.status
this.dataForm.createTime = data.member.createTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/member/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'levelId': this.dataForm.levelId,
'username': this.dataForm.username,
'password': this.dataForm.password,
'nickname': this.dataForm.nickname,
'mobile': this.dataForm.mobile,
'email': this.dataForm.email,
'header': this.dataForm.header,
'gender': this.dataForm.gender,
'birth': this.dataForm.birth,
'city': this.dataForm.city,
'job': this.dataForm.job,
'sign': this.dataForm.sign,
'sourceType': this.dataForm.sourceType,
'integration': this.dataForm.integration,
'growth': this.dataForm.growth,
'status': this.dataForm.status,
'createTime': this.dataForm.createTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,259 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:member:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:member:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="levelId"
header-align="center"
align="center"
label="会员等级id">
</el-table-column>
<el-table-column
prop="username"
header-align="center"
align="center"
label="用户名">
</el-table-column>
<el-table-column
prop="password"
header-align="center"
align="center"
label="密码">
</el-table-column>
<el-table-column
prop="nickname"
header-align="center"
align="center"
label="昵称">
</el-table-column>
<el-table-column
prop="mobile"
header-align="center"
align="center"
label="手机号码">
</el-table-column>
<el-table-column
prop="email"
header-align="center"
align="center"
label="邮箱">
</el-table-column>
<el-table-column
prop="header"
header-align="center"
align="center"
label="头像">
</el-table-column>
<el-table-column
prop="gender"
header-align="center"
align="center"
label="性别">
</el-table-column>
<el-table-column
prop="birth"
header-align="center"
align="center"
label="生日">
</el-table-column>
<el-table-column
prop="city"
header-align="center"
align="center"
label="所在城市">
</el-table-column>
<el-table-column
prop="job"
header-align="center"
align="center"
label="职业">
</el-table-column>
<el-table-column
prop="sign"
header-align="center"
align="center"
label="个性签名">
</el-table-column>
<el-table-column
prop="sourceType"
header-align="center"
align="center"
label="用户来源">
</el-table-column>
<el-table-column
prop="integration"
header-align="center"
align="center"
label="积分">
</el-table-column>
<el-table-column
prop="growth"
header-align="center"
align="center"
label="成长值">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="启用状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="注册时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './member-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/member/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/member/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="会员id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="会员id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="spu_name" prop="spuName">
<el-input v-model="dataForm.spuName" placeholder="spu_name"></el-input>
</el-form-item>
<el-form-item label="spu_img" prop="spuImg">
<el-input v-model="dataForm.spuImg" placeholder="spu_img"></el-input>
</el-form-item>
<el-form-item label="create_time" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="create_time"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
spuId: '',
spuName: '',
spuImg: '',
createTime: ''
},
dataRule: {
memberId: [
{ required: true, message: '会员id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
spuName: [
{ required: true, message: 'spu_name不能为空', trigger: 'blur' }
],
spuImg: [
{ required: true, message: 'spu_img不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: 'create_time不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/membercollectspu/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.memberCollectSpu.memberId
this.dataForm.spuId = data.memberCollectSpu.spuId
this.dataForm.spuName = data.memberCollectSpu.spuName
this.dataForm.spuImg = data.memberCollectSpu.spuImg
this.dataForm.createTime = data.memberCollectSpu.createTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/membercollectspu/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'spuId': this.dataForm.spuId,
'spuName': this.dataForm.spuName,
'spuImg': this.dataForm.spuImg,
'createTime': this.dataForm.createTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:membercollectspu:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:membercollectspu:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="会员id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="spuName"
header-align="center"
align="center"
label="spu_name">
</el-table-column>
<el-table-column
prop="spuImg"
header-align="center"
align="center"
label="spu_img">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="create_time">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './membercollectspu-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/membercollectspu/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/membercollectspu/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="subject_id" prop="subjectId">
<el-input v-model="dataForm.subjectId" placeholder="subject_id"></el-input>
</el-form-item>
<el-form-item label="subject_name" prop="subjectName">
<el-input v-model="dataForm.subjectName" placeholder="subject_name"></el-input>
</el-form-item>
<el-form-item label="subject_img" prop="subjectImg">
<el-input v-model="dataForm.subjectImg" placeholder="subject_img"></el-input>
</el-form-item>
<el-form-item label="活动url" prop="subjectUrll">
<el-input v-model="dataForm.subjectUrll" placeholder="活动url"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
subjectId: '',
subjectName: '',
subjectImg: '',
subjectUrll: ''
},
dataRule: {
subjectId: [
{ required: true, message: 'subject_id不能为空', trigger: 'blur' }
],
subjectName: [
{ required: true, message: 'subject_name不能为空', trigger: 'blur' }
],
subjectImg: [
{ required: true, message: 'subject_img不能为空', trigger: 'blur' }
],
subjectUrll: [
{ required: true, message: '活动url不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/membercollectsubject/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.subjectId = data.memberCollectSubject.subjectId
this.dataForm.subjectName = data.memberCollectSubject.subjectName
this.dataForm.subjectImg = data.memberCollectSubject.subjectImg
this.dataForm.subjectUrll = data.memberCollectSubject.subjectUrll
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/membercollectsubject/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'subjectId': this.dataForm.subjectId,
'subjectName': this.dataForm.subjectName,
'subjectImg': this.dataForm.subjectImg,
'subjectUrll': this.dataForm.subjectUrll
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:membercollectsubject:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:membercollectsubject:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="subjectId"
header-align="center"
align="center"
label="subject_id">
</el-table-column>
<el-table-column
prop="subjectName"
header-align="center"
align="center"
label="subject_name">
</el-table-column>
<el-table-column
prop="subjectImg"
header-align="center"
align="center"
label="subject_img">
</el-table-column>
<el-table-column
prop="subjectUrll"
header-align="center"
align="center"
label="活动url">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './membercollectsubject-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/membercollectsubject/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/membercollectsubject/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,156 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="等级名称" prop="name">
<el-input v-model="dataForm.name" placeholder="等级名称"></el-input>
</el-form-item>
<el-form-item label="等级需要的成长值" prop="growthPoint">
<el-input v-model="dataForm.growthPoint" placeholder="等级需要的成长值"></el-input>
</el-form-item>
<el-form-item label="是否为默认等级[0->不是1->是]" prop="defaultStatus">
<el-input v-model="dataForm.defaultStatus" placeholder="是否为默认等级[0->不是1->是]"></el-input>
</el-form-item>
<el-form-item label="免运费标准" prop="freeFreightPoint">
<el-input v-model="dataForm.freeFreightPoint" placeholder="免运费标准"></el-input>
</el-form-item>
<el-form-item label="每次评价获取的成长值" prop="commentGrowthPoint">
<el-input v-model="dataForm.commentGrowthPoint" placeholder="每次评价获取的成长值"></el-input>
</el-form-item>
<el-form-item label="是否有免邮特权" prop="priviledgeFreeFreight">
<el-input v-model="dataForm.priviledgeFreeFreight" placeholder="是否有免邮特权"></el-input>
</el-form-item>
<el-form-item label="是否有会员价格特权" prop="priviledgeMemberPrice">
<el-input v-model="dataForm.priviledgeMemberPrice" placeholder="是否有会员价格特权"></el-input>
</el-form-item>
<el-form-item label="是否有生日特权" prop="priviledgeBirthday">
<el-input v-model="dataForm.priviledgeBirthday" placeholder="是否有生日特权"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
growthPoint: '',
defaultStatus: '',
freeFreightPoint: '',
commentGrowthPoint: '',
priviledgeFreeFreight: '',
priviledgeMemberPrice: '',
priviledgeBirthday: '',
note: ''
},
dataRule: {
name: [
{ required: true, message: '等级名称不能为空', trigger: 'blur' }
],
growthPoint: [
{ required: true, message: '等级需要的成长值不能为空', trigger: 'blur' }
],
defaultStatus: [
{ required: true, message: '是否为默认等级[0->不是1->是]不能为空', trigger: 'blur' }
],
freeFreightPoint: [
{ required: true, message: '免运费标准不能为空', trigger: 'blur' }
],
commentGrowthPoint: [
{ required: true, message: '每次评价获取的成长值不能为空', trigger: 'blur' }
],
priviledgeFreeFreight: [
{ required: true, message: '是否有免邮特权不能为空', trigger: 'blur' }
],
priviledgeMemberPrice: [
{ required: true, message: '是否有会员价格特权不能为空', trigger: 'blur' }
],
priviledgeBirthday: [
{ required: true, message: '是否有生日特权不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/memberlevel/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.memberLevel.name
this.dataForm.growthPoint = data.memberLevel.growthPoint
this.dataForm.defaultStatus = data.memberLevel.defaultStatus
this.dataForm.freeFreightPoint = data.memberLevel.freeFreightPoint
this.dataForm.commentGrowthPoint = data.memberLevel.commentGrowthPoint
this.dataForm.priviledgeFreeFreight = data.memberLevel.priviledgeFreeFreight
this.dataForm.priviledgeMemberPrice = data.memberLevel.priviledgeMemberPrice
this.dataForm.priviledgeBirthday = data.memberLevel.priviledgeBirthday
this.dataForm.note = data.memberLevel.note
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/memberlevel/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'growthPoint': this.dataForm.growthPoint,
'defaultStatus': this.dataForm.defaultStatus,
'freeFreightPoint': this.dataForm.freeFreightPoint,
'commentGrowthPoint': this.dataForm.commentGrowthPoint,
'priviledgeFreeFreight': this.dataForm.priviledgeFreeFreight,
'priviledgeMemberPrice': this.dataForm.priviledgeMemberPrice,
'priviledgeBirthday': this.dataForm.priviledgeBirthday,
'note': this.dataForm.note
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,211 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:memberlevel:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:memberlevel:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="等级名称">
</el-table-column>
<el-table-column
prop="growthPoint"
header-align="center"
align="center"
label="等级需要的成长值">
</el-table-column>
<el-table-column
prop="defaultStatus"
header-align="center"
align="center"
label="是否为默认等级[0->不是1->是]">
</el-table-column>
<el-table-column
prop="freeFreightPoint"
header-align="center"
align="center"
label="免运费标准">
</el-table-column>
<el-table-column
prop="commentGrowthPoint"
header-align="center"
align="center"
label="每次评价获取的成长值">
</el-table-column>
<el-table-column
prop="priviledgeFreeFreight"
header-align="center"
align="center"
label="是否有免邮特权">
</el-table-column>
<el-table-column
prop="priviledgeMemberPrice"
header-align="center"
align="center"
label="是否有会员价格特权">
</el-table-column>
<el-table-column
prop="priviledgeBirthday"
header-align="center"
align="center"
label="是否有生日特权">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './memberlevel-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/memberlevel/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/memberlevel/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="ip" prop="ip">
<el-input v-model="dataForm.ip" placeholder="ip"></el-input>
</el-form-item>
<el-form-item label="city" prop="city">
<el-input v-model="dataForm.city" placeholder="city"></el-input>
</el-form-item>
<el-form-item label="登录类型[1-web2-app]" prop="loginType">
<el-input v-model="dataForm.loginType" placeholder="登录类型[1-web2-app]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
createTime: '',
ip: '',
city: '',
loginType: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
ip: [
{ required: true, message: 'ip不能为空', trigger: 'blur' }
],
city: [
{ required: true, message: 'city不能为空', trigger: 'blur' }
],
loginType: [
{ required: true, message: '登录类型[1-web2-app]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/memberloginlog/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.memberLoginLog.memberId
this.dataForm.createTime = data.memberLoginLog.createTime
this.dataForm.ip = data.memberLoginLog.ip
this.dataForm.city = data.memberLoginLog.city
this.dataForm.loginType = data.memberLoginLog.loginType
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/memberloginlog/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'createTime': this.dataForm.createTime,
'ip': this.dataForm.ip,
'city': this.dataForm.city,
'loginType': this.dataForm.loginType
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:memberloginlog:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:memberloginlog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="ip"
header-align="center"
align="center"
label="ip">
</el-table-column>
<el-table-column
prop="city"
header-align="center"
align="center"
label="city">
</el-table-column>
<el-table-column
prop="loginType"
header-align="center"
align="center"
label="登录类型[1-web2-app]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './memberloginlog-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/memberloginlog/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/memberloginlog/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,165 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="收货人姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="收货人姓名"></el-input>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="dataForm.phone" placeholder="电话"></el-input>
</el-form-item>
<el-form-item label="邮政编码" prop="postCode">
<el-input v-model="dataForm.postCode" placeholder="邮政编码"></el-input>
</el-form-item>
<el-form-item label="省份/直辖市" prop="province">
<el-input v-model="dataForm.province" placeholder="省份/直辖市"></el-input>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input v-model="dataForm.city" placeholder="城市"></el-input>
</el-form-item>
<el-form-item label="区" prop="region">
<el-input v-model="dataForm.region" placeholder="区"></el-input>
</el-form-item>
<el-form-item label="详细地址(街道)" prop="detailAddress">
<el-input v-model="dataForm.detailAddress" placeholder="详细地址(街道)"></el-input>
</el-form-item>
<el-form-item label="省市区代码" prop="areacode">
<el-input v-model="dataForm.areacode" placeholder="省市区代码"></el-input>
</el-form-item>
<el-form-item label="是否默认" prop="defaultStatus">
<el-input v-model="dataForm.defaultStatus" placeholder="是否默认"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
name: '',
phone: '',
postCode: '',
province: '',
city: '',
region: '',
detailAddress: '',
areacode: '',
defaultStatus: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '收货人姓名不能为空', trigger: 'blur' }
],
phone: [
{ required: true, message: '电话不能为空', trigger: 'blur' }
],
postCode: [
{ required: true, message: '邮政编码不能为空', trigger: 'blur' }
],
province: [
{ required: true, message: '省份/直辖市不能为空', trigger: 'blur' }
],
city: [
{ required: true, message: '城市不能为空', trigger: 'blur' }
],
region: [
{ required: true, message: '区不能为空', trigger: 'blur' }
],
detailAddress: [
{ required: true, message: '详细地址(街道)不能为空', trigger: 'blur' }
],
areacode: [
{ required: true, message: '省市区代码不能为空', trigger: 'blur' }
],
defaultStatus: [
{ required: true, message: '是否默认不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/memberreceiveaddress/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.memberReceiveAddress.memberId
this.dataForm.name = data.memberReceiveAddress.name
this.dataForm.phone = data.memberReceiveAddress.phone
this.dataForm.postCode = data.memberReceiveAddress.postCode
this.dataForm.province = data.memberReceiveAddress.province
this.dataForm.city = data.memberReceiveAddress.city
this.dataForm.region = data.memberReceiveAddress.region
this.dataForm.detailAddress = data.memberReceiveAddress.detailAddress
this.dataForm.areacode = data.memberReceiveAddress.areacode
this.dataForm.defaultStatus = data.memberReceiveAddress.defaultStatus
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/memberreceiveaddress/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'name': this.dataForm.name,
'phone': this.dataForm.phone,
'postCode': this.dataForm.postCode,
'province': this.dataForm.province,
'city': this.dataForm.city,
'region': this.dataForm.region,
'detailAddress': this.dataForm.detailAddress,
'areacode': this.dataForm.areacode,
'defaultStatus': this.dataForm.defaultStatus
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,217 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:memberreceiveaddress:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:memberreceiveaddress:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="收货人姓名">
</el-table-column>
<el-table-column
prop="phone"
header-align="center"
align="center"
label="电话">
</el-table-column>
<el-table-column
prop="postCode"
header-align="center"
align="center"
label="邮政编码">
</el-table-column>
<el-table-column
prop="province"
header-align="center"
align="center"
label="省份/直辖市">
</el-table-column>
<el-table-column
prop="city"
header-align="center"
align="center"
label="城市">
</el-table-column>
<el-table-column
prop="region"
header-align="center"
align="center"
label="区">
</el-table-column>
<el-table-column
prop="detailAddress"
header-align="center"
align="center"
label="详细地址(街道)">
</el-table-column>
<el-table-column
prop="areacode"
header-align="center"
align="center"
label="省市区代码">
</el-table-column>
<el-table-column
prop="defaultStatus"
header-align="center"
align="center"
label="是否默认">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './memberreceiveaddress-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/memberreceiveaddress/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/memberreceiveaddress/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,201 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="会员id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="会员id"></el-input>
</el-form-item>
<el-form-item label="累计消费金额" prop="consumeAmount">
<el-input v-model="dataForm.consumeAmount" placeholder="累计消费金额"></el-input>
</el-form-item>
<el-form-item label="累计优惠金额" prop="couponAmount">
<el-input v-model="dataForm.couponAmount" placeholder="累计优惠金额"></el-input>
</el-form-item>
<el-form-item label="订单数量" prop="orderCount">
<el-input v-model="dataForm.orderCount" placeholder="订单数量"></el-input>
</el-form-item>
<el-form-item label="优惠券数量" prop="couponCount">
<el-input v-model="dataForm.couponCount" placeholder="优惠券数量"></el-input>
</el-form-item>
<el-form-item label="评价数" prop="commentCount">
<el-input v-model="dataForm.commentCount" placeholder="评价数"></el-input>
</el-form-item>
<el-form-item label="退货数量" prop="returnOrderCount">
<el-input v-model="dataForm.returnOrderCount" placeholder="退货数量"></el-input>
</el-form-item>
<el-form-item label="登录次数" prop="loginCount">
<el-input v-model="dataForm.loginCount" placeholder="登录次数"></el-input>
</el-form-item>
<el-form-item label="关注数量" prop="attendCount">
<el-input v-model="dataForm.attendCount" placeholder="关注数量"></el-input>
</el-form-item>
<el-form-item label="粉丝数量" prop="fansCount">
<el-input v-model="dataForm.fansCount" placeholder="粉丝数量"></el-input>
</el-form-item>
<el-form-item label="收藏的商品数量" prop="collectProductCount">
<el-input v-model="dataForm.collectProductCount" placeholder="收藏的商品数量"></el-input>
</el-form-item>
<el-form-item label="收藏的专题活动数量" prop="collectSubjectCount">
<el-input v-model="dataForm.collectSubjectCount" placeholder="收藏的专题活动数量"></el-input>
</el-form-item>
<el-form-item label="收藏的评论数量" prop="collectCommentCount">
<el-input v-model="dataForm.collectCommentCount" placeholder="收藏的评论数量"></el-input>
</el-form-item>
<el-form-item label="邀请的朋友数量" prop="inviteFriendCount">
<el-input v-model="dataForm.inviteFriendCount" placeholder="邀请的朋友数量"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
consumeAmount: '',
couponAmount: '',
orderCount: '',
couponCount: '',
commentCount: '',
returnOrderCount: '',
loginCount: '',
attendCount: '',
fansCount: '',
collectProductCount: '',
collectSubjectCount: '',
collectCommentCount: '',
inviteFriendCount: ''
},
dataRule: {
memberId: [
{ required: true, message: '会员id不能为空', trigger: 'blur' }
],
consumeAmount: [
{ required: true, message: '累计消费金额不能为空', trigger: 'blur' }
],
couponAmount: [
{ required: true, message: '累计优惠金额不能为空', trigger: 'blur' }
],
orderCount: [
{ required: true, message: '订单数量不能为空', trigger: 'blur' }
],
couponCount: [
{ required: true, message: '优惠券数量不能为空', trigger: 'blur' }
],
commentCount: [
{ required: true, message: '评价数不能为空', trigger: 'blur' }
],
returnOrderCount: [
{ required: true, message: '退货数量不能为空', trigger: 'blur' }
],
loginCount: [
{ required: true, message: '登录次数不能为空', trigger: 'blur' }
],
attendCount: [
{ required: true, message: '关注数量不能为空', trigger: 'blur' }
],
fansCount: [
{ required: true, message: '粉丝数量不能为空', trigger: 'blur' }
],
collectProductCount: [
{ required: true, message: '收藏的商品数量不能为空', trigger: 'blur' }
],
collectSubjectCount: [
{ required: true, message: '收藏的专题活动数量不能为空', trigger: 'blur' }
],
collectCommentCount: [
{ required: true, message: '收藏的评论数量不能为空', trigger: 'blur' }
],
inviteFriendCount: [
{ required: true, message: '邀请的朋友数量不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/member/memberstatisticsinfo/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.memberStatisticsInfo.memberId
this.dataForm.consumeAmount = data.memberStatisticsInfo.consumeAmount
this.dataForm.couponAmount = data.memberStatisticsInfo.couponAmount
this.dataForm.orderCount = data.memberStatisticsInfo.orderCount
this.dataForm.couponCount = data.memberStatisticsInfo.couponCount
this.dataForm.commentCount = data.memberStatisticsInfo.commentCount
this.dataForm.returnOrderCount = data.memberStatisticsInfo.returnOrderCount
this.dataForm.loginCount = data.memberStatisticsInfo.loginCount
this.dataForm.attendCount = data.memberStatisticsInfo.attendCount
this.dataForm.fansCount = data.memberStatisticsInfo.fansCount
this.dataForm.collectProductCount = data.memberStatisticsInfo.collectProductCount
this.dataForm.collectSubjectCount = data.memberStatisticsInfo.collectSubjectCount
this.dataForm.collectCommentCount = data.memberStatisticsInfo.collectCommentCount
this.dataForm.inviteFriendCount = data.memberStatisticsInfo.inviteFriendCount
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/member/memberstatisticsinfo/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'consumeAmount': this.dataForm.consumeAmount,
'couponAmount': this.dataForm.couponAmount,
'orderCount': this.dataForm.orderCount,
'couponCount': this.dataForm.couponCount,
'commentCount': this.dataForm.commentCount,
'returnOrderCount': this.dataForm.returnOrderCount,
'loginCount': this.dataForm.loginCount,
'attendCount': this.dataForm.attendCount,
'fansCount': this.dataForm.fansCount,
'collectProductCount': this.dataForm.collectProductCount,
'collectSubjectCount': this.dataForm.collectSubjectCount,
'collectCommentCount': this.dataForm.collectCommentCount,
'inviteFriendCount': this.dataForm.inviteFriendCount
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,241 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('member:memberstatisticsinfo:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('member:memberstatisticsinfo:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="会员id">
</el-table-column>
<el-table-column
prop="consumeAmount"
header-align="center"
align="center"
label="累计消费金额">
</el-table-column>
<el-table-column
prop="couponAmount"
header-align="center"
align="center"
label="累计优惠金额">
</el-table-column>
<el-table-column
prop="orderCount"
header-align="center"
align="center"
label="订单数量">
</el-table-column>
<el-table-column
prop="couponCount"
header-align="center"
align="center"
label="优惠券数量">
</el-table-column>
<el-table-column
prop="commentCount"
header-align="center"
align="center"
label="评价数">
</el-table-column>
<el-table-column
prop="returnOrderCount"
header-align="center"
align="center"
label="退货数量">
</el-table-column>
<el-table-column
prop="loginCount"
header-align="center"
align="center"
label="登录次数">
</el-table-column>
<el-table-column
prop="attendCount"
header-align="center"
align="center"
label="关注数量">
</el-table-column>
<el-table-column
prop="fansCount"
header-align="center"
align="center"
label="粉丝数量">
</el-table-column>
<el-table-column
prop="collectProductCount"
header-align="center"
align="center"
label="收藏的商品数量">
</el-table-column>
<el-table-column
prop="collectSubjectCount"
header-align="center"
align="center"
label="收藏的专题活动数量">
</el-table-column>
<el-table-column
prop="collectCommentCount"
header-align="center"
align="center"
label="收藏的评论数量">
</el-table-column>
<el-table-column
prop="inviteFriendCount"
header-align="center"
align="center"
label="邀请的朋友数量">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './memberstatisticsinfo-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/member/memberstatisticsinfo/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/member/memberstatisticsinfo/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,444 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="member_id" prop="memberId">
<el-input v-model="dataForm.memberId" placeholder="member_id"></el-input>
</el-form-item>
<el-form-item label="订单号" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="订单号"></el-input>
</el-form-item>
<el-form-item label="使用的优惠券" prop="couponId">
<el-input v-model="dataForm.couponId" placeholder="使用的优惠券"></el-input>
</el-form-item>
<el-form-item label="create_time" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="create_time"></el-input>
</el-form-item>
<el-form-item label="用户名" prop="memberUsername">
<el-input v-model="dataForm.memberUsername" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="订单总额" prop="totalAmount">
<el-input v-model="dataForm.totalAmount" placeholder="订单总额"></el-input>
</el-form-item>
<el-form-item label="应付总额" prop="payAmount">
<el-input v-model="dataForm.payAmount" placeholder="应付总额"></el-input>
</el-form-item>
<el-form-item label="运费金额" prop="freightAmount">
<el-input v-model="dataForm.freightAmount" placeholder="运费金额"></el-input>
</el-form-item>
<el-form-item label="促销优化金额(促销价、满减、阶梯价)" prop="promotionAmount">
<el-input v-model="dataForm.promotionAmount" placeholder="促销优化金额(促销价、满减、阶梯价)"></el-input>
</el-form-item>
<el-form-item label="积分抵扣金额" prop="integrationAmount">
<el-input v-model="dataForm.integrationAmount" placeholder="积分抵扣金额"></el-input>
</el-form-item>
<el-form-item label="优惠券抵扣金额" prop="couponAmount">
<el-input v-model="dataForm.couponAmount" placeholder="优惠券抵扣金额"></el-input>
</el-form-item>
<el-form-item label="后台调整订单使用的折扣金额" prop="discountAmount">
<el-input v-model="dataForm.discountAmount" placeholder="后台调整订单使用的折扣金额"></el-input>
</el-form-item>
<el-form-item label="支付方式【1->支付宝2->微信3->银联; 4->货到付款;】" prop="payType">
<el-input v-model="dataForm.payType" placeholder="支付方式【1->支付宝2->微信3->银联; 4->货到付款;】"></el-input>
</el-form-item>
<el-form-item label="订单来源[0->PC订单1->app订单]" prop="sourceType">
<el-input v-model="dataForm.sourceType" placeholder="订单来源[0->PC订单1->app订单]"></el-input>
</el-form-item>
<el-form-item label="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】" prop="status">
<el-input v-model="dataForm.status" placeholder="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】"></el-input>
</el-form-item>
<el-form-item label="物流公司(配送方式)" prop="deliveryCompany">
<el-input v-model="dataForm.deliveryCompany" placeholder="物流公司(配送方式)"></el-input>
</el-form-item>
<el-form-item label="物流单号" prop="deliverySn">
<el-input v-model="dataForm.deliverySn" placeholder="物流单号"></el-input>
</el-form-item>
<el-form-item label="自动确认时间(天)" prop="autoConfirmDay">
<el-input v-model="dataForm.autoConfirmDay" placeholder="自动确认时间(天)"></el-input>
</el-form-item>
<el-form-item label="可以获得的积分" prop="integration">
<el-input v-model="dataForm.integration" placeholder="可以获得的积分"></el-input>
</el-form-item>
<el-form-item label="可以获得的成长值" prop="growth">
<el-input v-model="dataForm.growth" placeholder="可以获得的成长值"></el-input>
</el-form-item>
<el-form-item label="发票类型[0->不开发票1->电子发票2->纸质发票]" prop="billType">
<el-input v-model="dataForm.billType" placeholder="发票类型[0->不开发票1->电子发票2->纸质发票]"></el-input>
</el-form-item>
<el-form-item label="发票抬头" prop="billHeader">
<el-input v-model="dataForm.billHeader" placeholder="发票抬头"></el-input>
</el-form-item>
<el-form-item label="发票内容" prop="billContent">
<el-input v-model="dataForm.billContent" placeholder="发票内容"></el-input>
</el-form-item>
<el-form-item label="收票人电话" prop="billReceiverPhone">
<el-input v-model="dataForm.billReceiverPhone" placeholder="收票人电话"></el-input>
</el-form-item>
<el-form-item label="收票人邮箱" prop="billReceiverEmail">
<el-input v-model="dataForm.billReceiverEmail" placeholder="收票人邮箱"></el-input>
</el-form-item>
<el-form-item label="收货人姓名" prop="receiverName">
<el-input v-model="dataForm.receiverName" placeholder="收货人姓名"></el-input>
</el-form-item>
<el-form-item label="收货人电话" prop="receiverPhone">
<el-input v-model="dataForm.receiverPhone" placeholder="收货人电话"></el-input>
</el-form-item>
<el-form-item label="收货人邮编" prop="receiverPostCode">
<el-input v-model="dataForm.receiverPostCode" placeholder="收货人邮编"></el-input>
</el-form-item>
<el-form-item label="省份/直辖市" prop="receiverProvince">
<el-input v-model="dataForm.receiverProvince" placeholder="省份/直辖市"></el-input>
</el-form-item>
<el-form-item label="城市" prop="receiverCity">
<el-input v-model="dataForm.receiverCity" placeholder="城市"></el-input>
</el-form-item>
<el-form-item label="区" prop="receiverRegion">
<el-input v-model="dataForm.receiverRegion" placeholder="区"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="receiverDetailAddress">
<el-input v-model="dataForm.receiverDetailAddress" placeholder="详细地址"></el-input>
</el-form-item>
<el-form-item label="订单备注" prop="note">
<el-input v-model="dataForm.note" placeholder="订单备注"></el-input>
</el-form-item>
<el-form-item label="确认收货状态[0->未确认1->已确认]" prop="confirmStatus">
<el-input v-model="dataForm.confirmStatus" placeholder="确认收货状态[0->未确认1->已确认]"></el-input>
</el-form-item>
<el-form-item label="删除状态【0->未删除1->已删除】" prop="deleteStatus">
<el-input v-model="dataForm.deleteStatus" placeholder="删除状态【0->未删除1->已删除】"></el-input>
</el-form-item>
<el-form-item label="下单时使用的积分" prop="useIntegration">
<el-input v-model="dataForm.useIntegration" placeholder="下单时使用的积分"></el-input>
</el-form-item>
<el-form-item label="支付时间" prop="paymentTime">
<el-input v-model="dataForm.paymentTime" placeholder="支付时间"></el-input>
</el-form-item>
<el-form-item label="发货时间" prop="deliveryTime">
<el-input v-model="dataForm.deliveryTime" placeholder="发货时间"></el-input>
</el-form-item>
<el-form-item label="确认收货时间" prop="receiveTime">
<el-input v-model="dataForm.receiveTime" placeholder="确认收货时间"></el-input>
</el-form-item>
<el-form-item label="评价时间" prop="commentTime">
<el-input v-model="dataForm.commentTime" placeholder="评价时间"></el-input>
</el-form-item>
<el-form-item label="修改时间" prop="modifyTime">
<el-input v-model="dataForm.modifyTime" placeholder="修改时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
memberId: '',
orderSn: '',
couponId: '',
createTime: '',
memberUsername: '',
totalAmount: '',
payAmount: '',
freightAmount: '',
promotionAmount: '',
integrationAmount: '',
couponAmount: '',
discountAmount: '',
payType: '',
sourceType: '',
status: '',
deliveryCompany: '',
deliverySn: '',
autoConfirmDay: '',
integration: '',
growth: '',
billType: '',
billHeader: '',
billContent: '',
billReceiverPhone: '',
billReceiverEmail: '',
receiverName: '',
receiverPhone: '',
receiverPostCode: '',
receiverProvince: '',
receiverCity: '',
receiverRegion: '',
receiverDetailAddress: '',
note: '',
confirmStatus: '',
deleteStatus: '',
useIntegration: '',
paymentTime: '',
deliveryTime: '',
receiveTime: '',
commentTime: '',
modifyTime: ''
},
dataRule: {
memberId: [
{ required: true, message: 'member_id不能为空', trigger: 'blur' }
],
orderSn: [
{ required: true, message: '订单号不能为空', trigger: 'blur' }
],
couponId: [
{ required: true, message: '使用的优惠券不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: 'create_time不能为空', trigger: 'blur' }
],
memberUsername: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }
],
totalAmount: [
{ required: true, message: '订单总额不能为空', trigger: 'blur' }
],
payAmount: [
{ required: true, message: '应付总额不能为空', trigger: 'blur' }
],
freightAmount: [
{ required: true, message: '运费金额不能为空', trigger: 'blur' }
],
promotionAmount: [
{ required: true, message: '促销优化金额(促销价、满减、阶梯价)不能为空', trigger: 'blur' }
],
integrationAmount: [
{ required: true, message: '积分抵扣金额不能为空', trigger: 'blur' }
],
couponAmount: [
{ required: true, message: '优惠券抵扣金额不能为空', trigger: 'blur' }
],
discountAmount: [
{ required: true, message: '后台调整订单使用的折扣金额不能为空', trigger: 'blur' }
],
payType: [
{ required: true, message: '支付方式【1->支付宝2->微信3->银联; 4->货到付款;】不能为空', trigger: 'blur' }
],
sourceType: [
{ required: true, message: '订单来源[0->PC订单1->app订单]不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】不能为空', trigger: 'blur' }
],
deliveryCompany: [
{ required: true, message: '物流公司(配送方式)不能为空', trigger: 'blur' }
],
deliverySn: [
{ required: true, message: '物流单号不能为空', trigger: 'blur' }
],
autoConfirmDay: [
{ required: true, message: '自动确认时间(天)不能为空', trigger: 'blur' }
],
integration: [
{ required: true, message: '可以获得的积分不能为空', trigger: 'blur' }
],
growth: [
{ required: true, message: '可以获得的成长值不能为空', trigger: 'blur' }
],
billType: [
{ required: true, message: '发票类型[0->不开发票1->电子发票2->纸质发票]不能为空', trigger: 'blur' }
],
billHeader: [
{ required: true, message: '发票抬头不能为空', trigger: 'blur' }
],
billContent: [
{ required: true, message: '发票内容不能为空', trigger: 'blur' }
],
billReceiverPhone: [
{ required: true, message: '收票人电话不能为空', trigger: 'blur' }
],
billReceiverEmail: [
{ required: true, message: '收票人邮箱不能为空', trigger: 'blur' }
],
receiverName: [
{ required: true, message: '收货人姓名不能为空', trigger: 'blur' }
],
receiverPhone: [
{ required: true, message: '收货人电话不能为空', trigger: 'blur' }
],
receiverPostCode: [
{ required: true, message: '收货人邮编不能为空', trigger: 'blur' }
],
receiverProvince: [
{ required: true, message: '省份/直辖市不能为空', trigger: 'blur' }
],
receiverCity: [
{ required: true, message: '城市不能为空', trigger: 'blur' }
],
receiverRegion: [
{ required: true, message: '区不能为空', trigger: 'blur' }
],
receiverDetailAddress: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '订单备注不能为空', trigger: 'blur' }
],
confirmStatus: [
{ required: true, message: '确认收货状态[0->未确认1->已确认]不能为空', trigger: 'blur' }
],
deleteStatus: [
{ required: true, message: '删除状态【0->未删除1->已删除】不能为空', trigger: 'blur' }
],
useIntegration: [
{ required: true, message: '下单时使用的积分不能为空', trigger: 'blur' }
],
paymentTime: [
{ required: true, message: '支付时间不能为空', trigger: 'blur' }
],
deliveryTime: [
{ required: true, message: '发货时间不能为空', trigger: 'blur' }
],
receiveTime: [
{ required: true, message: '确认收货时间不能为空', trigger: 'blur' }
],
commentTime: [
{ required: true, message: '评价时间不能为空', trigger: 'blur' }
],
modifyTime: [
{ required: true, message: '修改时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/order/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.memberId = data.order.memberId
this.dataForm.orderSn = data.order.orderSn
this.dataForm.couponId = data.order.couponId
this.dataForm.createTime = data.order.createTime
this.dataForm.memberUsername = data.order.memberUsername
this.dataForm.totalAmount = data.order.totalAmount
this.dataForm.payAmount = data.order.payAmount
this.dataForm.freightAmount = data.order.freightAmount
this.dataForm.promotionAmount = data.order.promotionAmount
this.dataForm.integrationAmount = data.order.integrationAmount
this.dataForm.couponAmount = data.order.couponAmount
this.dataForm.discountAmount = data.order.discountAmount
this.dataForm.payType = data.order.payType
this.dataForm.sourceType = data.order.sourceType
this.dataForm.status = data.order.status
this.dataForm.deliveryCompany = data.order.deliveryCompany
this.dataForm.deliverySn = data.order.deliverySn
this.dataForm.autoConfirmDay = data.order.autoConfirmDay
this.dataForm.integration = data.order.integration
this.dataForm.growth = data.order.growth
this.dataForm.billType = data.order.billType
this.dataForm.billHeader = data.order.billHeader
this.dataForm.billContent = data.order.billContent
this.dataForm.billReceiverPhone = data.order.billReceiverPhone
this.dataForm.billReceiverEmail = data.order.billReceiverEmail
this.dataForm.receiverName = data.order.receiverName
this.dataForm.receiverPhone = data.order.receiverPhone
this.dataForm.receiverPostCode = data.order.receiverPostCode
this.dataForm.receiverProvince = data.order.receiverProvince
this.dataForm.receiverCity = data.order.receiverCity
this.dataForm.receiverRegion = data.order.receiverRegion
this.dataForm.receiverDetailAddress = data.order.receiverDetailAddress
this.dataForm.note = data.order.note
this.dataForm.confirmStatus = data.order.confirmStatus
this.dataForm.deleteStatus = data.order.deleteStatus
this.dataForm.useIntegration = data.order.useIntegration
this.dataForm.paymentTime = data.order.paymentTime
this.dataForm.deliveryTime = data.order.deliveryTime
this.dataForm.receiveTime = data.order.receiveTime
this.dataForm.commentTime = data.order.commentTime
this.dataForm.modifyTime = data.order.modifyTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/order/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'memberId': this.dataForm.memberId,
'orderSn': this.dataForm.orderSn,
'couponId': this.dataForm.couponId,
'createTime': this.dataForm.createTime,
'memberUsername': this.dataForm.memberUsername,
'totalAmount': this.dataForm.totalAmount,
'payAmount': this.dataForm.payAmount,
'freightAmount': this.dataForm.freightAmount,
'promotionAmount': this.dataForm.promotionAmount,
'integrationAmount': this.dataForm.integrationAmount,
'couponAmount': this.dataForm.couponAmount,
'discountAmount': this.dataForm.discountAmount,
'payType': this.dataForm.payType,
'sourceType': this.dataForm.sourceType,
'status': this.dataForm.status,
'deliveryCompany': this.dataForm.deliveryCompany,
'deliverySn': this.dataForm.deliverySn,
'autoConfirmDay': this.dataForm.autoConfirmDay,
'integration': this.dataForm.integration,
'growth': this.dataForm.growth,
'billType': this.dataForm.billType,
'billHeader': this.dataForm.billHeader,
'billContent': this.dataForm.billContent,
'billReceiverPhone': this.dataForm.billReceiverPhone,
'billReceiverEmail': this.dataForm.billReceiverEmail,
'receiverName': this.dataForm.receiverName,
'receiverPhone': this.dataForm.receiverPhone,
'receiverPostCode': this.dataForm.receiverPostCode,
'receiverProvince': this.dataForm.receiverProvince,
'receiverCity': this.dataForm.receiverCity,
'receiverRegion': this.dataForm.receiverRegion,
'receiverDetailAddress': this.dataForm.receiverDetailAddress,
'note': this.dataForm.note,
'confirmStatus': this.dataForm.confirmStatus,
'deleteStatus': this.dataForm.deleteStatus,
'useIntegration': this.dataForm.useIntegration,
'paymentTime': this.dataForm.paymentTime,
'deliveryTime': this.dataForm.deliveryTime,
'receiveTime': this.dataForm.receiveTime,
'commentTime': this.dataForm.commentTime,
'modifyTime': this.dataForm.modifyTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,403 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:order:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:order:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="memberId"
header-align="center"
align="center"
label="member_id">
</el-table-column>
<el-table-column
prop="orderSn"
header-align="center"
align="center"
label="订单号">
</el-table-column>
<el-table-column
prop="couponId"
header-align="center"
align="center"
label="使用的优惠券">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="create_time">
</el-table-column>
<el-table-column
prop="memberUsername"
header-align="center"
align="center"
label="用户名">
</el-table-column>
<el-table-column
prop="totalAmount"
header-align="center"
align="center"
label="订单总额">
</el-table-column>
<el-table-column
prop="payAmount"
header-align="center"
align="center"
label="应付总额">
</el-table-column>
<el-table-column
prop="freightAmount"
header-align="center"
align="center"
label="运费金额">
</el-table-column>
<el-table-column
prop="promotionAmount"
header-align="center"
align="center"
label="促销优化金额(促销价、满减、阶梯价)">
</el-table-column>
<el-table-column
prop="integrationAmount"
header-align="center"
align="center"
label="积分抵扣金额">
</el-table-column>
<el-table-column
prop="couponAmount"
header-align="center"
align="center"
label="优惠券抵扣金额">
</el-table-column>
<el-table-column
prop="discountAmount"
header-align="center"
align="center"
label="后台调整订单使用的折扣金额">
</el-table-column>
<el-table-column
prop="payType"
header-align="center"
align="center"
label="支付方式【1->支付宝2->微信3->银联; 4->货到付款;】">
</el-table-column>
<el-table-column
prop="sourceType"
header-align="center"
align="center"
label="订单来源[0->PC订单1->app订单]">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】">
</el-table-column>
<el-table-column
prop="deliveryCompany"
header-align="center"
align="center"
label="物流公司(配送方式)">
</el-table-column>
<el-table-column
prop="deliverySn"
header-align="center"
align="center"
label="物流单号">
</el-table-column>
<el-table-column
prop="autoConfirmDay"
header-align="center"
align="center"
label="自动确认时间(天)">
</el-table-column>
<el-table-column
prop="integration"
header-align="center"
align="center"
label="可以获得的积分">
</el-table-column>
<el-table-column
prop="growth"
header-align="center"
align="center"
label="可以获得的成长值">
</el-table-column>
<el-table-column
prop="billType"
header-align="center"
align="center"
label="发票类型[0->不开发票1->电子发票2->纸质发票]">
</el-table-column>
<el-table-column
prop="billHeader"
header-align="center"
align="center"
label="发票抬头">
</el-table-column>
<el-table-column
prop="billContent"
header-align="center"
align="center"
label="发票内容">
</el-table-column>
<el-table-column
prop="billReceiverPhone"
header-align="center"
align="center"
label="收票人电话">
</el-table-column>
<el-table-column
prop="billReceiverEmail"
header-align="center"
align="center"
label="收票人邮箱">
</el-table-column>
<el-table-column
prop="receiverName"
header-align="center"
align="center"
label="收货人姓名">
</el-table-column>
<el-table-column
prop="receiverPhone"
header-align="center"
align="center"
label="收货人电话">
</el-table-column>
<el-table-column
prop="receiverPostCode"
header-align="center"
align="center"
label="收货人邮编">
</el-table-column>
<el-table-column
prop="receiverProvince"
header-align="center"
align="center"
label="省份/直辖市">
</el-table-column>
<el-table-column
prop="receiverCity"
header-align="center"
align="center"
label="城市">
</el-table-column>
<el-table-column
prop="receiverRegion"
header-align="center"
align="center"
label="区">
</el-table-column>
<el-table-column
prop="receiverDetailAddress"
header-align="center"
align="center"
label="详细地址">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="订单备注">
</el-table-column>
<el-table-column
prop="confirmStatus"
header-align="center"
align="center"
label="确认收货状态[0->未确认1->已确认]">
</el-table-column>
<el-table-column
prop="deleteStatus"
header-align="center"
align="center"
label="删除状态【0->未删除1->已删除】">
</el-table-column>
<el-table-column
prop="useIntegration"
header-align="center"
align="center"
label="下单时使用的积分">
</el-table-column>
<el-table-column
prop="paymentTime"
header-align="center"
align="center"
label="支付时间">
</el-table-column>
<el-table-column
prop="deliveryTime"
header-align="center"
align="center"
label="发货时间">
</el-table-column>
<el-table-column
prop="receiveTime"
header-align="center"
align="center"
label="确认收货时间">
</el-table-column>
<el-table-column
prop="commentTime"
header-align="center"
align="center"
label="评价时间">
</el-table-column>
<el-table-column
prop="modifyTime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './order-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/order/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/order/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,246 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="order_id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="order_id"></el-input>
</el-form-item>
<el-form-item label="order_sn" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="order_sn"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="spu_name" prop="spuName">
<el-input v-model="dataForm.spuName" placeholder="spu_name"></el-input>
</el-form-item>
<el-form-item label="spu_pic" prop="spuPic">
<el-input v-model="dataForm.spuPic" placeholder="spu_pic"></el-input>
</el-form-item>
<el-form-item label="品牌" prop="spuBrand">
<el-input v-model="dataForm.spuBrand" placeholder="品牌"></el-input>
</el-form-item>
<el-form-item label="商品分类id" prop="categoryId">
<el-input v-model="dataForm.categoryId" placeholder="商品分类id"></el-input>
</el-form-item>
<el-form-item label="商品sku编号" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="商品sku编号"></el-input>
</el-form-item>
<el-form-item label="商品sku名字" prop="skuName">
<el-input v-model="dataForm.skuName" placeholder="商品sku名字"></el-input>
</el-form-item>
<el-form-item label="商品sku图片" prop="skuPic">
<el-input v-model="dataForm.skuPic" placeholder="商品sku图片"></el-input>
</el-form-item>
<el-form-item label="商品sku价格" prop="skuPrice">
<el-input v-model="dataForm.skuPrice" placeholder="商品sku价格"></el-input>
</el-form-item>
<el-form-item label="商品购买的数量" prop="skuQuantity">
<el-input v-model="dataForm.skuQuantity" placeholder="商品购买的数量"></el-input>
</el-form-item>
<el-form-item label="商品销售属性组合JSON" prop="skuAttrsVals">
<el-input v-model="dataForm.skuAttrsVals" placeholder="商品销售属性组合JSON"></el-input>
</el-form-item>
<el-form-item label="商品促销分解金额" prop="promotionAmount">
<el-input v-model="dataForm.promotionAmount" placeholder="商品促销分解金额"></el-input>
</el-form-item>
<el-form-item label="优惠券优惠分解金额" prop="couponAmount">
<el-input v-model="dataForm.couponAmount" placeholder="优惠券优惠分解金额"></el-input>
</el-form-item>
<el-form-item label="积分优惠分解金额" prop="integrationAmount">
<el-input v-model="dataForm.integrationAmount" placeholder="积分优惠分解金额"></el-input>
</el-form-item>
<el-form-item label="该商品经过优惠后的分解金额" prop="realAmount">
<el-input v-model="dataForm.realAmount" placeholder="该商品经过优惠后的分解金额"></el-input>
</el-form-item>
<el-form-item label="赠送积分" prop="giftIntegration">
<el-input v-model="dataForm.giftIntegration" placeholder="赠送积分"></el-input>
</el-form-item>
<el-form-item label="赠送成长值" prop="giftGrowth">
<el-input v-model="dataForm.giftGrowth" placeholder="赠送成长值"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
orderId: '',
orderSn: '',
spuId: '',
spuName: '',
spuPic: '',
spuBrand: '',
categoryId: '',
skuId: '',
skuName: '',
skuPic: '',
skuPrice: '',
skuQuantity: '',
skuAttrsVals: '',
promotionAmount: '',
couponAmount: '',
integrationAmount: '',
realAmount: '',
giftIntegration: '',
giftGrowth: ''
},
dataRule: {
orderId: [
{ required: true, message: 'order_id不能为空', trigger: 'blur' }
],
orderSn: [
{ required: true, message: 'order_sn不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
spuName: [
{ required: true, message: 'spu_name不能为空', trigger: 'blur' }
],
spuPic: [
{ required: true, message: 'spu_pic不能为空', trigger: 'blur' }
],
spuBrand: [
{ required: true, message: '品牌不能为空', trigger: 'blur' }
],
categoryId: [
{ required: true, message: '商品分类id不能为空', trigger: 'blur' }
],
skuId: [
{ required: true, message: '商品sku编号不能为空', trigger: 'blur' }
],
skuName: [
{ required: true, message: '商品sku名字不能为空', trigger: 'blur' }
],
skuPic: [
{ required: true, message: '商品sku图片不能为空', trigger: 'blur' }
],
skuPrice: [
{ required: true, message: '商品sku价格不能为空', trigger: 'blur' }
],
skuQuantity: [
{ required: true, message: '商品购买的数量不能为空', trigger: 'blur' }
],
skuAttrsVals: [
{ required: true, message: '商品销售属性组合JSON不能为空', trigger: 'blur' }
],
promotionAmount: [
{ required: true, message: '商品促销分解金额不能为空', trigger: 'blur' }
],
couponAmount: [
{ required: true, message: '优惠券优惠分解金额不能为空', trigger: 'blur' }
],
integrationAmount: [
{ required: true, message: '积分优惠分解金额不能为空', trigger: 'blur' }
],
realAmount: [
{ required: true, message: '该商品经过优惠后的分解金额不能为空', trigger: 'blur' }
],
giftIntegration: [
{ required: true, message: '赠送积分不能为空', trigger: 'blur' }
],
giftGrowth: [
{ required: true, message: '赠送成长值不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/orderitem/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderId = data.orderItem.orderId
this.dataForm.orderSn = data.orderItem.orderSn
this.dataForm.spuId = data.orderItem.spuId
this.dataForm.spuName = data.orderItem.spuName
this.dataForm.spuPic = data.orderItem.spuPic
this.dataForm.spuBrand = data.orderItem.spuBrand
this.dataForm.categoryId = data.orderItem.categoryId
this.dataForm.skuId = data.orderItem.skuId
this.dataForm.skuName = data.orderItem.skuName
this.dataForm.skuPic = data.orderItem.skuPic
this.dataForm.skuPrice = data.orderItem.skuPrice
this.dataForm.skuQuantity = data.orderItem.skuQuantity
this.dataForm.skuAttrsVals = data.orderItem.skuAttrsVals
this.dataForm.promotionAmount = data.orderItem.promotionAmount
this.dataForm.couponAmount = data.orderItem.couponAmount
this.dataForm.integrationAmount = data.orderItem.integrationAmount
this.dataForm.realAmount = data.orderItem.realAmount
this.dataForm.giftIntegration = data.orderItem.giftIntegration
this.dataForm.giftGrowth = data.orderItem.giftGrowth
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/orderitem/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'orderId': this.dataForm.orderId,
'orderSn': this.dataForm.orderSn,
'spuId': this.dataForm.spuId,
'spuName': this.dataForm.spuName,
'spuPic': this.dataForm.spuPic,
'spuBrand': this.dataForm.spuBrand,
'categoryId': this.dataForm.categoryId,
'skuId': this.dataForm.skuId,
'skuName': this.dataForm.skuName,
'skuPic': this.dataForm.skuPic,
'skuPrice': this.dataForm.skuPrice,
'skuQuantity': this.dataForm.skuQuantity,
'skuAttrsVals': this.dataForm.skuAttrsVals,
'promotionAmount': this.dataForm.promotionAmount,
'couponAmount': this.dataForm.couponAmount,
'integrationAmount': this.dataForm.integrationAmount,
'realAmount': this.dataForm.realAmount,
'giftIntegration': this.dataForm.giftIntegration,
'giftGrowth': this.dataForm.giftGrowth
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,271 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:orderitem:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:orderitem:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="order_id">
</el-table-column>
<el-table-column
prop="orderSn"
header-align="center"
align="center"
label="order_sn">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="spuName"
header-align="center"
align="center"
label="spu_name">
</el-table-column>
<el-table-column
prop="spuPic"
header-align="center"
align="center"
label="spu_pic">
</el-table-column>
<el-table-column
prop="spuBrand"
header-align="center"
align="center"
label="品牌">
</el-table-column>
<el-table-column
prop="categoryId"
header-align="center"
align="center"
label="商品分类id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="商品sku编号">
</el-table-column>
<el-table-column
prop="skuName"
header-align="center"
align="center"
label="商品sku名字">
</el-table-column>
<el-table-column
prop="skuPic"
header-align="center"
align="center"
label="商品sku图片">
</el-table-column>
<el-table-column
prop="skuPrice"
header-align="center"
align="center"
label="商品sku价格">
</el-table-column>
<el-table-column
prop="skuQuantity"
header-align="center"
align="center"
label="商品购买的数量">
</el-table-column>
<el-table-column
prop="skuAttrsVals"
header-align="center"
align="center"
label="商品销售属性组合JSON">
</el-table-column>
<el-table-column
prop="promotionAmount"
header-align="center"
align="center"
label="商品促销分解金额">
</el-table-column>
<el-table-column
prop="couponAmount"
header-align="center"
align="center"
label="优惠券优惠分解金额">
</el-table-column>
<el-table-column
prop="integrationAmount"
header-align="center"
align="center"
label="积分优惠分解金额">
</el-table-column>
<el-table-column
prop="realAmount"
header-align="center"
align="center"
label="该商品经过优惠后的分解金额">
</el-table-column>
<el-table-column
prop="giftIntegration"
header-align="center"
align="center"
label="赠送积分">
</el-table-column>
<el-table-column
prop="giftGrowth"
header-align="center"
align="center"
label="赠送成长值">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './orderitem-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/orderitem/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/orderitem/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="订单id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="订单id"></el-input>
</el-form-item>
<el-form-item label="操作人[用户;系统;后台管理员]" prop="operateMan">
<el-input v-model="dataForm.operateMan" placeholder="操作人[用户;系统;后台管理员]"></el-input>
</el-form-item>
<el-form-item label="操作时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="操作时间"></el-input>
</el-form-item>
<el-form-item label="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】" prop="orderStatus">
<el-input v-model="dataForm.orderStatus" placeholder="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】"></el-input>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
orderId: '',
operateMan: '',
createTime: '',
orderStatus: '',
note: ''
},
dataRule: {
orderId: [
{ required: true, message: '订单id不能为空', trigger: 'blur' }
],
operateMan: [
{ required: true, message: '操作人[用户;系统;后台管理员]不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '操作时间不能为空', trigger: 'blur' }
],
orderStatus: [
{ required: true, message: '订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】不能为空', trigger: 'blur' }
],
note: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/orderoperatehistory/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderId = data.orderOperateHistory.orderId
this.dataForm.operateMan = data.orderOperateHistory.operateMan
this.dataForm.createTime = data.orderOperateHistory.createTime
this.dataForm.orderStatus = data.orderOperateHistory.orderStatus
this.dataForm.note = data.orderOperateHistory.note
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/orderoperatehistory/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'orderId': this.dataForm.orderId,
'operateMan': this.dataForm.operateMan,
'createTime': this.dataForm.createTime,
'orderStatus': this.dataForm.orderStatus,
'note': this.dataForm.note
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:orderoperatehistory:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:orderoperatehistory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="订单id">
</el-table-column>
<el-table-column
prop="operateMan"
header-align="center"
align="center"
label="操作人[用户;系统;后台管理员]">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="操作时间">
</el-table-column>
<el-table-column
prop="orderStatus"
header-align="center"
align="center"
label="订单状态【0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单】">
</el-table-column>
<el-table-column
prop="note"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './orderoperatehistory-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/orderoperatehistory/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/orderoperatehistory/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,318 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="order_id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="order_id"></el-input>
</el-form-item>
<el-form-item label="退货商品id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="退货商品id"></el-input>
</el-form-item>
<el-form-item label="订单编号" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="订单编号"></el-input>
</el-form-item>
<el-form-item label="申请时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="申请时间"></el-input>
</el-form-item>
<el-form-item label="会员用户名" prop="memberUsername">
<el-input v-model="dataForm.memberUsername" placeholder="会员用户名"></el-input>
</el-form-item>
<el-form-item label="退款金额" prop="returnAmount">
<el-input v-model="dataForm.returnAmount" placeholder="退款金额"></el-input>
</el-form-item>
<el-form-item label="退货人姓名" prop="returnName">
<el-input v-model="dataForm.returnName" placeholder="退货人姓名"></el-input>
</el-form-item>
<el-form-item label="退货人电话" prop="returnPhone">
<el-input v-model="dataForm.returnPhone" placeholder="退货人电话"></el-input>
</el-form-item>
<el-form-item label="申请状态[0->待处理1->退货中2->已完成3->已拒绝]" prop="status">
<el-input v-model="dataForm.status" placeholder="申请状态[0->待处理1->退货中2->已完成3->已拒绝]"></el-input>
</el-form-item>
<el-form-item label="处理时间" prop="handleTime">
<el-input v-model="dataForm.handleTime" placeholder="处理时间"></el-input>
</el-form-item>
<el-form-item label="商品图片" prop="skuImg">
<el-input v-model="dataForm.skuImg" placeholder="商品图片"></el-input>
</el-form-item>
<el-form-item label="商品名称" prop="skuName">
<el-input v-model="dataForm.skuName" placeholder="商品名称"></el-input>
</el-form-item>
<el-form-item label="商品品牌" prop="skuBrand">
<el-input v-model="dataForm.skuBrand" placeholder="商品品牌"></el-input>
</el-form-item>
<el-form-item label="商品销售属性(JSON)" prop="skuAttrsVals">
<el-input v-model="dataForm.skuAttrsVals" placeholder="商品销售属性(JSON)"></el-input>
</el-form-item>
<el-form-item label="退货数量" prop="skuCount">
<el-input v-model="dataForm.skuCount" placeholder="退货数量"></el-input>
</el-form-item>
<el-form-item label="商品单价" prop="skuPrice">
<el-input v-model="dataForm.skuPrice" placeholder="商品单价"></el-input>
</el-form-item>
<el-form-item label="商品实际支付单价" prop="skuRealPrice">
<el-input v-model="dataForm.skuRealPrice" placeholder="商品实际支付单价"></el-input>
</el-form-item>
<el-form-item label="原因" prop="reason">
<el-input v-model="dataForm.reason" placeholder="原因"></el-input>
</el-form-item>
<el-form-item label="描述" prop="description述">
<el-input v-model="dataForm.description述" placeholder="描述"></el-input>
</el-form-item>
<el-form-item label="凭证图片,以逗号隔开" prop="descPics">
<el-input v-model="dataForm.descPics" placeholder="凭证图片,以逗号隔开"></el-input>
</el-form-item>
<el-form-item label="处理备注" prop="handleNote">
<el-input v-model="dataForm.handleNote" placeholder="处理备注"></el-input>
</el-form-item>
<el-form-item label="处理人员" prop="handleMan">
<el-input v-model="dataForm.handleMan" placeholder="处理人员"></el-input>
</el-form-item>
<el-form-item label="收货人" prop="receiveMan">
<el-input v-model="dataForm.receiveMan" placeholder="收货人"></el-input>
</el-form-item>
<el-form-item label="收货时间" prop="receiveTime">
<el-input v-model="dataForm.receiveTime" placeholder="收货时间"></el-input>
</el-form-item>
<el-form-item label="收货备注" prop="receiveNote">
<el-input v-model="dataForm.receiveNote" placeholder="收货备注"></el-input>
</el-form-item>
<el-form-item label="收货电话" prop="receivePhone">
<el-input v-model="dataForm.receivePhone" placeholder="收货电话"></el-input>
</el-form-item>
<el-form-item label="公司收货地址" prop="companyAddress">
<el-input v-model="dataForm.companyAddress" placeholder="公司收货地址"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
orderId: '',
skuId: '',
orderSn: '',
createTime: '',
memberUsername: '',
returnAmount: '',
returnName: '',
returnPhone: '',
status: '',
handleTime: '',
skuImg: '',
skuName: '',
skuBrand: '',
skuAttrsVals: '',
skuCount: '',
skuPrice: '',
skuRealPrice: '',
reason: '',
description述: '',
descPics: '',
handleNote: '',
handleMan: '',
receiveMan: '',
receiveTime: '',
receiveNote: '',
receivePhone: '',
companyAddress: ''
},
dataRule: {
orderId: [
{ required: true, message: 'order_id不能为空', trigger: 'blur' }
],
skuId: [
{ required: true, message: '退货商品id不能为空', trigger: 'blur' }
],
orderSn: [
{ required: true, message: '订单编号不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '申请时间不能为空', trigger: 'blur' }
],
memberUsername: [
{ required: true, message: '会员用户名不能为空', trigger: 'blur' }
],
returnAmount: [
{ required: true, message: '退款金额不能为空', trigger: 'blur' }
],
returnName: [
{ required: true, message: '退货人姓名不能为空', trigger: 'blur' }
],
returnPhone: [
{ required: true, message: '退货人电话不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '申请状态[0->待处理1->退货中2->已完成3->已拒绝]不能为空', trigger: 'blur' }
],
handleTime: [
{ required: true, message: '处理时间不能为空', trigger: 'blur' }
],
skuImg: [
{ required: true, message: '商品图片不能为空', trigger: 'blur' }
],
skuName: [
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
],
skuBrand: [
{ required: true, message: '商品品牌不能为空', trigger: 'blur' }
],
skuAttrsVals: [
{ required: true, message: '商品销售属性(JSON)不能为空', trigger: 'blur' }
],
skuCount: [
{ required: true, message: '退货数量不能为空', trigger: 'blur' }
],
skuPrice: [
{ required: true, message: '商品单价不能为空', trigger: 'blur' }
],
skuRealPrice: [
{ required: true, message: '商品实际支付单价不能为空', trigger: 'blur' }
],
reason: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
],
description述: [
{ required: true, message: '描述不能为空', trigger: 'blur' }
],
descPics: [
{ required: true, message: '凭证图片,以逗号隔开不能为空', trigger: 'blur' }
],
handleNote: [
{ required: true, message: '处理备注不能为空', trigger: 'blur' }
],
handleMan: [
{ required: true, message: '处理人员不能为空', trigger: 'blur' }
],
receiveMan: [
{ required: true, message: '收货人不能为空', trigger: 'blur' }
],
receiveTime: [
{ required: true, message: '收货时间不能为空', trigger: 'blur' }
],
receiveNote: [
{ required: true, message: '收货备注不能为空', trigger: 'blur' }
],
receivePhone: [
{ required: true, message: '收货电话不能为空', trigger: 'blur' }
],
companyAddress: [
{ required: true, message: '公司收货地址不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/orderreturnapply/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderId = data.orderReturnApply.orderId
this.dataForm.skuId = data.orderReturnApply.skuId
this.dataForm.orderSn = data.orderReturnApply.orderSn
this.dataForm.createTime = data.orderReturnApply.createTime
this.dataForm.memberUsername = data.orderReturnApply.memberUsername
this.dataForm.returnAmount = data.orderReturnApply.returnAmount
this.dataForm.returnName = data.orderReturnApply.returnName
this.dataForm.returnPhone = data.orderReturnApply.returnPhone
this.dataForm.status = data.orderReturnApply.status
this.dataForm.handleTime = data.orderReturnApply.handleTime
this.dataForm.skuImg = data.orderReturnApply.skuImg
this.dataForm.skuName = data.orderReturnApply.skuName
this.dataForm.skuBrand = data.orderReturnApply.skuBrand
this.dataForm.skuAttrsVals = data.orderReturnApply.skuAttrsVals
this.dataForm.skuCount = data.orderReturnApply.skuCount
this.dataForm.skuPrice = data.orderReturnApply.skuPrice
this.dataForm.skuRealPrice = data.orderReturnApply.skuRealPrice
this.dataForm.reason = data.orderReturnApply.reason
this.dataForm.description述 = data.orderReturnApply.description述
this.dataForm.descPics = data.orderReturnApply.descPics
this.dataForm.handleNote = data.orderReturnApply.handleNote
this.dataForm.handleMan = data.orderReturnApply.handleMan
this.dataForm.receiveMan = data.orderReturnApply.receiveMan
this.dataForm.receiveTime = data.orderReturnApply.receiveTime
this.dataForm.receiveNote = data.orderReturnApply.receiveNote
this.dataForm.receivePhone = data.orderReturnApply.receivePhone
this.dataForm.companyAddress = data.orderReturnApply.companyAddress
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/orderreturnapply/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'orderId': this.dataForm.orderId,
'skuId': this.dataForm.skuId,
'orderSn': this.dataForm.orderSn,
'createTime': this.dataForm.createTime,
'memberUsername': this.dataForm.memberUsername,
'returnAmount': this.dataForm.returnAmount,
'returnName': this.dataForm.returnName,
'returnPhone': this.dataForm.returnPhone,
'status': this.dataForm.status,
'handleTime': this.dataForm.handleTime,
'skuImg': this.dataForm.skuImg,
'skuName': this.dataForm.skuName,
'skuBrand': this.dataForm.skuBrand,
'skuAttrsVals': this.dataForm.skuAttrsVals,
'skuCount': this.dataForm.skuCount,
'skuPrice': this.dataForm.skuPrice,
'skuRealPrice': this.dataForm.skuRealPrice,
'reason': this.dataForm.reason,
'description述': this.dataForm.description述,
'descPics': this.dataForm.descPics,
'handleNote': this.dataForm.handleNote,
'handleMan': this.dataForm.handleMan,
'receiveMan': this.dataForm.receiveMan,
'receiveTime': this.dataForm.receiveTime,
'receiveNote': this.dataForm.receiveNote,
'receivePhone': this.dataForm.receivePhone,
'companyAddress': this.dataForm.companyAddress
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,319 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:orderreturnapply:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:orderreturnapply:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="order_id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="退货商品id">
</el-table-column>
<el-table-column
prop="orderSn"
header-align="center"
align="center"
label="订单编号">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="申请时间">
</el-table-column>
<el-table-column
prop="memberUsername"
header-align="center"
align="center"
label="会员用户名">
</el-table-column>
<el-table-column
prop="returnAmount"
header-align="center"
align="center"
label="退款金额">
</el-table-column>
<el-table-column
prop="returnName"
header-align="center"
align="center"
label="退货人姓名">
</el-table-column>
<el-table-column
prop="returnPhone"
header-align="center"
align="center"
label="退货人电话">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="申请状态[0->待处理1->退货中2->已完成3->已拒绝]">
</el-table-column>
<el-table-column
prop="handleTime"
header-align="center"
align="center"
label="处理时间">
</el-table-column>
<el-table-column
prop="skuImg"
header-align="center"
align="center"
label="商品图片">
</el-table-column>
<el-table-column
prop="skuName"
header-align="center"
align="center"
label="商品名称">
</el-table-column>
<el-table-column
prop="skuBrand"
header-align="center"
align="center"
label="商品品牌">
</el-table-column>
<el-table-column
prop="skuAttrsVals"
header-align="center"
align="center"
label="商品销售属性(JSON)">
</el-table-column>
<el-table-column
prop="skuCount"
header-align="center"
align="center"
label="退货数量">
</el-table-column>
<el-table-column
prop="skuPrice"
header-align="center"
align="center"
label="商品单价">
</el-table-column>
<el-table-column
prop="skuRealPrice"
header-align="center"
align="center"
label="商品实际支付单价">
</el-table-column>
<el-table-column
prop="reason"
header-align="center"
align="center"
label="原因">
</el-table-column>
<el-table-column
prop="description述"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="descPics"
header-align="center"
align="center"
label="凭证图片,以逗号隔开">
</el-table-column>
<el-table-column
prop="handleNote"
header-align="center"
align="center"
label="处理备注">
</el-table-column>
<el-table-column
prop="handleMan"
header-align="center"
align="center"
label="处理人员">
</el-table-column>
<el-table-column
prop="receiveMan"
header-align="center"
align="center"
label="收货人">
</el-table-column>
<el-table-column
prop="receiveTime"
header-align="center"
align="center"
label="收货时间">
</el-table-column>
<el-table-column
prop="receiveNote"
header-align="center"
align="center"
label="收货备注">
</el-table-column>
<el-table-column
prop="receivePhone"
header-align="center"
align="center"
label="收货电话">
</el-table-column>
<el-table-column
prop="companyAddress"
header-align="center"
align="center"
label="公司收货地址">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './orderreturnapply-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/orderreturnapply/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/orderreturnapply/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="退货原因名" prop="name">
<el-input v-model="dataForm.name" placeholder="退货原因名"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="启用状态" prop="status">
<el-input v-model="dataForm.status" placeholder="启用状态"></el-input>
</el-form-item>
<el-form-item label="create_time" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="create_time"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
sort: '',
status: '',
createTime: ''
},
dataRule: {
name: [
{ required: true, message: '退货原因名不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
status: [
{ required: true, message: '启用状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: 'create_time不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/orderreturnreason/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.orderReturnReason.name
this.dataForm.sort = data.orderReturnReason.sort
this.dataForm.status = data.orderReturnReason.status
this.dataForm.createTime = data.orderReturnReason.createTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/orderreturnreason/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'sort': this.dataForm.sort,
'status': this.dataForm.status,
'createTime': this.dataForm.createTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:orderreturnreason:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:orderreturnreason:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="退货原因名">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="启用状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="create_time">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './orderreturnreason-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/orderreturnreason/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/orderreturnreason/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="秒杀订单超时关闭时间(分)" prop="flashOrderOvertime">
<el-input v-model="dataForm.flashOrderOvertime" placeholder="秒杀订单超时关闭时间(分)"></el-input>
</el-form-item>
<el-form-item label="正常订单超时时间(分)" prop="normalOrderOvertime">
<el-input v-model="dataForm.normalOrderOvertime" placeholder="正常订单超时时间(分)"></el-input>
</el-form-item>
<el-form-item label="发货后自动确认收货时间(天)" prop="confirmOvertime">
<el-input v-model="dataForm.confirmOvertime" placeholder="发货后自动确认收货时间(天)"></el-input>
</el-form-item>
<el-form-item label="自动完成交易时间,不能申请退货(天)" prop="finishOvertime">
<el-input v-model="dataForm.finishOvertime" placeholder="自动完成交易时间,不能申请退货(天)"></el-input>
</el-form-item>
<el-form-item label="订单完成后自动好评时间(天)" prop="commentOvertime">
<el-input v-model="dataForm.commentOvertime" placeholder="订单完成后自动好评时间(天)"></el-input>
</el-form-item>
<el-form-item label="会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】" prop="memberLevel">
<el-input v-model="dataForm.memberLevel" placeholder="会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
flashOrderOvertime: '',
normalOrderOvertime: '',
confirmOvertime: '',
finishOvertime: '',
commentOvertime: '',
memberLevel: ''
},
dataRule: {
flashOrderOvertime: [
{ required: true, message: '秒杀订单超时关闭时间(分)不能为空', trigger: 'blur' }
],
normalOrderOvertime: [
{ required: true, message: '正常订单超时时间(分)不能为空', trigger: 'blur' }
],
confirmOvertime: [
{ required: true, message: '发货后自动确认收货时间(天)不能为空', trigger: 'blur' }
],
finishOvertime: [
{ required: true, message: '自动完成交易时间,不能申请退货(天)不能为空', trigger: 'blur' }
],
commentOvertime: [
{ required: true, message: '订单完成后自动好评时间(天)不能为空', trigger: 'blur' }
],
memberLevel: [
{ required: true, message: '会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/ordersetting/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.flashOrderOvertime = data.orderSetting.flashOrderOvertime
this.dataForm.normalOrderOvertime = data.orderSetting.normalOrderOvertime
this.dataForm.confirmOvertime = data.orderSetting.confirmOvertime
this.dataForm.finishOvertime = data.orderSetting.finishOvertime
this.dataForm.commentOvertime = data.orderSetting.commentOvertime
this.dataForm.memberLevel = data.orderSetting.memberLevel
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/ordersetting/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'flashOrderOvertime': this.dataForm.flashOrderOvertime,
'normalOrderOvertime': this.dataForm.normalOrderOvertime,
'confirmOvertime': this.dataForm.confirmOvertime,
'finishOvertime': this.dataForm.finishOvertime,
'commentOvertime': this.dataForm.commentOvertime,
'memberLevel': this.dataForm.memberLevel
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:ordersetting:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:ordersetting:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="flashOrderOvertime"
header-align="center"
align="center"
label="秒杀订单超时关闭时间(分)">
</el-table-column>
<el-table-column
prop="normalOrderOvertime"
header-align="center"
align="center"
label="正常订单超时时间(分)">
</el-table-column>
<el-table-column
prop="confirmOvertime"
header-align="center"
align="center"
label="发货后自动确认收货时间(天)">
</el-table-column>
<el-table-column
prop="finishOvertime"
header-align="center"
align="center"
label="自动完成交易时间,不能申请退货(天)">
</el-table-column>
<el-table-column
prop="commentOvertime"
header-align="center"
align="center"
label="订单完成后自动好评时间(天)">
</el-table-column>
<el-table-column
prop="memberLevel"
header-align="center"
align="center"
label="会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './ordersetting-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/ordersetting/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/ordersetting/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,165 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="订单号(对外业务号)" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="订单号(对外业务号)"></el-input>
</el-form-item>
<el-form-item label="订单id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="订单id"></el-input>
</el-form-item>
<el-form-item label="支付宝交易流水号" prop="alipayTradeNo">
<el-input v-model="dataForm.alipayTradeNo" placeholder="支付宝交易流水号"></el-input>
</el-form-item>
<el-form-item label="支付总金额" prop="totalAmount">
<el-input v-model="dataForm.totalAmount" placeholder="支付总金额"></el-input>
</el-form-item>
<el-form-item label="交易内容" prop="subject">
<el-input v-model="dataForm.subject" placeholder="交易内容"></el-input>
</el-form-item>
<el-form-item label="支付状态" prop="paymentStatus">
<el-input v-model="dataForm.paymentStatus" placeholder="支付状态"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="确认时间" prop="confirmTime">
<el-input v-model="dataForm.confirmTime" placeholder="确认时间"></el-input>
</el-form-item>
<el-form-item label="回调内容" prop="callbackContent">
<el-input v-model="dataForm.callbackContent" placeholder="回调内容"></el-input>
</el-form-item>
<el-form-item label="回调时间" prop="callbackTime">
<el-input v-model="dataForm.callbackTime" placeholder="回调时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
orderSn: '',
orderId: '',
alipayTradeNo: '',
totalAmount: '',
subject: '',
paymentStatus: '',
createTime: '',
confirmTime: '',
callbackContent: '',
callbackTime: ''
},
dataRule: {
orderSn: [
{ required: true, message: '订单号(对外业务号)不能为空', trigger: 'blur' }
],
orderId: [
{ required: true, message: '订单id不能为空', trigger: 'blur' }
],
alipayTradeNo: [
{ required: true, message: '支付宝交易流水号不能为空', trigger: 'blur' }
],
totalAmount: [
{ required: true, message: '支付总金额不能为空', trigger: 'blur' }
],
subject: [
{ required: true, message: '交易内容不能为空', trigger: 'blur' }
],
paymentStatus: [
{ required: true, message: '支付状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
confirmTime: [
{ required: true, message: '确认时间不能为空', trigger: 'blur' }
],
callbackContent: [
{ required: true, message: '回调内容不能为空', trigger: 'blur' }
],
callbackTime: [
{ required: true, message: '回调时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/paymentinfo/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderSn = data.paymentInfo.orderSn
this.dataForm.orderId = data.paymentInfo.orderId
this.dataForm.alipayTradeNo = data.paymentInfo.alipayTradeNo
this.dataForm.totalAmount = data.paymentInfo.totalAmount
this.dataForm.subject = data.paymentInfo.subject
this.dataForm.paymentStatus = data.paymentInfo.paymentStatus
this.dataForm.createTime = data.paymentInfo.createTime
this.dataForm.confirmTime = data.paymentInfo.confirmTime
this.dataForm.callbackContent = data.paymentInfo.callbackContent
this.dataForm.callbackTime = data.paymentInfo.callbackTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/paymentinfo/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'orderSn': this.dataForm.orderSn,
'orderId': this.dataForm.orderId,
'alipayTradeNo': this.dataForm.alipayTradeNo,
'totalAmount': this.dataForm.totalAmount,
'subject': this.dataForm.subject,
'paymentStatus': this.dataForm.paymentStatus,
'createTime': this.dataForm.createTime,
'confirmTime': this.dataForm.confirmTime,
'callbackContent': this.dataForm.callbackContent,
'callbackTime': this.dataForm.callbackTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,217 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:paymentinfo:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:paymentinfo:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="orderSn"
header-align="center"
align="center"
label="订单号(对外业务号)">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="订单id">
</el-table-column>
<el-table-column
prop="alipayTradeNo"
header-align="center"
align="center"
label="支付宝交易流水号">
</el-table-column>
<el-table-column
prop="totalAmount"
header-align="center"
align="center"
label="支付总金额">
</el-table-column>
<el-table-column
prop="subject"
header-align="center"
align="center"
label="交易内容">
</el-table-column>
<el-table-column
prop="paymentStatus"
header-align="center"
align="center"
label="支付状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="confirmTime"
header-align="center"
align="center"
label="确认时间">
</el-table-column>
<el-table-column
prop="callbackContent"
header-align="center"
align="center"
label="回调内容">
</el-table-column>
<el-table-column
prop="callbackTime"
header-align="center"
align="center"
label="回调时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './paymentinfo-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/paymentinfo/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/paymentinfo/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="退款的订单" prop="orderReturnId">
<el-input v-model="dataForm.orderReturnId" placeholder="退款的订单"></el-input>
</el-form-item>
<el-form-item label="退款金额" prop="refund">
<el-input v-model="dataForm.refund" placeholder="退款金额"></el-input>
</el-form-item>
<el-form-item label="退款交易流水号" prop="refundSn">
<el-input v-model="dataForm.refundSn" placeholder="退款交易流水号"></el-input>
</el-form-item>
<el-form-item label="退款状态" prop="refundStatus">
<el-input v-model="dataForm.refundStatus" placeholder="退款状态"></el-input>
</el-form-item>
<el-form-item label="退款渠道[1-支付宝2-微信3-银联4-汇款]" prop="refundChannel">
<el-input v-model="dataForm.refundChannel" placeholder="退款渠道[1-支付宝2-微信3-银联4-汇款]"></el-input>
</el-form-item>
<el-form-item label="" prop="refundContent">
<el-input v-model="dataForm.refundContent" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
orderReturnId: '',
refund: '',
refundSn: '',
refundStatus: '',
refundChannel: '',
refundContent: ''
},
dataRule: {
orderReturnId: [
{ required: true, message: '退款的订单不能为空', trigger: 'blur' }
],
refund: [
{ required: true, message: '退款金额不能为空', trigger: 'blur' }
],
refundSn: [
{ required: true, message: '退款交易流水号不能为空', trigger: 'blur' }
],
refundStatus: [
{ required: true, message: '退款状态不能为空', trigger: 'blur' }
],
refundChannel: [
{ required: true, message: '退款渠道[1-支付宝2-微信3-银联4-汇款]不能为空', trigger: 'blur' }
],
refundContent: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/order/refundinfo/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderReturnId = data.refundInfo.orderReturnId
this.dataForm.refund = data.refundInfo.refund
this.dataForm.refundSn = data.refundInfo.refundSn
this.dataForm.refundStatus = data.refundInfo.refundStatus
this.dataForm.refundChannel = data.refundInfo.refundChannel
this.dataForm.refundContent = data.refundInfo.refundContent
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/order/refundinfo/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'orderReturnId': this.dataForm.orderReturnId,
'refund': this.dataForm.refund,
'refundSn': this.dataForm.refundSn,
'refundStatus': this.dataForm.refundStatus,
'refundChannel': this.dataForm.refundChannel,
'refundContent': this.dataForm.refundContent
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('order:refundinfo:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('order:refundinfo:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="orderReturnId"
header-align="center"
align="center"
label="退款的订单">
</el-table-column>
<el-table-column
prop="refund"
header-align="center"
align="center"
label="退款金额">
</el-table-column>
<el-table-column
prop="refundSn"
header-align="center"
align="center"
label="退款交易流水号">
</el-table-column>
<el-table-column
prop="refundStatus"
header-align="center"
align="center"
label="退款状态">
</el-table-column>
<el-table-column
prop="refundChannel"
header-align="center"
align="center"
label="退款渠道[1-支付宝2-微信3-银联4-汇款]">
</el-table-column>
<el-table-column
prop="refundContent"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './refundinfo-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/order/refundinfo/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/order/refundinfo/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,19 +1,19 @@
package com.xjs.mall.product.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.xjs.mall.product.entity.AttrEntity;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.xjs.mall.product.service.AttrService;
import com.xjs.mall.product.vo.AttrResponseVo;
import com.xjs.mall.product.vo.AttrVo;
import com.xjs.utils.PageUtils;
import com.xjs.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
@ -22,21 +22,20 @@ import com.xjs.utils.R;
*
* @author xiejs
* @email 1294405880@qq.com
* @date 2022-03-15 10:16:53
* @since 2022-03-15 10:16:53
*/
@RestController
@RequestMapping("product/attr")
@Api(tags = "商城-商品-规格参数")
public class AttrController {
@Autowired
private AttrService attrService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = attrService.queryPage(params);
@GetMapping("/base/list/{catelogId}")
@ApiOperation("列表")
public R baseAttrList(@RequestParam Map<String, Object> params, @PathVariable("catelogId") Long catelogId) {
PageUtils page = attrService.queryBaseAttrPage(params, catelogId);
return R.ok().put("page", page);
}
@ -44,9 +43,10 @@ public class AttrController {
/**
*
*/
@RequestMapping("/info/{attrId}")
@GetMapping("/info/{attrId}")
@ApiOperation("信息")
public R info(@PathVariable("attrId") Long attrId){
AttrEntity attr = attrService.getById(attrId);
AttrResponseVo attr = attrService.getAttrInfo(attrId);
return R.ok().put("attr", attr);
}
@ -54,9 +54,11 @@ public class AttrController {
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody AttrEntity attr){
attrService.save(attr);
@PostMapping("/save")
@ApiOperation("保存")
@Log(title = "规格参数", businessType = BusinessType.INSERT)
public R save(@RequestBody AttrVo attr){
attrService.saveAttr(attr);
return R.ok();
}
@ -64,9 +66,11 @@ public class AttrController {
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody AttrEntity attr){
attrService.updateById(attr);
@PutMapping("/update")
@ApiOperation("修改")
@Log(title = "规格参数", businessType = BusinessType.UPDATE)
public R update(@RequestBody AttrVo attr){
attrService.updateAttr(attr);
return R.ok();
}
@ -74,7 +78,9 @@ public class AttrController {
/**
*
*/
@RequestMapping("/delete")
@DeleteMapping("/delete")
@ApiOperation("删除")
@Log(title = "规格参数", businessType = BusinessType.DELETE)
public R delete(@RequestBody Long[] attrIds){
attrService.removeByIds(Arrays.asList(attrIds));

@ -2,14 +2,13 @@ package com.xjs.mall.product.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
*
* @author xiejs
* @email 1294405880@qq.com
* @date 2022-03-15 10:16:53
@ -44,6 +43,10 @@ public class AttrEntity implements Serializable {
* [0-1-2-]
*/
private Integer attrType;
/**
*
*/
private Integer valueType;
/**
* [0 - 1 - ]
*/

@ -1,6 +1,8 @@
package com.xjs.mall.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjs.mall.product.vo.AttrResponseVo;
import com.xjs.mall.product.vo.AttrVo;
import com.xjs.utils.PageUtils;
import com.xjs.mall.product.entity.AttrEntity;
@ -15,6 +17,31 @@ import java.util.Map;
*/
public interface AttrService extends IService<AttrEntity> {
PageUtils queryPage(Map<String, Object> params);
/**
*
* @param attr vo
*/
void saveAttr(AttrVo attr);
/**
*
* @param params
* @param catelogId id
* @return pageUtils
*/
PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId);
/**
* attr
* @param attrId attrId
* @return vo
*/
AttrResponseVo getAttrInfo(Long attrId);
/**
*
* @param attr
*/
void updateAttr(AttrVo attr);
}

@ -1,29 +1,172 @@
package com.xjs.mall.product.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjs.utils.PageUtils;
import com.xjs.utils.Query;
import com.ruoyi.common.core.utils.StringUtils;
import com.xjs.consts.ProductConstant;
import com.xjs.mall.product.dao.AttrAttrgroupRelationDao;
import com.xjs.mall.product.dao.AttrDao;
import com.xjs.mall.product.dao.AttrGroupDao;
import com.xjs.mall.product.dao.CategoryDao;
import com.xjs.mall.product.entity.AttrAttrgroupRelationEntity;
import com.xjs.mall.product.entity.AttrEntity;
import com.xjs.mall.product.entity.AttrGroupEntity;
import com.xjs.mall.product.entity.CategoryEntity;
import com.xjs.mall.product.service.AttrAttrgroupRelationService;
import com.xjs.mall.product.service.AttrService;
import com.xjs.mall.product.service.CategoryService;
import com.xjs.mall.product.vo.AttrResponseVo;
import com.xjs.mall.product.vo.AttrVo;
import com.xjs.utils.PageUtils;
import com.xjs.utils.Query;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service("attrService")
@Transactional
public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements AttrService {
@Autowired
private AttrAttrgroupRelationService attrAttrgroupRelationService;
@Resource
private AttrGroupDao attrGroupDao;
@Resource
private CategoryDao categoryDao;
@Resource
private AttrAttrgroupRelationDao attrAttrgroupRelationDao;
@Autowired
private CategoryService categoryService;
@Override
public PageUtils queryPage(Map<String, Object> params) {
public void saveAttr(AttrVo attr) {
AttrEntity attrEntity = new AttrEntity();
BeanUtils.copyProperties(attr, attrEntity);
//保存基本数据
super.save(attrEntity);
//保存关联关系
AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = new AttrAttrgroupRelationEntity();
attrAttrgroupRelationEntity.setAttrGroupId(attr.getAttrGroupId());
attrAttrgroupRelationEntity.setAttrId(attrEntity.getAttrId());
attrAttrgroupRelationService.save(attrAttrgroupRelationEntity);
}
@Override
public PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId) {
LambdaQueryWrapper<AttrEntity> wrapper = new LambdaQueryWrapper<>();
if (catelogId != 0) {
wrapper.eq(AttrEntity::getCatelogId, catelogId);
}
String key = (String) params.get(Query.KEY_NAME);
wrapper.and(StringUtils.isNotEmpty(key), obj -> {
obj.like(AttrEntity::getAttrName, key);
});
IPage<AttrEntity> page = this.page(
new Query<AttrEntity>().getPage(params),
new QueryWrapper<AttrEntity>()
wrapper
);
PageUtils pageUtils = new PageUtils(page);
List<AttrEntity> records = page.getRecords();
List<AttrResponseVo> collect = records.stream().map(attrEntity -> {
AttrResponseVo attrResponseVo = new AttrResponseVo();
BeanUtils.copyProperties(attrEntity, attrResponseVo);
//1、设置分类和分组的数据
AttrAttrgroupRelationEntity attrId = attrAttrgroupRelationDao.selectOne(new LambdaQueryWrapper<AttrAttrgroupRelationEntity>()
.eq(AttrAttrgroupRelationEntity::getAttrId, attrEntity.getAttrId()));
if (attrId != null) {
AttrGroupEntity attrGroupEntity = attrGroupDao.selectById(attrId.getAttrGroupId());
attrResponseVo.setGroupName(attrGroupEntity.getAttrGroupName());
}
CategoryEntity categoryEntity = categoryDao.selectById(attrEntity.getCatelogId());
if (categoryEntity != null) {
attrResponseVo.setCatelogName(categoryEntity.getName());
}
return attrResponseVo;
}).collect(Collectors.toList());
pageUtils.setList(collect);
return pageUtils;
}
@Override
public AttrResponseVo getAttrInfo(Long attrId) {
AttrEntity attrEntity = super.getById(attrId);
AttrResponseVo attrResponseVo = new AttrResponseVo();
BeanUtils.copyProperties(attrEntity, attrResponseVo);
//设置分组信息
AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = attrAttrgroupRelationDao.selectOne(
new LambdaQueryWrapper<AttrAttrgroupRelationEntity>().eq(AttrAttrgroupRelationEntity::getAttrId, attrId)
);
return new PageUtils(page);
if (attrAttrgroupRelationEntity != null) {
attrResponseVo.setAttrGroupId(attrAttrgroupRelationEntity.getAttrGroupId());
AttrGroupEntity attrGroupEntity = attrGroupDao.selectById(attrAttrgroupRelationEntity.getAttrGroupId());
if (attrGroupEntity != null) {
attrResponseVo.setGroupName(attrGroupEntity.getAttrGroupName());
}
}
//设置分类信息
Long catelogId = attrEntity.getCatelogId();
Long[] catelogPath = categoryService.finCatelogPath(catelogId);
List<String> collect = Arrays.stream(catelogPath).map(String::valueOf).collect(Collectors.toList());
attrResponseVo.setCatelogPath(collect);
CategoryEntity categoryEntity = categoryDao.selectById(catelogId);
if (categoryEntity != null) {
attrResponseVo.setCatelogName(categoryEntity.getName());
}
return attrResponseVo;
}
@Override
public void updateAttr(AttrVo attr) {
AttrEntity attrEntity = new AttrEntity();
BeanUtils.copyProperties(attr, attrEntity);
this.updateById(attrEntity);
if (attrEntity.getAttrType() == ProductConstant.AttrEnum.ATTR_TYPE_BASE.getCode()) {
//1、修改分组关联
AttrAttrgroupRelationEntity relationEntity = new AttrAttrgroupRelationEntity();
relationEntity.setAttrGroupId(attr.getAttrGroupId());
relationEntity.setAttrId(attr.getAttrId());
Long count = attrAttrgroupRelationDao.selectCount(new LambdaQueryWrapper<AttrAttrgroupRelationEntity>()
.eq(AttrAttrgroupRelationEntity::getAttrId, attr.getAttrId()));
if (count > 0) {
attrAttrgroupRelationDao.update(relationEntity,
new LambdaUpdateWrapper<AttrAttrgroupRelationEntity>()
.eq(AttrAttrgroupRelationEntity::getAttrId, attr.getAttrId()));
} else {
attrAttrgroupRelationDao.insert(relationEntity);
}
}
}
}
}

@ -0,0 +1,37 @@
package com.xjs.mall.product.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* AttrVo
* @author xiejs
* @since 2022-03-17
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AttrResponseVo extends AttrVo {
/**
*
*/
private String groupName;
/**
*
*/
private String catelogName;
/**
* catelog
*/
private List<String> catelogPath;
}

@ -0,0 +1,54 @@
package com.xjs.mall.product.vo;
import lombok.Data;
/**
* Vo
* @author xiejs
* @since 2022-03-17
*/
@Data
public class AttrVo {
private Long attrId;
/**
*
*/
private String attrName;
/**
* [0-1-]
*/
private Integer searchType;
/**
*
*/
private String icon;
/**
* []
*/
private String valueSelect;
/**
* [0-1-2-]
*/
private Integer attrType;
/**
*
*/
private Integer valueType;
/**
* [0 - 1 - ]
*/
private Long enable;
/**
*
*/
private Long catelogId;
/**
* 0- 1-sku
*/
private Integer showDesc;
private Long attrGroupId;
}

@ -11,10 +11,11 @@
<result property="icon" column="icon"/>
<result property="valueSelect" column="value_select"/>
<result property="attrType" column="attr_type"/>
<result property="valueType" column="value_type"/>
<result property="enable" column="enable"/>
<result property="catelogId" column="catelog_id"/>
<result property="showDesc" column="show_desc"/>
</resultMap>
</mapper>
</mapper>

@ -1,147 +0,0 @@
<template>
<el-dialog
:title="!dataForm.attrId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="属性名" prop="attrName">
<el-input v-model="dataForm.attrName" placeholder="属性名"></el-input>
</el-form-item>
<el-form-item label="是否需要检索[0-不需要1-需要]" prop="searchType">
<el-input v-model="dataForm.searchType" placeholder="是否需要检索[0-不需要1-需要]"></el-input>
</el-form-item>
<el-form-item label="属性图标" prop="icon">
<el-input v-model="dataForm.icon" placeholder="属性图标"></el-input>
</el-form-item>
<el-form-item label="可选值列表[用逗号分隔]" prop="valueSelect">
<el-input v-model="dataForm.valueSelect" placeholder="可选值列表[用逗号分隔]"></el-input>
</el-form-item>
<el-form-item label="属性类型[0-销售属性1-基本属性2-既是销售属性又是基本属性]" prop="attrType">
<el-input v-model="dataForm.attrType" placeholder="属性类型[0-销售属性1-基本属性2-既是销售属性又是基本属性]"></el-input>
</el-form-item>
<el-form-item label="启用状态[0 - 禁用1 - 启用]" prop="enable">
<el-input v-model="dataForm.enable" placeholder="启用状态[0 - 禁用1 - 启用]"></el-input>
</el-form-item>
<el-form-item label="所属分类" prop="catelogId">
<el-input v-model="dataForm.catelogId" placeholder="所属分类"></el-input>
</el-form-item>
<el-form-item label="快速展示【是否展示在介绍上0-否 1-是】在sku中仍然可以调整" prop="showDesc">
<el-input v-model="dataForm.showDesc" placeholder="快速展示【是否展示在介绍上0-否 1-是】在sku中仍然可以调整"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
attrId: 0,
attrName: '',
searchType: '',
icon: '',
valueSelect: '',
attrType: '',
enable: '',
catelogId: '',
showDesc: ''
},
dataRule: {
attrName: [
{ required: true, message: '属性名不能为空', trigger: 'blur' }
],
searchType: [
{ required: true, message: '是否需要检索[0-不需要1-需要]不能为空', trigger: 'blur' }
],
icon: [
{ required: true, message: '属性图标不能为空', trigger: 'blur' }
],
valueSelect: [
{ required: true, message: '可选值列表[用逗号分隔]不能为空', trigger: 'blur' }
],
attrType: [
{ required: true, message: '属性类型[0-销售属性1-基本属性2-既是销售属性又是基本属性]不能为空', trigger: 'blur' }
],
enable: [
{ required: true, message: '启用状态[0 - 禁用1 - 启用]不能为空', trigger: 'blur' }
],
catelogId: [
{ required: true, message: '所属分类不能为空', trigger: 'blur' }
],
showDesc: [
{ required: true, message: '快速展示【是否展示在介绍上0-否 1-是】在sku中仍然可以调整不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.attrId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.attrId) {
this.$http({
url: this.$http.adornUrl(`/product/attr/info/${this.dataForm.attrId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.attrName = data.attr.attrName
this.dataForm.searchType = data.attr.searchType
this.dataForm.icon = data.attr.icon
this.dataForm.valueSelect = data.attr.valueSelect
this.dataForm.attrType = data.attr.attrType
this.dataForm.enable = data.attr.enable
this.dataForm.catelogId = data.attr.catelogId
this.dataForm.showDesc = data.attr.showDesc
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/attr/${!this.dataForm.attrId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'attrId': this.dataForm.attrId || undefined,
'attrName': this.dataForm.attrName,
'searchType': this.dataForm.searchType,
'icon': this.dataForm.icon,
'valueSelect': this.dataForm.valueSelect,
'attrType': this.dataForm.attrType,
'enable': this.dataForm.enable,
'catelogId': this.dataForm.catelogId,
'showDesc': this.dataForm.showDesc
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,205 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:attr:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:attr:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="attrId"
header-align="center"
align="center"
label="属性id">
</el-table-column>
<el-table-column
prop="attrName"
header-align="center"
align="center"
label="属性名">
</el-table-column>
<el-table-column
prop="searchType"
header-align="center"
align="center"
label="是否需要检索[0-不需要1-需要]">
</el-table-column>
<el-table-column
prop="icon"
header-align="center"
align="center"
label="属性图标">
</el-table-column>
<el-table-column
prop="valueSelect"
header-align="center"
align="center"
label="可选值列表[用逗号分隔]">
</el-table-column>
<el-table-column
prop="attrType"
header-align="center"
align="center"
label="属性类型[0-销售属性1-基本属性2-既是销售属性又是基本属性]">
</el-table-column>
<el-table-column
prop="enable"
header-align="center"
align="center"
label="启用状态[0 - 禁用1 - 启用]">
</el-table-column>
<el-table-column
prop="catelogId"
header-align="center"
align="center"
label="所属分类">
</el-table-column>
<el-table-column
prop="showDesc"
header-align="center"
align="center"
label="快速展示【是否展示在介绍上0-否 1-是】在sku中仍然可以调整">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.attrId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.attrId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './attr-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/attr/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.attrId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/attr/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,102 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="属性id" prop="attrId">
<el-input v-model="dataForm.attrId" placeholder="属性id"></el-input>
</el-form-item>
<el-form-item label="属性分组id" prop="attrGroupId">
<el-input v-model="dataForm.attrGroupId" placeholder="属性分组id"></el-input>
</el-form-item>
<el-form-item label="属性组内排序" prop="attrSort">
<el-input v-model="dataForm.attrSort" placeholder="属性组内排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
attrId: '',
attrGroupId: '',
attrSort: ''
},
dataRule: {
attrId: [
{ required: true, message: '属性id不能为空', trigger: 'blur' }
],
attrGroupId: [
{ required: true, message: '属性分组id不能为空', trigger: 'blur' }
],
attrSort: [
{ required: true, message: '属性组内排序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/attrattrgrouprelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.attrId = data.attrAttrgroupRelation.attrId
this.dataForm.attrGroupId = data.attrAttrgroupRelation.attrGroupId
this.dataForm.attrSort = data.attrAttrgroupRelation.attrSort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/attrattrgrouprelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'attrId': this.dataForm.attrId,
'attrGroupId': this.dataForm.attrGroupId,
'attrSort': this.dataForm.attrSort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,175 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:attrattrgrouprelation:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:attrattrgrouprelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="attrId"
header-align="center"
align="center"
label="属性id">
</el-table-column>
<el-table-column
prop="attrGroupId"
header-align="center"
align="center"
label="属性分组id">
</el-table-column>
<el-table-column
prop="attrSort"
header-align="center"
align="center"
label="属性组内排序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './attrattrgrouprelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/attrattrgrouprelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/attrattrgrouprelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.attrGroupId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="组名" prop="attrGroupName">
<el-input v-model="dataForm.attrGroupName" placeholder="组名"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="描述" prop="descript">
<el-input v-model="dataForm.descript" placeholder="描述"></el-input>
</el-form-item>
<el-form-item label="组图标" prop="icon">
<el-input v-model="dataForm.icon" placeholder="组图标"></el-input>
</el-form-item>
<el-form-item label="所属分类id" prop="catelogId">
<el-input v-model="dataForm.catelogId" placeholder="所属分类id"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
attrGroupId: 0,
attrGroupName: '',
sort: '',
descript: '',
icon: '',
catelogId: ''
},
dataRule: {
attrGroupName: [
{ required: true, message: '组名不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
descript: [
{ required: true, message: '描述不能为空', trigger: 'blur' }
],
icon: [
{ required: true, message: '组图标不能为空', trigger: 'blur' }
],
catelogId: [
{ required: true, message: '所属分类id不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.attrGroupId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.attrGroupId) {
this.$http({
url: this.$http.adornUrl(`/product/attrgroup/info/${this.dataForm.attrGroupId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.attrGroupName = data.attrGroup.attrGroupName
this.dataForm.sort = data.attrGroup.sort
this.dataForm.descript = data.attrGroup.descript
this.dataForm.icon = data.attrGroup.icon
this.dataForm.catelogId = data.attrGroup.catelogId
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/attrgroup/${!this.dataForm.attrGroupId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'attrGroupId': this.dataForm.attrGroupId || undefined,
'attrGroupName': this.dataForm.attrGroupName,
'sort': this.dataForm.sort,
'descript': this.dataForm.descript,
'icon': this.dataForm.icon,
'catelogId': this.dataForm.catelogId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:attrgroup:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:attrgroup:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="attrGroupId"
header-align="center"
align="center"
label="分组id">
</el-table-column>
<el-table-column
prop="attrGroupName"
header-align="center"
align="center"
label="组名">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="descript"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="icon"
header-align="center"
align="center"
label="组图标">
</el-table-column>
<el-table-column
prop="catelogId"
header-align="center"
align="center"
label="所属分类id">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.attrGroupId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.attrGroupId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './attrgroup-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/attrgroup/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.attrGroupId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/attrgroup/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.brandId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="品牌名" prop="name">
<el-input v-model="dataForm.name" placeholder="品牌名"></el-input>
</el-form-item>
<el-form-item label="品牌logo地址" prop="logo">
<el-input v-model="dataForm.logo" placeholder="品牌logo地址"></el-input>
</el-form-item>
<el-form-item label="介绍" prop="descript">
<el-input v-model="dataForm.descript" placeholder="介绍"></el-input>
</el-form-item>
<el-form-item label="显示状态[0-不显示1-显示]" prop="showStatus">
<el-input v-model="dataForm.showStatus" placeholder="显示状态[0-不显示1-显示]"></el-input>
</el-form-item>
<el-form-item label="检索首字母" prop="firstLetter">
<el-input v-model="dataForm.firstLetter" placeholder="检索首字母"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
brandId: 0,
name: '',
logo: '',
descript: '',
showStatus: '',
firstLetter: '',
sort: ''
},
dataRule: {
name: [
{ required: true, message: '品牌名不能为空', trigger: 'blur' }
],
logo: [
{ required: true, message: '品牌logo地址不能为空', trigger: 'blur' }
],
descript: [
{ required: true, message: '介绍不能为空', trigger: 'blur' }
],
showStatus: [
{ required: true, message: '显示状态[0-不显示1-显示]不能为空', trigger: 'blur' }
],
firstLetter: [
{ required: true, message: '检索首字母不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.brandId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.brandId) {
this.$http({
url: this.$http.adornUrl(`/product/brand/info/${this.dataForm.brandId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.brand.name
this.dataForm.logo = data.brand.logo
this.dataForm.descript = data.brand.descript
this.dataForm.showStatus = data.brand.showStatus
this.dataForm.firstLetter = data.brand.firstLetter
this.dataForm.sort = data.brand.sort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/brand/${!this.dataForm.brandId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'brandId': this.dataForm.brandId || undefined,
'name': this.dataForm.name,
'logo': this.dataForm.logo,
'descript': this.dataForm.descript,
'showStatus': this.dataForm.showStatus,
'firstLetter': this.dataForm.firstLetter,
'sort': this.dataForm.sort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:brand:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:brand:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="brandId"
header-align="center"
align="center"
label="品牌id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="品牌名">
</el-table-column>
<el-table-column
prop="logo"
header-align="center"
align="center"
label="品牌logo地址">
</el-table-column>
<el-table-column
prop="descript"
header-align="center"
align="center"
label="介绍">
</el-table-column>
<el-table-column
prop="showStatus"
header-align="center"
align="center"
label="显示状态[0-不显示1-显示]">
</el-table-column>
<el-table-column
prop="firstLetter"
header-align="center"
align="center"
label="检索首字母">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.brandId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.brandId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './brand-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/brand/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.brandId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/brand/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,147 +0,0 @@
<template>
<el-dialog
:title="!dataForm.catId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="分类名称" prop="name">
<el-input v-model="dataForm.name" placeholder="分类名称"></el-input>
</el-form-item>
<el-form-item label="父分类id" prop="parentCid">
<el-input v-model="dataForm.parentCid" placeholder="父分类id"></el-input>
</el-form-item>
<el-form-item label="层级" prop="catLevel">
<el-input v-model="dataForm.catLevel" placeholder="层级"></el-input>
</el-form-item>
<el-form-item label="是否显示[0-不显示1显示]" prop="showStatus">
<el-input v-model="dataForm.showStatus" placeholder="是否显示[0-不显示1显示]"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="图标地址" prop="icon">
<el-input v-model="dataForm.icon" placeholder="图标地址"></el-input>
</el-form-item>
<el-form-item label="计量单位" prop="productUnit">
<el-input v-model="dataForm.productUnit" placeholder="计量单位"></el-input>
</el-form-item>
<el-form-item label="商品数量" prop="productCount">
<el-input v-model="dataForm.productCount" placeholder="商品数量"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
catId: 0,
name: '',
parentCid: '',
catLevel: '',
showStatus: '',
sort: '',
icon: '',
productUnit: '',
productCount: ''
},
dataRule: {
name: [
{ required: true, message: '分类名称不能为空', trigger: 'blur' }
],
parentCid: [
{ required: true, message: '父分类id不能为空', trigger: 'blur' }
],
catLevel: [
{ required: true, message: '层级不能为空', trigger: 'blur' }
],
showStatus: [
{ required: true, message: '是否显示[0-不显示1显示]不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
icon: [
{ required: true, message: '图标地址不能为空', trigger: 'blur' }
],
productUnit: [
{ required: true, message: '计量单位不能为空', trigger: 'blur' }
],
productCount: [
{ required: true, message: '商品数量不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.catId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.catId) {
this.$http({
url: this.$http.adornUrl(`/product/category/info/${this.dataForm.catId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.category.name
this.dataForm.parentCid = data.category.parentCid
this.dataForm.catLevel = data.category.catLevel
this.dataForm.showStatus = data.category.showStatus
this.dataForm.sort = data.category.sort
this.dataForm.icon = data.category.icon
this.dataForm.productUnit = data.category.productUnit
this.dataForm.productCount = data.category.productCount
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/category/${!this.dataForm.catId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'catId': this.dataForm.catId || undefined,
'name': this.dataForm.name,
'parentCid': this.dataForm.parentCid,
'catLevel': this.dataForm.catLevel,
'showStatus': this.dataForm.showStatus,
'sort': this.dataForm.sort,
'icon': this.dataForm.icon,
'productUnit': this.dataForm.productUnit,
'productCount': this.dataForm.productCount
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,205 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:category:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:category:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="catId"
header-align="center"
align="center"
label="分类id">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分类名称">
</el-table-column>
<el-table-column
prop="parentCid"
header-align="center"
align="center"
label="父分类id">
</el-table-column>
<el-table-column
prop="catLevel"
header-align="center"
align="center"
label="层级">
</el-table-column>
<el-table-column
prop="showStatus"
header-align="center"
align="center"
label="是否显示[0-不显示1显示]">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="icon"
header-align="center"
align="center"
label="图标地址">
</el-table-column>
<el-table-column
prop="productUnit"
header-align="center"
align="center"
label="计量单位">
</el-table-column>
<el-table-column
prop="productCount"
header-align="center"
align="center"
label="商品数量">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.catId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.catId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './category-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/category/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.catId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/category/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="品牌id" prop="brandId">
<el-input v-model="dataForm.brandId" placeholder="品牌id"></el-input>
</el-form-item>
<el-form-item label="分类id" prop="catelogId">
<el-input v-model="dataForm.catelogId" placeholder="分类id"></el-input>
</el-form-item>
<el-form-item label="" prop="brandName">
<el-input v-model="dataForm.brandName" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="catelogName">
<el-input v-model="dataForm.catelogName" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
brandId: '',
catelogId: '',
brandName: '',
catelogName: ''
},
dataRule: {
brandId: [
{ required: true, message: '品牌id不能为空', trigger: 'blur' }
],
catelogId: [
{ required: true, message: '分类id不能为空', trigger: 'blur' }
],
brandName: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
catelogName: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/categorybrandrelation/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.brandId = data.categoryBrandRelation.brandId
this.dataForm.catelogId = data.categoryBrandRelation.catelogId
this.dataForm.brandName = data.categoryBrandRelation.brandName
this.dataForm.catelogName = data.categoryBrandRelation.catelogName
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/categorybrandrelation/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'brandId': this.dataForm.brandId,
'catelogId': this.dataForm.catelogId,
'brandName': this.dataForm.brandName,
'catelogName': this.dataForm.catelogName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:categorybrandrelation:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:categorybrandrelation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="brandId"
header-align="center"
align="center"
label="品牌id">
</el-table-column>
<el-table-column
prop="catelogId"
header-align="center"
align="center"
label="分类id">
</el-table-column>
<el-table-column
prop="brandName"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="catelogName"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './categorybrandrelation-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/categorybrandrelation/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/categorybrandrelation/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,93 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="评论id" prop="commentId">
<el-input v-model="dataForm.commentId" placeholder="评论id"></el-input>
</el-form-item>
<el-form-item label="回复id" prop="replyId">
<el-input v-model="dataForm.replyId" placeholder="回复id"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
commentId: '',
replyId: ''
},
dataRule: {
commentId: [
{ required: true, message: '评论id不能为空', trigger: 'blur' }
],
replyId: [
{ required: true, message: '回复id不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/commentreplay/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.commentId = data.commentReplay.commentId
this.dataForm.replyId = data.commentReplay.replyId
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/commentreplay/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'commentId': this.dataForm.commentId,
'replyId': this.dataForm.replyId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,169 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:commentreplay:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:commentreplay:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="commentId"
header-align="center"
align="center"
label="评论id">
</el-table-column>
<el-table-column
prop="replyId"
header-align="center"
align="center"
label="回复id">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './commentreplay-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/commentreplay/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/commentreplay/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,129 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="商品id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="商品id"></el-input>
</el-form-item>
<el-form-item label="属性id" prop="attrId">
<el-input v-model="dataForm.attrId" placeholder="属性id"></el-input>
</el-form-item>
<el-form-item label="属性名" prop="attrName">
<el-input v-model="dataForm.attrName" placeholder="属性名"></el-input>
</el-form-item>
<el-form-item label="属性值" prop="attrValue">
<el-input v-model="dataForm.attrValue" placeholder="属性值"></el-input>
</el-form-item>
<el-form-item label="顺序" prop="attrSort">
<el-input v-model="dataForm.attrSort" placeholder="顺序"></el-input>
</el-form-item>
<el-form-item label="快速展示【是否展示在介绍上0-否 1-是】" prop="quickShow">
<el-input v-model="dataForm.quickShow" placeholder="快速展示【是否展示在介绍上0-否 1-是】"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
spuId: '',
attrId: '',
attrName: '',
attrValue: '',
attrSort: '',
quickShow: ''
},
dataRule: {
spuId: [
{ required: true, message: '商品id不能为空', trigger: 'blur' }
],
attrId: [
{ required: true, message: '属性id不能为空', trigger: 'blur' }
],
attrName: [
{ required: true, message: '属性名不能为空', trigger: 'blur' }
],
attrValue: [
{ required: true, message: '属性值不能为空', trigger: 'blur' }
],
attrSort: [
{ required: true, message: '顺序不能为空', trigger: 'blur' }
],
quickShow: [
{ required: true, message: '快速展示【是否展示在介绍上0-否 1-是】不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/productattrvalue/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.spuId = data.productAttrValue.spuId
this.dataForm.attrId = data.productAttrValue.attrId
this.dataForm.attrName = data.productAttrValue.attrName
this.dataForm.attrValue = data.productAttrValue.attrValue
this.dataForm.attrSort = data.productAttrValue.attrSort
this.dataForm.quickShow = data.productAttrValue.quickShow
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/productattrvalue/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'spuId': this.dataForm.spuId,
'attrId': this.dataForm.attrId,
'attrName': this.dataForm.attrName,
'attrValue': this.dataForm.attrValue,
'attrSort': this.dataForm.attrSort,
'quickShow': this.dataForm.quickShow
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,193 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:productattrvalue:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:productattrvalue:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="商品id">
</el-table-column>
<el-table-column
prop="attrId"
header-align="center"
align="center"
label="属性id">
</el-table-column>
<el-table-column
prop="attrName"
header-align="center"
align="center"
label="属性名">
</el-table-column>
<el-table-column
prop="attrValue"
header-align="center"
align="center"
label="属性值">
</el-table-column>
<el-table-column
prop="attrSort"
header-align="center"
align="center"
label="顺序">
</el-table-column>
<el-table-column
prop="quickShow"
header-align="center"
align="center"
label="快速展示【是否展示在介绍上0-否 1-是】">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './productattrvalue-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/productattrvalue/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/productattrvalue/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,111 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="imgUrl">
<el-input v-model="dataForm.imgUrl" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="排序" prop="imgSort">
<el-input v-model="dataForm.imgSort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="默认图[0 - 不是默认图1 - 是默认图]" prop="defaultImg">
<el-input v-model="dataForm.defaultImg" placeholder="默认图[0 - 不是默认图1 - 是默认图]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
imgUrl: '',
imgSort: '',
defaultImg: ''
},
dataRule: {
skuId: [
{ required: true, message: 'sku_id不能为空', trigger: 'blur' }
],
imgUrl: [
{ required: true, message: '图片地址不能为空', trigger: 'blur' }
],
imgSort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
defaultImg: [
{ required: true, message: '默认图[0 - 不是默认图1 - 是默认图]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/skuimages/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.skuImages.skuId
this.dataForm.imgUrl = data.skuImages.imgUrl
this.dataForm.imgSort = data.skuImages.imgSort
this.dataForm.defaultImg = data.skuImages.defaultImg
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/skuimages/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'imgUrl': this.dataForm.imgUrl,
'imgSort': this.dataForm.imgSort,
'defaultImg': this.dataForm.defaultImg
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,181 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:skuimages:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:skuimages:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="imgUrl"
header-align="center"
align="center"
label="图片地址">
</el-table-column>
<el-table-column
prop="imgSort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="defaultImg"
header-align="center"
align="center"
label="默认图[0 - 不是默认图1 - 是默认图]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skuimages-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/skuimages/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/skuimages/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,165 +0,0 @@
<template>
<el-dialog
:title="!dataForm.skuId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="spuId" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spuId"></el-input>
</el-form-item>
<el-form-item label="sku名称" prop="skuName">
<el-input v-model="dataForm.skuName" placeholder="sku名称"></el-input>
</el-form-item>
<el-form-item label="sku介绍描述" prop="skuDesc">
<el-input v-model="dataForm.skuDesc" placeholder="sku介绍描述"></el-input>
</el-form-item>
<el-form-item label="所属分类id" prop="catalogId">
<el-input v-model="dataForm.catalogId" placeholder="所属分类id"></el-input>
</el-form-item>
<el-form-item label="品牌id" prop="brandId">
<el-input v-model="dataForm.brandId" placeholder="品牌id"></el-input>
</el-form-item>
<el-form-item label="默认图片" prop="skuDefaultImg">
<el-input v-model="dataForm.skuDefaultImg" placeholder="默认图片"></el-input>
</el-form-item>
<el-form-item label="标题" prop="skuTitle">
<el-input v-model="dataForm.skuTitle" placeholder="标题"></el-input>
</el-form-item>
<el-form-item label="副标题" prop="skuSubtitle">
<el-input v-model="dataForm.skuSubtitle" placeholder="副标题"></el-input>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input v-model="dataForm.price" placeholder="价格"></el-input>
</el-form-item>
<el-form-item label="销量" prop="saleCount">
<el-input v-model="dataForm.saleCount" placeholder="销量"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
skuId: 0,
spuId: '',
skuName: '',
skuDesc: '',
catalogId: '',
brandId: '',
skuDefaultImg: '',
skuTitle: '',
skuSubtitle: '',
price: '',
saleCount: ''
},
dataRule: {
spuId: [
{ required: true, message: 'spuId不能为空', trigger: 'blur' }
],
skuName: [
{ required: true, message: 'sku名称不能为空', trigger: 'blur' }
],
skuDesc: [
{ required: true, message: 'sku介绍描述不能为空', trigger: 'blur' }
],
catalogId: [
{ required: true, message: '所属分类id不能为空', trigger: 'blur' }
],
brandId: [
{ required: true, message: '品牌id不能为空', trigger: 'blur' }
],
skuDefaultImg: [
{ required: true, message: '默认图片不能为空', trigger: 'blur' }
],
skuTitle: [
{ required: true, message: '标题不能为空', trigger: 'blur' }
],
skuSubtitle: [
{ required: true, message: '副标题不能为空', trigger: 'blur' }
],
price: [
{ required: true, message: '价格不能为空', trigger: 'blur' }
],
saleCount: [
{ required: true, message: '销量不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.skuId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.skuId) {
this.$http({
url: this.$http.adornUrl(`/product/skuinfo/info/${this.dataForm.skuId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.spuId = data.skuInfo.spuId
this.dataForm.skuName = data.skuInfo.skuName
this.dataForm.skuDesc = data.skuInfo.skuDesc
this.dataForm.catalogId = data.skuInfo.catalogId
this.dataForm.brandId = data.skuInfo.brandId
this.dataForm.skuDefaultImg = data.skuInfo.skuDefaultImg
this.dataForm.skuTitle = data.skuInfo.skuTitle
this.dataForm.skuSubtitle = data.skuInfo.skuSubtitle
this.dataForm.price = data.skuInfo.price
this.dataForm.saleCount = data.skuInfo.saleCount
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/skuinfo/${!this.dataForm.skuId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'skuId': this.dataForm.skuId || undefined,
'spuId': this.dataForm.spuId,
'skuName': this.dataForm.skuName,
'skuDesc': this.dataForm.skuDesc,
'catalogId': this.dataForm.catalogId,
'brandId': this.dataForm.brandId,
'skuDefaultImg': this.dataForm.skuDefaultImg,
'skuTitle': this.dataForm.skuTitle,
'skuSubtitle': this.dataForm.skuSubtitle,
'price': this.dataForm.price,
'saleCount': this.dataForm.saleCount
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,217 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:skuinfo:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:skuinfo:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="skuId">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spuId">
</el-table-column>
<el-table-column
prop="skuName"
header-align="center"
align="center"
label="sku名称">
</el-table-column>
<el-table-column
prop="skuDesc"
header-align="center"
align="center"
label="sku介绍描述">
</el-table-column>
<el-table-column
prop="catalogId"
header-align="center"
align="center"
label="所属分类id">
</el-table-column>
<el-table-column
prop="brandId"
header-align="center"
align="center"
label="品牌id">
</el-table-column>
<el-table-column
prop="skuDefaultImg"
header-align="center"
align="center"
label="默认图片">
</el-table-column>
<el-table-column
prop="skuTitle"
header-align="center"
align="center"
label="标题">
</el-table-column>
<el-table-column
prop="skuSubtitle"
header-align="center"
align="center"
label="副标题">
</el-table-column>
<el-table-column
prop="price"
header-align="center"
align="center"
label="价格">
</el-table-column>
<el-table-column
prop="saleCount"
header-align="center"
align="center"
label="销量">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.skuId)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.skuId)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skuinfo-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/skuinfo/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.skuId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/skuinfo/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="attr_id" prop="attrId">
<el-input v-model="dataForm.attrId" placeholder="attr_id"></el-input>
</el-form-item>
<el-form-item label="销售属性名" prop="attrName">
<el-input v-model="dataForm.attrName" placeholder="销售属性名"></el-input>
</el-form-item>
<el-form-item label="销售属性值" prop="attrValue">
<el-input v-model="dataForm.attrValue" placeholder="销售属性值"></el-input>
</el-form-item>
<el-form-item label="顺序" prop="attrSort">
<el-input v-model="dataForm.attrSort" placeholder="顺序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
attrId: '',
attrName: '',
attrValue: '',
attrSort: ''
},
dataRule: {
skuId: [
{ required: true, message: 'sku_id不能为空', trigger: 'blur' }
],
attrId: [
{ required: true, message: 'attr_id不能为空', trigger: 'blur' }
],
attrName: [
{ required: true, message: '销售属性名不能为空', trigger: 'blur' }
],
attrValue: [
{ required: true, message: '销售属性值不能为空', trigger: 'blur' }
],
attrSort: [
{ required: true, message: '顺序不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/skusaleattrvalue/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.skuSaleAttrValue.skuId
this.dataForm.attrId = data.skuSaleAttrValue.attrId
this.dataForm.attrName = data.skuSaleAttrValue.attrName
this.dataForm.attrValue = data.skuSaleAttrValue.attrValue
this.dataForm.attrSort = data.skuSaleAttrValue.attrSort
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/skusaleattrvalue/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'attrId': this.dataForm.attrId,
'attrName': this.dataForm.attrName,
'attrValue': this.dataForm.attrValue,
'attrSort': this.dataForm.attrSort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,187 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:skusaleattrvalue:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:skusaleattrvalue:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="attrId"
header-align="center"
align="center"
label="attr_id">
</el-table-column>
<el-table-column
prop="attrName"
header-align="center"
align="center"
label="销售属性名">
</el-table-column>
<el-table-column
prop="attrValue"
header-align="center"
align="center"
label="销售属性值">
</el-table-column>
<el-table-column
prop="attrSort"
header-align="center"
align="center"
label="顺序">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './skusaleattrvalue-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/skusaleattrvalue/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/skusaleattrvalue/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,210 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="sku_id" prop="skuId">
<el-input v-model="dataForm.skuId" placeholder="sku_id"></el-input>
</el-form-item>
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="商品名字" prop="spuName">
<el-input v-model="dataForm.spuName" placeholder="商品名字"></el-input>
</el-form-item>
<el-form-item label="会员昵称" prop="memberNickName">
<el-input v-model="dataForm.memberNickName" placeholder="会员昵称"></el-input>
</el-form-item>
<el-form-item label="星级" prop="star">
<el-input v-model="dataForm.star" placeholder="星级"></el-input>
</el-form-item>
<el-form-item label="会员ip" prop="memberIp">
<el-input v-model="dataForm.memberIp" placeholder="会员ip"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="显示状态[0-不显示1-显示]" prop="showStatus">
<el-input v-model="dataForm.showStatus" placeholder="显示状态[0-不显示1-显示]"></el-input>
</el-form-item>
<el-form-item label="购买时属性组合" prop="spuAttributes">
<el-input v-model="dataForm.spuAttributes" placeholder="购买时属性组合"></el-input>
</el-form-item>
<el-form-item label="点赞数" prop="likesCount">
<el-input v-model="dataForm.likesCount" placeholder="点赞数"></el-input>
</el-form-item>
<el-form-item label="回复数" prop="replyCount">
<el-input v-model="dataForm.replyCount" placeholder="回复数"></el-input>
</el-form-item>
<el-form-item label="评论图片/视频[json数据[{type:文件类型,url:资源路径}]]" prop="resources">
<el-input v-model="dataForm.resources" placeholder="评论图片/视频[json数据[{type:文件类型,url:资源路径}]]"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" placeholder="内容"></el-input>
</el-form-item>
<el-form-item label="用户头像" prop="memberIcon">
<el-input v-model="dataForm.memberIcon" placeholder="用户头像"></el-input>
</el-form-item>
<el-form-item label="评论类型[0 - 对商品的直接评论1 - 对评论的回复]" prop="commentType">
<el-input v-model="dataForm.commentType" placeholder="评论类型[0 - 对商品的直接评论1 - 对评论的回复]"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
skuId: '',
spuId: '',
spuName: '',
memberNickName: '',
star: '',
memberIp: '',
createTime: '',
showStatus: '',
spuAttributes: '',
likesCount: '',
replyCount: '',
resources: '',
content: '',
memberIcon: '',
commentType: ''
},
dataRule: {
skuId: [
{ required: true, message: 'sku_id不能为空', trigger: 'blur' }
],
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
spuName: [
{ required: true, message: '商品名字不能为空', trigger: 'blur' }
],
memberNickName: [
{ required: true, message: '会员昵称不能为空', trigger: 'blur' }
],
star: [
{ required: true, message: '星级不能为空', trigger: 'blur' }
],
memberIp: [
{ required: true, message: '会员ip不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
showStatus: [
{ required: true, message: '显示状态[0-不显示1-显示]不能为空', trigger: 'blur' }
],
spuAttributes: [
{ required: true, message: '购买时属性组合不能为空', trigger: 'blur' }
],
likesCount: [
{ required: true, message: '点赞数不能为空', trigger: 'blur' }
],
replyCount: [
{ required: true, message: '回复数不能为空', trigger: 'blur' }
],
resources: [
{ required: true, message: '评论图片/视频[json数据[{type:文件类型,url:资源路径}]]不能为空', trigger: 'blur' }
],
content: [
{ required: true, message: '内容不能为空', trigger: 'blur' }
],
memberIcon: [
{ required: true, message: '用户头像不能为空', trigger: 'blur' }
],
commentType: [
{ required: true, message: '评论类型[0 - 对商品的直接评论1 - 对评论的回复]不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/spucomment/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.skuId = data.spuComment.skuId
this.dataForm.spuId = data.spuComment.spuId
this.dataForm.spuName = data.spuComment.spuName
this.dataForm.memberNickName = data.spuComment.memberNickName
this.dataForm.star = data.spuComment.star
this.dataForm.memberIp = data.spuComment.memberIp
this.dataForm.createTime = data.spuComment.createTime
this.dataForm.showStatus = data.spuComment.showStatus
this.dataForm.spuAttributes = data.spuComment.spuAttributes
this.dataForm.likesCount = data.spuComment.likesCount
this.dataForm.replyCount = data.spuComment.replyCount
this.dataForm.resources = data.spuComment.resources
this.dataForm.content = data.spuComment.content
this.dataForm.memberIcon = data.spuComment.memberIcon
this.dataForm.commentType = data.spuComment.commentType
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/spucomment/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'skuId': this.dataForm.skuId,
'spuId': this.dataForm.spuId,
'spuName': this.dataForm.spuName,
'memberNickName': this.dataForm.memberNickName,
'star': this.dataForm.star,
'memberIp': this.dataForm.memberIp,
'createTime': this.dataForm.createTime,
'showStatus': this.dataForm.showStatus,
'spuAttributes': this.dataForm.spuAttributes,
'likesCount': this.dataForm.likesCount,
'replyCount': this.dataForm.replyCount,
'resources': this.dataForm.resources,
'content': this.dataForm.content,
'memberIcon': this.dataForm.memberIcon,
'commentType': this.dataForm.commentType
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

@ -1,247 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()"></el-button>
<el-button v-if="isAuth('product:spucomment:save')" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-if="isAuth('product:spucomment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="skuId"
header-align="center"
align="center"
label="sku_id">
</el-table-column>
<el-table-column
prop="spuId"
header-align="center"
align="center"
label="spu_id">
</el-table-column>
<el-table-column
prop="spuName"
header-align="center"
align="center"
label="商品名字">
</el-table-column>
<el-table-column
prop="memberNickName"
header-align="center"
align="center"
label="会员昵称">
</el-table-column>
<el-table-column
prop="star"
header-align="center"
align="center"
label="星级">
</el-table-column>
<el-table-column
prop="memberIp"
header-align="center"
align="center"
label="会员ip">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="showStatus"
header-align="center"
align="center"
label="显示状态[0-不显示1-显示]">
</el-table-column>
<el-table-column
prop="spuAttributes"
header-align="center"
align="center"
label="购买时属性组合">
</el-table-column>
<el-table-column
prop="likesCount"
header-align="center"
align="center"
label="点赞数">
</el-table-column>
<el-table-column
prop="replyCount"
header-align="center"
align="center"
label="回复数">
</el-table-column>
<el-table-column
prop="resources"
header-align="center"
align="center"
label="评论图片/视频[json数据[{type:文件类型,url:资源路径}]]">
</el-table-column>
<el-table-column
prop="content"
header-align="center"
align="center"
label="内容">
</el-table-column>
<el-table-column
prop="memberIcon"
header-align="center"
align="center"
label="用户头像">
</el-table-column>
<el-table-column
prop="commentType"
header-align="center"
align="center"
label="评论类型[0 - 对商品的直接评论1 - 对评论的回复]">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)"></el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './spucomment-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/product/spucomment/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/product/spucomment/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

@ -1,120 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="spu_id" prop="spuId">
<el-input v-model="dataForm.spuId" placeholder="spu_id"></el-input>
</el-form-item>
<el-form-item label="图片名" prop="imgName">
<el-input v-model="dataForm.imgName" placeholder="图片名"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="imgUrl">
<el-input v-model="dataForm.imgUrl" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="顺序" prop="imgSort">
<el-input v-model="dataForm.imgSort" placeholder="顺序"></el-input>
</el-form-item>
<el-form-item label="是否默认图" prop="defaultImg">
<el-input v-model="dataForm.defaultImg" placeholder="是否默认图"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()"></el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
spuId: '',
imgName: '',
imgUrl: '',
imgSort: '',
defaultImg: ''
},
dataRule: {
spuId: [
{ required: true, message: 'spu_id不能为空', trigger: 'blur' }
],
imgName: [
{ required: true, message: '图片名不能为空', trigger: 'blur' }
],
imgUrl: [
{ required: true, message: '图片地址不能为空', trigger: 'blur' }
],
imgSort: [
{ required: true, message: '顺序不能为空', trigger: 'blur' }
],
defaultImg: [
{ required: true, message: '是否默认图不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/product/spuimages/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.spuId = data.spuImages.spuId
this.dataForm.imgName = data.spuImages.imgName
this.dataForm.imgUrl = data.spuImages.imgUrl
this.dataForm.imgSort = data.spuImages.imgSort
this.dataForm.defaultImg = data.spuImages.defaultImg
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/product/spuimages/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'spuId': this.dataForm.spuId,
'imgName': this.dataForm.imgName,
'imgUrl': this.dataForm.imgUrl,
'imgSort': this.dataForm.imgSort,
'defaultImg': this.dataForm.defaultImg
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save