change-log.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <style>
  2. .item-box .label{
  3. margin-right:5px;
  4. }
  5. .item-box .search-btn{
  6. margin-left:5px;
  7. }
  8. </style>
  9. <div id="app" v-cloak>
  10. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  11. <div slot="header">
  12. <div>
  13. <span>种子金记录</span>
  14. </div>
  15. </template>
  16. </div>
  17. <div class="table-body el-input--small">
  18. <!-- 搜索 -->
  19. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  20. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  21. <div class="label">用户ID</div>
  22. <el-input style="width: 250px" v-model="search.user_id" placeholder="用户ID"></el-input>
  23. </div>
  24. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  25. <div class="label">订单号</div>
  26. <el-input style="width: 250px" v-model="search.order_no" placeholder="订单号"></el-input>
  27. </div>
  28. <div class="item-box" flex="dir:left cross:center">
  29. <div class="label">时间</div>
  30. <el-date-picker
  31. v-model="time"
  32. type="datetimerange"
  33. value-format="yyyy-MM-dd HH:mm:ss"
  34. range-separator="至"
  35. start-placeholder="开始日期"
  36. end-placeholder="结束日期">
  37. </el-date-picker>
  38. </div>
  39. <div class="item-box" flex="dir:left cross:center">
  40. <el-button type="primary" size="small" class="search-btn" @click="searchs">搜索
  41. </el-button>
  42. </div>
  43. </el-form>
  44. <!-- 表格开始 -->
  45. <el-table v-loading="listLoading" :data="orderList" stripe style="width: 100%">
  46. <el-table-column prop="order_no" label="订单号" align="center" width="230px">
  47. <template slot-scope="scope">
  48. {{ scope.row.seedOrder.order_no }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="user_id" label="用户ID" align="center" ></el-table-column>
  52. <el-table-column prop="scope" label="用户" align="center" width="230px">
  53. <template slot-scope="scope" >
  54. <div style="display:flex;justify-content: space-evenly;">
  55. <div style="font-size: 13px;" >{{scope.row.user.nickname}}</div>
  56. <div style="font-size: 13px;" >{{scope.row.user.mobile}}</div>
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="seed_num" label="种子金数量" align="center"></el-table-column>
  61. <el-table-column prop="seed_cost" label="种子金总价值" align="center"></el-table-column>
  62. <el-table-column prop="after_unit_price" label="现单价" align="center"></el-table-column>
  63. <el-table-column prop="basic_unit_price" label="初始价值" align="center">
  64. <template slot-scope="scope">
  65. {{ scope.row.seedOrder.basic_unit_price }}
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="scope" width="160" label="变动时间">
  69. <template slot-scope="scope">
  70. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="user_id" label="当前状态" align="center">
  74. <template slot-scope="scope">
  75. {{orderStatus[scope.row.capital_type]}}
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <div style="text-align: right;margin: 20px 0;">
  80. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  81. style="display: inline-block;float: right;" background @current-change="pageChange"
  82. layout="prev, pager, next" :total="pagination.total_count">
  83. </el-pagination>
  84. </div>
  85. </div>
  86. </el-card>
  87. </div>
  88. <script>
  89. const app = new Vue({
  90. el: '#app',
  91. data: {
  92. search:{
  93. seed_order_id:null,
  94. user_id:null,
  95. order_no:'',
  96. start_at:'',
  97. end_at:''
  98. },
  99. page:1,
  100. limit:20,
  101. orderList:[],
  102. listLoading: false,
  103. pagination:null,
  104. time:[],
  105. orderStatus:[]
  106. },
  107. mounted() {
  108. this.search.user_id = getQuery('user_id');
  109. this.search.order_no = getQuery('order_no');
  110. if (getQuery('seed_order_id')) this.search.seed_order_id = getQuery('seed_order_id');
  111. this.getList()
  112. },
  113. methods: {
  114. searchs(){
  115. this.page = 1;
  116. this.getList();
  117. },
  118. getList() { //种子金用户记录
  119. let self = this;
  120. self.listLoading = true;
  121. console.log(this.time,'--------------')
  122. if(this.time){
  123. this.search.start_at = this.time[0];
  124. this.search.end_at = this.time[1];
  125. }else{
  126. this.search.start_at ='';
  127. this.search.end_at = '';
  128. }
  129. request({
  130. method: 'get',
  131. params: {
  132. r: '/seed/index/change-log',
  133. page: self.page,
  134. limit:self.limit,
  135. order_no: self.search.order_no,//订单号
  136. seed_order_id: self.search.seed_order_id,
  137. user_id: self.search.user_id,
  138. start_at: self.search.start_at,
  139. end_at: self.search.end_at,
  140. },
  141. data: {},
  142. }).then(e => {
  143. self.listLoading = false;
  144. self.orderList = e.data.data.list.list;
  145. self.orderStatus = e.data.data.seed_status_arr
  146. self.pagination = e.data.data.list.pagination;
  147. self.pagination.pageSize = e.data.data.list.page_size;
  148. self.pagination.total_count = e.data.data.list.count;
  149. }).catch(e => {
  150. console.log(e);
  151. });
  152. },
  153. pageChange(currentPage) {
  154. let self = this;
  155. self.page = currentPage;
  156. self.getList();
  157. },
  158. }
  159. });
  160. </script>