| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-image');
- ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
- ?>
- <div id="app" v-cloak>
- <div class="order_stat">
- <div class="title">
- <span>数字币明细</span>
- <!-- <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>-->
- </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>
- </div>
- <el-card shadow="never" style="border:0;min-width: 800px;">
- <template>
- <el-tabs v-model="actionName" type="card" @tab-click="change_tab">
- <el-tab-pane label="已结算" name="settlement">
- </el-tab-pane>
- <el-tab-pane label="未结算" name="noSettlement">
- </el-tab-pane>
- </el-tabs>
- </template>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员id" v-model="searchData.user_id" clearable>
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="会员昵称/手机号" v-model="searchData.keyword" clearable>
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入订单号" v-model="searchData.order_no" clearable>
- </el-input>
- </div>
- <el-date-picker size="small" style="margin-top: 1px; float: left" @change="selectDateTime" v-model="searchData.date" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="备注" v-model="searchData.remark" clearable>
- </el-input>
- </div>
- <el-select size="small" v-model="searchData.capital_type" @change='search' class="select">
- <el-option key="all" label="业务类型" value=""></el-option>
- <el-option :key="index" :label="item" :value="index" v-for="(item, index) in incomeCapitalTypeList"></el-option>
- </el-select>
- <div class="input-item">
- <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="会员" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image v-if="scope.row.user" class="table-info-img circle" :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 class="table-info-text">
- <div v-if="scope.row.user">{{scope.row.user.nickname}}</div>
- <div v-if="scope.row.user">{{scope.row.user.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="业务类型" min-width="200" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.source_text">{{scope.row.source_text}}</div>
- </template>
- </el-table-column>
- <el-table-column label="收入/支出" min-width="150" 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="current_num" label="变动前数字币" min-width="150" align="center">
- <template slot-scope="scope">
- {{parseFloat(scope.row.current_num)}}
- </template>
- </el-table-column>
- <el-table-column prop="current_num" label="变动后数字币" min-width="150" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.change_type == 'add'">{{Number((scope.row.current_num + scope.row.change_num)).toFixed(2)}}</div>
- <div v-if="scope.row.change_type == 'sub'">{{Number((scope.row.current_num - scope.row.change_num)).toFixed(2)}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="desc" label="备注" min-width="200"></el-table-column>
- <el-table-column prop="scope" min-width="180" label="创建时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 批量操作和分页-->
- <el-col :span="24" class="toolbar">
- <el-input v-model="page" placeholder="" size="small" @keyup.enter.native="pageSearch" style="width:50px; margin-top: 100px; float: right; text-align: center; margin-top: 15px; padding: 0;"></el-input>
- <el-pagination v-if="pagination" style="display: inline-block;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
- </el-pagination>
- </el-col>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- keyword: '',
- date: '',
- start_date: '',
- end_at: '',
- user_id: '',
- order_no: '',
- remark: '',
- capital_type: '',
- },
- exportList: {},
- export_url: 'mall/finance/score-log',
- status: 1,
- actionName: 'settlement',
- incomeCapitalTypeList: [],
- date: '',
- keyword: '',
- user_id: '',
- remark: '',
- capital_type: '',
- form: [],
- page: 1,
- pageCount: 0,
- pagination: null,
- listLoading: false,
- scoreFromTypeList: [],
- orderTotalArr: [{
- type: 'score',
- name: '总发放金豆',
- value: '0.00',
- prompt: '平台全部发放的金豆',
- }, {
- type: 'score_no_used',
- name: '待结算金豆',
- value: '0.00',
- prompt: '待结算的金豆',
- }, {
- type: 'score_used',
- name: '已使用',
- value: '0.00',
- prompt: '所有会员总共使用的金豆',
- }, ]
- };
- },
- methods: {
- exportConfirm() {
- this.search.status = this.status
- },
- pageChange(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- pageSearch() {
- this.page_count = 1;
- this.getList();
- },
- search() {
- this.page = 1;
- if (this.date == null) {
- this.date = ''
- }
- this.getList();
- },
- selectDateTime(e) {
- this.searchData.date = e;
- this.page = 1;
- this.search();
- },
- getList() {
- let params = {
- r: 'mall/digital/index',
- page: this.page,
- date: this.searchData.date,
- user_id: this.searchData.user_id,
- order_no: this.searchData.order_no,
- keyword: this.searchData.keyword,
- desc: this.searchData.remark,
- capital_type: this.searchData.capital_type,
- status: this.status
- };
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- this.form = e.data.data.list;
- this.searchData.date = e.data.data.date;
- this.pagination = e.data.data.pagination;
- if (this.page_count != 1) this.pageCount = e.data.data.page_count;
- this.currentPage = parseInt(this.page);
- this.incomeCapitalTypeList = e.data.data.incomeCapitalTypeList;
- this.pageCount = e.data.data.page_count;
- this.exportList = e.data.data.export_list;
- 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 {
- if (e.data.msg == 'User Id必须是整数。') {
- e.data.msg = '会员id必须是整数';
- }
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- },
- change_tab(tab, event) {
- for (let i in this.searchData) {
- this.searchData[i] = '';
- }
- if (tab.name == 'settlement') {
- this.searchData['status'] = 1;
- this.status = 1;
- } else {
- this.searchData['status'] = 9;
- this.status = 9;
- }
- this.search();
- },
- exportData() {
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'mall/finance/score-log',
- date: this.searchData.date,
- user_id: this.searchData.user_id,
- order_no: this.searchData.order_no,
- keyword: this.searchData.keyword,
- desc: this.searchData.remark,
- capital_type: this.searchData.capital_type,
- status: this.status,
- flag: 'EXPORT'
- },
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- self.listLoading = false;
- }).catch(e => {
- self.listLoading = false;
- });
- }
- },
- mounted: function() {
- this.searchData.user_id = getQuery('user_id');
- this.getList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px 20px;
- }
- .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;
- }
- .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;
- }
- .stat_details {
- 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;
- }
- .order_stat {
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title {
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- display: flex;
- justify-content: space-between;
- }
- .order_stat>.title>.time {
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details {
- padding: 30px 0;
- display: flex;
- }
- .default-avatar {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .user_img {
- position: relative;
- margin-right: 8px;
- }
- </style>
|