| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <style>
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .table1 .el-table__footer-wrapper,
- .table1 .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .name-box {
- display: flex;
- flex-direction: column;
- }
- </style>
- <div id="app">
- <div class="table-body" style="min-width: 1000px;">
- <div slot="header" class="clearfix" style="height: 20px;">
- <span>订单流水</span>
- </div>
- <div slot="header" class="clearfix" style="margin-top: 20px;">
- <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入订单编号" v-model="search.order_no" clearable></el-input>
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入会员昵称/ID/手机号" v-model="search.keyword" clearable></el-input>
- <el-select size="small" v-model="search.order_status" @change='toSearch' class="select" style="margin-right: 20px;width: 150px;" placeholder="请选择订单状态">
- <el-option label="全部状态" value=""></el-option>
- <el-option :key="index" :label="item" :value="index" v-for="(item, index) in order_status_map" v-if="index != 0"></el-option>
- </el-select>
- <el-date-picker
- style="margin-right: 20px;"
- size="small"
- v-model="selectDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
- </div>
- </div>
- <template>
- <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
- <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
- <el-table-column label="会员信息" >
- <template slot-scope="scope">
- <div class="user_img" flex="cross:center">
- <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 class="name-box">
- <div class="uer-nickname over1" style="color:#000;">{{scope.row.user.nickname}}</div>
- <div class="user-realname">{{scope.row.mobile == null || scope.row.mobile == '' ? scope.row.user.mobile : scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="goods_name" label="商品名称" align="center">
- <template slot-scope="scope">
- <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
- <el-table-column prop="goods_name" label="">
- <template slot-scope="gScope">
- <com-ellipsis :line="1" :text="gScope.row.goods_name+''"></com-ellipsis>
- </template>
- </el-table-column>
- </el-table>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="商品价格" align="center" width="150">
- <template slot-scope="scope">
- <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
- <el-table-column prop="price" label="" align="center">
- </el-table-column>
- </el-table>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="退款金额" align="center" width="150">
- <template slot-scope="scope">
- <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
- <el-table-column prop="refund_price" label="" align="center">
- </el-table-column>
- </el-table>
- </template>
- </el-table-column>
- <el-table-column prop="order_no" label="订单编号" align="center"></el-table-column>
- <el-table-column prop="goods_price" label="订单金额" align="center"></el-table-column>
- <el-table-column label="订单时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="pay_money" label="实付金额" align="center"></el-table-column>
- <el-table-column label="订单状态" align="center">
- <template slot-scope="scope">
- <el-tag size="small" type="info">{{order_status_map[scope.row.order_status] ? order_status_map[scope.row.order_status] : '未知状态'}}</el-tag>
- </template>
- </el-table-column>
- </el-table>
- <div flex="main:right cross:center" style="margin-top: 20px;">
- <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.totalCount">
- </el-pagination>
- </div>
- </template>
- </div>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- listLoading: false,
- list: [],
- pagination: {
- total: 0
- },
- loading: false,
- LoadDataType: -1, //默认显示全部数据
- dialogFormVisible: false, //默认不显示弹窗
- group_buy_attr_list: [],
- goodsDetail: {},
- dialogLoading:false,
- commander_level_limit_text:'',
- user_level_limit_text:'',
- level_map:null,
- selectDate:'',
- search: {
- page: 1,
- limit:10,
- start:'',
- end:'',
- keyword: '',
- level: '',
- user_id: '',
- order_no: '',
- order_status: '',
- },
- show: false,
- level: {
- show: false,
- area: null,
- },
- current_area:null,
- order_status_map: {},
- }
- },
- methods: {
- //状态按钮的点击事件
- toSearch() {
- if(this.selectDate && this.selectDate[0]){
- this.search.start = this.selectDate[0];
- this.search.end = this.selectDate[1];
- }else{
- this.search.start = '';
- this.search.end = '';
- }
- this.search.page = 1;
- this.loadData();
- },
- toSearchActivity() {
- this.loadData()
- },
- pageChange(page) {
- this.search.page = page;
- this.loadData();
- },
- // 请求获取数据--获取拼团商品列表
- loadData() {
- this.listLoading = true;
- let params = {
- r: 'area/data/list'
- };
- params = Object.assign(params, this.search);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- let res = e.data;
- this.listLoading = false;
- if (res.code === 0) {
- try {
- this.list = res.data.list;
- this.order_status_map = res.data.order_status_map;
- this.pagination = res.data.pagination; //拿到关于页码页容量的数据
- } catch (e) {
- console.error(e)
- }
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- editClick() {
- this.show = true;
- },
- levelSuccess() {
- this.loadData();
- },
- editLevel(row) {
- this.level.show = true;
- this.current_area = row;
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (row.detail.length > 1) {
- if (columnIndex !== 2 && columnIndex !== 3) {
- return {
- rowspan: row.detail.length,
- colspan: 1
- }
- }
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- },
- // 加载的时候获取到列表页
- mounted() {
- // 数据初始化
- this.LoadDataType = -1;
- this.search.user_id = getQuery('user_id');
- this.loadData();
- }
- })
- </script>
|