score-record.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div class="page-box" v-loading="loading > 0">
  3. <Header :title="title"></Header>
  4. <div class="container">
  5. <div class="content">
  6. <!-- 表格 -->
  7. <div class="filter-box">
  8. <div class="filter">
  9. <div class="filter-item">
  10. <div class="label">变动类型:</div>
  11. <el-select
  12. v-model="filter.fundType"
  13. size="small"
  14. class="select"
  15. placeholder="请选择"
  16. >
  17. <el-option
  18. v-for="item in statusType"
  19. :key="item.value"
  20. :label="item.name"
  21. :value="item.value"
  22. >
  23. </el-option>
  24. </el-select>
  25. </div>
  26. <div class="filter-item">
  27. <div class="label">奖励获得者ID:</div>
  28. <el-input
  29. class="input"
  30. v-model="filter.uid"
  31. placeholder="请输入内容"
  32. size="small"
  33. ></el-input>
  34. </div>
  35. <div class="filter-item">
  36. <div class="label">奖励发起者ID:</div>
  37. <el-input
  38. class="input"
  39. v-model="filter.fid"
  40. placeholder="请输入内容"
  41. size="small"
  42. ></el-input>
  43. </div>
  44. <div class="filter-item">
  45. <div class="label">创建时间:</div>
  46. <el-date-picker
  47. v-model="date"
  48. type="daterange"
  49. align="right"
  50. unlink-panels
  51. class="date-input"
  52. range-separator="至"
  53. start-placeholder="开始日期"
  54. end-placeholder="结束日期"
  55. value-format="yyyy-MM-dd HH:mm:ss"
  56. :default-time="['00:00:00', '23:59:59']"
  57. size="small"
  58. >
  59. </el-date-picker>
  60. </div>
  61. </div>
  62. <div class="btn-box">
  63. <button class="search" @click="search">筛选</button>
  64. <button class="reset" @click="reset">重置</button>
  65. </div>
  66. </div>
  67. <el-table
  68. :data="list"
  69. class="order-table table no-border-table"
  70. ref="orderTable"
  71. :header-cell-style="{
  72. border: 'none',
  73. color: '#333',
  74. background: '#f6f6f6',
  75. borderBottom: '1px solid #E8E8E8',
  76. height: '54px',
  77. }"
  78. :row-style="{
  79. height: '54px',
  80. }"
  81. >
  82. <el-table-column
  83. prop="created"
  84. align="center"
  85. label="创建时间"
  86. ></el-table-column>
  87. <el-table-column
  88. prop="describe"
  89. align="center"
  90. label="奖励类型"
  91. ></el-table-column>
  92. <el-table-column
  93. prop="amount"
  94. align="center"
  95. label="代金券数"
  96. ></el-table-column>
  97. <el-table-column
  98. prop="uid"
  99. align="center"
  100. label="奖励获得者ID"
  101. ></el-table-column>
  102. <el-table-column
  103. prop="fid"
  104. align="center"
  105. label="奖励发起者ID"
  106. ></el-table-column>
  107. </el-table>
  108. </div>
  109. <!-- 分页按钮 -->
  110. <div class="footer">
  111. <el-pagination
  112. @current-change="handleCurrentChange"
  113. :current-page.sync="currentPage"
  114. background
  115. layout="total, prev, pager, next, jumper"
  116. :page-size="size"
  117. :total="total"
  118. ></el-pagination>
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. <script type="text/ecmascript-6">
  124. import Header from '../../components/common/header';
  125. export default {
  126. components: {
  127. Header
  128. },
  129. name: 'balanceRecord',
  130. data() {
  131. return {
  132. currentPage: 1, // 当前页码
  133. size: 20, // 每页条数
  134. total: 0, // 总页数
  135. loading: 0, // 加载中
  136. title: {
  137. // 页面标题
  138. firstTitile: '资金管理',
  139. secondTitle: '贡献值记录'
  140. },
  141. filter: {
  142. uid: null,
  143. fid: null,
  144. fundType: null,
  145. },
  146. statusMap: {},
  147. list: [], // 列表
  148. date: []
  149. };
  150. },
  151. mounted() {
  152. // 获取列表
  153. this.getFundTypeMap();
  154. this.getList();
  155. },
  156. computed: {},
  157. methods: {
  158. // 切换页码
  159. handleCurrentChange(page) {
  160. this.currentPage = page;
  161. this.getList();
  162. },
  163. getFundTypeMap() {
  164. this.loading++;
  165. this.httpGet(this.$root.getFundTypeMap, {}).then(
  166. (res) => {
  167. this.loading--;
  168. // this.statusType = res.balanceLog.score
  169. let list = [{
  170. name: '全部',
  171. value: null
  172. }];
  173. for(let key in res.balanceLog.score){
  174. list.push({
  175. name: res.balanceLog.score[key],
  176. value: key
  177. });
  178. }
  179. this.statusType = list;
  180. },
  181. (res) => {
  182. this.loading--;
  183. this.$message.error(res);
  184. })
  185. },
  186. // 获取列表
  187. getList() {
  188. this.filter.begin = this.date[0] || '';
  189. this.filter.end = this.date[1] || '';
  190. this.loading++;
  191. this.httpGet(this.$root.getScoreList, {
  192. page: this.currentPage,
  193. size: this.size,
  194. ...this.filter
  195. }).then(
  196. (res) => {
  197. this.loading--;
  198. this.list = res.list;
  199. this.total = res.total;
  200. },
  201. (res) => {
  202. this.loading--;
  203. this.$message.error(res);
  204. }
  205. );
  206. },
  207. // 过滤
  208. search() {
  209. this.currentPage = 1;
  210. this.getList();
  211. },
  212. // 重置过滤
  213. reset() {
  214. this.filter = {
  215. uid: null,
  216. fid: null,
  217. fundType: null,
  218. };
  219. this.date = [];
  220. this.getList();
  221. }
  222. }
  223. };
  224. </script>
  225. <style lang="stylus" rel="stylesheet/stylus">
  226. @import '~assets/public.styl';
  227. </style>
  228. <style lang="stylus" rel="stylesheet/stylus" scoped>
  229. @import '~assets/main.styl';
  230. .page-box {
  231. height: 100%;
  232. width: 100%;
  233. flex-y(flex-start, flex-start);
  234. overflow-y: hidden;
  235. background: bg-color;
  236. .container {
  237. box-sizing: border-box;
  238. height: 100%;
  239. width: 100%;
  240. overflow-y: auto;
  241. flex-y(flex-start, flex-start);
  242. padding: 10px;
  243. // content 表格
  244. .content {
  245. flex: 1;
  246. width: 100%;
  247. font-size: 14px;
  248. background: white;
  249. box-sizing: border-box;
  250. padding: 24px 32px;
  251. border-radius: 2px;
  252. // 按钮
  253. .btn {
  254. width: 100px;
  255. height: 32px;
  256. line-height: 32px;
  257. confirm-btn();
  258. font-size: 14px;
  259. margin: 16px 0;
  260. }
  261. // 表格按钮
  262. .table-btn {
  263. // width: 65px;
  264. height: 24px;
  265. line-height: 24px;
  266. color: gray3;
  267. font-size: 12px;
  268. margin-right: 8px;
  269. cancel-btn();
  270. padding: 0 8px;
  271. }
  272. .filter-item {
  273. margin-right: 12px;
  274. }
  275. .select, .input {
  276. width: 125px;
  277. }
  278. .date-input {
  279. width: 360px;
  280. }
  281. .btn-box {
  282. margin: 0;
  283. }
  284. .table {
  285. margin-top: 24px !important;
  286. }
  287. }
  288. }
  289. .footer {
  290. width: 100%;
  291. padding: 24px;
  292. box-sizing: border-box;
  293. flex-x(flex-end);
  294. background: white;
  295. }
  296. .dialog-content {
  297. flex-y();
  298. }
  299. .form {
  300. width: 100%;
  301. flex-center();
  302. margin: 8px 0;
  303. }
  304. }
  305. </style>