index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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">视频ID</div>
  20. <el-input size="small" style="width: 200px" v-model="search.video_id" placeholder="请输入ID"></el-input>
  21. </div>
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">会员昵称</div>
  24. <el-input size="small" style="width: 200px" v-model="search.nickname" placeholder="请输入会员呢称"></el-input>
  25. </div>
  26. <div class="item-box" flex="dir:left cross:center">
  27. <div class="label">订单编号</div>
  28. <el-input size="small" style="width: 200px" v-model="search.order_no" placeholder="请输入订单编号"></el-input>
  29. </div>
  30. <div class="item-box" flex="dir:left cross:center">
  31. <div class="label">创建时间</div>
  32. <el-date-picker @change="selectedDateTime" size="small" v-model="time" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" clearable>
  33. </el-date-picker>
  34. </div>
  35. <div class="item-box" flex="dir:left cross:center">
  36. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  37. </el-button>
  38. </div>
  39. <div class="item-box" flex="dir:left cross:center" v-if="search.video_id || search.nickname || search.order_no || search.start_time || search.end_time">
  40. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearchs">清除搜索条件
  41. </el-button>
  42. </div>
  43. </el-form>
  44. <el-tabs v-model="activeName" @tab-click="handleClick">
  45. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" @selection-change="handleSelectionChange">
  46. <el-table-column prop="video_id" label="视频ID" min-width="80" align="center"></el-table-column>
  47. <el-table-column prop="avatar_url,nickname" label="会员" min-width="200">
  48. <template slot-scope="scope">
  49. <div class="table-info-img-text">
  50. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  51. <div slot="error" class="image-slot">
  52. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  53. </div>
  54. </el-image>
  55. <div class="table-info-text">
  56. <div v-if="scope.row.nickname">{{scope.row.nickname}} [ID: {{scope.row.user_id}}]</div>
  57. <div>{{scope.row.mobile}}</div>
  58. </div>
  59. </div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="goods_name" label="关联商品" min-width="100" align="center">
  63. <template slot-scope="scope">
  64. <div>{{scope.row.goods_name}}</div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="订单号" prop="order_no" min-width="150" align="center">
  68. <template slot-scope="scope">
  69. <div>{{scope.row.order_no}}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="订单金额(元)" prop="total_pay_price" min-width="100" align="center">
  73. <template slot-scope="scope">
  74. <div>{{scope.row.total_pay_price}}</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="商品售价(元)" prop="goods_price" min-width="100" align="center">
  78. <template slot-scope="scope">
  79. <div>{{scope.row.goods_price}}</div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="分红比例(%)" prop="award_percentage" min-width="100" align="center">
  83. <template slot-scope="scope">
  84. <div>{{scope.row.award_percentage}}</div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="分红金额(元)" prop="dividend" min-width="100" align="center">
  88. <template slot-scope="scope">
  89. <div>{{scope.row.award_money}}</div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="状态" width="150" align="center">
  93. <template slot-scope="scope">
  94. <div>{{scope.row.is_settlement==0?'待结算':'已结算'}}</div><!-- flex="cross:top cross:center" -->
  95. </template>
  96. </el-table-column><!-- fixed="right" -->
  97. <el-table-column label="发布时间" prop="created_at" min-width="160" align="center">
  98. <template slot-scope="scope">
  99. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </el-tabs>
  104. <!-- 分页器 -->
  105. <div flex="box:last cross:center">
  106. <div></div>
  107. <div>
  108. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :page-count="pageCount">
  109. </el-pagination>
  110. </div>
  111. </div>
  112. </div>
  113. </el-card>
  114. </div>
  115. <script>
  116. const app = new Vue({
  117. el: '#app',
  118. data: {
  119. page: 1,
  120. time: [], //本地存时间,请求时不发送
  121. search: {
  122. video_id: null, //视频id
  123. nickname: null, //昵称
  124. order_no: null,
  125. start_time: null,
  126. end_time: null,
  127. },
  128. loading: false,
  129. activeName: '-1',
  130. list: [], //列表数据
  131. pagination: null,
  132. pageCount: 1,
  133. },
  134. mounted() {
  135. this.loadData(this.page, this.search); //获取列表数据
  136. },
  137. methods: {
  138. // 1.0 获取分红列表
  139. loadData(page, others) {
  140. this.loading = true;
  141. request({
  142. params: {
  143. r: 'short-video/default/share-benefits',
  144. page: page,
  145. ...others, //其他搜索字段
  146. },
  147. method: 'get'
  148. }).then(e => {
  149. this.loading = false;
  150. if (e.data.code === 0) {
  151. this.list = e.data.data.list;
  152. this.pagination = e.data.data.pagination;
  153. this.pageCount = e.data.data.page_count;
  154. } else {
  155. this.$message.error(e.data.msg);
  156. }
  157. }).catch(e => {});
  158. },
  159. pageChange(page) {
  160. this.page = page;
  161. this.loadData(this.page, this.search);
  162. },
  163. handleClick(tab, event) {
  164. this.page = 1;
  165. this.search.status = this.activeName;
  166. this.loadData(this.page, this.search)
  167. },
  168. handleSelectionChange(val) {
  169. let self = this;
  170. self.choose_list = [];
  171. val.forEach(function(item) {
  172. self.choose_list.push(item.id);
  173. })
  174. },
  175. searchs() {
  176. this.page = 1;
  177. this.loadData(this.page, this.search);
  178. },
  179. clearSearchs() {
  180. this.search.video_id = null;
  181. this.search.nickname = null;
  182. this.search.order_no = null;
  183. this.search.start_time = null;
  184. this.search.end_time = null;
  185. this.time = [];
  186. this.loadData(this.page, this.search);
  187. },
  188. // 时间搜索选中
  189. selectedDateTime(val) {
  190. console.log(val);
  191. if (val) {
  192. this.search.start_time = val[0];
  193. this.search.end_time = val[1];
  194. } else {
  195. this.time = [];
  196. this.search.start_time = null;
  197. this.search.end_time = null;
  198. }
  199. this.loadData(1, this.search);
  200. },
  201. }
  202. });
  203. </script>
  204. <style>
  205. .el-tabs__header {
  206. font-size: 16px;
  207. }
  208. .table-body {
  209. padding: 20px;
  210. background-color: #fff;
  211. }
  212. .table-body .el-button {
  213. padding: 0 !important;
  214. border: 0;
  215. margin: 0 5px;
  216. }
  217. .input-item {
  218. width: 250px;
  219. margin: 0 0 20px;
  220. display: inline-block;
  221. }
  222. .input-item .el-input__inner {
  223. border-right: 0;
  224. }
  225. .input-item .el-input__inner:hover {
  226. border: 1px solid #dcdfe6;
  227. border-right: 0;
  228. outline: 0;
  229. }
  230. .input-item .el-input__inner:focus {
  231. border: 1px solid #dcdfe6;
  232. border-right: 0;
  233. outline: 0;
  234. }
  235. .input-item .el-input-group__append {
  236. background-color: #fff;
  237. border-left: 0;
  238. width: 10%;
  239. padding: 0;
  240. }
  241. .input-item .el-input-group__append .el-button {
  242. padding: 0;
  243. }
  244. .input-item .el-input-group__append .el-button {
  245. margin: 0;
  246. }
  247. .batch {
  248. margin: 0 0 20px;
  249. display: inline-block;
  250. }
  251. .batch .el-button {
  252. padding: 9px 15px !important;
  253. }
  254. .item-box {
  255. margin-right: 20px;
  256. }
  257. .item-box .label {
  258. margin-right: 8px;
  259. }
  260. .el-table th>.cell {
  261. color: #333;
  262. font-weight: bold;
  263. font-size: 14px;
  264. }
  265. .el-table__footer-wrapper,
  266. .el-table__header-wrapper {
  267. border-bottom: 1.4px solid #D6D6D6;
  268. }
  269. </style>