index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  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. .el-table th>.cell {
  46. color: #333;
  47. font-weight: bold;
  48. font-size: 14px;
  49. }
  50. .el-table__footer-wrapper,
  51. .el-table__header-wrapper {
  52. border-bottom: 1.4px solid #D6D6D6;
  53. }
  54. .el-date-editor .el-range-separator {
  55. /* 设置选择日期框的中间的 ‘至’ 的宽度 */
  56. width: 8%;
  57. }
  58. </style>
  59. <div id="app" v-cloak>
  60. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
  61. <div slot="header">
  62. <div>
  63. <span>支付记录列表</span>
  64. <div style="float: right; margin: -5px 0">
  65. <!-- <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="search">-->
  66. <!-- </com-export-dialog>-->
  67. </div>
  68. </div>
  69. </div>
  70. <div class="table-body">
  71. <div class="head" style="display: flex;flex-wrap: wrap;">
  72. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  73. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">会员ID</div>
  74. <el-input clearable size="small" type="text" v-model="search.user_id" placeholder="请输入会员ID精准搜索" @keyup.enter.native="toSearch"></el-input>
  75. </div>
  76. <!-- <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">-->
  77. <!-- <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">会员昵称/手机号</div>-->
  78. <!-- <el-input clearable size="small" type="text" v-model="search.user_keyword" placeholder="请输入会员昵称/手机号" @keyup.enter.native="toSearch"></el-input>-->
  79. <!-- </div>-->
  80. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  81. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">支付单号</div>
  82. <el-input clearable size="small" type="text" v-model="search.out_trade_no" placeholder="请输入支付单号" @keyup.enter.native="toSearch"></el-input>
  83. </div>
  84. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  85. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">订单号</div>
  86. <el-input clearable size="small" type="text" v-model="search.order_no" placeholder="请输入订单号" @keyup.enter.native="toSearch"></el-input>
  87. </div>
  88. <div style="display: flex;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  89. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">创建时间</div>
  90. <el-date-picker size="small" v-model="time" @change="datetimeChange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" align="center">
  91. </el-date-picker>
  92. </div>
  93. <div class="item-box" flex="dir:left cross:center">
  94. <el-button size="small" type="primary" style="margin-bottom: 20px;" @click="toSearch">搜索
  95. </el-button>
  96. </div>
  97. <div class="item-box" flex="dir:left cross:center" v-if="search.order_no || search.start_time || search.end_time || search.user_id || search.user_keyword || search.out_trade_no || search.pay_type">
  98. <el-button size="small" type="warning" style="margin-bottom: 20px; margin-left: 10px;" @click="resetFun">清除搜索条件 </el-button>
  99. </div>
  100. </div>
  101. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  102. <el-table-column label="会员ID" min-width="120" align="center">
  103. <template slot-scope="scope">
  104. <div size="small">{{scope.row.user_id}}</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column prop="avatar_url,nickname" label="会员名称" min-width="120">
  108. <template slot-scope="scope">
  109. <div class="table-info-img-text">
  110. <el-image class="table-info-img circle" :src="scope.row.avatar_url"> </el-image>
  111. <div class="table-info-text">
  112. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  113. <div>{{scope.row.mobile}}</div>
  114. </div>
  115. </div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="订单号" min-width="150" align="center">
  119. <template slot-scope="scope">
  120. <div size="small">{{scope.row.order_no}}</div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="支付单号" min-width="150" align="center">
  124. <template slot-scope="scope">
  125. <div size="small">{{scope.row.out_trade_no}}</div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="支付金额" min-width="100" align="center">
  129. <template slot-scope="scope">
  130. <div size="small">{{scope.row.amount}}</div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="类型" min-width="80" align="center">
  134. <template slot-scope="scope">
  135. <div size="small" v-if="scope.row.trade_type=='W02'">微信公众号支付</div>
  136. <div size="small" v-else-if="scope.row.trade_type=='W06'">微信小程序支付</div>
  137. <div size="small" v-else-if="scope.row.trade_type=='A01'">支付宝h5</div>
  138. <div size="small" v-else-if="scope.row.trade_type=='fast_pay'">快捷支付</div>
  139. <div size="small" v-else>-</div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="订单状态" min-width="80" align="center">
  143. <template slot-scope="scope">
  144. <div size="small">{{payStatus[scope.row.is_pay]}}</div>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="创建时间" prop="user_id" min-width="120" align="center">
  148. <template slot-scope="scope">
  149. <div size="small">{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  150. </template>
  151. </el-table-column>
  152. <!-- <el-table-column label="支付时间" prop="user_id" min-width="120" align="center">
  153. <template slot-scope="scope">
  154. <div size="small">{{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  155. </template>
  156. </el-table-column> -->
  157. </el-table>
  158. <div flex="box:last cross:center">
  159. <div></div>
  160. <div>
  161. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :page-count="pageCount">
  162. </el-pagination>
  163. </div>
  164. </div>
  165. </div>
  166. </el-card>
  167. </div>
  168. <script>
  169. const app = new Vue({
  170. el: '#app',
  171. data() {
  172. return {
  173. export_list: {},
  174. export_url: 'union-pay/default/pay-record',
  175. list: [],
  176. listLoading: false,
  177. page: 1,
  178. pageCount: 0,
  179. search: {
  180. page: 1,
  181. start_time: '',
  182. end_time: '',
  183. user_id: null,
  184. user_keyword: '',
  185. out_trade_no: '',
  186. order_no: '',
  187. trade_type: 0,
  188. },
  189. time: '',
  190. pagination: null,
  191. payStatus: {
  192. 0: '未支付',
  193. 1: '已支付'
  194. }
  195. };
  196. },
  197. methods: {
  198. resetFun() {
  199. this.search = {
  200. page: 1,
  201. start_time: '',
  202. end_time: '',
  203. user_id: null,
  204. user_keyword: '',
  205. out_trade_no: '',
  206. order_no: '',
  207. trade_type: 0,
  208. }
  209. this.time = '';
  210. this.toSearch();
  211. },
  212. datetimeChange() {
  213. if (this.time) {
  214. this.search.start_time = this.time[0];
  215. this.search.end_time = this.time[1];
  216. } else {
  217. this.search.start_time = '';
  218. this.search.end_time = '';
  219. }
  220. this.toSearch();
  221. },
  222. toSearch() {
  223. this.search.page = 1;
  224. this.getList();
  225. },
  226. pageChange(currentPage) {
  227. let self = this;
  228. self.search.page = currentPage;
  229. self.getList();
  230. },
  231. getList() {
  232. let self = this;
  233. self.listLoading = true;
  234. let params = {
  235. r: 'union-pay/default/index',
  236. }
  237. params = Object.assign(params, this.search);
  238. request({
  239. params: params,
  240. method: 'get',
  241. }).then(e => {
  242. self.listLoading = false;
  243. if (e.data.code == 0) {
  244. self.list = e.data.data.list;
  245. self.export_list = e.data.data.export_list;
  246. this.pagination = e.data.data.pagination;
  247. self.pageCount = e.data.data.page_count;
  248. } else {
  249. self.$message.error(e.data.msg);
  250. }
  251. }).catch(e => {
  252. console.log(e);
  253. self.$message.error(e);
  254. });
  255. },
  256. },
  257. mounted: function() {
  258. this.getList();
  259. }
  260. });
  261. </script>