income-list.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1500px;" 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="input-item">
  8. <el-input @keyup.enter.native="loadData" size="small" placeholder="订单编号" v-model="search.keyword"
  9. clearable @clear="toSearch">
  10. </el-input>
  11. </div>
  12. <div class="input-item">
  13. <el-input @keyup.enter.native="loadData" size="small" placeholder="会员信息" v-model="search.keyword2"
  14. clearable @clear="toSearch">
  15. </el-input>
  16. </div>
  17. <div class="input-item">
  18. <el-input @keyup.enter.native="loadData" size="small" placeholder="门店名称" v-model="search.keyword3"
  19. clearable @clear="toSearch">
  20. </el-input>
  21. </div>
  22. <el-select size="small" v-model="search.type" @change='toSearch' class="select" placeholder="请选择">
  23. <el-option :key="item.value" :label="item.label" :value="item.value"
  24. v-for="(item, index) in incomeCapitalTypeList"></el-option>
  25. </el-select>
  26. <el-date-picker
  27. style="margin-right: 20px;"
  28. size="small"
  29. v-model="selectData"
  30. type="daterange"
  31. value-format="yyyy-MM-dd"
  32. range-separator="至"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期">
  35. </el-date-picker>
  36. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  37. <el-tabs v-model="activeName" @tab-click="handleClick">
  38. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  39. @selection-change="handleSelectionChange">
  40. <el-table-column prop="id" label="编码" align="center"></el-table-column>
  41. <el-table-column label="消费者信息" >
  42. <template slot-scope="scope">
  43. <div class="user_img" flex="cross:center">
  44. <el-image class="default-avatar" :src="scope.row.avatar_url">
  45. <div slot="error" class="image-slot">
  46. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  47. </div>
  48. </el-image>
  49. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  50. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="奖励用户" >
  55. <template slot-scope="scope">
  56. <div class="user_img" flex="cross:center">
  57. <el-image class="default-avatar" :src="scope.row.reward_avatar_url">
  58. <div slot="error" class="image-slot">
  59. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  60. </div>
  61. </el-image>
  62. <div class="uer-nickname over1" v-if="scope.row.reward_nickname">{{scope.row.reward_nickname}}</div>
  63. <div class="uer-nickname over1" v-else >ID:{{scope.row.reward_user_id}}</div>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="门店名称" prop="mobile" align="center" >
  68. <template slot-scope="scope">
  69. <div>{{scope.row.store_name}}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="商品名称" prop="mobile" align="center" >
  73. <template slot-scope="scope">
  74. <div>{{scope.row.goods_name}}</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="订单编号" prop="mobile" align="center" >
  78. <template slot-scope="scope">
  79. <div>{{scope.row.order_no}}</div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="订单金额" prop="mobile" align="center" >
  83. <template slot-scope="scope">
  84. <div>{{scope.row.order_money}}</div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="折扣金额" prop="mobile" align="center" >
  88. <template slot-scope="scope">
  89. <div>{{scope.row.discount_money}}</div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="佣金金额" prop="mobile" align="center" >
  93. <template slot-scope="scope">
  94. <div>{{scope.row.reward_money}}</div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="结算状态" prop="mobile" align="center" >
  98. <template slot-scope="scope">
  99. <div>{{scope.row.desc}}</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="创建时间" align="center">
  103. <template slot-scope="scope">
  104. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. </el-tabs>
  109. <div flex="box:last cross:center">
  110. <div></div>
  111. <div>
  112. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  113. style="display: inline-block;float: right;" background @current-change="pageChange"
  114. layout="prev, pager, next" :total="pagination.totalCount">
  115. </el-pagination>
  116. </div>
  117. </div>
  118. </div>
  119. </el-card>
  120. </div>
  121. <script>
  122. const app = new Vue({
  123. el: '#app',
  124. data: {
  125. avatar: '',
  126. nickname: '',
  127. search: {
  128. keyword: '',
  129. keyword2:'',
  130. page: 1,
  131. start:'',
  132. end:'',
  133. type:'',
  134. },
  135. loading: false,
  136. activeName: '-1',
  137. list: [],
  138. pagination: null,
  139. dialogChild: false,
  140. dialogLoading: false,
  141. dialogContent: false,
  142. remarksForm: {
  143. remarks: '',
  144. user_id: '',
  145. id: '',
  146. },
  147. remarksLoading: false,
  148. exportList: {},
  149. userEdit: {
  150. show: false,
  151. },
  152. level: {
  153. show: false,
  154. agent: null,
  155. },
  156. commission_arr: {},
  157. agentLevelList: [],
  158. levelList: {},
  159. choose_list: [],
  160. sort: 0,
  161. sort_id: 0,
  162. incomeCapitalTypeList:[
  163. {
  164. value:1,
  165. label:'已结算',
  166. },
  167. {
  168. value:2,
  169. label:'待结算',
  170. },
  171. ],
  172. selectData:'',
  173. },
  174. mounted() {
  175. this.loadData();
  176. },
  177. methods: {
  178. loadData() {
  179. this.loading = true;
  180. let params = {
  181. r: 'members-card/default/income-list'
  182. };
  183. params = Object.assign(params, this.search);
  184. request({
  185. params: params,
  186. method: 'get',
  187. }).then(e => {
  188. this.loading = false;
  189. if (e.data.code == 0) {
  190. this.list = e.data.data.list;
  191. this.pagination = e.data.data.pagination;
  192. } else {
  193. this.$message.error(e.data.msg);
  194. }
  195. }).catch(e => {
  196. this.loading = false;
  197. });
  198. },
  199. pageChange(page) {
  200. this.search.page = page;
  201. this.loadData();
  202. },
  203. handleClick(tab, event) {
  204. this.search.page = 1;
  205. this.search.status = this.activeName;
  206. this.loadData()
  207. },
  208. toSearch() {
  209. if(this.selectData && this.selectData[0]){
  210. this.search.start = this.selectData[0];
  211. this.search.end = this.selectData[1];
  212. }else{
  213. this.search.start = '';
  214. this.search.end = '';
  215. }
  216. this.search.page = 1;
  217. this.loadData();
  218. },
  219. switchFun(event,id){
  220. console.log(event);
  221. this.listLoading = true;
  222. request({
  223. params: {
  224. r: 'members-card/default/update-status'
  225. },
  226. method: 'post',
  227. data:{
  228. id:id,
  229. is_enable:event,
  230. }
  231. }).then(e => {
  232. this.listLoading = false;
  233. if (e.data.code == 0) {
  234. this.$message.success('更改状态成功');
  235. } else {
  236. this.$message.error(e.data.msg);
  237. }
  238. this.loadData();
  239. }).catch(e => {
  240. this.$message.error(e.data.msg);
  241. this.listLoading = false;
  242. this.loadData();
  243. });
  244. },
  245. // 跳转编辑页
  246. edit(id) {
  247. id = parseInt(id);
  248. let params = {
  249. r: 'members-card/default/edit',
  250. };
  251. if (id) params = Object.assign(params, {
  252. id: id
  253. });
  254. navigateTo(params);
  255. },
  256. operate(type, data = null) {
  257. let param = { id: data.id, type: type };
  258. switch (type) {
  259. case 'destroy':
  260. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  261. type: 'warning'
  262. }).then(() => {
  263. this.send(param)
  264. })
  265. break;
  266. }
  267. },
  268. send(params) {
  269. let self = this;
  270. request({
  271. params: {
  272. r: 'members-card/default/label',
  273. },
  274. method: 'post',
  275. data: params
  276. }).then(e => {
  277. if (e.data.code == 0) {
  278. self.$message.success(e.data.msg);
  279. self.loadData();
  280. } else {
  281. self.$message.error(e.data.msg);
  282. }
  283. }).catch(e => {
  284. console.log(e);
  285. });
  286. }
  287. }
  288. });
  289. </script>
  290. <style>
  291. .el-tabs__header {
  292. font-size: 16px;
  293. }
  294. .table-body {
  295. padding: 20px;
  296. background-color: #fff;
  297. }
  298. .table-body .el-button {
  299. padding: 0 !important;
  300. border: 0;
  301. margin: 0 5px;
  302. }
  303. .input-item {
  304. width: 250px;
  305. margin: 0 0 20px;
  306. display: inline-block;
  307. }
  308. /*.input-item .el-input__inner {*/
  309. /* border-right: 0;*/
  310. /*}*/
  311. .input-item .el-input__inner:hover {
  312. border: 1px solid #dcdfe6;
  313. /*border-right: 0;*/
  314. outline: 0;
  315. }
  316. .input-item .el-input__inner:focus {
  317. border: 1px solid #dcdfe6;
  318. /*border-right: 0;*/
  319. outline: 0;
  320. }
  321. .input-item .el-input-group__append {
  322. background-color: #fff;
  323. border-left: 0;
  324. width: 10%;
  325. padding: 0;
  326. }
  327. .input-item .el-input-group__append .el-button {
  328. padding: 0;
  329. }
  330. .input-item .el-input-group__append .el-button {
  331. margin: 0;
  332. }
  333. .batch {
  334. margin: 0 0 20px;
  335. display: inline-block;
  336. }
  337. .batch .el-button {
  338. padding: 9px 15px !important;
  339. }
  340. .el-table th>.cell{
  341. color: #333;
  342. font-weight: bold;
  343. font-size: 14px;
  344. }
  345. .el-table__footer-wrapper, .el-table__header-wrapper{
  346. border-bottom: 1.4px solid #D6D6D6;
  347. }
  348. .el-table th>.cell {
  349. color: #333;
  350. font-weight: bold;
  351. font-size: 14px;
  352. }
  353. .table1 .el-table__footer-wrapper,
  354. .table1 .el-table__header-wrapper {
  355. border-bottom: 1.4px solid #D6D6D6;
  356. }
  357. .user_img{
  358. position: relative;
  359. margin-right: 8px;
  360. /* height: 50px;
  361. width: 50px; */
  362. }
  363. .default-avatar{
  364. width: 50px;
  365. height: 50px;
  366. border-radius: 50%;
  367. margin-right: 8px;
  368. }
  369. .uer-nickname {
  370. flex: 1;
  371. }
  372. </style>