order.php 6.6 KB

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