| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <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;
- }
- </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;">
- <el-button :type="LoadDataType==-1?'primary':''" size="small" @click="getLoadData(-1)">全部({{statistics.all_order_number}})</el-button>
- <el-button :type="LoadDataType==0?'primary':''" size="small" @click="getLoadData(0)">待付定金({{statistics.not_pay_order}})</el-button>
- <el-button :type="LoadDataType==1?'primary':''" size="small" @click="getLoadData(1)">待付尾款({{statistics.just_pay_deposit}})</el-button>
- <el-button :type="LoadDataType==2?'primary':''" size="small" @click="getLoadData(2)">订购成功({{statistics.order_success}})</el-button>
- <el-button :type="LoadDataType==3?'primary':''" size="small" @click="getLoadData(3)">订购失败({{statistics.order_fail}})</el-button>
- <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.nickname" clearable></el-input>
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="手机号" v-model="search.mobile" clearable></el-input>
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="订单号" v-model="search.order_no" clearable></el-input>
- <el-button type="primary" size="small" @click="toSearchActivity">搜索</el-button>
- </div>
- </div>
- <template>
- <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
- <!-- <el-table-column prop="id" label="id" width="100" align="center"></el-table-column> -->
- <el-table-column label="会员" width="180">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image 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>{{scope.row.user.nickname}}</div>
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="order_no" label="订单号" width="220" align="center"></el-table-column>
- <el-table-column property="user.mobile" label="手机号" width="110" align="center"></el-table-column>
- <!-- <el-table-column property="is_creator" label="角色" align="center">
- <template slot-scope="scope">
- <span v-html="scope.row.is_commander=='1'?'团长':'团员'"></span>
- </template>
- </el-table-column> -->
- <el-table-column prop="goods.name,goods.cover_pic" label="商品名称" width="210">
- <template slot-scope="scope">
- <div flex="box:first cross:top cross:center">
- <div style="padding-right: 10px;">
- <com-image mode="aspectFill" :src="scope.row.pic_url"></com-image>
- </div>
- <div>
- {{scope.row.goods_name}}
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="售价" align="center"></el-table-column>
- <el-table-column prop="deposit_price" label="定金" align="center"></el-table-column>
- <el-table-column prop="deposit_presale_price" label="尾款" align="center">
- <template slot-scope="scope">
- {{(scope.row.deposit_presale_price - scope.row.deposit_price) > 0 ? (scope.row.deposit_presale_price - scope.row.deposit_price) : 0}}
- </template>
- </el-table-column>
- <el-table-column prop="shipping_money" label="运费" align="center"></el-table-column>
- <el-table-column prop="total_pay_price" label="订单金额" align="center"></el-table-column>
- <el-table-column prop="order_status" label="状态" align="center">
- <template slot-scope="scope">
- <el-tag effect="dark" size="small" type="info" v-if="scope.row.order_status==0">待付定金</el-tag>
- <el-tag effect="dark" size="small" type="" v-if="scope.row.order_status==1">待付尾款</el-tag>
- <el-tag effect="dark" size="small" type="success" v-if="scope.row.order_status==2">订购成功</el-tag>
- <el-tag effect="dark" size="small" type="warning" v-if="scope.row.order_status==3">订购失败</el-tag>
- <el-tag effect="dark" size="small" type="danger" v-if="scope.row.order_status==4">已关闭</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="支付时间" width="150" align="center">
- <template slot-scope="scope">
- <span> {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}</span>
- </template>
- </el-table-column>
- <el-table-column label="下单时间" width="150" align="center">
- <template slot-scope="scope">
- <span> {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</span>
- </template>
- </el-table-column>
- <el-table-column label="支付尾款时间" width="150" align="center">
- <template slot-scope="scope">
- <span> {{scope.row.final_payment_time|dateTimeFormat('Y-m-d H:i:s')}}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button v-if="scope.row.depositPresaleActive.is_virtual==1&&scope.row.order_status==1" @click="finish(scope.row)" type="text" size="small">结束定金预售</el-button>
- <el-button @click="toOrderDetail(scope.row.order_id)" type="text" size="small">订单详情</el-button>
- <!-- <el-button v-if="scope.row.order_status==3" @click="queryRefund(scope.row)" type="primary" size="small">查询退款</el-button> -->
- </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, //默认不显示弹窗
- deposit_presale_attr_list: [],
- goodsDetail: {},
- order_status_map: {},
- dialogLoading: false,
- search: {
- nickname: '',
- mobile: '',
- order_no: '',
- order_status: -1,
- page: 1,
- },
- statistics:{
- all_order_number: 0,
- not_pay_order: 0,
- just_pay_deposit: 0,
- order_success: 0,
- order_fail: 0
- }
- }
- },
- methods: {
- //状态按钮的点击事件
- getLoadData(e) {
- this.search.order_status = e;
- this.loadData()
- this.LoadDataType = e;
- },
- toSearchActivity() {
- this.loadData()
- },
- pageChange(page) {
- this.search.page = page;
- this.loadData();
- },
- // 跳转到订单详情
- toOrderDetail(order_id) {
- navigateTo({
- r: 'deposit-presale/order/detail',
- id: order_id, //直接跳转到订单详情页,但是要确保获取时字段统一
- })
- },
- // 请求获取数据--获取定金预售商品列表
- loadData() {
- this.listLoading = true;
- let params = {
- r: 'deposit-presale/default/order-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) {
- this.list = res.data.list;
- this.order_status_map = res.data.order_status_map;
- this.pagination = res.data.pagination; //拿到关于页码页容量的数据
- this.statistics = Object.assign(this.statistics, res.data.statistics);
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- finish(row) {
- this.loading = true;
- request({
- params: {
- r: 'deposit-presale/default/finish',
- open_group_id: row.id
- },
- method: 'get',
- }).then(e => {
- let res = e.data;
- this.listLoading = false;
- if (res.code === 0) {
- let others = {
- deposit_presale_active_id: this.deposit_presale_active_id
- }
- this.loadData(this.current_page, others, this.search);
- this.$message.success(res.msg);
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- queryRefund(row) {
- this.loading = true;
- request({
- params: {
- r: 'deposit-presale/default/query-refund',
- id: row.id
- },
- method: 'get',
- }).then(e => {
- let res = e.data;
- this.listLoading = false;
- if (res.code === 0) {
- this.$message.success(res.msg);
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- },
- // 加载的时候获取到列表页
- mounted() {
- // 数据初始化
- this.LoadDataType = -1;
- this.loadData();
- }
- })
- </script>
|