income-log.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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.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.nickname">{{scope.row.nickname}}</div>
  103. <div>{{scope.row.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="discount_money" label="优惠金额" min-width="100" align="center"></el-table-column>
  110. <el-table-column prop="order_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="service_charge" label="服务费" min-width="100" align="center"></el-table-column>
  113. <el-table-column prop="amount_received" label="到账金额" min-width="100" align="center"></el-table-column>
  114. <el-table-column prop="is_settlement" label="状态" min-width="100" align="center">
  115. <template slot-scope="scope">
  116. <div v-if="scope.row.is_settlement == '1'">已结算</div>
  117. <div v-if="scope.row.is_settlement == '0'">未结算</div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="scope" min-width="150" label="创建时间" align="center">
  121. <template slot-scope="scope">
  122. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <!--工具条 批量操作和分页-->
  127. <div style="display: flex; margin-top: 20px;">
  128. <el-col :span="24" class="toolbar">
  129. <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
  130. </el-pagination>
  131. </el-col>
  132. </div>
  133. <!-- 上传图片弹窗 -->
  134. <el-dialog :visible.sync="picturevisible" width="30%" title="上传" center>
  135. <el-form @submit.native.prevent size="small" label-width="80px">
  136. <el-form-item label="上传图片" >
  137. <com-attachment v-model="ruleForm.voucher_img" :multiple="false" :max="1">
  138. <el-tooltip class="item" effect="dark" content="建议尺寸:750 * 300" placement="top">
  139. <el-button size="mini">选择图片</el-button>
  140. </el-tooltip>
  141. </com-attachment>
  142. </el-form-item>
  143. <el-form-item label="" v-if="ruleForm.voucher_img !== ''">
  144. <image :src="ruleForm.voucher_img" style="width:50px;height:50px"/>
  145. </el-form-item>
  146. </el-form>
  147. <span slot="footer" class="dialog-footer">
  148. <el-button @click="picturevisible = false" type="default" size="small">取消</el-button>
  149. <el-button type="primary" style="margin-bottom: 10px;" size="small"
  150. v-loading="listLoading"
  151. @click="editSave">保存</el-button>
  152. </span>
  153. </el-dialog>
  154. </el-card>
  155. </div>
  156. <script>
  157. const app = new Vue({
  158. el: '#app',
  159. data() {
  160. return {
  161. picturevisible:false,
  162. ruleForm:{
  163. voucher_img:'',
  164. store_commission_id :''
  165. },
  166. searchData: {
  167. keyword: '',
  168. user_id: '',
  169. order_no: '',
  170. is_settlement: '',
  171. },
  172. exportList: {},
  173. export_url: 'happiness/client/finance/income-log',
  174. status: 1,
  175. actionName: 'settlement',
  176. date: '',
  177. keyword: '',
  178. user_id: '',
  179. remark: '',
  180. capital_type: '',
  181. form: [],
  182. pageCount: 0,
  183. page: 1,
  184. pagination: null,
  185. listLoading: false,
  186. scoreFromTypeList: [],
  187. orderTotalArr: [{
  188. type: 'total_num',
  189. name: '用户总数',
  190. value: '0.00',
  191. prompt: '',
  192. }, {
  193. type: 'score_used',
  194. name: '订单总金额',
  195. value: '0.00',
  196. prompt: '已结算到账金额与未结算到账金额总和',
  197. }, {
  198. type: 'total_settled_amount',
  199. name: '已结算到账金额',
  200. value: '0.00',
  201. prompt: '',
  202. }, {
  203. type: 'unsettled_amount',
  204. name: '未结算到账金额',
  205. value: '0.00',
  206. prompt: '',
  207. }]
  208. };
  209. },
  210. methods: {
  211. editSave(){
  212. this.listLoading = true
  213. request({
  214. params: {
  215. r: 'happiness/client/store-commission-check/edit',
  216. },
  217. data:{
  218. ...this.ruleForm
  219. },
  220. method: 'post'
  221. }).then(e => {
  222. this.listLoading = false;
  223. if (e.data.code == 0) {
  224. this.$message.success(e.data.msg);
  225. this.ruleForm.voucher_img = ''
  226. this.getList();
  227. this.picturevisible = false
  228. } else {
  229. this.$message.error(e.data.msg);
  230. }
  231. // console.log(this.ruleForm);
  232. }).catch(e => {
  233. console.log(e);
  234. });
  235. },
  236. upload(row){
  237. this.ruleForm.store_commission_id = row.id
  238. this.picturevisible = true
  239. },
  240. exportConfirm() {
  241. this.search.status = this.status
  242. },
  243. pageChange(currentPage) {
  244. this.page = currentPage;
  245. this.getList();
  246. },
  247. search() {
  248. this.page = 1;
  249. if (this.date == null) {
  250. this.date = ''
  251. }
  252. this.getList();
  253. },
  254. selectDateTime(e) {
  255. this.searchData.date = e;
  256. this.page = 1;
  257. this.search();
  258. },
  259. getList() {
  260. let params = {
  261. r: 'happiness/client/finance/income-log',
  262. page: this.page,
  263. user_id: this.searchData.user_id,
  264. keyword: this.searchData.keyword,
  265. order_no: this.searchData.order_no,
  266. is_settlement: this.searchData.is_settlement,
  267. };
  268. request({
  269. params,
  270. }).then(e => {
  271. if (e.data.code === 0) {
  272. this.form = e.data.data.list;
  273. this.pagination = e.data.data.pagination;
  274. this.pageCount = e.data.data.page_count;
  275. this.orderTotalArr = e.data.data.order_total_arr;
  276. } else {
  277. this.$message.error(e.data.msg);
  278. }
  279. this.listLoading = false;
  280. }).catch(e => {
  281. this.listLoading = false;
  282. });
  283. this.listLoading = true;
  284. },
  285. change_tab(tab, event) {
  286. if (tab.name == 'settlement') {
  287. this.status = 1;
  288. } else {
  289. this.status = 0;
  290. }
  291. for (let i in this.searchData) {
  292. this.searchData[i] = '';
  293. }
  294. this.search();
  295. },
  296. exportData() {
  297. let self = this;
  298. self.listLoading = true;
  299. request({
  300. params: {
  301. r: 'mall/finance/score-log',
  302. date: this.searchData.date,
  303. user_id: this.searchData.user_id,
  304. keyword: this.searchData.keyword,
  305. desc: this.searchData.remark,
  306. capital_type: this.searchData.capital_type,
  307. status: this.status,
  308. flag: 'EXPORT'
  309. },
  310. }).then(e => {
  311. // console.log(e);return null;
  312. if (e.data.code == 0) {
  313. this.$message.success(e.data.msg);
  314. } else {
  315. this.$message.error(e.data.msg);
  316. }
  317. self.listLoading = false;
  318. }).catch(e => {
  319. self.listLoading = false;
  320. });
  321. }
  322. },
  323. mounted: function() {
  324. this.searchData.user_id = getQuery('user_id');
  325. this.getList();
  326. }
  327. });
  328. </script>
  329. <style>
  330. .table-body {
  331. padding: 20px;
  332. background-color: #fff;
  333. }
  334. .input-item {
  335. display: inline-block;
  336. width: 250px;
  337. margin: 0 0 20px 20px;
  338. }
  339. .input-item .el-input__inner:hover {
  340. border: 1px solid #dcdfe6;
  341. border-right: 0;
  342. outline: 0;
  343. }
  344. .input-item .el-input__inner:focus {
  345. border: 1px solid #dcdfe6;
  346. border-right: 0;
  347. outline: 0;
  348. }
  349. .input-item .el-input-group__append {
  350. background-color: #fff;
  351. border-left: 0;
  352. width: 10%;
  353. padding: 0;
  354. }
  355. /* .input-item .el-input-group__append .el-button {
  356. padding: 0;
  357. }
  358. .input-item .el-input-group__append .el-button {
  359. margin: 0;
  360. }
  361. .table-body .el-button {
  362. padding: 0!important;
  363. border: 0;
  364. margin: 0 5px;
  365. } */
  366. .el-table th>.cell {
  367. color: #333;
  368. font-weight: bold;
  369. font-size: 14px;
  370. }
  371. .el-table__footer-wrapper,
  372. .el-table__header-wrapper {
  373. border-bottom: 1.4px solid #D6D6D6;
  374. }
  375. .stat_details {
  376. padding-bottom: 30px;
  377. display: flex;
  378. }
  379. .order_module {
  380. flex: 1;
  381. background: #F2F2F2;
  382. margin: 0 5px;
  383. padding: 20px 25px;
  384. }
  385. .order_module:last-child {
  386. margin-right: 0;
  387. }
  388. .order_module:first-child {
  389. margin-left: 0;
  390. }
  391. .price {
  392. font-size: 22px;
  393. font-weight: bold;
  394. }
  395. .oirder_modul_title {
  396. font-size: 12px;
  397. margin-bottom: 10px;
  398. display: flex;
  399. align-items: center;
  400. }
  401. .oirder_modul_title .text {
  402. margin-right: 10px;
  403. }
  404. .stat_icon {
  405. font-size: 19px;
  406. color: #BFBFBF;
  407. }
  408. </style>