user_bills.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div>
  3. <div>
  4. <div class="user-name">用户:开发者大汪(123132)</div>
  5. <div class="user-info">订单数量:100(支付成功 50),收入金额:123.45元(成功 34.45元),支出金额:543.21元(成功 43.21元),当前余额 1000.00元</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. <a href="" class="link-type product_title">{{scope.row.product_title}}</a>
  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. {{scope.row.order_no}}
  56. </template>
  57. </el-table-column>
  58. <el-table-column
  59. prop=""
  60. label="人工">
  61. <template slot-scope="scope">
  62. {{scope.row.artificial_mark?'是':'否'}}
  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. tradeList: [
  93. {
  94. id: 0,
  95. type: "全部"
  96. },
  97. {
  98. id: 1,
  99. type: "充值"
  100. },
  101. {
  102. id: 2,
  103. type: "提现"
  104. },
  105. {
  106. id: 3,
  107. type: "购买"
  108. },
  109. {
  110. id: 4,
  111. type: "购买"
  112. }
  113. ],
  114. finaceList: [],
  115. // 下发的总数据
  116. totalData: {},
  117. // 项目ID
  118. jobID: "",
  119. // 审核人
  120. period: "",
  121. status: "",
  122. // 负责人
  123. checkUser: "",
  124. // 审核人列表
  125. periodStatusList: [],
  126. // 数据总条目
  127. totalCount: 1,
  128. currentPage: 1,
  129. currentPageSize: 20,
  130. // 列表数据
  131. tableData: [],
  132. localData: {
  133. env: "test"
  134. }
  135. };
  136. },
  137. computed: {
  138. isTest() {
  139. return this.localData.env === "test";
  140. }
  141. },
  142. mounted() {
  143. // this.getTableData();
  144. this.getFinanceList();
  145. },
  146. methods: {
  147. clickDev(uid) {
  148. this.$router.push({ path: "/main/orders_detail", params: { id: uid } });
  149. },
  150. changePageSize(val) {
  151. this.getFinanceList();
  152. },
  153. // 格式化列表数据
  154. formatTableData(data) {
  155. return data.map(i => ({
  156. ...i,
  157. payAround: `${i.start_time}<br>${i.end_time}`,
  158. pre_send_salary_timeShow: new Date(
  159. i.pre_send_salary_time * 1000
  160. ).toLocaleDateString()
  161. }));
  162. },
  163. formatDate(time) {
  164. var now = new Date(time * 1000);
  165. var year = now.getFullYear();
  166. var month = now.getMonth() + 1;
  167. var date = now.getDate();
  168. var hour = now.getHours();
  169. var minute = now.getMinutes();
  170. var second = now.getSeconds();
  171. if (hour < 10) {
  172. hour = "0" + hour;
  173. }
  174. if (minute < 10) {
  175. minute = "0" + minute;
  176. }
  177. if (second < 10) {
  178. second = "0" + second;
  179. }
  180. return (
  181. year +
  182. "-" +
  183. month +
  184. "-" +
  185. date +
  186. " " +
  187. hour +
  188. ":" +
  189. minute +
  190. ":" +
  191. second
  192. );
  193. },
  194. // 获取列表数据
  195. async getFinanceList() {
  196. let body = {
  197. page: this.currentPage,
  198. page_size: this.currentPageSize,
  199. };
  200. const res = await this.$post("/api/admin/order/get_user_orders", body);
  201. var data = res.data;
  202. this.finaceList = data.orders;
  203. this.totalCount = Number(data.count);
  204. },
  205. async downFinanceList() {
  206. let body = {
  207. page: this.currentPage,
  208. page_size: this.currentPageSize,
  209. user:this.$route.query.uid
  210. };
  211. // const res = await this.$get("/api/admin/order/get_orders", body);
  212. // http://local-rooter.proginn.com:20201/api/admin/order/get_orders?page=1&page_size=20&artificial_mark=1
  213. var url =
  214. window.location.host + "/api/admin/order/export?" + "artificial_mark=1";
  215. console.log(url);
  216. window.location.href = "http://" + url;
  217. },
  218. createOrder() {
  219. this.$router.push({
  220. path: "artificial_order/",
  221. query: {
  222. type: "create"
  223. }
  224. });
  225. }
  226. }
  227. };
  228. </script>
  229. <style lang="scss" scoped>
  230. .user-name {
  231. margin-bottom: 10px;
  232. }
  233. .user-info {
  234. margin-bottom: 10px;
  235. }
  236. .order-footer {
  237. position: absolute;
  238. bottom: 10px;
  239. left: 10px;
  240. }
  241. .product_title{
  242. overflow: hidden;
  243. -webkit-line-clamp: 1;
  244. text-overflow: ellipsis;
  245. display: -webkit-box;
  246. -webkit-box-orient: vertical;
  247. }
  248. </style>