release.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 class="table-body el-input--small">
  12. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  13. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  14. <div class="label">释放期数</div>
  15. <el-input style="width: 250px" v-model="search.release_num" placeholder="释放期数"></el-input>
  16. </div>
  17. <div class="item-box" flex="dir:left cross:center">
  18. <div class="label">时间</div>
  19. <el-date-picker
  20. v-model="time"
  21. type="datetimerange"
  22. value-format="yyyy-MM-dd HH:mm:ss"
  23. range-separator="至"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期">
  26. </el-date-picker>
  27. </div>
  28. <div class="item-box" flex="dir:left cross:center">
  29. <el-button type="primary" size="small" class="search-btn" @click="searchs">搜索
  30. </el-button>
  31. </div>
  32. </el-form>
  33. <el-table v-if="releaseList && releaseList.length > 0" :data="releaseList" fit stripe style="width: 100%;margin-top:10px;" >
  34. <el-table-column prop="release_num" label="释放期数" >
  35. <template slot-scope="scope">
  36. 第{{ scope.row.release_num }}期
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="total_seed_num" label="种子金数量" ></el-table-column>
  40. <el-table-column prop="release_energy_pool" label="能量池能量" ></el-table-column>
  41. <el-table-column prop="unit_price" label="价值增长额" ></el-table-column>
  42. <el-table-column label="状态" >
  43. <template slot-scope="scope">
  44. <el-tag v-if="scope.row.release_status == 0">释放中</el-tag>
  45. <el-tag v-if="scope.row.release_status == 1" type="success">释放成功</el-tag>
  46. <el-tooltip v-if="scope.row.release_status == 2" class="item" effect="dark" :content="scope.row.reason" placement="top">
  47. <el-tag type="danger">释放失败</el-tag>
  48. </el-tooltip>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="释放时间">
  52. <template slot-scope="scope">
  53. <div flex>
  54. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
  55. </div>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <div style="text-align: right;margin: 20px 0;">
  60. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  61. style="display: inline-block;float: right;" background @current-change="pageChange"
  62. layout="prev, pager, next" :total="pagination.total_count">
  63. </el-pagination>
  64. </div>
  65. </div>
  66. </el-card>
  67. </div>
  68. <script>
  69. const app = new Vue({
  70. el: '#app',
  71. data: {
  72. search:{
  73. release_num:null,
  74. start_at:'',
  75. end_at:''
  76. },
  77. page:1,
  78. limit:20,
  79. releaseList:[],
  80. listLoading: false,
  81. pagination:null,
  82. time:[]
  83. },
  84. mounted() {
  85. this.search.user_id = getQuery('user_id');
  86. this.getList()
  87. },
  88. methods: {
  89. searchs(){
  90. this.page = 1;
  91. this.getList();
  92. },
  93. toOrderDetail(order_no){
  94. this.$navigate({
  95. r: 'seed/index/change-log',
  96. order_no: order_no
  97. })
  98. },
  99. getList() { //种子金用户记录
  100. let self = this;
  101. self.listLoading = true;
  102. console.log(this.time,'--------------')
  103. if(this.time){
  104. this.search.start_at = this.time[0];
  105. this.search.end_at = this.time[1];
  106. }else{
  107. this.search.start_at ='';
  108. this.search.end_at = '';
  109. }
  110. request({
  111. method: 'get',
  112. params: {
  113. r: '/seed/pool/release',
  114. page: self.page,
  115. limit:self.limit,
  116. release_num: this.search.release_num,//订单号
  117. start_at: this.search.start_at,
  118. end_at: this.search.end_at,
  119. },
  120. data: {},
  121. }).then(e => {
  122. self.listLoading = false;
  123. self.releaseList = e.data.data.list;
  124. self.pagination = e.data.data.pagination;
  125. self.pagination.pageSize = e.data.data.page_size;
  126. self.pagination.total_count = e.data.data.count;
  127. }).catch(e => {
  128. console.log(e);
  129. });
  130. },
  131. pageChange(currentPage) {
  132. let self = this;
  133. self.page = currentPage;
  134. self.getList();
  135. },
  136. }
  137. });
  138. </script>