balance_change.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template >
  2. <div id="mainBody" v-if="coins">
  3. <el-row>
  4. <el-col :span="24">
  5. <h3>用户余额订单</h3>
  6. <div class="type-boxs top">
  7. <span class="vsub">订单类型:</span>
  8. <div class="inlineb">
  9. <el-checkbox-group v-model="orderType" @change="orderStatus" size="mini">
  10. <el-checkbox-button v-for="allorder in orders" :label="allorder" :key="allorder">{{allorder}}</el-checkbox-button>
  11. </el-checkbox-group>
  12. </div>
  13. </div>
  14. </el-col>
  15. </el-row>
  16. <el-form ref="form" label-width="40px" :model="form">
  17. <el-row :gutter="20">
  18. <el-col :span="3">
  19. <el-form-item label="用户">
  20. <el-input placeholder="UID" v-model="user"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="3">
  24. <el-form-item label="编号">
  25. <el-input placeholder="订单编号" v-model="order_no"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="7">
  29. <el-form-item label="时间范围" label-width="80px">
  30. <el-date-picker
  31. v-model="timeRange"
  32. type="daterange"
  33. range-separator="至"
  34. start-placeholder="开始时间"
  35. end-placeholder="结束时间">
  36. </el-date-picker>
  37. </el-form-item>
  38. </el-col>
  39. <el-button type="primary" plain @click="getFinanceList">筛选</el-button>
  40. <el-button plain>导出报表</el-button>
  41. </el-row>
  42. </el-form>
  43. <el-table
  44. :data="coins" border
  45. style="width: 100%">
  46. <el-table-column
  47. prop="date"
  48. label="ID"
  49. width="180">
  50. <template slot-scope="scope">
  51. {{scope.row.id}}
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. prop="name"
  56. label="用户"
  57. width="180">
  58. <template slot-scope="scope">
  59. <a :href="scope.row.user_url" class="link-type" target="_blank"> {{scope.row.nickname}}({{scope.row.uid}})</a>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. prop="address"
  64. label="变动金额">
  65. <template slot-scope="scope">
  66. {{scope.row.use}}
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. prop="address"
  71. label="变动后总金额">
  72. <template slot-scope="scope">
  73. {{scope.row.total}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. prop="address"
  78. label="变动前总金额">
  79. <template slot-scope="scope">
  80. {{scope.row.before_total_balance}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column
  84. prop="address"
  85. label="变动后充值余额">
  86. <template slot-scope="scope">
  87. {{scope.row.total_recharge}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column
  91. prop="address"
  92. label="变动后收入余额">
  93. <template slot-scope="scope">
  94. {{scope.row.total_income}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column
  98. prop="address"
  99. label="变动前收入余额">
  100. <template slot-scope="scope">
  101. {{scope.row.before_income_balance}}
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. prop="address"
  106. label="创建时间">
  107. <template slot-scope="scope">
  108. {{scope.row.time}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column
  112. prop="address"
  113. label="更新时间">
  114. <template slot-scope="scope">
  115. {{scope.row.update_time}}
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. prop="address"
  120. label="订单编号">
  121. <template slot-scope="scope">
  122. {{scope.row.order_no}}
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <div class="order-footer">
  127. <el-pagination
  128. background
  129. @current-change="getFinanceList"
  130. @size-change="changePageSize"
  131. :current-page.sync="currentPage"
  132. :page-sizes="[10, 20, 30, 40]"
  133. :page-size="20"
  134. layout="total, sizes, prev, pager, next, jumper"
  135. :total="count"
  136. ></el-pagination>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. const allorderOptions = ['全部', '可用余额'];
  142. export default {
  143. data(){
  144. return {
  145. currentPage:1,
  146. currentPageSize:20,
  147. coins:[],
  148. count:1,
  149. user:'',
  150. order_no:'',
  151. timeRange:[],
  152. orderType: ['全部'],
  153. orders: allorderOptions
  154. }
  155. },
  156. mounted() {
  157. this.getFinanceList();
  158. },
  159. methods: {
  160. changePageSize(val) {
  161. this.getFinanceList();
  162. },
  163. async getFinanceList() {
  164. // this.user=this.$route.query.user;
  165. let body = {
  166. page: this.currentPage,
  167. size: this.currentPageSize,
  168. user:this.user,
  169. orderType: this.orderType
  170. };
  171. if (this.order_no){
  172. body.order_no=this.order_no;
  173. }
  174. if (this.timeRange.length>0){
  175. console.log(this.timeRange);
  176. body.start_time=this.timeRange[0]/1000;
  177. body.end_time=this.timeRange[1]/1000;
  178. }
  179. const res = await this.$post("/api/admin/order/get_coins", body);
  180. this.coins = res.data.list;
  181. this.count=Number(res.data.count);
  182. },
  183. async downFinanceList() {
  184. let body = {
  185. page: this.currentPage,
  186. page_size: this.currentPageSize,
  187. user:this.$route.query.user
  188. };
  189. var url = window.location.host + "/api/admin/order/export?" + "artificial_mark=1";
  190. window.location.href = "http://" + url;
  191. },
  192. async orderStatus(val){
  193. // this.orderType = ['全部'];
  194. if (this.orderType[0]=='全部'){
  195. this.orderType = ['可用余额']
  196. }else if (this.orderType[0]=='可用余额'){
  197. this.orderType = ['全部']
  198. }else {
  199. this.orderType = ['全部']
  200. }
  201. let body = {
  202. page: this.currentPage,
  203. size: this.currentPageSize,
  204. };
  205. if (this.orderType){
  206. body.orderType=this.orderType;
  207. }
  208. const res = await this.$post("/api/admin/order/get_coins", body);
  209. this.coins = res.data.list;
  210. this.count=Number(res.data.count);
  211. },
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. .order-footer {
  217. position: absolute;
  218. bottom: 10px;
  219. left: 10px;
  220. }
  221. #mainBody {
  222. white-space: nowrap;
  223. overflow-x: scroll;
  224. height: calc(100% - 40px);
  225. }
  226. .top{
  227. padding: 10px;
  228. }
  229. </style>