index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <style>
  6. </style>
  7. <div id="app" v-cloak>
  8. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  9. <div slot="header">
  10. <span>业绩明细</span>
  11. <el-form size="small" :inline="true" :model="search" style="float: right;margin-top: -5px;">
  12. <el-form-item>
  13. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="search" @selected="confirmSubmit">
  14. </com-export-dialog>
  15. </el-form-item>
  16. </el-form>
  17. </div>
  18. <div class="table-body">
  19. <div class="input-item">
  20. <el-select size="small" v-model="search.level" @change='toSearch' class="select">
  21. <el-option key="all" label="全部等级" value=""></el-option>
  22. <el-option :key="index" :label="item.name" :value="item.level" v-for="(item, index) in agentLevelList"></el-option>
  23. </el-select>
  24. </div>
  25. <div class="input-item">
  26. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入订单编号" v-model="search.order_no" clearable @clear="toSearch">
  27. </el-input>
  28. </div>
  29. <div class="input-item">
  30. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入用户昵称/手机号搜索" v-model="search.keyword" clearable @clear="toSearch">
  31. </el-input>
  32. </div>
  33. <el-date-picker size="small" v-model="search.date" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="addTimeChange">
  34. </el-date-picker>
  35. <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
  36. <el-tabs v-model="activeName" @tab-click="handleClick">
  37. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" @selection-change="handleSelectionChange">
  38. <el-table-column align='center' type="selection"></el-table-column>
  39. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  40. <el-table-column label="用户昵称">
  41. <template slot-scope="scope">
  42. <div class="user_img" flex="cross:center">
  43. <el-image class="default-avatar" :src="scope.row.avatar_url">
  44. <div slot="error" class="image-slot">
  45. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  46. </div>
  47. </el-image>
  48. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  49. <div class="uer-nickname over1" v-else>ID:{{scope.row.user_id}}</div>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="商品名称">
  54. <template slot-scope="scope">
  55. <div class="user_img" flex="cross:center">
  56. <el-image class="default-avatar" :src="scope.row.pic_url">
  57. <div slot="error" class="image-slot">
  58. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  59. </div>
  60. </el-image>
  61. <div class="uer-nickname over1">{{scope.row.goods_name}}</div>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="订单号" prop="order_no" align="center">
  66. <template slot-scope="scope">
  67. <span style="display:block;">{{scope.row.order_no}}</span>
  68. <span class="tag-diff" v-if="scope.row.order_no && scope.row.order_no.indexOf('DYC') > -1">抖音cps订单</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="订单金额" prop="order_price" align="center">
  72. </el-table-column>
  73. <el-table-column label="订单状态" prop="order_status_text" align="center">
  74. </el-table-column>
  75. <el-table-column label="等级" prop="level" align="center">
  76. </el-table-column>
  77. <el-table-column label="等级名称" prop="level" align="center">
  78. <template slot-scope="scope">
  79. <el-tag size="small" type="info" v-if="scope.row.level == 0">默认等级</el-tag>
  80. <el-tag size="small" v-else>{{levelList[scope.row.level]}}</el-tag>
  81. </template>
  82. </el-table-column>
  83. </el-table-column>
  84. <el-table-column label="创建时间" align="center">
  85. <template slot-scope="scope">
  86. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  87. </template>
  88. </el-table-column>
  89. </el-table-column>
  90. </el-table>
  91. </el-tabs>
  92. <div flex="box:last cross:center">
  93. <div></div>
  94. <div>
  95. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize" style="display: inline-block;float: right;" background @current-change="pageChange" layout="prev, pager, next" :total="pagination.totalCount">
  96. </el-pagination>
  97. </div>
  98. </div>
  99. </div>
  100. </el-card>
  101. </div>
  102. <script>
  103. const app = new Vue({
  104. el: '#app',
  105. data: {
  106. search: {
  107. order_no: '',
  108. keyword: '',
  109. page: 1,
  110. level: '',
  111. date_start: '',
  112. date_end: '',
  113. date: []
  114. },
  115. loading: false,
  116. activeName: '-1',
  117. list: [],
  118. pagination: null,
  119. exportList: {},
  120. agentLevelList: [],
  121. levelList: {},
  122. choose_list: [],
  123. export_url: 'agent/detail/index', // 导出路径
  124. },
  125. mounted() {
  126. this.loadData();
  127. },
  128. methods: {
  129. addTimeChange(v) {
  130. this.search.date_start = v ? v[0] : '';
  131. this.search.date_end = v ? v[1] : '';
  132. },
  133. confirmSubmit() {
  134. console.log(this.activeName)
  135. this.search.status = this.activeName
  136. },
  137. loadData() {
  138. this.loading = true;
  139. let params = {
  140. r: 'agent/detail/index'
  141. };
  142. params = Object.assign(params, this.search);
  143. request({
  144. params: params,
  145. method: 'get',
  146. }).then(e => {
  147. this.loading = false;
  148. if (e.data.code == 0) {
  149. this.list = e.data.data.list;
  150. this.pagination = e.data.data.pagination;
  151. this.exportList = e.data.data.export_list;
  152. this.agentLevelList = e.data.data.agentLevelList;
  153. for (i in this.agentLevelList) {
  154. this.levelList[this.agentLevelList[i]['level']] = this.agentLevelList[i]['name'];
  155. }
  156. } else {
  157. this.$message.error(e.data.msg);
  158. }
  159. }).catch(e => {
  160. this.loading = false;
  161. });
  162. },
  163. pageChange(page) {
  164. this.search.page = page;
  165. this.loadData();
  166. },
  167. handleClick(tab, event) {
  168. this.search.page = 1;
  169. this.search.status = this.activeName;
  170. this.loadData()
  171. },
  172. toSearch() {
  173. this.search.page = 1;
  174. this.loadData();
  175. },
  176. editClick() {
  177. this.edit.show = true;
  178. },
  179. handleSelectionChange(val) {
  180. let self = this;
  181. self.choose_list = [];
  182. val.forEach(function(item) {
  183. self.choose_list.push(item.id);
  184. })
  185. },
  186. levelSuccess() {
  187. this.loadData();
  188. }
  189. }
  190. });
  191. </script>
  192. <style>
  193. .el-tabs__header {
  194. font-size: 16px;
  195. }
  196. .table-body {
  197. padding: 20px;
  198. background-color: #fff;
  199. }
  200. .table-body .el-button {
  201. border: 0;
  202. margin: 0 5px;
  203. }
  204. .input-item {
  205. width: 250px;
  206. margin: 0 0 20px;
  207. display: inline-block;
  208. }
  209. /*.input-item .el-input__inner {*/
  210. /* border-right: 0;*/
  211. /*}*/
  212. .input-item .el-input__inner:hover {
  213. border: 1px solid #dcdfe6;
  214. /*border-right: 0;*/
  215. outline: 0;
  216. }
  217. .input-item .el-input__inner:focus {
  218. border: 1px solid #dcdfe6;
  219. /*border-right: 0;*/
  220. outline: 0;
  221. }
  222. .input-item .el-input-group__append {
  223. background-color: #fff;
  224. border-left: 0;
  225. width: 10%;
  226. padding: 0;
  227. }
  228. .input-item .el-input-group__append .el-button {
  229. padding: 0;
  230. }
  231. .input-item .el-input-group__append .el-button {
  232. margin: 0;
  233. }
  234. .batch {
  235. margin: 0 0 20px;
  236. display: inline-block;
  237. }
  238. .batch .el-button {
  239. padding: 9px 15px !important;
  240. }
  241. .el-table th>.cell {
  242. color: #333;
  243. font-weight: bold;
  244. font-size: 14px;
  245. }
  246. .el-table__footer-wrapper,
  247. .el-table__header-wrapper {
  248. border-bottom: 1.4px solid #D6D6D6;
  249. }
  250. .el-table th>.cell {
  251. color: #333;
  252. font-weight: bold;
  253. font-size: 14px;
  254. }
  255. .table1 .el-table__footer-wrapper,
  256. .table1 .el-table__header-wrapper {
  257. border-bottom: 1.4px solid #D6D6D6;
  258. }
  259. .user_img {
  260. position: relative;
  261. margin-right: 8px;
  262. }
  263. .default-avatar {
  264. width: 50px;
  265. height: 50px;
  266. border-radius: 50%;
  267. margin-right: 8px;
  268. }
  269. .uer-nickname {
  270. flex: 1;
  271. }
  272. .tag-diff{
  273. display: inline-block;
  274. background-color: rgba(112, 182, 3, 1);
  275. color: #fff;
  276. border-radius: 42px;
  277. line-height: 22px;
  278. height: 22px;
  279. padding: 0 6px;
  280. }
  281. </style>