index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('component/order-proactive-refund', __DIR__);
  4. ?>
  5. <style>
  6. .table-body {
  7. padding: 20px;
  8. background-color: #fff;
  9. }
  10. .input-item {
  11. display: inline-block;
  12. width: 250px;
  13. margin: 0 0 20px;
  14. }
  15. .input-item .el-input__inner {
  16. border-right: 0;
  17. }
  18. .input-item .el-input__inner:hover {
  19. border: 1px solid #dcdfe6;
  20. border-right: 0;
  21. outline: 0;
  22. }
  23. .input-item .el-input__inner:focus {
  24. border: 1px solid #dcdfe6;
  25. border-right: 0;
  26. outline: 0;
  27. }
  28. .input-item .el-input-group__append {
  29. background-color: #fff;
  30. border-left: 0;
  31. width: 10%;
  32. padding: 0;
  33. }
  34. .input-item .el-input-group__append .el-button {
  35. padding: 0;
  36. }
  37. .input-item .el-input-group__append .el-button {
  38. margin: 0;
  39. }
  40. /* .table-body .el-button {
  41. padding: 0 !important;
  42. border: 0;
  43. margin: 0 5px;
  44. } */
  45. .form-body {
  46. background-color: #fff;
  47. margin-bottom: 20px;
  48. }
  49. .el-tabs__header {
  50. background-color: #fff;
  51. }
  52. .el-tabs__item {
  53. width: 100px;
  54. text-align: center;
  55. }
  56. /*.el-table th>.cell {*/
  57. /* color: #333;*/
  58. /* font-weight: bold;*/
  59. /* font-size: 14px;*/
  60. /*}*/
  61. /*.el-table__footer-wrapper,*/
  62. /*.el-table__header-wrapper {*/
  63. /* border-bottom: 1.4px solid #D6D6D6;*/
  64. /*}*/
  65. .flex-y-center {
  66. display: -webkit-box;
  67. display: -webkit-flex;
  68. display: flex;
  69. -webkit-box-align: center;
  70. -webkit-align-items: center;
  71. -ms-flex-align: center;
  72. -ms-grid-row-align: center;
  73. align-items: center;
  74. }
  75. .flex-x-center {
  76. display: -webkit-box;
  77. display: -webkit-flex;
  78. /* #ifndef APP-NVUE */
  79. display: flex;
  80. /* #endif */
  81. -webkit-box-pack: center;
  82. -webkit-justify-content: center;
  83. -ms-flex-pack: center;
  84. justify-content: center;
  85. }
  86. .flex {
  87. display: flex;
  88. align-items: center;
  89. }
  90. .input-title {
  91. margin-right: 15px;
  92. }
  93. .el-table th>.cell{
  94. color: #333;
  95. font-weight: bold;
  96. font-size: 14px;
  97. }
  98. .el-table__footer-wrapper, .el-table__header-wrapper{
  99. border-bottom: 1.4px solid #D6D6D6;
  100. }
  101. .el-table th>.cell {
  102. color: #333;
  103. font-weight: bold;
  104. font-size: 14px;
  105. }
  106. .table1 .el-table__footer-wrapper,
  107. .table1 .el-table__header-wrapper {
  108. border-bottom: 1.4px solid #D6D6D6;
  109. }
  110. .user_img{
  111. position: relative;
  112. margin-right: 8px;
  113. /* height: 50px;
  114. width: 50px; */
  115. }
  116. .default-avatar{
  117. width: 50px;
  118. height: 50px;
  119. border-radius: 50%;
  120. margin-right: 8px;
  121. }
  122. .uer-nickname {
  123. flex: 1;
  124. }
  125. </style>
  126. <div id="app" v-cloak>
  127. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  128. <div slot="header">
  129. <div>
  130. <span>课程订单</span>
  131. </div>
  132. </div>
  133. <div class="table-body">
  134. <div style="padding-bottom: 20px;">
  135. <div class="flex">
  136. <div class="flex" style="margin-right: 20px;">
  137. <div class="input-title" style="flex-shrink: 0;">会员ID</div>
  138. <el-input size="small" style="width: 120px;" placeholder="请输入会员ID" v-model="searchKey.user_id">
  139. </el-input>
  140. </div>
  141. <div class="flex" style="margin-right: 20px;">
  142. <div class="input-title" style="flex-shrink: 0;">会员</div>
  143. <el-input size="small" style="width: 165px;" placeholder="请输入会员昵称/手机号" v-model="searchKey.user_info">
  144. </el-input>
  145. </div>
  146. <div class="flex" style="margin-right: 20px;">
  147. <div class="input-title" style="flex-shrink: 0;">课程名称</div>
  148. <el-input size="small" style="width: 130px;" placeholder="请输入课程名称" v-model="searchKey.course_name">
  149. </el-input>
  150. </div>
  151. <div class="flex" style="margin-right: 20px;">
  152. <div class="input-title" style="flex-shrink: 0;">订单编号</div>
  153. <el-input size="small" style="width: 130px;" placeholder="请输入订单编号" v-model="searchKey.order_no">
  154. </el-input>
  155. </div>
  156. <div class="flex" style="margin: 0 10px;">
  157. <div class="input-title" style="flex-shrink: 0;">下单时间</div>
  158. <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">
  159. </el-date-picker>
  160. <span style="margin: 0 15px;">至</span>
  161. <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">
  162. </el-date-picker>
  163. </div>
  164. <el-button size="small" type="primary" @click="search">搜索</el-button>
  165. <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>
  166. </div>
  167. </div>
  168. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  169. <el-table-column label="会员ID" prop="name" min-width="80">
  170. <template slot-scope="scope">
  171. <div size="small">{{scope.row.user_id}}</div>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="会员名称" >
  175. <template slot-scope="scope">
  176. <div class="user_img" flex="cross:center">
  177. <el-image class="default-avatar" :src="scope.row.avatar_url">
  178. <div slot="error" class="image-slot">
  179. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  180. </div>
  181. </el-image>
  182. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  183. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="课程名称" prop="course_name" min-width="80" align="center">
  188. <template slot-scope="scope">
  189. <div size="small" v-if="scope.row.course_picture" class="flex-y-center">
  190. <com-image style="border-radius: 22px;" width='45px' height='45px' :src=scope.row.course_picture></com-image>
  191. <span style="padding-left: 10px;">{{scope.row.course_name}}</span>
  192. </div>
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="订单编号" prop="order_no" min-width="80">
  196. <template slot-scope="scope">
  197. <div size="small">{{scope.row.order_no}}</div>
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="下单时间" prop="created_at" min-width="80" align="center">
  201. <template slot-scope="scope">
  202. <div size="small">{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="实付金额" prop="real_pay" min-width="80" align="center">
  206. <template slot-scope="scope">
  207. <div size="small">¥{{scope.row.pay_money}}</div>
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="订单状态" prop="status" min-width="80" align="center">
  211. <template slot-scope="scope">
  212. <div size="small">{{order_status_map[scope.row.order_status]}}</div>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="支付方式" prop="pay_type" min-width="80" align="center">
  216. <template slot-scope="scope">
  217. <div size="small" v-if="scope.row.pay_type == 0 && scope.row.order_status == 1">免费发放</div>
  218. <div size="small" v-if="scope.row.pay_type == 0 && scope.row.order_status == 0">-</div>
  219. <div size="small" v-if="scope.row.pay_type > 0">{{pay_type[scope.row.pay_type]}}</div>
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="操作" align="center">
  223. <template slot-scope="scope">
  224. <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>
  225. <div v-else>-</div>
  226. </template>
  227. </el-table-column>
  228. </el-table>
  229. <div style="text-align: right;margin: 20px 0;">
  230. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  231. </div>
  232. </div>
  233. <!-- <el-dialog :visible.sync="showRefundDialog" width="20%" title="主动退款">
  234. <div>
  235. <el-form ref="ruleForm" :model="ruleForm" :rules="rules" size="small" label-width="150px">
  236. <el-form-item label="退款金额:" prop='' >
  237. <el-input v-model="ruleForm.refund_price" size="small" :placeholder="'最高可退款金额¥'+ruleForm.pay_money" style="width:300px;">
  238. </el-form-item>
  239. </el-form>
  240. </template>
  241. </div>
  242. <span slot="footer" class="dialog-footer">
  243. <el-button @click="showGiveCourse = false" type="default" size="small">取消</el-button>
  244. <el-button type="primary" :loading="btnLoading" style="margin-bottom: 10px;" size="small"
  245. @click="toRefund">确认退款</el-button>
  246. </span>
  247. </el-dialog> -->
  248. <!-- 主动退款 -->
  249. <order-proactive-refund :is_show="isShowChangeRefund" :change-refund-loading="changeRefundLoading"
  250. :order_info="order_info" :order_id="order_info.id" @close="isShowChangeRefund = false" @success="handleSuccess">
  251. </order-proactive-refund>
  252. </el-card>
  253. </div>
  254. <script>
  255. const app = new Vue({
  256. el: '#app',
  257. data() {
  258. return {
  259. status: 0,
  260. list: [],
  261. keyword: '',
  262. listLoading: false,
  263. page: 1,
  264. pageCount: 0,
  265. lableLoading: false,
  266. btnLoading: false,
  267. pay_type: [],
  268. searchKey:{},
  269. order_status_map:{
  270. },
  271. order_info: {},
  272. showRefundDialog: false,
  273. isShowChangeRefund: false,
  274. changeRefundLoading: false,
  275. };
  276. },
  277. methods: {
  278. search() {
  279. this.page = 1;
  280. this.getList();
  281. },
  282. clereSearch() {
  283. this.searchKey.user_id = null;
  284. this.searchKey.user_info = '';
  285. this.searchKey.course_name = '';
  286. this.searchKey.order_no = '';
  287. this.searchKey.start_time = null;
  288. this.searchKey.end_time = null;
  289. this.page = 1;
  290. this.getList();
  291. },
  292. pagination(currentPage) {
  293. let self = this;
  294. self.page = currentPage;
  295. self.getList();
  296. },
  297. // 0.1 获取课程列表
  298. getList() {
  299. let self = this;
  300. self.listLoading = true;
  301. request({
  302. params: {
  303. r: 'course/order/index',
  304. page: self.page,
  305. user_id: this.searchKey.user_id,
  306. user_info: this.searchKey.user_info,
  307. course_name: this.searchKey.course_name,
  308. order_no: this.searchKey.order_no,
  309. start_time: this.searchKey.start_time,
  310. end_time: this.searchKey.end_time
  311. },
  312. method: 'get',
  313. }).then(e => {
  314. self.listLoading = false;
  315. self.list = e.data.data.list;
  316. self.pageCount = e.data.data.page_count;
  317. self.pay_type = e.data.data.payment_type_list;
  318. self.order_status_map = e.data.data.order_status_map;
  319. }).catch(e => {
  320. console.log(e);
  321. });
  322. },
  323. showRefund(data) {
  324. // this.ruleForm = {
  325. // id: data.id,
  326. // refund_price: data.pay_money,
  327. // pay_money: data.pay_money,
  328. // };
  329. this.order_info = data;
  330. this.isShowChangeRefund = true;
  331. },
  332. toRefund() {
  333. },
  334. //本地更新数据
  335. handleSuccess() {
  336. this.isShowChangeRefund = false,
  337. this.getList();
  338. },
  339. },
  340. mounted: function() {
  341. this.getList();
  342. }
  343. });
  344. </script>