index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * Created by PhpStorm
  6. * Author: ganxiaohao
  7. * Date: 2020-05-13
  8. * Time: 14:21
  9. */
  10. use common\helpers\ComponentHelper;
  11. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  12. ?>
  13. <style>
  14. .order_stat{
  15. background: #FFF;
  16. padding: 10px 10px 0;
  17. margin-bottom: 10px;
  18. }
  19. .title{
  20. font-size: 18px;
  21. font-weight: bold;
  22. display: flex;
  23. align-items: center;
  24. height: 40px;
  25. }
  26. .order_stat > .title > .time{
  27. font-size: 13px;
  28. font-weight: 400;
  29. color: #BFBFBF;
  30. margin-left: 20px;
  31. flex: 1;
  32. }
  33. .order_stat .stat_details{
  34. padding: 30px 0;
  35. display: flex;
  36. }
  37. .default-avatar{
  38. width: 50px;
  39. height: 50px;
  40. border-radius: 50%;
  41. margin-right: 8px;
  42. }
  43. .uer-nickname {
  44. flex: 1;
  45. }
  46. .user_img{
  47. position: relative;
  48. margin-right: 8px;
  49. /* height: 50px;
  50. width: 50px; */
  51. }
  52. </style>
  53. <div id="app" v-cloak>
  54. <div class="order_stat">
  55. <div class="title">佣金明细</div>
  56. <div class="el-card is-never-shadow" style="border: 0px; min-width: 800px; margin-bottom: 10px;">
  57. </div>
  58. </div>
  59. <el-card shadow="never" style="border:0;min-width: 800px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  60. <div class="table-body">
  61. <div class="input-item">
  62. <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员id" v-model="searchData.user_id" clearable >
  63. </el-input>
  64. </div>
  65. <div class="input-item">
  66. <el-input @keyup.enter.native="search" size="small" placeholder="会员昵称/手机号" v-model="searchData.keyword" clearable>
  67. </el-input>
  68. </div>
  69. <!-- <el-select size="small" v-model="searchData.capital_type" @change='search' class="select">-->
  70. <!-- <el-option key="all" label="佣金类型" value=""></el-option>-->
  71. <!-- <el-option :key="index" :label="item" :value="index"-->
  72. <!-- v-for="(item, index) in incomeCapitalTypeList"></el-option>-->
  73. <!-- </el-select>-->
  74. <el-date-picker size="small" placeholder="选择日期" v-model="searchData.date" type="month" style="float: left" value-format="yyyy-MM" @change="selectDateTime" >
  75. </el-date-picker>
  76. <!-- <div class="input-item">
  77. <el-input @keyup.enter.native="search" size="small" placeholder="订单编号" v-model="order_num" clearable @clear="search">
  78. <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
  79. </el-input>
  80. </div> -->
  81. <div class="input-item">
  82. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  83. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>
  84. </div>
  85. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
  86. <el-table-column prop="user_id" label="会员ID" min-width="100" align="center"></el-table-column>
  87. <el-table-column label="会员" width="200">
  88. <template slot-scope="scope">
  89. <div class="table-info-img-text">
  90. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  91. <div slot="error" class="image-slot">
  92. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  93. </div>
  94. </el-image>
  95. <div class="table-info-text">
  96. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  97. <div>{{scope.row.mobile}}</div>
  98. </div>
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <!-- <el-table-column prop="orderDetail.order.order_no" label="订单号" min-width="200" align="center"></el-table-column> -->
  103. <!-- <el-table-column prop="source_text" label="佣金类型" min-width="200" align="center">-->
  104. <!-- <template slot-scope="scope">-->
  105. <!-- <div v-if="scope.row.source_text">{{scope.row.source_text}}</div>-->
  106. <!-- <div v-else-if="scope.row.source">{{scope.row.source}}</div>-->
  107. <!-- <div v-else>--</div>-->
  108. <!-- </template>-->
  109. <!-- </el-table-column>-->
  110. <el-table-column label="结算金额" min-width="150" align="center">
  111. <template slot-scope="scope">
  112. <div style="font-size: 18px;color: #68CF3D" v-if="scope.row.change_type == 'add'">+{{scope.row.change_num}}</div>
  113. <div style="font-size: 18px;color: #F6AA5A" v-if="scope.row.change_type == 'sub'">-{{scope.row.change_num}}</div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column prop="current_num" label="变动前佣金" min-width="150" align="center"></el-table-column>
  117. <el-table-column prop="current_num" label="变动后佣金" min-width="150" align="center">
  118. <template slot-scope="scope">
  119. <div v-if="scope.row.change_type == 'add'">{{Number((scope.row.current_num + scope.row.change_num)).toFixed(2)}}</div>
  120. <div v-if="scope.row.change_type == 'sub'">{{Number((scope.row.current_num - scope.row.change_num)).toFixed(2)}}</div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="desc" label="说明" min-width="300" align="center"></el-table-column>
  124. <el-table-column prop="scope" min-width="180" label="创建时间" align="center">
  125. <template slot-scope="scope">
  126. {{scope.row.created_at}}
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <!--工具条 批量操作和分页-->
  131. <el-col :span="24" class="toolbar">
  132. <el-pagination
  133. background
  134. layout="prev, pager, next"
  135. @current-change="pageChange"
  136. :page-size="pageSize"
  137. :total="pagination.totalCount"
  138. style="float:right;margin:15px"
  139. v-if="pagination">
  140. </el-pagination>
  141. </el-col>
  142. </div>
  143. </el-card>
  144. </div>
  145. <script>
  146. const app = new Vue({
  147. el: '#app',
  148. data() {
  149. return {
  150. actionName: 'settlement',
  151. status: 1,
  152. searchData: {
  153. keyword: '',
  154. date: '',
  155. user_id: '',
  156. // order_num: '',
  157. capital_type: '',
  158. },
  159. export_url: 'boss-three/commission/index',
  160. exportList:{},
  161. form: [],
  162. incomeFromTypeList:[],
  163. incomeCapitalTypeList:[],
  164. pagination: null,
  165. listLoading: false,
  166. orderTotalArr: [
  167. {
  168. type: 'commission_total',
  169. name: '总发放佣金',
  170. value: '0.00',
  171. prompt: '累计所有发放给会员的佣金(待结算+已结算)',
  172. },{
  173. type: 'frozen_capital_total',
  174. name: '待结算佣金',
  175. value: '0.00',
  176. prompt: '所有会员待结算的佣金',
  177. },
  178. // {
  179. // type: 'settled_commission_total',
  180. // name: '已结算佣金',
  181. // value: '0.00',
  182. // prompt: '所有会员已结算的佣金',
  183. // },
  184. {
  185. type: 'invalid_capital_total',
  186. name: '无效佣金',
  187. value: '0.00',
  188. prompt: '订单出现售后和取消订单并且订单未结算,会产生无效佣金不在结算给会员',
  189. }
  190. ],
  191. pageSize: 20,
  192. };
  193. },
  194. methods: {
  195. exportConfirm() {
  196. this.search.status = this.status
  197. },
  198. pageChange(currentPage) {
  199. this.page = currentPage;
  200. this.getList();
  201. },
  202. search() {
  203. this.page = 1;
  204. this.getList();
  205. },
  206. selectDateTime(e) {
  207. this.searchData.date = e;
  208. this.page = 1;
  209. this.search();
  210. },
  211. getList() {
  212. let params = {
  213. r: 'boss-three/commission/index',
  214. page: this.page,
  215. user_id: this.searchData.user_id,
  216. keyword: this.searchData.keyword,
  217. status: this.status,
  218. date: this.searchData.date,
  219. capital_type: this.searchData.capital_type,
  220. };
  221. request({
  222. params,
  223. }).then(e => {
  224. if (e.data.code === 0) {
  225. this.pageSize = e.data.data.page_size;
  226. this.form = e.data.data.list;
  227. this.pagination = e.data.data.pagination;
  228. this.incomeCapitalTypeList = e.data.data.incomeCapitalTypeList;
  229. //this.searchData.date = e.data.data.date;
  230. this.exportList = e.data.data.export_list;
  231. for (const key in e.data.data.statistics_data) {
  232. let info = this.orderTotalArr.filter(v => v.type == key); //订单概况
  233. if(info.length){
  234. let index = this.orderTotalArr.findIndex(v => v.type==info[0].type);
  235. this.orderTotalArr[index].value = Number(e.data.data.statistics_data[key]).toFixed(2);
  236. }
  237. }
  238. } else {
  239. if(e.data.msg == 'User Id必须是整数。'){
  240. e.data.msg = '会员id必须是整数';
  241. }
  242. this.$message.error(e.data.msg);
  243. }
  244. this.listLoading = false;
  245. }).catch(e => {
  246. this.listLoading = false;
  247. });
  248. this.listLoading = true;
  249. },
  250. // change_tab(tab, event) {
  251. // if (tab.name == 'settlement') {
  252. // this.status = 1;
  253. // } else {
  254. // this.status = 0;
  255. // }
  256. // for(let i in this.searchData) {
  257. // this.searchData[i] = '';
  258. // }
  259. // this.search();
  260. // },
  261. exportData(){
  262. let self = this;
  263. self.listLoading = true;
  264. request({
  265. params: {
  266. r: 'boss-three/commission/index',
  267. date: this.searchData.date,
  268. user_id: this.searchData.user_id,
  269. keyword: this.searchData.keyword,
  270. desc: this.searchData.remark,
  271. capital_type: this.searchData.capital_type,
  272. status: this.status,
  273. flag: 'EXPORT'
  274. },
  275. }).then(e => {
  276. // console.log(e);return null;
  277. if (e.data.code == 0) {
  278. this.$message.success(e.data.msg);
  279. } else {
  280. this.$message.error(e.data.msg);
  281. }
  282. self.listLoading = false;
  283. }).catch(e => {
  284. self.listLoading = false;
  285. });
  286. }
  287. },
  288. mounted: function() {
  289. this.user_id = getQuery('user_id');
  290. this.searchData.user_id = getQuery('user_id');
  291. this.getList();
  292. }
  293. });
  294. </script>
  295. <style>
  296. .table-body {
  297. padding: 20px;
  298. background-color: #fff;
  299. }
  300. .input-item {
  301. display: inline-block;
  302. width: 250px;
  303. margin: 0 0 20px 20px;
  304. }
  305. .input-item .el-input__inner:hover{
  306. border: 1px solid #dcdfe6;
  307. border-right: 0;
  308. outline: 0;
  309. }
  310. .input-item .el-input__inner:focus{
  311. border: 1px solid #dcdfe6;
  312. border-right: 0;
  313. outline: 0;
  314. }
  315. .input-item .el-input-group__append {
  316. background-color: #fff;
  317. border-left: 0;
  318. width: 10%;
  319. padding: 0;
  320. }
  321. /* .input-item .el-input-group__append .el-button {
  322. padding: 0;
  323. }
  324. .input-item .el-input-group__append .el-button {
  325. margin: 0;
  326. }
  327. .table-body .el-button {
  328. padding: 0!important;
  329. border: 0;
  330. margin: 0 5px;
  331. } */
  332. .el-table th>.cell{
  333. color: #333;
  334. font-weight: bold;
  335. font-size: 14px;
  336. }
  337. .el-table__footer-wrapper, .el-table__header-wrapper{
  338. border-bottom: 1.4px solid #D6D6D6;
  339. }
  340. .statistical ul {
  341. float: left;
  342. }
  343. .statistical ul li.ul-li {
  344. width: 33%;
  345. float: left;
  346. list-style-type :none;
  347. padding-bottom: 10px;
  348. }
  349. .stat_details{
  350. /* padding-bottom: 30px; */
  351. padding-top: 20px;
  352. display: flex;
  353. }
  354. .order_module{
  355. flex: 1;
  356. background: #F2F2F2;
  357. margin: 0 5px;
  358. padding: 20px 25px;
  359. }
  360. .order_module:last-child{
  361. margin-right: 0;
  362. }
  363. .order_module:first-child{
  364. margin-left: 0;
  365. }
  366. .price{
  367. font-size: 22px;
  368. font-weight: bold;
  369. }
  370. .oirder_modul_title{
  371. font-size: 12px;
  372. margin-bottom: 10px;
  373. display: flex;
  374. align-items: center;
  375. }
  376. .oirder_modul_title .text{
  377. margin-right: 10px;
  378. }
  379. .stat_icon{
  380. font-size: 19px;
  381. color: #BFBFBF;
  382. }
  383. </style>