index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>支出统计</span>
  5. </div>
  6. <div class="table-body">
  7. <div class="stat_details">
  8. <div class="order_module" v-for="(item,index) in Total_Money" :key="item.type">
  9. <div class="oirder_modul_title">
  10. <div class="text">{{item.name}}</div>
  11. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  12. <i class="el-icon-question stat_icon"></i>
  13. </el-tooltip>
  14. </div>
  15. <div class="price">
  16. ¥{{item.value}}
  17. </div>
  18. </div>
  19. </div>
  20. <div>
  21. <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
  22. <div class="flex">
  23. <el-form-item label="">
  24. <el-input placeholder="请输入用户ID" v-model="search_data.user_id" clearable></el-input>
  25. </el-form-item>
  26. <el-form-item label="">
  27. <el-input placeholder="请输入用户昵称/手机号" v-model="search_data.user" clearable></el-input>
  28. </el-form-item>
  29. <el-form-item label="">
  30. <el-select v-model="search_data.is_store_admin" placeholder="是否小店店主">
  31. <el-option label="全部" value=""></el-option>
  32. <el-option label="是" value="1"></el-option>
  33. <el-option label="否" value="2"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="">
  37. <el-select v-model="search_data.level" placeholder="请选择身份等级">
  38. <el-option label="全部" value=""></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item>
  42. <el-button type="primary" @click="search">搜索</el-button>
  43. <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件</el-button>
  44. </el-form-item>
  45. </div>
  46. </el-form>
  47. </div>
  48. <el-table :data="list" stripe v-loading="listLoading" size="small" style="margin-bottom: 15px; width: 100%">
  49. <el-table-column prop="user_id" label="会员ID" align="center"></el-table-column>
  50. <el-table-column label="会员信息" width="200" prop="store_name">
  51. <template slot-scope="scope">
  52. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.user.avatar_url"></com-image>
  53. <div>{{scope.row.user.nickname}}</div>
  54. <div>{{scope.row.user.mobile}}</div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="is_store_admin" label="是否小店店主" align="center">
  58. <template scope="scope">
  59. <span v-if="scope.row.is_store_admin == 1">是</span>
  60. <span v-else>否</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="identity_info" label="身份等级" align="center"></el-table-column>
  64. <el-table-column label="小店收益" align="center">
  65. <template slot-scope="scope">
  66. <div>¥{{scope.row.store_money}}</div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="分享奖励" align="center">
  70. <template slot-scope="scope">
  71. <div>¥{{scope.row.share_money}}</div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column prop="promotion_money" label="推广奖励" align="center">
  75. <template slot-scope="scope">
  76. <div>¥{{scope.row.promotion_money}}</div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column prop="agent_money" label="代理奖励" align="center">
  80. <template slot-scope="scope">
  81. <div>¥{{scope.row.agent_money}}</div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="fans_money" label="锁定奖励" align="center">
  85. <template slot-scope="scope">
  86. <div>¥{{scope.row.fans_money}}</div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="pension_money" label="养老金" align="center">
  90. <template slot-scope="scope">
  91. <div>¥{{scope.row.pension_money}}</div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="pv_money" label="PV值" align="center">
  95. <template slot-scope="scope">
  96. <div>¥{{scope.row.pv_money}}</div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="操作" style="width: 180px;" fixed="right" align="center">
  100. <template slot-scope="scope">
  101. <template>
  102. <el-button type="text" size="small" @click="handle('detail',scope.row)">查看明细</el-button>
  103. </template>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <div style="text-align: right;margin: 20px 0;">
  108. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  109. </div>
  110. </div>
  111. </el-card>
  112. </div>
  113. <script>
  114. const app = new Vue({
  115. el: '#app',
  116. data() {
  117. return {
  118. search_data: {
  119. user_id:null,
  120. user:null,
  121. is_store_admin: null,
  122. level: null,
  123. },
  124. list: [],
  125. page: 1,
  126. pageCount: 0,
  127. listLoading: false,
  128. //金额统计
  129. Total_Money: {
  130. "store_money":{
  131. type: 'store_money',
  132. name: '小店收益',
  133. value: '0.00',
  134. prompt: '',
  135. },
  136. "share_money":{
  137. type: 'share_money',
  138. name: '分享奖励',
  139. value: '0.00',
  140. prompt: '',
  141. },
  142. "promotion_money":{
  143. type: 'promotion_money',
  144. name: '推广奖励',
  145. value: '0.00',
  146. prompt: '',
  147. },
  148. "agent_money":{
  149. type: 'agent_money',
  150. name: '代理奖励',
  151. value: '0.00',
  152. prompt: '',
  153. },
  154. "fans_money":{
  155. type: 'fans_money',
  156. name: '锁定奖励',
  157. value: '0.00',
  158. prompt: '',
  159. },
  160. "pension_money":{
  161. type: 'pension_money',
  162. name: '养老金',
  163. value: '0.00',
  164. prompt: '',
  165. },
  166. "pv_money":{
  167. type: 'pv_money',
  168. name: 'PV值',
  169. value: '0.00',
  170. prompt: '',
  171. },
  172. }
  173. };
  174. },
  175. mounted: function() {
  176. this.getList();
  177. },
  178. computed: {
  179. show_clear_search_btn: function() {
  180. return !isEmpty(this.search_data.user_id) || !isEmpty(this.search_data.user) ||
  181. !isEmpty(this.search_data.is_store_admin) || !isEmpty(this.search_data.level);
  182. }
  183. },
  184. methods: {
  185. getList() {
  186. let self = this;
  187. let basic_params = {
  188. r: 'happiness/store-expenses/index',
  189. page: self.page,
  190. };
  191. params = Object.assign(basic_params, this.search_data);
  192. if (self.listLoading === false) {
  193. self.listLoading = true;
  194. request({
  195. params: params,
  196. method: 'get',
  197. }).then(e => {
  198. self.listLoading = false;
  199. if (e.data.code === 0) {
  200. self.list = e.data.data.list;
  201. self.pageCount = e.data.data.page_count;
  202. //金额统计
  203. for (let field in this.Total_Money) {
  204. if (e.data.data.total_money[field]) {
  205. this.Total_Money[field]['value'] = e.data.data.total_money[field];
  206. } else {
  207. this.Total_Money[field]['value'] = '0.00';
  208. }
  209. }
  210. } else {
  211. self.$message.error(e.data.msg);
  212. }
  213. }).catch(e => {
  214. });
  215. }
  216. },
  217. pagination(currentPage) {
  218. let self = this;
  219. self.page = currentPage;
  220. self.getList();
  221. },
  222. search() {
  223. this.page = 1;
  224. this.getList();
  225. },
  226. clearSearch() {
  227. this.search_data.level = null;
  228. this.search_data.is_store_admin = null;
  229. this.search_data.user_id = null;
  230. this.search_data.user = null;
  231. this.getList();
  232. },
  233. handle(type, data = null) {
  234. let id = data ? parseInt(data.id) : '';
  235. let user_id = data ? parseInt(data.user_id) : '';
  236. switch (type) {
  237. // 详情
  238. case 'detail':
  239. let params = {
  240. r: 'happiness/store-expenses/detail'
  241. };
  242. if (user_id) params = Object.assign(params, {
  243. user_id: user_id
  244. });
  245. navigateTo(params);
  246. break;
  247. }
  248. },
  249. }
  250. })
  251. </script>
  252. <style>
  253. .flex {
  254. display: flex;
  255. align-items: center;
  256. }
  257. .stat_details{
  258. padding: 0 0 20px;
  259. display: flex;
  260. }
  261. .stat_details .order_module{
  262. flex: 1;
  263. background: #F2F2F2;
  264. margin: 0 5px;
  265. padding: 20px 25px;
  266. }
  267. .order_module{
  268. display: flex;
  269. flex-direction: column;
  270. }
  271. .order_module:last-child{
  272. margin-right: 0;
  273. }
  274. .order_module:first-child{
  275. margin-left: 0;
  276. }
  277. .price{
  278. font-size: 14px;
  279. flex: 1;
  280. word-break: break-all;
  281. }
  282. .oirder_modul_title{
  283. font-size: 12px;
  284. margin-bottom: 10px;
  285. display: flex;
  286. align-items: center;
  287. }
  288. .oirder_modul_title .text{
  289. margin-right: 10px;
  290. }
  291. .stat_icon{
  292. font-size: 19px;
  293. color: #BFBFBF;
  294. }
  295. </style>