orders_frozen.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <div id="cloud-balance" class="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">
  68. <a
  69. :href="scope.row.user_url"
  70. target="_blank"
  71. >{{scope.row.nickname}}({{scope.row.uid}})</a>
  72. </span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="name" label="关联订单ID">
  76. <template slot-scope="scope">
  77. <span>{{scope.row.order_no}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="name" label="类型">
  81. <template slot-scope="scope">
  82. <span>{{scope.row.target_type_name}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="name" label="冻结金额">
  86. <template slot-scope="scope">
  87. <span>{{scope.row.coins}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="name" label="冻结方式">
  91. <template slot-scope="scope">
  92. <span>{{scope.row.end_time_type_name}}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="name" label="创建日期">
  96. <template slot-scope="scope">
  97. <span>{{scope.row.create_time}}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="name" label="解冻日期">
  101. <template slot-scope="scope">
  102. <span>{{scope.row.end_time}}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="name" label="当前状态">
  106. <template slot-scope="scope">
  107. <span>{{scope.row.status_name}}</span>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. </div>
  112. <div class="order-footer">
  113. <el-pagination
  114. background
  115. @current-change="getTableData"
  116. @size-change="changePageSize"
  117. :current-page.sync="currentPage"
  118. :page-sizes="[10, 20, 30, 40]"
  119. :page-size="20"
  120. layout="total, sizes, prev, pager, next, jumper"
  121. :total="searchCount"
  122. ></el-pagination>
  123. </div>
  124. </div>
  125. </template>
  126. <script>
  127. export default {
  128. data() {
  129. return {
  130. count: 1,
  131. user: "",
  132. statusList: [
  133. { id: 0, name: "已解冻" },
  134. { id: 1, name: "冻结中" }
  135. ],
  136. order_no: "",
  137. timeRange: "",
  138. arriveTime: "",
  139. searchId: "",
  140. tableData: [],
  141. // 下发的总数据
  142. totalData: {},
  143. orderStatus: 1,
  144. currentPage: 1,
  145. currentPageSize: 20,
  146. waitUnfrozenCount: 0,
  147. searchCount: 0,
  148. waitUnfrozenCoins: 0,
  149. totalCoins: 0,
  150. totalCount: 0
  151. };
  152. },
  153. mounted() {
  154. this.getTableData();
  155. },
  156. methods: {
  157. // 改变订单类型
  158. clickExport() {
  159. window.open("/api/admin/job/get_all_periods?action=export");
  160. },
  161. clickSearchConfirm() {
  162. this.currentPage = 1;
  163. this.getTableData();
  164. },
  165. changePageSize(pageSize) {
  166. this.currentPageSize = pageSize;
  167. this.getTableData();
  168. },
  169. // 获取列表数据
  170. async getTableData() {
  171. this.tableData = [];
  172. let url = "/api/admin/order/get_frozen_coins";
  173. let body = { page: this.currentPage, size: this.currentPageSize };
  174. if (this.user) body.user = this.user;
  175. if (this.orderStatus !== "") body.status = this.orderStatus;
  176. if (this.order_no) body.order_no = this.order_no;
  177. if (this.timeRange) {
  178. body.start_time = this.timeRange[0] / 1000;
  179. body.end_time = this.timeRange[1] / 1000;
  180. }
  181. const res = await this.$post(url, body);
  182. debugger;
  183. this.tableData = res.data.list;
  184. this.totalCoins = res.data.totalCoins;
  185. this.totalCount = res.data.totalCount * 1;
  186. this.waitUnfrozenCount = res.data.waitUnfrozenCount;
  187. this.searchCount = res.data.searchCount * 1;
  188. this.waitUnfrozenCoins = res.data.waitUnfrozenCoins;
  189. }
  190. },
  191. created() {
  192. // console.log(process.env.NODE_ENV);
  193. }
  194. };
  195. </script>
  196. <style scoped lang="scss">
  197. .order-footer {
  198. padding: 10px;
  199. }
  200. #order-wrap {
  201. width: 100%;
  202. }
  203. #cloud-balance {
  204. white-space: nowrap;
  205. overflow-x: scroll;
  206. height: calc(100% - 40px);
  207. }
  208. .top {
  209. display: flex;
  210. flex-direction: column;
  211. justify-content: center;
  212. height: 160px;
  213. font-size: 14px;
  214. line-height: 1.5;
  215. }
  216. .selector-box {
  217. /* margin-top: 10px; */
  218. }
  219. .selector-box {
  220. display: flex;
  221. justify-content: space-between;
  222. }
  223. /* .selector-box-left {
  224. } */
  225. .table {
  226. margin-top: 10px;
  227. height: calc(100% - 320px);
  228. }
  229. .order-table {
  230. /* height: calc(100% - 300px); */
  231. }
  232. .end-row {
  233. background: rgba(0, 0, 0, 0.1);
  234. }
  235. .inlineb {
  236. display: inline-block;
  237. }
  238. .vsub {
  239. vertical-align: sub;
  240. }
  241. .type-boxs {
  242. margin-bottom: 10px;
  243. }
  244. .green {
  245. color: rgba(37, 155, 36, 1);
  246. }
  247. .orange {
  248. color: rgba(255, 152, 0, 1);
  249. }
  250. .state-success {
  251. display: inline-block;
  252. padding: 0px 8px;
  253. text-align: center;
  254. border: 1px solid rgb(48, 142, 255);
  255. }
  256. .state-wait {
  257. display: inline-block;
  258. padding: 0px 8px;
  259. text-align: center;
  260. border: 1px solid rgb(134, 130, 130);
  261. }
  262. .state-load {
  263. display: inline-block;
  264. padding: 0px 8px;
  265. text-align: center;
  266. border: 1px solid rgb(37, 155, 36);
  267. }
  268. .state-faile {
  269. display: inline-block;
  270. padding: 0px 8px;
  271. text-align: center;
  272. border: 1px solid rgb(229, 28, 35);
  273. }
  274. .el-form-item {
  275. margin-bottom: 0;
  276. }
  277. .el-form:last-child {
  278. margin-bottom: 22px;
  279. }
  280. </style>