index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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. <!-- <el-button type="primary" size="small" @click="handle('edit')">添加商品</el-button>-->
  66. <!-- <el-button type="primary" size="small">订单导出</el-button>-->
  67. <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="search">
  68. </com-export-dialog>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="table-body">
  73. <div class="head" style="display: flex;flex-wrap: wrap;">
  74. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  75. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">会员ID</div>
  76. <el-input clearable size="small" type="text" v-model="search.user_id" placeholder="请输入会员ID精准搜索" @keyup.enter.native="toSearch"></el-input>
  77. </div>
  78. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  79. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">会员昵称/手机号</div>
  80. <el-input clearable size="small" type="text" v-model="search.user_keyword" placeholder="请输入会员昵称/手机号" @keyup.enter.native="toSearch"></el-input>
  81. </div>
  82. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  83. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">支付单号</div>
  84. <el-input clearable size="small" type="text" v-model="search.out_trade_no" placeholder="请输入支付单号" @keyup.enter.native="toSearch"></el-input>
  85. </div>
  86. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  87. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">订单号</div>
  88. <el-input clearable size="small" type="text" v-model="search.order_no" placeholder="请输入订单号" @keyup.enter.native="toSearch"></el-input>
  89. </div>
  90. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  91. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">支付方式</div>
  92. <!-- <el-input type="text" v-model="search.order_no" placeholder="请输入订单号" @keyup.enter.native="toSearch"></el-input> -->
  93. <el-select clearable size="small" v-model="search.pay_type" placeholder="请选择支付类型" @keyup.enter.native="toSearch">
  94. <el-option :key="0" label="全部" :value="0">全部</el-option>
  95. <el-option :key="1" label="快捷支付" :value="7">快捷支付</el-option>
  96. <el-option :key="2" label="聚合支付" :value="8">聚合支付</el-option>
  97. </el-select>
  98. </div>
  99. <div style="display: flex;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  100. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">创建时间</div>
  101. <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">
  102. </el-date-picker><!-- type="datetimerange" @change="datetimeChange" v-model="time"-->
  103. </div>
  104. <!-- <el-button type="primary" size="small" icon="el-icon-search" style="margin-bottom: 20px;" @click='toSearch'>搜索</el-button> -->
  105. <div class="item-box" flex="dir:left cross:center">
  106. <el-button size="small" type="primary" style="margin-bottom: 20px;" @click="toSearch">搜索
  107. </el-button>
  108. </div>
  109. <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">
  110. <el-button size="small" type="warning" style="margin-bottom: 20px; margin-left: 10px;" @click="resetFun">清除搜索条件 </el-button>
  111. </div>
  112. </div>
  113. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  114. <el-table-column label="会员ID" min-width="120" align="center">
  115. <template slot-scope="scope">
  116. <div size="small">{{scope.row.user_id}}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="avatar_url,nickname" label="会员名称" min-width="120">
  120. <template slot-scope="scope">
  121. <div class="table-info-img-text">
  122. <el-image class="table-info-img circle" :src="scope.row.avatar_url"> </el-image>
  123. <div class="table-info-text">
  124. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  125. <div>{{scope.row.mobile}}</div>
  126. </div>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="订单号" min-width="150" align="center">
  131. <template slot-scope="scope">
  132. <div size="small">{{scope.row.order_no}}</div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="支付单号" min-width="150" align="center">
  136. <template slot-scope="scope">
  137. <div size="small">{{scope.row.out_trade_no}}</div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="支付金额" min-width="100" align="center">
  141. <template slot-scope="scope">
  142. <div size="small">{{scope.row.amount}}</div>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="类型" min-width="80" align="center">
  146. <template slot-scope="scope">
  147. <div size="small" v-if="scope.row.pay_type==7">快捷支付</div>
  148. <div size="small" v-else-if="scope.row.pay_type==8">聚合支付</div>
  149. <div size="small" v-else>-</div>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="订单状态" min-width="80" align="center">
  153. <template slot-scope="scope">
  154. <div size="small">{{payStatus[scope.row.is_pay]}}</div>
  155. </template>
  156. </el-table-column>
  157. <!--
  158. <el-table-column
  159. label="操作"
  160. align="center"
  161. min-width="100">
  162. <template slot-scope="scope">
  163. <el-button style="margin: 1px;" type="primary" size="mini" @click="seeOrder(scope.row)">查看订单<i class="el-icon-caret-right el-icon--right"></i></el-button>
  164. </template>
  165. </el-table-column>
  166. -->
  167. <el-table-column label="创建时间" prop="user_id" min-width="120" align="center">
  168. <template slot-scope="scope">
  169. <div size="small">{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  170. </template>
  171. </el-table-column>
  172. <!-- <el-table-column label="支付时间" prop="user_id" min-width="120" align="center">
  173. <template slot-scope="scope">
  174. <div size="small">{{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  175. </template>
  176. </el-table-column> -->
  177. </el-table>
  178. <div flex="box:last cross:center">
  179. <div></div>
  180. <div>
  181. <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">
  182. </el-pagination>
  183. </div>
  184. </div>
  185. </div>
  186. </el-card>
  187. </div>
  188. <script>
  189. const app = new Vue({
  190. el: '#app',
  191. data() {
  192. return {
  193. export_list: {},
  194. export_url: 'join-pay/default/pay-record',
  195. list: [],
  196. listLoading: false,
  197. page: 1,
  198. pageCount: 0,
  199. 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. pay_type: 0,
  208. },
  209. time: '',
  210. pagination: null,
  211. payStatus: {
  212. 0: '未支付',
  213. 1: '已支付'
  214. }
  215. };
  216. },
  217. methods: {
  218. resetFun() {
  219. this.search = {
  220. page: 1,
  221. start_time: '',
  222. end_time: '',
  223. user_id: null,
  224. user_keyword: '',
  225. out_trade_no: '',
  226. order_no: '',
  227. pay_type: 0,
  228. }
  229. this.time = '';
  230. this.toSearch();
  231. },
  232. datetimeChange() {
  233. if (this.time) {
  234. this.search.start_time = this.time[0];
  235. this.search.end_time = this.time[1];
  236. } else {
  237. this.search.start_time = '';
  238. this.search.end_time = '';
  239. }
  240. this.toSearch();
  241. },
  242. toSearch() {
  243. this.search.page = 1;
  244. this.getList();
  245. },
  246. pageChange(currentPage) {
  247. let self = this;
  248. self.search.page = currentPage;
  249. self.getList();
  250. },
  251. getList() {
  252. let self = this;
  253. self.listLoading = true;
  254. let params = {
  255. r: 'join-pay/default/pay-record',
  256. }
  257. params = Object.assign(params, this.search);
  258. request({
  259. params: params,
  260. method: 'get',
  261. }).then(e => {
  262. self.listLoading = false;
  263. if (e.data.code == 0) {
  264. self.list = e.data.data.list;
  265. self.export_list = e.data.data.export_list;
  266. this.pagination = e.data.data.pagination;
  267. self.pageCount = e.data.data.page_count;
  268. } else {
  269. self.$message.error(e.data.msg);
  270. }
  271. }).catch(e => {
  272. console.log(e);
  273. self.$message.error(e);
  274. });
  275. },
  276. },
  277. mounted: function() {
  278. this.getList();
  279. }
  280. });
  281. </script>