| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('component/order-proactive-refund', __DIR__);
- ?>
- <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;
- } */
- .form-body {
- background-color: #fff;
- margin-bottom: 20px;
- }
- .el-tabs__header {
- background-color: #fff;
- }
- .el-tabs__item {
- width: 100px;
- text-align: center;
- }
- /*.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;*/
- /*}*/
- .flex-y-center {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- -ms-grid-row-align: center;
- align-items: center;
- }
- .flex-x-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- }
- .flex {
- display: flex;
- align-items: center;
- }
- .input-title {
- margin-right: 15px;
- }
- .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;
- }
- .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" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>课程订单</span>
- </div>
- </div>
- <div class="table-body">
- <div style="padding-bottom: 20px;">
- <div class="flex">
- <div class="flex" style="margin-right: 20px;">
- <div class="input-title" style="flex-shrink: 0;">会员ID</div>
- <el-input size="small" style="width: 120px;" placeholder="请输入会员ID" v-model="searchKey.user_id">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <div class="input-title" style="flex-shrink: 0;">会员</div>
- <el-input size="small" style="width: 165px;" placeholder="请输入会员昵称/手机号" v-model="searchKey.user_info">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <div class="input-title" style="flex-shrink: 0;">课程名称</div>
- <el-input size="small" style="width: 130px;" placeholder="请输入课程名称" v-model="searchKey.course_name">
- </el-input>
- </div>
- <div class="flex" style="margin-right: 20px;">
- <div class="input-title" style="flex-shrink: 0;">订单编号</div>
- <el-input size="small" style="width: 130px;" placeholder="请输入订单编号" v-model="searchKey.order_no">
- </el-input>
- </div>
- <div class="flex" style="margin: 0 10px;">
- <div class="input-title" style="flex-shrink: 0;">下单时间</div>
- <el-date-picker style="width: 150px;" size="small" v-model="searchKey.start_time" type="date" size="large" placeholder="开始日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
- </el-date-picker>
- <span style="margin: 0 15px;">至</span>
- <el-date-picker style="width: 150px;" size="small" v-model="searchKey.end_time" type="date" size="large" placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
- </el-date-picker>
- </div>
- <el-button size="small" type="primary" @click="search">搜索</el-button>
- <el-button type="warning" @click="clereSearch" v-if="searchKey.user_id || searchKey.user_info || searchKey.course_name || searchKey.order_no || searchKey.start_time || searchKey.end_time" style="padding: 9px 15px !important;">清除搜索条件</el-button>
- </div>
- </div>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column label="会员ID" prop="name" min-width="80">
- <template slot-scope="scope">
- <div size="small">{{scope.row.user_id}}</div>
- </template>
- </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.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
- </div>
- </el-image>
- <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
- <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="课程名称" prop="course_name" min-width="80" align="center">
- <template slot-scope="scope">
- <div size="small" v-if="scope.row.course_picture" class="flex-y-center">
- <com-image style="border-radius: 22px;" width='45px' height='45px' :src=scope.row.course_picture></com-image>
- <span style="padding-left: 10px;">{{scope.row.course_name}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="订单编号" prop="order_no" min-width="80">
- <template slot-scope="scope">
- <div size="small">{{scope.row.order_no}}</div>
- </template>
- </el-table-column>
- <el-table-column label="下单时间" prop="created_at" min-width="80" align="center">
- <template slot-scope="scope">
- <div size="small">{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
- </template>
- </el-table-column>
- <el-table-column label="实付金额" prop="real_pay" min-width="80" align="center">
- <template slot-scope="scope">
- <div size="small">¥{{scope.row.pay_money}}</div>
- </template>
- </el-table-column>
- <el-table-column label="订单状态" prop="status" min-width="80" align="center">
- <template slot-scope="scope">
- <div size="small">{{order_status_map[scope.row.order_status]}}</div>
- </template>
- </el-table-column>
- <el-table-column label="支付方式" prop="pay_type" min-width="80" align="center">
- <template slot-scope="scope">
- <div size="small" v-if="scope.row.pay_type == 0 && scope.row.order_status == 1">免费发放</div>
- <div size="small" v-if="scope.row.pay_type == 0 && scope.row.order_status == 0">-</div>
- <div size="small" v-if="scope.row.pay_type > 0">{{pay_type[scope.row.pay_type]}}</div>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.show_refund_botton == 1 && scope.row.order_status > 0"><el-button circle size="mini" type="text" @click="showRefund(scope.row)">主动退款</el-button></div>
- <div v-else>-</div>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </div>
- <!-- <el-dialog :visible.sync="showRefundDialog" width="20%" title="主动退款">
- <div>
- <el-form ref="ruleForm" :model="ruleForm" :rules="rules" size="small" label-width="150px">
- <el-form-item label="退款金额:" prop='' >
- <el-input v-model="ruleForm.refund_price" size="small" :placeholder="'最高可退款金额¥'+ruleForm.pay_money" style="width:300px;">
- </el-form-item>
- </el-form>
- </template>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="showGiveCourse = false" type="default" size="small">取消</el-button>
- <el-button type="primary" :loading="btnLoading" style="margin-bottom: 10px;" size="small"
- @click="toRefund">确认退款</el-button>
- </span>
- </el-dialog> -->
- <!-- 主动退款 -->
- <order-proactive-refund :is_show="isShowChangeRefund" :change-refund-loading="changeRefundLoading"
- :order_info="order_info" :order_id="order_info.id" @close="isShowChangeRefund = false" @success="handleSuccess">
- </order-proactive-refund>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- status: 0,
- list: [],
- keyword: '',
- listLoading: false,
- page: 1,
- pageCount: 0,
- lableLoading: false,
- btnLoading: false,
- pay_type: [],
- searchKey:{},
- order_status_map:{
- },
- order_info: {},
- showRefundDialog: false,
- isShowChangeRefund: false,
- changeRefundLoading: false,
- };
- },
- methods: {
- search() {
- this.page = 1;
- this.getList();
- },
- clereSearch() {
- this.searchKey.user_id = null;
- this.searchKey.user_info = '';
- this.searchKey.course_name = '';
- this.searchKey.order_no = '';
- this.searchKey.start_time = null;
- this.searchKey.end_time = null;
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- // 0.1 获取课程列表
- getList() {
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'course/order/index',
- page: self.page,
- user_id: this.searchKey.user_id,
- user_info: this.searchKey.user_info,
- course_name: this.searchKey.course_name,
- order_no: this.searchKey.order_no,
- start_time: this.searchKey.start_time,
- end_time: this.searchKey.end_time
- },
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- self.pageCount = e.data.data.page_count;
- self.pay_type = e.data.data.payment_type_list;
- self.order_status_map = e.data.data.order_status_map;
- }).catch(e => {
- console.log(e);
- });
- },
- showRefund(data) {
- // this.ruleForm = {
- // id: data.id,
- // refund_price: data.pay_money,
- // pay_money: data.pay_money,
- // };
- this.order_info = data;
- this.isShowChangeRefund = true;
- },
- toRefund() {
- },
- //本地更新数据
- handleSuccess() {
- this.isShowChangeRefund = false,
- this.getList();
- },
- },
- mounted: function() {
- this.getList();
- }
- });
- </script>
|