| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <?php
- $activity_id = Yii::$app->request->getQueryParam('activity_id');
- $activity_id = $activity_id ? $activity_id : 0;
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>拼团订单</span>
- <div style="float: right; margin: -5px 0">
- </div>
- </div>
- </div>
- <div class="table-body">
- <el-row :gutter="20">
- <el-col :span="4">
- 会员ID:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
- </div>
- </el-col>
- <el-col :span="4">
- 会员昵称:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
- </div>
- </el-col>
- <el-col :span="4">
- 订单编号:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="订单编号" v-model="searchData.order_no" clearable @clear="search"></el-input>
- </div>
- </el-col>
- <el-col :span="4">
- 拼单状态:
- <el-select size="small" v-model="searchData.group_status" @change='search' class="select" style="float:none;width: 140px;">
- <el-option key="0" label="请选择拼单状态" value="0"></el-option>
- <el-option key="1" label="参团中" value="1"></el-option>
- <el-option key="2" label="拼团成功" value="2"></el-option>
- <el-option key="3" label="拼团失败" value="3"></el-option>
- <el-option key="-1" label="已取消" value="-1"></el-option>
- </el-select>
- </el-col>
- <el-col :span="4">
- 拼团方式:
- <el-select size="small" v-model="searchData.attend_type" @change='search' class="select" style="float:none;width: 140px;">
- <el-option key="0" label="请选择拼单状态" value="0"></el-option>
- <el-option key="1" label="手动拼团" value="1"></el-option>
- <el-option key="2" label="自动拼团" value="2"></el-option>
- </el-select>
- </el-col>
- <el-col :span="4">
- 商品名称
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入商品名称" v-model="searchData.goods_name" clearable></el-input>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- 参团时间:
- <el-date-picker
- class="item-box"
- size="small"
- @change="changeTime"
- v-model="searchData.time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-col>
- <el-col :span="8">
- 拼中时间:
- <el-date-picker
- class="item-box"
- size="small"
- @change="win_changeTime"
- v-model="searchData.win_time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-col>
- <el-col :span="4">
- 订单id:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="订单id" v-model="searchData.id" clearable @clear="search"></el-input>
- </div>
- </el-col>
- <el-col :span="4">
- <div style="display: inline-block;margin-left: 10px;">
- <el-button type="primary" size="small" @click="search">查询</el-button>
- <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
- </div>
- </el-col>
- </el-row>
- <el-table class="table-info" :data="form" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column prop="id" label="ID" width="60" align="center"></el-table-column>
- <el-table-column label="昵称" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.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.nickname">{{scope.row.nickname}}</div>
- <div v-else>{{scope.row.username}}</div>
- <div>用户id:{{scope.row.user_id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="order_sn" label="拼团订单编号" align="center">
- <template slot-scope="scope">
- <span class="orderno-status" v-if="scope.row.group_status==2" @click="jumpToMallOrderList(scope.row.mall_order_id)">{{scope.row.order_no ? scope.row.order_no :'--'}}</span>
- <!-- <el-button type="text" v-if="scope.row.group_status==2" @click="jumpToMallOrderList(scope.row.mall_order_id)">{{scope.row.order_no ? scope.row.order_no :'--'}}</el-button> -->
- <span v-else>{{scope.row.order_no ? scope.row.order_no :'--'}}</span>
- <i class="el-icon-document-copy copy_btn" @click="copyLink(scope.row.order_no)"></i>
- </template>
- </el-table-column>
- <el-table-column prop="status" label="拼团状态" width="100" align="center">
- <template slot-scope="scope">{{group_status_map[scope.row.group_status]? group_status_map[scope.row.group_status] :'--'}}</template>
- </el-table-column>
- <el-table-column prop="attend_type" label="拼团方式" align="center">
- <template slot-scope="scope">{{attendTypeArr[scope.row.attend_type]? attendTypeArr[scope.row.attend_type] :'--'}}</template>
- </el-table-column>
- <el-table-column prop="total_pay_price" label="订单金额" align="center"></el-table-column>
- <el-table-column prop="activity_title" label="活动名称" align="center"></el-table-column>
- <el-table-column prop="goods_id" label="商品id" align="center"></el-table-column>
- <el-table-column prop="goods_name" label="活动商品" align="center"></el-table-column>
- <el-table-column prop="buy_nums" label="购买数量" align="center"></el-table-column>
- <el-table-column prop="win_nums" label="中奖数量" align="center"></el-table-column>
- <el-table-column prop="win_time" label="拼中时间" width="160px" align="center">
- <template slot-scope="scope">
- {{scope.row.win_time|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="created_at" label="参团时间" width="160px" align="center">
- <template slot-scope="scope">
- {{scope.row.pay_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :current-page="page" :page-count="pageCount"></el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- var activity_id = <?php echo $activity_id?>;
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- user_id:'',
- nickname:'',
- order_no:'',
- id:'',
- group_status:'',
- attend_type:'',
- date_start:'',
- date_end:'',
- win_date_start:'',
- win_date_end:'',
- goods_name: '',
- },
- status: '0',
- form: [],
- member: [],
- pageCount: 0,
- page: 1,
- member_page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- group_status_map:[],
- attendTypeArr:[],
- // 导出
- exportList: [],
- };
- },
- methods: {
- copyLink(data) { //复制链接
- var clipboard = new ClipboardJS('.copy_btn', {
- text: function() {
- return data;
- }
- });
- clipboard.on('success', (e) => {
- this.$message.success('复制成功!');
- clipboard.destroy()
- });
- clipboard.on('error', (e) => {
- this.$message.error('复制失败!');
- this.clipboard.destroy()
- });
- },
- openId(index) {
- let item = this.form;
- item[index].is_open_id = !item[index].is_open_id;
- this.form = JSON.parse(JSON.stringify(this.form));
- },
- changeTime() {
- if (this.searchData.time) {
- this.searchData.date_start = this.searchData.time[0];
- this.searchData.date_end = this.searchData.time[1];
- }
- },
- win_changeTime() {
- if (this.searchData.win_time) {
- this.searchData.win_date_start = this.searchData.win_time[0];
- this.searchData.win_date_end = this.searchData.win_time[1];
- }
- console.log( this.searchData);
- },
- //搜索
- search() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- getList() {
- this.listLoading = true;
- request({
- params: {
- r: 'lucky-group/group-order/index',
- page: this.page,
- user_id:this.searchData.user_id,
- nickname:this.searchData.nickname,
- order_no:this.searchData.order_no,
- id:this.searchData.id,
- group_status:this.searchData.group_status,
- attend_type:this.searchData.attend_type,
- date_start:this.searchData.date_start,
- date_end:this.searchData.date_end,
- win_date_start:this.searchData.win_date_start,
- win_date_end:this.searchData.win_date_end,
- goods_name:this.searchData.goods_name,
- pagesize:10
- },
- }).then(e => {
- if (e.data.code === 0) {
- this.form = e.data.data.list;
- this.pageCount = e.data.data.page_count;
- this.group_status_map = e.data.data.group_status_map;
- this.attendTypeArr = e.data.data.attend_type_map;
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- },
- //重置
- resetForm() {
- this.searchData.user_id = '';
- this.searchData.nickname = '';
- this.searchData.order_no = '';
- this.searchData.id = '';
- this.searchData.group_status = '';
- this.searchData.attend_type = '';
- this.searchData.date_start = '';
- this.searchData.date_end = '';
- this.searchData.win_date_start = '';
- this.searchData.win_date_end = '';
- this.searchData.time = '';
- this.searchData.win_time = '';
- this.searchData.goods_name = '';
- this.getList();
- },
- // 跳转商城主订单列表
- jumpToMallOrderList(order_id) {
- navigateTo({
- r: 'mall/order/index',
- order_id: order_id,
- });
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1;
- this.getList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- /* .table-info .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- } */
- .input-item {
- display: inline-block;
- width: 150px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 1px solid #dcdfe6;
- }
- .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;
- }
- .select {
- float: left;
- width: 100px;
- margin-right: 10px;
- }
- .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;
- }
- .table-info-img{
- min-width: 50px;
- min-height: 50px;
- }
- .orderno-status {
- color: #409EFF;
- cursor: pointer;
- }
- </style>
|