| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543 |
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .el-table th > .cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .label {
- margin-right: 10px;
- }
- .default-goods{
- max-width: 50px;
- max-height: 50px;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .cont-title {
- font-size: 15px;
- padding-top: 20px;
- padding-bottom: 10px;
- font-weight: 700;
- }
- .cont-num {
- font-size: 14px;
- font-weight: 700;
- padding-bottom: 10px;
- }
- .center {
- text-align: center;
- }
- .el-dialog__header .el-dialog__title{
- font-size: 18px;
- }
- .el-dialog__wrapper .el-dialog__body{
- padding: 3px 20px;
- }
- /*头像样式 start*/
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .el-table_1_column_2 .cell { /*-2 表示在第二行*/
- display: flex;
- }
- /*头像样式 end*/
- #qrcode-info{
- margin: 20px 31%;
- }
- .stat_details{
- margin-top: 30px;
- padding-bottom: 30px;
- display: flex;
- }
- .order_module{
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module:last-child{
- margin-right: 0;
- }
- .order_module:first-child{
- margin-left: 0;
- }
- .price{
- font-size: 22px;
- font-weight: bold;
- }
- .oirder_modul_title{
- font-size: 12px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .oirder_modul_title .text{
- margin-right: 10px;
- }
- .stat_icon{
- font-size: 19px;
- color: #BFBFBF;
- }
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>{{ score_name }}明细</span>
- <div style="float: right;">
- <el-button type="primary" size="small" @click="toRechargePage">批量充值</el-button>
- </div>
- </div>
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</div>
- <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
- <i class="el-icon-question stat_icon"></i>
- </el-tooltip>
- </div>
- <div class="price">
- {{item.value}}
- </div>
- </div>
- </div>
- </template>
- </div>
- <div class="table-body el-input--small">
- <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">创建时间</div>
- <el-date-picker
- v-model="time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
- <div class="label">会员ID</div>
- <el-input style="width: 80px" v-model="search.user_id" placeholder="会员ID"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员名称</div>
- <el-input style="width: 150px" v-model="search.user_name" placeholder="会员名称"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员手机号</div>
- <el-input style="width: 150px" v-model="search.mobile" placeholder="请输完整手机号码"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">类型</div>
- <el-select size="small" v-model="search.from_type" class="select">
- <el-option :key="index" :label="item" :value="index"
- v-for="(item, index) in from_type"></el-option>
- </el-select>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button type="primary" size="mini" style="padding: 10px 20px !important;" @click="searchs">搜索
- </el-button>
- <el-button type="danger" size="small" style="padding: 10px 20px !important;" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </div>
- </el-form>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column label="ID" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.user.id}}</p>
- </template>
- </el-table-column>
- <el-table-column label="会员" width="180" class="user_data" >
- <template slot-scope="scope">
- <div class="user_img" v-if = "scope.row.user">
- <el-image class="default-avatar" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- </div>
- <div v-if = "scope.row.user">
- <div style="color:#000;">{{scope.row.user.nickname}}</div>
- <div style="font-size: 13px;">{{scope.row.user.mobile}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column :label="score_name+'类型'" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{redpack_type[scope.row.integral_wallet_type]}}</p>
- </template>
- </el-table-column>
- <el-table-column label="类型" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{from_type[scope.row.from_type]}}</p>
- </template>
- </el-table-column>
- <el-table-column :label="score_name+'数额'" min-width="80" align="center">
- <template slot-scope="scope">
- <div style="font-size: 18px;color: #68CF3D" v-if="scope.row.change_type == 'add'">+{{scope.row.change_num}}</div>
- <div style="font-size: 18px;color: #F6AA5A" v-if="scope.row.change_type == 'sub'">{{ -Math.abs(scope.row.change_num)}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="after_num" :label="'变动前'+score_name+'数额'" min-width="60" align="center"></el-table-column>
- <el-table-column prop="scope" width="160" label="创建时间">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{ scope.row.desc }}</p>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination v-if="pagination" :page-size="pagination.pageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.total_count">
- </el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- qrodestatus:false,
- listLoading: false,
- page: 1,
- pageCount: 0,
- //基础数据
- editBasisData: {
- materialTypeList: [],
- },
- //本地存时间,请求时不发送
- time: [],
- search: {
- user_id: "",
- user_name: "",
- mobile: "",
- date_start: "",
- date_end: "",
- from_type: "",
- },
- list: [],
- user_grab_list:[],
- from_type:[],
- redpack_type:[],
- new_time:[],
- //弹框配置
- addForm: {
- id: '',
- name: '',
- },
- title: "",
- dialogFormVisible: false, //数据弹窗
- data_list: {},//数据
- goods_data:[],//详细数据
- dialogAddgsVisible: false,
- redpack_links:'',//前端红包链接
- redpack_url:'',//前端红包链接
- // 对话框显示与否
- dialogVisible: false,
- dataloading: false,
- pagination:null,
- grab_list:'', //红包记录
- grab_pagination:null,
- grab_page: 1,
- grab_pageCount: 0,
- score_name: '积分',
- orderTotalArr: [
- {
- type: 'total_integral',
- name: '平台激活积分',
- value: '0.00',
- prompt: '平台全部发放的激活积分',
- },
- {
- type: 'total_frozen_integral',
- name: '平台冻结积分',
- value: '0.00',
- prompt: '平台全部发放的冻结积分',
- }
- ]
- };
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.search.user_id)
- || !isEmpty(this.search.user_name)
- || !isEmpty(this.search.mobile)
- || !isEmpty(this.time)
- || !isEmpty(this.search.from_type)
- }
- },
- methods: {
- resetSearch(){
- this.search = {
- user_id: '',
- user_name: '',
- mobile: '',
- from_type:'',
- }
- this.time = '';
- this.searchs()
- },
- searchs() {
- this.page = 1;
- this.getList();
- },
- pageChange(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList() {
- let self = this;
- self.listLoading = true;
- if(getQuery('user_id')) self.search.user_id = getQuery('user_id');
- // 检查是否选择了搜索时间
- if (!self.time) {
- self.search.date_start = '';
- self.search.date_end = '';
- } else {
- self.search.date_start = self.time[0];
- self.search.date_end = self.time[1];
- }
- request({
- method: 'post',
- params: {
- r: 'score-expansion/score-log/index',
- },
- data: {
- page: self.page,
- user_id: self.search.user_id,
- user_name: self.search.user_name,
- mobile: self.search.mobile,
- date_start: self.search.date_start,
- date_end: self.search.date_end,
- from_type: self.search.from_type,
- },
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- self.redpack_type = e.data.data.redpack_type;
- self.redpack_name = e.data.data.redpack_name;
- this.pagination = e.data.data.pagination;
- this.pagination.pageSize = e.data.data.page_size;
- this.pagination.total_count = e.data.data.count;
- this.from_type = e.data.data.from_type;
- this.new_time = e.data.data.new_time;
- this.redpack_links = e.data.data.redpacklinks;
- console.log(this.pagination);
- }).catch(e => {
- console.log(e);
- });
- },
- detail(data) {
- console.log(data);
- this.data_list = [];
- this.goods_data = [];
- this.dialogFormVisible = true;
- this.data_list = data;
- this.goods_data.push(data);
- },
- handle(type,data = null){
- switch (type) {
- case 'edit':// 编辑
- navigateTo({
- r: 'redpack/default/edit',
- id:data.id,
- });
- break;
- case 'copy':// 复制
- navigateTo({
- r: 'redpack/default/edit',
- id:data.id,
- type:1,
- });
- break;
- case 'qrode'://推广二维码
- this.qrodestatus = true;
- this.redpack_url = this.redpack_links + '/#/?id=' + data.id;
- this.createQrcode(this.redpack_links);
- break;
- case 'delete':// 删除
- data.type = 2;
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.delect(data);})
- break;
- case 'enable':
- data.type = 1;
- this.delect(data);
- break;
- }
- },
- delect(data){
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'redpack/default/del-or-enable',
- },
- method: 'post',
- data: {id:data.id,type:data.type},
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.getList();
- }).catch(e => {
- console.log(e);
- });
- },
- send(data){
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'redpack/default/edit',
- },
- method: 'post',
- data:data,
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.getList();
- }).catch(e => {
- console.log(e);
- });
- },
- /**
- *关闭或取消模态框,清空值
- * @param
- */
- closeDialogAddgsVisible() {
- this.$refs.addForm.resetFields();//element封装的方法,清空模态框的值
- this.title = "" //初始化title的值
- this.addForm = {//初始化addForm中的值
- title: "",
- }
- },
- getTotal() {
- let self = this;
- request({
- params: {
- r: 'score-expansion/score-log/total'
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- for (const key in e.data.data.total) {
- let info = this.orderTotalArr.filter(v => v.type == key); //订单概况
- if(info.length){
- let index = this.orderTotalArr.findIndex(v => v.type==info[0].type);
- this.orderTotalArr[index].value = Number(e.data.data.total[key]).toFixed(2);
- }
- }
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- },
- toRechargePage() {
- navigateTo({
- r: 'score-expansion/score-log/import'
- });
- }
- },
- mounted: function () {
- this.getList();
- this.getTotal();
- }
- });
- </script>
|