user_bills.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div id="mainBody">
  3. <div v-if="user">
  4. <div class="user-name">用户:{{user.nickname}}({{user.uid}})</div>
  5. <div class="user-info">订单数量:{{totalCount}}(支付成功 {{successCount}}),收入金额:{{income_sum}}元(成功 {{income_success_sum}}元),支出金额:{{expense_sum}}元(成功 {{expense_success_sum}}元),当前余额 {{balance}}元</div>
  6. <el-table
  7. :data="finaceList" border
  8. style="width: 100%">
  9. <el-table-column
  10. prop=""
  11. label="订单名称">
  12. <template slot-scope="scope">
  13. <nuxt-link target="_blank" :to="{path:'/main/orders_detail?id='+scope.row.order_no}">{{scope.row.product_title}}</nuxt-link>
  14. </template>
  15. </el-table-column>
  16. <el-table-column
  17. prop=""
  18. label="实际金额">
  19. <template slot-scope="scope">
  20. {{scope.row.real_amount}}
  21. </template>
  22. </el-table-column>
  23. <el-table-column
  24. prop=""
  25. label="当前余额">
  26. <template slot-scope="scope">
  27. {{scope.row.total_balance?scope.row.total_balance:'--'}}
  28. </template>
  29. </el-table-column>
  30. <el-table-column
  31. prop=""
  32. label="支付方式">
  33. <template slot-scope="scope">
  34. {{scope.row.channel_name}}
  35. </template>
  36. </el-table-column>
  37. <el-table-column
  38. prop=""
  39. label="订单状态">
  40. <template slot-scope="scope">
  41. {{scope.row.order_state_name}}
  42. </template>
  43. </el-table-column>
  44. <el-table-column
  45. prop=""
  46. label="创建时间">
  47. <template slot-scope="scope">
  48. {{scope.row.created_at_name}}
  49. </template>
  50. </el-table-column>
  51. <el-table-column
  52. prop=""
  53. label="订单编号">
  54. <template slot-scope="scope">
  55. <nuxt-link target="_blank" :to="{path:'/main/orders_detail?id='+scope.row.order_no}">{{scope.row.order_no}}</nuxt-link>
  56. </template>
  57. </el-table-column>
  58. <el-table-column
  59. prop=""
  60. label="人工">
  61. <template slot-scope="scope">
  62. {{(scope.row.artificial_mark === 1 || scope.row.artificial_mark === "1")?'是':'否'}}
  63. </template>
  64. </el-table-column>
  65. <el-table-column
  66. prop=""
  67. label="备注说明">
  68. <template slot-scope="scope">
  69. {{scope.row.public_comment}}
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. </div>
  74. <div class="order-footer">
  75. <el-pagination
  76. background
  77. @current-change="getFinanceList"
  78. @size-change="changePageSize"
  79. :current-page.sync="currentPage"
  80. :page-sizes="[10, 20, 30, 40]"
  81. :page-size="20"
  82. layout="total, sizes, prev, pager, next, jumper"
  83. :total="totalCount"
  84. ></el-pagination>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. export default {
  90. data() {
  91. return {
  92. user:{},
  93. tradeList: [
  94. {
  95. id: 0,
  96. type: "全部"
  97. },
  98. {
  99. id: 1,
  100. type: "充值"
  101. },
  102. {
  103. id: 2,
  104. type: "提现"
  105. },
  106. {
  107. id: 3,
  108. type: "购买"
  109. },
  110. {
  111. id: 4,
  112. type: "购买"
  113. }
  114. ],
  115. finaceList: [],
  116. // 下发的总数据
  117. totalData: {},
  118. // 负责人
  119. checkUser: "",
  120. // 审核人列表
  121. periodStatusList: [],
  122. // 数据总条目
  123. totalCount: 1,
  124. currentPage: 1,
  125. currentPageSize: 20,
  126. // 列表数据
  127. tableData: [],
  128. };
  129. },
  130. computed: {
  131. isTest() {
  132. return this.localData.env === "test";
  133. }
  134. },
  135. mounted() {
  136. // this.getTableData();
  137. this.getFinanceList();
  138. },
  139. methods: {
  140. clickDev(uid) {
  141. this.$router.push({ path: "/main/orders_detail", params: { id: uid } });
  142. },
  143. changePageSize(val) {
  144. this.getFinanceList();
  145. },
  146. // 获取列表数据
  147. async getFinanceList() {
  148. let body = {
  149. page: this.currentPage,
  150. page_size: this.currentPageSize,
  151. user:this.$route.query.user
  152. };
  153. const res = await this.$post("/api/admin/order/get_user_orders", body);
  154. var data = res.data;
  155. this.finaceList = data.orders;
  156. this.totalCount = Number(data.count);
  157. this.successCount=Number(data.successCount);
  158. this.income_sum=Number(data.income_sum);
  159. this.income_success_sum=Number(data.income_success_sum);
  160. this.expense_sum=Number(data.expense_sum);
  161. this.expense_success_sum=Number(data.expense_success_sum);
  162. this.balance=data.total_balance.total_balance;
  163. this.user=data.user;
  164. //console.log(this.user.nickname);
  165. },
  166. async downFinanceList() {
  167. let body = {
  168. page: this.currentPage,
  169. page_size: this.currentPageSize,
  170. user:this.$route.query.user
  171. };
  172. // const res = await this.$get("/api/admin/order/get_orders", body);
  173. // http://local-rooter.proginn.com:20201/api/admin/order/get_orders?page=1&page_size=20&artificial_mark=1
  174. var url =
  175. window.location.host + "/api/admin/order/export?" + "artificial_mark=1";
  176. console.log(url);
  177. window.location.href = "http://" + url;
  178. },
  179. }
  180. };
  181. </script>
  182. <style lang="scss" scoped>
  183. .user-name {
  184. margin-bottom: 10px;
  185. }
  186. .user-info {
  187. margin-bottom: 10px;
  188. }
  189. .order-footer {
  190. position: absolute;
  191. bottom: 10px;
  192. left: 10px;
  193. }
  194. .product_title{
  195. overflow: hidden;
  196. -webkit-line-clamp: 1;
  197. text-overflow: ellipsis;
  198. display: -webkit-box;
  199. -webkit-box-orient: vertical;
  200. }
  201. #mainBody {
  202. white-space: nowrap;
  203. overflow-x: scroll;
  204. height: calc(100% - 40px);
  205. }
  206. </style>