|
|
|
@ -4,90 +4,81 @@ |
|
|
|
|
<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.nickname"--> |
|
|
|
|
<!-- />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="手机号:"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 200px" |
|
|
|
|
placeholder="请输入手机号" |
|
|
|
|
v-model="tableFrom.phone" |
|
|
|
|
v-model="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="货币类型:" 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-form-item label="转让类型:"> |
|
|
|
|
<el-select |
|
|
|
|
placeholder="请选择" |
|
|
|
|
v-model="tableFrom.type" |
|
|
|
|
clearable |
|
|
|
|
v-model="type" |
|
|
|
|
> |
|
|
|
|
<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-option value="6" label="积分" aria-checked="true">积分</el-option> |
|
|
|
|
<el-option value="20" 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-button size="small" type="primary" @click="exportTableToExcel('table', 'exported-data')">导出</el-button> |
|
|
|
|
<!-- <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="getStockHandle()">搜索</el-button> |
|
|
|
|
<!-- <el-button size="small" type="primary" @click="exportTableToExcel('table', 'exported-data')">导出</el-button>--> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-table v-loading="loading" :data="tableData.data" style="width: 100%" size="small" id="table"> |
|
|
|
|
<el-table :data="tableData" style="width: 100%" size="small" id="table"> |
|
|
|
|
<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="asset_type" min-width="120"/> |
|
|
|
|
<el-table-column label="转让账户" prop="user_phone" min-width="120"/> |
|
|
|
|
<el-table-column label="收款账户" prop="ext.to_phone" min-width="120"/> |
|
|
|
|
<el-table-column label="转让数量" prop="count" min-width="120"/> |
|
|
|
|
<el-table-column label="手续费" prop="fee" 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" |
|
|
|
|
:current-page="pageIndex" |
|
|
|
|
:page-sizes="[10, 20, 50, 100]" |
|
|
|
|
:page-size="pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="tableData.total" |
|
|
|
|
@size-change="handleSizeChange" |
|
|
|
|
@current-change="pageChange" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
@ -95,229 +86,80 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { mapState } from "vuex"; |
|
|
|
|
import {discountsList, discountsChangeStatus, discountsGetDetails, assetsLogList} from "@/api/marketing"; |
|
|
|
|
import { formatDate } from "@/utils/validate"; |
|
|
|
|
import { roterPre } from '@/settings' |
|
|
|
|
|
|
|
|
|
import { saveAs } from 'file-saver'; |
|
|
|
|
import * as XLSX from 'xlsx'; |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | Author: CRMEB Team <admin@crmeb.com> |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
import {assetsLogList} from '@/api/user' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: 20, |
|
|
|
|
}, |
|
|
|
|
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: [], |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
phone:'', |
|
|
|
|
tableData:[], |
|
|
|
|
pageIndex:1, |
|
|
|
|
pageSize:10, |
|
|
|
|
total:0, |
|
|
|
|
type:'积分', |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.getList(''); |
|
|
|
|
mounted() { |
|
|
|
|
this.getStockHandle() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
exportTableToExcel(tableId, fileName) { |
|
|
|
|
/* 获取表格数据 */ |
|
|
|
|
const ws = XLSX.utils.table_to_sheet(document.getElementById(tableId)); |
|
|
|
|
|
|
|
|
|
/* 新建工作簿并添加工作表 */ |
|
|
|
|
const wb = XLSX.utils.book_new(); |
|
|
|
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); |
|
|
|
|
|
|
|
|
|
/* 生成Excel文件 */ |
|
|
|
|
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'binary' }); |
|
|
|
|
|
|
|
|
|
/* 字符串转ArrayBuffer */ |
|
|
|
|
function s2ab(s) { |
|
|
|
|
const buf = new ArrayBuffer(s.length); |
|
|
|
|
const view = new Uint8Array(buf); |
|
|
|
|
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; |
|
|
|
|
return buf; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 保存文件 */ |
|
|
|
|
saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), fileName + '.xlsx'); |
|
|
|
|
}, |
|
|
|
|
// 查看 |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
handleCurrentChange(val){ |
|
|
|
|
this.pageIndex = val; |
|
|
|
|
this.getStockHandle() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 列表 |
|
|
|
|
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(''); |
|
|
|
|
handleSizeChange(val){ |
|
|
|
|
this.pageSize = val; |
|
|
|
|
this.getStockHandle() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 具体日期 |
|
|
|
|
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%; |
|
|
|
|
getStockHandle(){ |
|
|
|
|
let postType = this.type |
|
|
|
|
if(this.type === '积分'){ |
|
|
|
|
postType = 6 |
|
|
|
|
} |
|
|
|
|
let params = { |
|
|
|
|
page:this.pageIndex, |
|
|
|
|
limit:this.pageSize, |
|
|
|
|
phone:this.phone, |
|
|
|
|
type:postType, |
|
|
|
|
} |
|
|
|
|
assetsLogList(params).then(res=>{ |
|
|
|
|
this.tableData = res.data.list; |
|
|
|
|
this.total = res.data.count; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.box-container { |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
.box-container .list { |
|
|
|
|
float: left; |
|
|
|
|
line-height: 40px; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.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 { |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.search{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
.image { |
|
|
|
|
width: 50px !important; |
|
|
|
|
height: 50px !important; |
|
|
|
|
margin-right: 10px; |
|
|
|
|
.input{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
span{ |
|
|
|
|
display:inline-block; |
|
|
|
|
width:200px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.info{ |
|
|
|
|
font-size: 18px; |
|
|
|
|
font-weight: bold; |
|
|
|
|
margin:10px 0; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|