index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>奖励总计</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="item-box" flex="dir:left cross:center">
  19. <div class="label">奖励时间:</div>
  20. <el-date-picker
  21. size="small"
  22. v-model="time"
  23. type="datetimerange"
  24. value-format="yyyy-MM-dd HH:mm:ss"
  25. range-separator="至"
  26. start-placeholder="开始日期"
  27. end-placeholder="结束日期">
  28. </el-date-picker>
  29. </div>
  30. <div class="item-box" flex="dir:left cross:center">
  31. <div class="label">奖励金额:</div>
  32. <el-input size="small" style="width: 200px" type="number" v-model="search.min_money" placeholder="请输入最小奖励金额"></el-input>
  33. <div class="symbol"> - </div>
  34. <el-input size="small" style="width: 200px" type="number" v-model="search.max_money" placeholder="请输入最大奖励金额"></el-input>
  35. </div>
  36. <div class="item-box" flex="dir:left cross:center">
  37. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  38. </el-button>
  39. </div>
  40. </el-form>
  41. <div style="display: flex;margin: 20px 0">
  42. 共奖励金额:<div class="price_col">¥{{sum.award_money}}</div>,发放次数:<div class="price_col">{{sum.grant_num}}</div></div>
  43. </div>
  44. <el-tabs v-model="activeName" @tab-click="handleClick">
  45. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  46. @selection-change="handleSelectionChange">
  47. <el-table-column label="会员ID" prop="user_id" align="center">
  48. <template slot-scope="scope">
  49. <div>{{scope.row.user.id}}</div>
  50. </template>
  51. </el-table-column>
  52. <el-table-column
  53. label="会员信息"
  54. min-width="150"
  55. >
  56. <template slot-scope="scope">
  57. <div class="table-info-img-text">
  58. <el-image class="table-info-img circle" v-if="scope.row.user.avatar_url" :src="scope.row.user.avatar_url">
  59. <div slot="error" class="image-slot">
  60. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  61. </div>
  62. </el-image>
  63. <div class="table-info-text">
  64. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  65. <div>{{scope.row.user.mobile}}</div>
  66. </div>
  67. </div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="总业绩(元)" prop="achievement_sum" align="center">
  71. <template slot-scope="scope">
  72. <div>{{scope.row.achievement_sum}}</div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="奖励金额(元)" prop="award_money" align="center">
  76. <template slot-scope="scope">
  77. <div>{{scope.row.award_money}}</div>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="发放时间" prop="created_at" min-width="160" align="center">
  81. <template slot-scope="scope">
  82. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. fixed="right"
  87. label="操作"
  88. align="center"
  89. width="300">
  90. <template slot-scope="scope">
  91. <el-button @click="toDetails(scope.row,scope.$index)" type="text" size="small">查看详情</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. </el-tabs>
  96. <!-- 分页器 -->
  97. <div flex="box:last cross:center">
  98. <div></div>
  99. <div>
  100. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  101. style="display: inline-block;float: right;" background @current-change="pageChange"
  102. layout="prev, pager, next" :total="pagination.totalCount">
  103. </el-pagination>
  104. </div>
  105. </div>
  106. </div>
  107. <!-- 这个是复制用的容器,已隐藏 -->
  108. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  109. </el-card>
  110. </div>
  111. <script>
  112. const app = new Vue({
  113. el: '#app',
  114. data: {
  115. page:1,
  116. avatar: '',
  117. nickname: '',
  118. time:[], //本地存时间,请求时不发送
  119. search: {
  120. // id : '',
  121. // keyword:0,
  122. // user_id : '',
  123. // goods_id : '',
  124. // related_type : '', //否 int 关联类型1:关联商品 2:关联店铺 3:关联地址
  125. // nickname : '',
  126. // title : '',
  127. date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
  128. date_start : '',
  129. min_money : '', //最小金额
  130. max_money : '', //最大金额
  131. },
  132. loading: false,
  133. activeName: '-1',
  134. list: [], //列表数据
  135. sum: {
  136. award_money:0,
  137. award_user:0,
  138. grant_num:0,
  139. },
  140. pagination: null,
  141. },
  142. mounted() {
  143. // 获取列表首页数据
  144. this.loadData(this.page,this.search); //获取列表数据
  145. },
  146. methods: {
  147. //1.0 跳转详情
  148. toDetails(row,index){
  149. this.$navigate({
  150. r: 'write-off/achievement/detail',
  151. user_id: row.user_id,
  152. created_at:row.created_at,
  153. })
  154. },
  155. // 1.0 获取视频列表
  156. loadData(page,others) {
  157. this.loading = true;
  158. console.log(this.search);
  159. if(!this.time){
  160. this.search.date_start = '';
  161. this.search.date_end = '';
  162. }else{
  163. this.search.date_start = this.time[0];
  164. this.search.date_end = this.time[1];
  165. }
  166. request({
  167. method: 'get',
  168. params: {
  169. r: 'write-off/achievement/index',
  170. page: page,
  171. ...others, //其他搜索字段
  172. },
  173. }).then(e => {
  174. this.loading = false;
  175. console.log(e.data.data.list)
  176. if (e.data.code === 0) {
  177. this.list = e.data.data.list.list;
  178. this.sum = e.data.data.sum;
  179. this.pagination = e.data.data.list.pagination;
  180. } else {
  181. this.$message.error(e.data.msg);
  182. }
  183. }).catch(e => {
  184. });
  185. },
  186. pageChange(page) {
  187. this.page = page;
  188. this.loadData(this.page,this.search);
  189. },
  190. handleClick(tab, event) {
  191. this.page = 1;
  192. this.search.status = this.activeName;
  193. this.loadData(this.page,this.search)
  194. },
  195. handleSelectionChange(val) {
  196. let self = this;
  197. self.choose_list = [];
  198. val.forEach(function (item) {
  199. self.choose_list.push(item.id);
  200. })
  201. },
  202. searchs() {
  203. this.page = 1;
  204. this.loadData(this.page,this.search);
  205. },
  206. }
  207. });
  208. </script>
  209. <style>
  210. .el-tabs__header {
  211. font-size: 16px;
  212. }
  213. .table-body {
  214. padding: 20px;
  215. background-color: #fff;
  216. }
  217. .table-body .el-button {
  218. padding: 0 !important;
  219. border: 0;
  220. margin: 0 5px;
  221. }
  222. .input-item {
  223. width: 250px;
  224. margin: 0 0 20px;
  225. display: inline-block;
  226. }
  227. .input-item .el-input__inner {
  228. border-right: 0;
  229. }
  230. .input-item .el-input__inner:hover {
  231. border: 1px solid #dcdfe6;
  232. border-right: 0;
  233. outline: 0;
  234. }
  235. .input-item .el-input__inner:focus {
  236. border: 1px solid #dcdfe6;
  237. border-right: 0;
  238. outline: 0;
  239. }
  240. .input-item .el-input-group__append {
  241. background-color: #fff;
  242. border-left: 0;
  243. width: 10%;
  244. padding: 0;
  245. }
  246. .input-item .el-input-group__append .el-button {
  247. padding: 0;
  248. }
  249. .input-item .el-input-group__append .el-button {
  250. margin: 0;
  251. }
  252. .batch {
  253. margin: 0 0 20px;
  254. display: inline-block;
  255. }
  256. .batch .el-button {
  257. padding: 9px 15px !important;
  258. }
  259. .item-box{
  260. margin-right: 20px;
  261. }
  262. .item-box .label{
  263. margin-right: 8px;
  264. }
  265. .item-box .symbol{
  266. margin: 0 6px;
  267. }
  268. .form-nickname{
  269. width: 180px;
  270. white-space:nowrap;
  271. overflow:hidden;
  272. text-overflow:ellipsis;
  273. }
  274. .index-video-url{
  275. width: 300px;
  276. }
  277. .index-video-url video{
  278. width: 100%;
  279. }
  280. .index-related-info{
  281. width: 500px;
  282. }
  283. .video-top{
  284. width: 100%;
  285. display: flex;
  286. align-items: flex-start;
  287. box-sizing: border-box;
  288. padding: 20px;
  289. /* opacity: .5; */
  290. background-color: #FFFFFF;
  291. }
  292. .video-top .top-right{
  293. line-height: 26px;
  294. }
  295. .video-top .top-right .top-title{
  296. font-size: 18px;
  297. white-space:nowrap;
  298. overflow:hidden;
  299. text-overflow:ellipsis;
  300. width: 360px;
  301. }
  302. .video-top .top-right .wrapper{
  303. display: flex;
  304. /* align-items: flex-start; */
  305. }
  306. .video-top .top-right .wrapper .to-copy{
  307. /* color: #03C5FF; */
  308. margin-left: 20px;
  309. }
  310. .video-top .top-right .detail-price{
  311. color: #BC0100;
  312. font-size: 18px;
  313. font-family: Microsoft YaHei;
  314. font-weight: bold;
  315. }
  316. /* .atooltip {
  317. background: #FFFFFF !important;
  318. border: none !important;
  319. } */
  320. .el-table th>.cell{
  321. color: #333;
  322. font-weight: bold;
  323. font-size: 14px;
  324. }
  325. .el-table__footer-wrapper, .el-table__header-wrapper{
  326. border-bottom: 1.4px solid #D6D6D6;
  327. }
  328. .price_col{
  329. color: #FF5D05;
  330. }
  331. </style>