income-log.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <?php
  2. /**
  3. * @link:http://www.gdqijianshi.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="stat_details">
  57. <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
  58. <div class="oirder_modul_title">
  59. <div class="text">{{item.name}}</div>
  60. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  61. <i class="el-icon-question stat_icon"></i>
  62. </el-tooltip>
  63. </div>
  64. <div class="price">
  65. {{item.value}}
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <el-card shadow="never" style="border:0;min-width: 800px;">
  71. <div class="input-item">
  72. <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员id" v-model="searchData.user_id" clearable>
  73. </el-input>
  74. </div>
  75. <div class="input-item">
  76. <el-input @keyup.enter.native="search" size="small" placeholder="会员昵称/手机号" v-model="searchData.keyword" clearable >
  77. </el-input>
  78. </div>
  79. <div class="input-item">
  80. <el-input @keyup.enter.native="search" size="small" placeholder="订单编号" v-model="searchData.order_no" clearable >
  81. </el-input>
  82. </div>
  83. <el-select size="small" v-model="searchData.is_settlement" @change='search' class="select">
  84. <el-option label="已结算" value="1"></el-option>
  85. <el-option label="未结算" value="0"></el-option>
  86. </el-select>
  87. <div class="input-item">
  88. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  89. <!-- <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>-->
  90. </div>
  91. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
  92. <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
  93. <el-table-column label="会员" width="200">
  94. <template slot-scope="scope">
  95. <div class="table-info-img-text">
  96. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  97. <div slot="error" class="image-slot">
  98. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  99. </div>
  100. </el-image>
  101. <div class="table-info-text">
  102. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  103. <div>{{scope.row.user.mobile}}</div>
  104. </div>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="order_no" label="订单编号" min-width="220" align="center"></el-table-column>
  109. <el-table-column prop="order_money" label="订单金额" min-width="100" align="center"></el-table-column>
  110. <el-table-column prop="discount_money" label="优惠金额" min-width="100" align="center"></el-table-column>
  111. <el-table-column prop="pay_money" label="支付金额" min-width="100" align="center"></el-table-column>
  112. <el-table-column prop="addons_bonus" label="插件(佣金)分红" min-width="100" align="center"></el-table-column>
  113. <el-table-column prop="service_charge" label="服务费" min-width="100" align="center"></el-table-column>
  114. <el-table-column prop="amount_received" label="到账金额" min-width="100" align="center"></el-table-column>
  115. <el-table-column prop="is_settlement" label="状态" min-width="150" align="center">
  116. <template slot-scope="scope">
  117. <div v-if="scope.row.is_settlement == '1'">已结算</div>
  118. <div v-if="scope.row.is_settlement == '0'">未结算</div>
  119. </template>
  120. </el-table-column>
  121. <!-- <el-table-column prop="type" label="类型" min-width="150" align="center">-->
  122. <!-- <template slot-scope="scope">-->
  123. <!-- <div v-if="scope.row.type == '1'">非收银台订单</div>-->
  124. <!-- <div v-if="scope.row.type == '2'">收银台订单</div>-->
  125. <!-- </template>-->
  126. <!-- </el-table-column>-->
  127. <el-table-column prop="scope" min-width="180" label="创建时间" align="center">
  128. <template slot-scope="scope">
  129. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <!--工具条 批量操作和分页-->
  134. <el-col :span="24" class="toolbar">
  135. <el-pagination v-if="pagination"
  136. style="display: inline-block;float: right;" background @current-change="pageChange"
  137. layout="prev, pager, next" :page-count="pageCount">
  138. </el-pagination>
  139. </el-col>
  140. </el-card>
  141. </div>
  142. <script>
  143. const app = new Vue({
  144. el: '#app',
  145. data() {
  146. return {
  147. searchData: {
  148. keyword: '',
  149. user_id: '',
  150. order_no: '',
  151. is_settlement: '',
  152. },
  153. exportList:{},
  154. export_url: 'mch/client/finance/income-log',
  155. status: 1,
  156. actionName: 'settlement',
  157. date: '',
  158. keyword: '',
  159. user_id: '',
  160. remark: '',
  161. capital_type: '',
  162. form: [],
  163. pageCount: 0,
  164. pagination: null,
  165. listLoading: false,
  166. scoreFromTypeList:[],
  167. orderTotalArr: [
  168. {
  169. type: 'total_num',
  170. name: '总数',
  171. value: '0.00',
  172. prompt: '',
  173. },{
  174. type: 'score_used',
  175. name: '订单总金额',
  176. value: '0.00',
  177. prompt: '',
  178. },{
  179. type: 'total_settled_amount',
  180. name: '提成已结算总金额',
  181. value: '0.00',
  182. prompt: '',
  183. },{
  184. type: 'unsettled_amount',
  185. name: '提成未结算总金额',
  186. value: '0.00',
  187. prompt: '',
  188. }
  189. ]
  190. };
  191. },
  192. methods: {
  193. exportConfirm() {
  194. this.search.status = this.status
  195. },
  196. pageChange(currentPage) {
  197. this.page = currentPage;
  198. this.getList();
  199. },
  200. search() {
  201. this.page = 1;
  202. if (this.date == null) {
  203. this.date = ''
  204. }
  205. this.getList();
  206. },
  207. selectDateTime(e) {
  208. this.searchData.date = e;
  209. this.page = 1;
  210. this.search();
  211. },
  212. getList() {
  213. let params = {
  214. r: 'mch/client/finance/income-log',
  215. page: this.page,
  216. user_id: this.searchData.user_id,
  217. keyword: this.searchData.keyword,
  218. order_no: this.searchData.order_no,
  219. is_settlement: this.searchData.is_settlement,
  220. };
  221. request({
  222. params,
  223. }).then(e => {
  224. if (e.data.code === 0) {
  225. this.form = e.data.data.list;
  226. this.pagination = e.data.data.pagination;
  227. this.pageCount = e.data.data.page_count;
  228. this.orderTotalArr = e.data.data.order_total_arr;
  229. } else {
  230. this.$message.error(e.data.msg);
  231. }
  232. this.listLoading = false;
  233. }).catch(e => {
  234. this.listLoading = false;
  235. });
  236. this.listLoading = true;
  237. },
  238. change_tab(tab, event) {
  239. if (tab.name == 'settlement') {
  240. this.status = 1;
  241. } else {
  242. this.status = 0;
  243. }
  244. for(let i in this.searchData) {
  245. this.searchData[i] = '';
  246. }
  247. this.search();
  248. },
  249. exportData(){
  250. let self = this;
  251. self.listLoading = true;
  252. request({
  253. params: {
  254. r: 'mall/finance/score-log',
  255. date: this.searchData.date,
  256. user_id: this.searchData.user_id,
  257. keyword: this.searchData.keyword,
  258. desc: this.searchData.remark,
  259. capital_type: this.searchData.capital_type,
  260. status: this.status,
  261. flag: 'EXPORT'
  262. },
  263. }).then(e => {
  264. // console.log(e);return null;
  265. if (e.data.code == 0) {
  266. this.$message.success(e.data.msg);
  267. } else {
  268. this.$message.error(e.data.msg);
  269. }
  270. self.listLoading = false;
  271. }).catch(e => {
  272. self.listLoading = false;
  273. });
  274. }
  275. },
  276. mounted: function() {
  277. this.searchData.user_id = getQuery('user_id');
  278. this.getList();
  279. }
  280. });
  281. </script>
  282. <style>
  283. .table-body {
  284. padding: 20px;
  285. background-color: #fff;
  286. }
  287. .input-item {
  288. display: inline-block;
  289. width: 250px;
  290. margin: 0 0 20px 20px;
  291. }
  292. .input-item .el-input__inner:hover{
  293. border: 1px solid #dcdfe6;
  294. border-right: 0;
  295. outline: 0;
  296. }
  297. .input-item .el-input__inner:focus{
  298. border: 1px solid #dcdfe6;
  299. border-right: 0;
  300. outline: 0;
  301. }
  302. .input-item .el-input-group__append {
  303. background-color: #fff;
  304. border-left: 0;
  305. width: 10%;
  306. padding: 0;
  307. }
  308. /* .input-item .el-input-group__append .el-button {
  309. padding: 0;
  310. }
  311. .input-item .el-input-group__append .el-button {
  312. margin: 0;
  313. }
  314. .table-body .el-button {
  315. padding: 0!important;
  316. border: 0;
  317. margin: 0 5px;
  318. } */
  319. .el-table th>.cell{
  320. color: #333;
  321. font-weight: bold;
  322. font-size: 14px;
  323. }
  324. .el-table__footer-wrapper, .el-table__header-wrapper{
  325. border-bottom: 1.4px solid #D6D6D6;
  326. }
  327. .stat_details{
  328. padding-bottom: 30px;
  329. display: flex;
  330. }
  331. .order_module{
  332. flex: 1;
  333. background: #F2F2F2;
  334. margin: 0 5px;
  335. padding: 20px 25px;
  336. }
  337. .order_module:last-child{
  338. margin-right: 0;
  339. }
  340. .order_module:first-child{
  341. margin-left: 0;
  342. }
  343. .price{
  344. font-size: 22px;
  345. font-weight: bold;
  346. }
  347. .oirder_modul_title{
  348. font-size: 12px;
  349. margin-bottom: 10px;
  350. display: flex;
  351. align-items: center;
  352. }
  353. .oirder_modul_title .text{
  354. margin-right: 10px;
  355. }
  356. .stat_icon{
  357. font-size: 19px;
  358. color: #BFBFBF;
  359. }
  360. </style>