user_bills.vue 6.0 KB

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