parent
e2bacc76b8
commit
7ec28298de
@ -0,0 +1,297 @@ |
|||||||
|
<template> |
||||||
|
<div class="divBox"> |
||||||
|
<el-card class="box-card"> |
||||||
|
<div slot="header" class="clearfix"> |
||||||
|
<div class="container"> |
||||||
|
<el-form size="small" inline label-width="100px"> |
||||||
|
<el-form-item label="昵称:"> |
||||||
|
<el-input |
||||||
|
style="width: 200px" |
||||||
|
placeholder="请输入昵称" |
||||||
|
v-model="tableFrom.nickname" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item label="手机号:"> |
||||||
|
<el-input |
||||||
|
style="width: 200px" |
||||||
|
placeholder="请输入手机号" |
||||||
|
v-model="tableFrom.phone" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item label="货币类型:" clearable> |
||||||
|
<el-select |
||||||
|
v-model="tableFrom.asset_type" |
||||||
|
placeholder="请选择货币类型" |
||||||
|
clearable |
||||||
|
> |
||||||
|
<el-option value="1" label="消费积分">消费积分</el-option> |
||||||
|
<el-option value="2" label="分红点">分红点</el-option> |
||||||
|
<el-option value="3" label="福利积分">福利积分</el-option> |
||||||
|
<el-option value="4" label="惠通宝">惠通宝</el-option> |
||||||
|
<el-option value="5" label="贡献值">贡献值</el-option> |
||||||
|
</el-select> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="分值来源:"> |
||||||
|
<el-select |
||||||
|
placeholder="请选择" |
||||||
|
v-model="tableFrom.type" |
||||||
|
clearable |
||||||
|
> |
||||||
|
<el-option value="1" label="个人下单">个人下单</el-option> |
||||||
|
<el-option value="2" label="签到">签到</el-option> |
||||||
|
<el-option value="3" label="消费积分兑换分红点">消费积分兑换分红点</el-option> |
||||||
|
<el-option value="4" label="分红点返佣">分红点返佣</el-option> |
||||||
|
<el-option value="5" label="推广返佣">推广返佣</el-option> |
||||||
|
<el-option value="6" label="培育奖">培育奖</el-option> |
||||||
|
<el-option value="7" label="区域代理奖">区域代理奖</el-option> |
||||||
|
<el-option value="8" label="惠通宝兑换消费积分">惠通宝兑换消费积分</el-option> |
||||||
|
<el-option value="9" label="转让他人">转让他人</el-option> |
||||||
|
<el-option value="10" label="他人转让">他人转让</el-option> |
||||||
|
</el-select> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="时间选择:" class="width100"> |
||||||
|
<el-date-picker |
||||||
|
v-model="timeVal" |
||||||
|
value-format="yyyy/MM/dd" |
||||||
|
format="yyyy/MM/dd" |
||||||
|
size="small" |
||||||
|
type="daterange" |
||||||
|
placement="bottom-end" |
||||||
|
placeholder="自定义时间" |
||||||
|
style="width: 250px;" |
||||||
|
@change="onchangeTime" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
<el-button size="small" type="primary" icon="el-icon-search" @click="getList()">搜索</el-button> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<el-table v-loading="loading" :data="tableData.data" style="width: 100%" size="small"> |
||||||
|
<el-table-column label="ID" prop="id" min-width="80"/> |
||||||
|
<el-table-column label="用户昵称" prop="user_nickname" min-width="120"/> |
||||||
|
<el-table-column label="手机" prop="user_phone" min-width="120"/> |
||||||
|
<el-table-column label="货币类型" prop="asset_type" min-width="120"/> |
||||||
|
<el-table-column label="分值来源" prop="type" min-width="120"/> |
||||||
|
<el-table-column label="变动情况" prop="count" min-width="120"/> |
||||||
|
<el-table-column label="变动时间" prop="create_time" min-width="120" /> |
||||||
|
|
||||||
|
</el-table> |
||||||
|
<div class="block"> |
||||||
|
<el-pagination |
||||||
|
:page-sizes="[20, 40, 60, 80]" |
||||||
|
:page-size="tableFrom.limit" |
||||||
|
:current-page="tableFrom.page" |
||||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||||
|
:total="tableData.total" |
||||||
|
@size-change="handleSizeChange" |
||||||
|
@current-change="pageChange" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</el-card> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { mapState } from "vuex"; |
||||||
|
import {discountsList, discountsChangeStatus, discountsGetDetails, assetsLogList} from "@/api/marketing"; |
||||||
|
import { formatDate } from "@/utils/validate"; |
||||||
|
import { roterPre } from '@/settings' |
||||||
|
export default { |
||||||
|
name: "Discounts", |
||||||
|
filters: { |
||||||
|
formatDate(time) { |
||||||
|
if (time !== 0) { |
||||||
|
let date = new Date(time * 1000); |
||||||
|
return formatDate(date, "yyyy-MM-dd hh:mm"); |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
loading: false, |
||||||
|
dialogLoading: false, |
||||||
|
roterPre: roterPre, |
||||||
|
dialogVisible: false, |
||||||
|
tableData: { |
||||||
|
data: [], |
||||||
|
total: 0, |
||||||
|
}, |
||||||
|
tableFrom: { |
||||||
|
type: "", |
||||||
|
nickname: "", |
||||||
|
phone: "", |
||||||
|
page: 1, |
||||||
|
asset_type: "", |
||||||
|
limit: 15, |
||||||
|
}, |
||||||
|
specsMainData: [], |
||||||
|
specsData: [], |
||||||
|
timeVal: [], |
||||||
|
formValidate: { |
||||||
|
title: "", //套餐名称 |
||||||
|
type: 0, //套餐类型 |
||||||
|
image: "", //套餐主图 |
||||||
|
is_time: 0, //是否限时 |
||||||
|
is_limit: 0, //限量1/不限量0 |
||||||
|
limit_num: 0, //限量 |
||||||
|
link_ids: [], //参与用户标签 |
||||||
|
time: [], //套餐时间 |
||||||
|
sort: 0, //排序 |
||||||
|
free_shipping: 1, //是否包邮 |
||||||
|
status: 1, |
||||||
|
products: [], |
||||||
|
}, |
||||||
|
}; |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getList(''); |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
// 查看 |
||||||
|
handleDetail(id) { |
||||||
|
this.dialogVisible = true; |
||||||
|
this.dialogLoading = true; |
||||||
|
discountsGetDetails(id).then((res) => { |
||||||
|
this.formValidate = res.data; |
||||||
|
this.formValidate.time = res.data.time || []; |
||||||
|
this.dialogLoading = false; |
||||||
|
for (let i = 0; i < res.data.discountsProduct.length; i++) { |
||||||
|
const element = res.data.discountsProduct[i]; |
||||||
|
element.attr= []; |
||||||
|
const attrArr = element['product'] && element['product']['attrValue'] || []; |
||||||
|
for (let j = 0; j < attrArr.length; j++) { |
||||||
|
const attr = attrArr[j]; |
||||||
|
if (attr.productSku) { |
||||||
|
element.attr.push(attr) |
||||||
|
} |
||||||
|
} |
||||||
|
if (element.type == 1) { |
||||||
|
this.specsMainData.push(element); |
||||||
|
} else { |
||||||
|
this.specsData.push(element); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
|
// 列表 |
||||||
|
getList(num) { |
||||||
|
this.loading = true; |
||||||
|
this.tableFrom.page = num ? num : this.tableFrom.page; |
||||||
|
assetsLogList(this.tableFrom) |
||||||
|
.then(async (res) => { |
||||||
|
this.tableData.data = res.data.list; |
||||||
|
this.tableData.total = res.data.count; |
||||||
|
this.loading = false; |
||||||
|
}) |
||||||
|
.catch((res) => { |
||||||
|
this.loading = false; |
||||||
|
this.$message.error(res.message); |
||||||
|
}); |
||||||
|
}, |
||||||
|
pageChange(page) { |
||||||
|
this.tableFrom.page = page; |
||||||
|
this.getList(''); |
||||||
|
}, |
||||||
|
handleSizeChange(val) { |
||||||
|
this.tableFrom.limit = val; |
||||||
|
this.getList(''); |
||||||
|
}, |
||||||
|
|
||||||
|
// 具体日期 |
||||||
|
onchangeTime(e) { |
||||||
|
this.timeVal = e; |
||||||
|
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : ""; |
||||||
|
}, |
||||||
|
|
||||||
|
// 修改是否显示 |
||||||
|
onchangeIsShow(row) { |
||||||
|
discountsChangeStatus(row.discount_id,row.status) |
||||||
|
.then(async (res) => { |
||||||
|
this.$message.success(res.message); |
||||||
|
this.getList(''); |
||||||
|
}) |
||||||
|
.catch((res) => { |
||||||
|
this.$message.error(res.message); |
||||||
|
this.getList(''); |
||||||
|
}); |
||||||
|
}, |
||||||
|
}, |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped lang="scss"> |
||||||
|
.tabBox_img { |
||||||
|
width: 36px; |
||||||
|
height: 36px; |
||||||
|
border-radius: 4px; |
||||||
|
cursor: pointer; |
||||||
|
|
||||||
|
img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
.box-container { |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
.box-container .list { |
||||||
|
float: left; |
||||||
|
line-height: 40px; |
||||||
|
|
||||||
|
} |
||||||
|
.box-container .sp { |
||||||
|
width: 50%; |
||||||
|
//white-space: nowrap; |
||||||
|
//overflow: hidden; |
||||||
|
//text-overflow: ellipsis; |
||||||
|
} |
||||||
|
.box-container .sp3 { |
||||||
|
width: 33.3333%; |
||||||
|
} |
||||||
|
.box-container .sp100 { |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
.box-container .list .name { |
||||||
|
display: inline-block; |
||||||
|
color: #606266; |
||||||
|
} |
||||||
|
.box-container .list .blue { |
||||||
|
color: #1890ff; |
||||||
|
} |
||||||
|
.box-container .list.image { |
||||||
|
margin: 20px 0; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
.box-container .list.image img { |
||||||
|
position: absolute; |
||||||
|
top: -20px; |
||||||
|
} |
||||||
|
.labeltop{ |
||||||
|
max-height: 280px; |
||||||
|
min-height: 120px; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
.title{ |
||||||
|
margin-bottom: 16px; |
||||||
|
color: #17233d; |
||||||
|
font-size: 14px; |
||||||
|
font-weight: bold; |
||||||
|
padding-bottom: 2px; |
||||||
|
border-bottom: 1px solid #dfe6ec; |
||||||
|
} |
||||||
|
.product-data { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
.image { |
||||||
|
width: 50px !important; |
||||||
|
height: 50px !important; |
||||||
|
margin-right: 10px; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue