income-log.php 16 KB

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