orders_frozen.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div id="cloud-balance" v-if="tableData">
  3. <section class="top">
  4. <!-- <h3>交易订单中心</h3> -->
  5. <section>
  6. <div class="type-boxs">
  7. <div>
  8. <span class="marginr30">待解冻金额:{{waitUnfrozenCoins}}</span>
  9. <span class="marginr30">冻结订单数:{{totalCount}}</span>
  10. <span class="marginr30">待解冻订单数:{{waitUnfrozenCount}}</span>
  11. </div>
  12. </div>
  13. <div class="type-boxs">
  14. <div class="inlineb">
  15. <span class>时间范围:</span>
  16. <el-date-picker
  17. v-model="timeRange"
  18. type="daterange"
  19. align="right"
  20. unlink-panels
  21. range-separator="到"
  22. start-placeholder="开始日期"
  23. end-placeholder="结束日期"
  24. ></el-date-picker>
  25. </div>
  26. </div>
  27. <div class="type-boxs">
  28. <div class="inlineb">
  29. <span class>用户:</span>
  30. <div class="inlineb">
  31. <el-input style="width: 180px;" v-model="user" placeholder="UID"></el-input>
  32. </div>
  33. </div>
  34. <div class="inlineb">
  35. <span class>订单ID:</span>
  36. <el-input style="width: 180px;" v-model="order_no" placeholder="输入订单ID"></el-input>
  37. </div>
  38. <div class="inlineb">
  39. <span class>状态:</span>
  40. <el-select v-model="orderStatus">
  41. <el-option
  42. v-for="item of statusList"
  43. :key="item.id"
  44. :label="item.name"
  45. :value="item.id"
  46. ></el-option>
  47. </el-select>
  48. </div>
  49. <el-button type="primary" @click="clickSearchConfirm">筛选</el-button>
  50. <el-button>导出报表</el-button>
  51. </div>
  52. </section>
  53. </section>
  54. <div class>
  55. <!-- height="250" -->
  56. <el-table :data="tableData" border style="width: 100%">
  57. <el-table-column label="项目名称">
  58. <template slot-scope="scope">
  59. <!-- @click="clickDev(scope.row.uid)" -->
  60. <span class="lblue point">
  61. <a :href="scope.row.url" target="_blank">{{scope.row.name}}</a>
  62. </span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="name" label="用户">
  66. <template slot-scope="scope">
  67. <span class="lblue point"><a :href="scope.row.user_url" target="_blank">{{scope.row.nickname}}({{scope.row.uid}})</a></span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="name" label="关联订单ID">
  71. <template slot-scope="scope">
  72. <span>{{scope.row.order_no}}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="name" label="类型">
  76. <template slot-scope="scope">
  77. <span>{{scope.row.target_type_name}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="name" label="冻结金额">
  81. <template slot-scope="scope">
  82. <span>{{scope.row.coins}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="name" label="冻结方式">
  86. <template slot-scope="scope">
  87. <span>{{scope.row.end_time_type_name}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="name" label="创建日期">
  91. <template slot-scope="scope">
  92. <span>{{scope.row.create_time}}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="name" label="解冻日期">
  96. <template slot-scope="scope">
  97. <span>{{scope.row.end_time}}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="name" label="当前状态">
  101. <template slot-scope="scope">
  102. <span>{{scope.row.status_name}}</span>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </div>
  107. <div class="order-footer">
  108. <el-pagination
  109. background
  110. @current-change="getTableData"
  111. @size-change="changePageSize"
  112. :current-page.sync="currentPage"
  113. :page-sizes="[10, 20, 30, 40]"
  114. :page-size="20"
  115. layout="total, sizes, prev, pager, next, jumper"
  116. :total="searchCount"
  117. ></el-pagination>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. export default {
  123. data() {
  124. return {
  125. count:1,
  126. user:'',
  127. statusList:[{id:0,name:'已解冻'},{id:1,name:'冻结中'}],
  128. order_no:'',
  129. timeRange: "",
  130. arriveTime: "",
  131. searchId: "",
  132. tableData: [],
  133. // 下发的总数据
  134. totalData: {},
  135. orderStatus: 1,
  136. currentPage: 1,
  137. currentPageSize: 20,
  138. waitUnfrozenCount: 0,
  139. searchCount: 0,
  140. waitUnfrozenCoins: 0,
  141. totalCoins: 0,
  142. totalCount: 0,
  143. };
  144. },
  145. mounted() {
  146. this.getTableData();
  147. },
  148. methods: {
  149. // 改变订单类型
  150. clickExport() {
  151. window.open("/api/admin/job/get_all_periods?action=export");
  152. },
  153. clickSearchConfirm() {
  154. this.currentPage = 1;
  155. this.getTableData();
  156. },
  157. changePageSize(pageSize) {
  158. this.currentPageSize = pageSize;
  159. this.getTableData();
  160. },
  161. // 获取列表数据
  162. async getTableData() {
  163. this.tableData = [];
  164. let url = "/api/admin/order/get_frozen_coins";
  165. let body = { page: this.currentPage, size: this.currentPageSize };
  166. if (this.user) body.user = this.user;
  167. if (this.orderStatus!=='') body.status = this.orderStatus;
  168. if (this.order_no) body.order_no = this.order_no;
  169. if (this.timeRange){
  170. body.start_time=this.timeRange[0]/1000;
  171. body.end_time=this.timeRange[1]/1000;
  172. }
  173. const res = await this.$post(url, body);
  174. this.tableData = res.data.list;
  175. this.totalCoins=res.data.totalCoins;
  176. this.totalCount=res.data.totalCount;
  177. this.waitUnfrozenCount=res.data.waitUnfrozenCount;
  178. this.searchCount=res.data.searchCount;
  179. this.waitUnfrozenCoins=res.data.waitUnfrozenCoins;
  180. },
  181. },
  182. created() {
  183. // console.log(process.env.NODE_ENV);
  184. }
  185. };
  186. </script>
  187. <style scoped>
  188. .order-footer {
  189. position: absolute;
  190. bottom: 10px;
  191. left: 10px;
  192. }
  193. #order-wrap {
  194. width: 100%;
  195. }
  196. #cloud-balance {
  197. white-space: nowrap;
  198. overflow-x: scroll;
  199. height: calc(100% - 40px);
  200. }
  201. .top {
  202. display: flex;
  203. flex-direction: column;
  204. justify-content: center;
  205. height: 160px;
  206. }
  207. .selector-box {
  208. /* margin-top: 10px; */
  209. }
  210. .selector-box {
  211. display: flex;
  212. justify-content: space-between;
  213. }
  214. /* .selector-box-left {
  215. } */
  216. .table {
  217. margin-top: 10px;
  218. height: calc(100% - 320px);
  219. }
  220. .order-table {
  221. /* height: calc(100% - 300px); */
  222. }
  223. .end-row {
  224. background: rgba(0, 0, 0, 0.1);
  225. }
  226. .inlineb {
  227. display: inline-block;
  228. }
  229. .vsub {
  230. vertical-align: sub;
  231. }
  232. .type-boxs {
  233. margin-bottom: 10px;
  234. }
  235. .green {
  236. color: rgba(37, 155, 36, 1);
  237. }
  238. .orange {
  239. color: rgba(255, 152, 0, 1);
  240. }
  241. .state-success {
  242. display: inline-block;
  243. padding: 0px 8px;
  244. text-align: center;
  245. border: 1px solid rgb(48, 142, 255);
  246. }
  247. .state-wait {
  248. display: inline-block;
  249. padding: 0px 8px;
  250. text-align: center;
  251. border: 1px solid rgb(134, 130, 130);
  252. }
  253. .state-load {
  254. display: inline-block;
  255. padding: 0px 8px;
  256. text-align: center;
  257. border: 1px solid rgb(37, 155, 36);
  258. }
  259. .state-faile {
  260. display: inline-block;
  261. padding: 0px 8px;
  262. text-align: center;
  263. border: 1px solid rgb(229, 28, 35);
  264. }
  265. </style>