index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <?php
  2. ?>
  3. <style>
  4. @media screen and (max-width: 1370px) {
  5. #stat_pay {
  6. min-width: 1131px;
  7. }
  8. }
  9. .order_stat {
  10. background: #FFF;
  11. padding: 10px 10px 0;
  12. margin-bottom: 10px;
  13. }
  14. .title {
  15. font-size: 18px;
  16. font-weight: bold;
  17. display: flex;
  18. align-items: center;
  19. height: 40px;
  20. }
  21. .order_stat>.title>.time {
  22. font-size: 13px;
  23. font-weight: 400;
  24. color: #BFBFBF;
  25. margin-left: 20px;
  26. flex: 1;
  27. }
  28. .order_stat .stat_details {
  29. padding: 10px 0;
  30. display: flex;
  31. }
  32. .stat_details .order_module {
  33. flex: 1;
  34. background: #F2F2F2;
  35. margin: 0 5px;
  36. padding: 20px 25px;
  37. }
  38. .order_module {
  39. display: flex;
  40. flex-direction: column;
  41. }
  42. .order_module:last-child {
  43. margin-right: 0;
  44. }
  45. .order_module:first-child {
  46. margin-left: 0;
  47. }
  48. .price {
  49. font-size: 22px;
  50. font-weight: bold;
  51. flex: 1;
  52. word-break: break-all;
  53. }
  54. .oirder_modul_title {
  55. font-size: 12px;
  56. margin: 10px 0;
  57. /* display: flex;
  58. align-items: center; */
  59. }
  60. .oirder_modul_title .text {
  61. margin-right: 10px;
  62. }
  63. .stat_icon {
  64. font-size: 19px;
  65. color: #BFBFBF;
  66. }
  67. .total {
  68. display: flex;
  69. margin-bottom: 10px;
  70. }
  71. .pay_total {
  72. flex: 1;
  73. flex-basis: 764px;
  74. background: #FFF;
  75. padding: 10px 10px 15px;
  76. }
  77. .pay_total:last-child {
  78. margin-left: 12px;
  79. }
  80. .el-date-editor .el-range-separator {
  81. padding: 0;
  82. }
  83. .pay_modules {
  84. margin-top: 20px;
  85. display: flex;
  86. flex-wrap: wrap;
  87. }
  88. .module {
  89. /* width: 350px; */
  90. width: 46%;
  91. background: #F7F7F7;
  92. padding: 20px 25px;
  93. margin-bottom: 15px;
  94. display: flex;
  95. }
  96. .module_two {
  97. width: 33%;
  98. background: #F7F7F7;
  99. padding: 20px 25px;
  100. margin-bottom: 15px;
  101. display: flex;
  102. }
  103. .module:nth-child(2n) {
  104. margin-left: 30px
  105. }
  106. .no_open {
  107. flex: 1;
  108. color: #2E8FF4;
  109. display: flex;
  110. align-items: center;
  111. justify-content: flex-end;
  112. }
  113. .pay_button {
  114. display: flex;
  115. border: 1px solid #2E8FF4;
  116. border-radius: 4px;
  117. color: #464646;
  118. }
  119. .pay_button div {
  120. background: #FFF;
  121. padding: 10px;
  122. font-size: 14px;
  123. font-weight: 500;
  124. width: 80px;
  125. height: 36px;
  126. border-radius: 4px;
  127. text-align: center;
  128. }
  129. .assets {
  130. color: #848484;
  131. }
  132. .data_chart {
  133. background: #FFF;
  134. padding: 10px 10px 15px;
  135. width: 100%;
  136. position: relative;
  137. /* display: flex; */
  138. }
  139. .data_chart_time {
  140. position: absolute;
  141. top: 10px;
  142. right: 50px;
  143. display: flex;
  144. font-size: 16px;
  145. }
  146. .sel_time {
  147. margin-right: 20px;
  148. padding-bottom: 5px;
  149. }
  150. .sel_time:hover {
  151. cursor: pointer
  152. }
  153. .sel_color {
  154. border-bottom: 2px solid #5ED9A9;
  155. }
  156. .top_title {
  157. display: flex;
  158. padding: 18px 0;
  159. background-color: white;
  160. margin: 10px 0;
  161. align-items: center;
  162. }
  163. .top_title div:nth-of-type(1) {
  164. padding: 0 30px 0 20px;
  165. font-weight: bold;
  166. font-size: 16px;
  167. }
  168. .div_text_center {
  169. text-align: center;
  170. }
  171. .table-body {
  172. padding: 20px;
  173. background-color: #fff;
  174. }
  175. .input-item {
  176. display: inline-block;
  177. width: 250px;
  178. margin: 0 0 20px 20px;
  179. }
  180. .input-item .el-input__inner {
  181. /* border-right: 0; */
  182. height: 32px;
  183. line-height: 32px;
  184. font-size: 12px;
  185. }
  186. .input-item .el-input__inner:hover {
  187. border: 1px solid #dcdfe6;
  188. /* border-right: 0; */
  189. /* outline: 0; */
  190. }
  191. .input-item .el-input__inner:focus {
  192. border: 1px solid #dcdfe6;
  193. /* border-right: 0; */
  194. /* outline: 0; */
  195. }
  196. .input-item .el-input-group__append {
  197. background-color: #fff;
  198. /* border-left: 0; */
  199. width: 10%;
  200. padding: 0;
  201. }
  202. .input-item .el-input-group__append .el-button {
  203. padding: 0;
  204. }
  205. .input-item .el-input-group__append .el-button {
  206. margin: 0;
  207. }
  208. .table-info-img {
  209. max-width: 50px !important;
  210. }
  211. .table-body .el-input__icon{
  212. line-height: 32px;
  213. }
  214. </style>
  215. <div id="stat_pay" v-cloak>
  216. <div class="top_title">
  217. <div>嗨值明细</div>
  218. </div>
  219. <div class="order_stat">
  220. <div class="stat_details">
  221. <div class="order_module" v-for="(item,index) in dataOverview" :key="item.type">
  222. <div class="price div_text_center">
  223. {{item.value}}
  224. </div>
  225. <div class="oirder_modul_title">
  226. <div class="div_text_center">{{item.name}}</div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <div class="table-body">
  232. <div class="input-item" v-if="!user_id">
  233. <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员ID" v-model="searchData.user_id" clearable @clear="search">
  234. </el-input>
  235. </div>
  236. <div class="input-item">
  237. <el-input @keyup.enter.native="search" size="small" placeholder="请输入昵称/手机号" v-model="searchData.keyword" clearable @clear="search">
  238. </el-input>
  239. </div>
  240. <div class="input-item">
  241. <el-input @keyup.enter.native="search" size="small" placeholder="备注" v-model="searchData.remark" clearable @clear="search">
  242. </el-input>
  243. </div>
  244. <div class="input-item">
  245. <template>
  246. <el-select v-model="searchData.change_type" placeholder="请选择类型" clearable @change="search" @clear="search">
  247. <el-option v-for="item in options" :key="item.name" :label="item.label" :value="item.name">
  248. </el-option>
  249. </el-select>
  250. </template>
  251. </div>
  252. <div class="input-item">
  253. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  254. </div>
  255. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
  256. <el-table-column prop="user_id" label="会员ID" min-width="100" align="center"></el-table-column>
  257. <el-table-column label="用户信息" min-width="180">
  258. <template slot-scope="scope">
  259. <div style="display:flex;align-items:center;">
  260. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  261. <div slot="error" class="image-slot">
  262. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  263. </div>
  264. </el-image>
  265. <div style="padding-left:8px;">
  266. <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  267. <div>{{scope.row.user.mobile}}</div>
  268. </div>
  269. </div>
  270. </template>
  271. </el-table-column>
  272. <el-table-column prop="from_type" label="业务类型">
  273. </el-table-column>
  274. <el-table-column prop="scope" label="收入/支出">
  275. <template slot-scope="scope">
  276. <div v-if="scope.row.change_type == 'add'">
  277. <span style="color:#5ED9A9">{{'+'+scope.row.change_num}}</span>
  278. </div>
  279. <div v-else>
  280. <span style="color:red">{{'-'+scope.row.change_num}}</span>
  281. </div>
  282. </template>
  283. </el-table-column>
  284. <el-table-column prop="before_num" label="变动前嗨值">
  285. </el-table-column>
  286. <el-table-column prop="after_num" label="变动后嗨值">
  287. </el-table-column>
  288. <el-table-column prop="desc" label="备注">
  289. </el-table-column>
  290. <el-table-column label="创建时间" align="center">
  291. <template slot-scope="scope">
  292. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  293. </template>
  294. </el-table-column>
  295. <el-table-column label="操作" width="250" align="center">
  296. <template slot-scope="scope">
  297. <el-button circle size="small" type="text" @click="recharge(scope.row.user_id)">充值</el-button>
  298. </template>
  299. </el-table-column>
  300. </el-table>
  301. <!--工具条 批量操作和分页-->
  302. <el-col :span="24" class="toolbar">
  303. <div style="height:20px;"></div>
  304. <el-pagination background layout="prev, pager, next" @current-change="pageChange" :page-count="pageCount" style="float:right;margin:15px">
  305. </el-col>
  306. </div>
  307. <el-dialog :title="'充值嗨值'" :visible.sync="dialogBalance" width="30%" @close="closePop" center>
  308. <el-form :model="balanceForm" label-width="100px" ref="integralForm">
  309. <el-form-item prop="price" size="small">
  310. <el-col :span="4">
  311. <label>嗨值数额</label>
  312. </el-col>
  313. <el-col :span="12">
  314. <el-input type="number" v-model="balanceForm.price" placeholder="请输入要加/减的嗨值(-1代表减1嗨值)"></el-input>
  315. </el-col>
  316. </el-form-item>
  317. <el-form-item prop="remark" size="small">
  318. <el-col :span="4">
  319. <label>备注</label>
  320. </el-col>
  321. <el-col :span="12">
  322. <el-input type="textarea" v-model="balanceForm.remark"></el-input>
  323. </el-col>
  324. </el-form-item>
  325. </el-form>
  326. <div slot="footer" class="dialog-footer">
  327. <el-button @click="dialogBalance = false" style="padding:8px 18px;font-size:13px;">取消</el-button>
  328. <el-button :loading="btnLoading" type="primary" style="padding:8px 16px;font-size:13px;" @click="balanceSubmit">确定</el-button>
  329. </div>
  330. </el-dialog>
  331. </div>
  332. <script>
  333. new Vue({
  334. el: '#stat_pay',
  335. data() {
  336. return {
  337. options: [{
  338. label: '增加',
  339. name: 'add'
  340. },
  341. {
  342. label: '减少',
  343. name: 'sub'
  344. },
  345. ],
  346. searchData: {
  347. keyword: '',
  348. user_id: null,
  349. remark: '',
  350. change_type: '',
  351. // date: '',
  352. start_date: '',
  353. end_at: '',
  354. },
  355. dialogBalance: false,
  356. btnLoading: false,
  357. balanceForm: {
  358. price: 0,
  359. remark: '',
  360. user_id: 0,
  361. wallet_type: 'hi_value'
  362. },
  363. listLoading: false,
  364. user_id: null, // 外部链接传递进来的 user_id
  365. pageCount: 0,
  366. form: [],
  367. update_order_time: '',
  368. order_time: [],
  369. buttonType: 1,
  370. user_total: null,
  371. order_total: null,
  372. dataOverview: {
  373. "total_send_hi_zhi": {
  374. type: 'total_send_hi_zhi',
  375. name: '总发放嗨值',
  376. value: '0.00',
  377. },
  378. "used": {
  379. type: 'used',
  380. name: '已使用',
  381. value: '0.00',
  382. },
  383. "unused": {
  384. type: 'unused',
  385. name: '未使用',
  386. value: '0.00',
  387. },
  388. },
  389. // 会员资产
  390. memberAssets: {},
  391. chartTimeType: 0,
  392. currencyInfo: [],
  393. chartTimeArr: [],
  394. paid_amount_arr: [],
  395. settle_income_arr: [],
  396. }
  397. },
  398. created() {
  399. },
  400. mounted: function() {
  401. this.getData();
  402. this.getList();
  403. },
  404. methods: {
  405. recharge(user_id) {
  406. this.dialogBalance = true;
  407. this.balanceForm.user_id = user_id;
  408. },
  409. closePop() {
  410. this.dialogBalance = false;
  411. this.btnLoading = false;
  412. this.balanceForm.price = 0;
  413. this.balanceForm.remark = '';
  414. this.balanceForm.user_id = 0;
  415. },
  416. balanceSubmit() {
  417. this.btnLoading = true;
  418. if (this.balanceForm.price == 0) {
  419. this.$message.error('充值金额不能为0');
  420. return;
  421. }
  422. request({
  423. params: {
  424. r: 'hi-go/hi-bei/recharge',
  425. },
  426. method: 'post',
  427. data: this.balanceForm
  428. }).then(e => {
  429. if (e.data.code == 0) {
  430. this.$message.success(e.data.msg);
  431. } else {
  432. this.$message.error(e.data.msg);
  433. }
  434. this.closePop()
  435. }).catch(e => {
  436. this.$message.error(e);
  437. this.closePop()
  438. })
  439. },
  440. pageChange(currentPage) {
  441. this.page = currentPage;
  442. this.getList();
  443. },
  444. search() {
  445. this.page = 1;
  446. this.getList();
  447. },
  448. getList() {
  449. let user_id = this.user_id ? this.user_id : this.searchData.user_id;
  450. let params = {
  451. r: 'hi-go/hi-value/index',
  452. page: this.page,
  453. date: this.date,
  454. user_id: user_id,
  455. keyword: this.searchData.keyword,
  456. remark: this.searchData.remark,
  457. type: this.searchData.change_type
  458. };
  459. if (this.searchData.date) {
  460. Object.assign(params, {
  461. start_time: this.searchData.date[0],
  462. end_time: this.searchData.date[1],
  463. });
  464. }
  465. request({
  466. params,
  467. }).then(e => {
  468. if (e.data.code === 0) {
  469. this.form = e.data.data.list;
  470. this.pagination = e.data.data.pagination;
  471. this.pageSize = e.data.data.page_size;
  472. this.pageCount = e.data.data.page_count;
  473. //订单概况
  474. for (let field in this.dataOverview) {
  475. if (e.data.data.orderStatistics[field]) {
  476. this.dataOverview[field]['value'] = e.data.data.orderStatistics[field];
  477. } else {
  478. this.dataOverview[field]['value'] = '0.00';
  479. }
  480. }
  481. console.log(this.pageCount);
  482. } else {
  483. this.$message.error(e.data.msg);
  484. }
  485. this.listLoading = false;
  486. }).catch(e => {
  487. this.listLoading = false;
  488. });
  489. this.listLoading = true;
  490. },
  491. getData() {
  492. let that = this;
  493. that.currencyInfo = [];
  494. //that.memberAssets = [];
  495. let date = {
  496. r: '/mall/finance/stat'
  497. }
  498. if (this.order_time) {
  499. // date.start_date = this.order_time[0];
  500. // date.end_date = this.order_time[1];
  501. date.order_time = this.order_time;
  502. }
  503. request({
  504. params: date,
  505. method: 'get',
  506. }).then(res => {
  507. if (res.data.code == 0) {
  508. that.update_order_time = res.data.data.update_time;
  509. that.order_time = res.data.data.date;
  510. //订单概况
  511. for (let field in this.orderTotalArr) {
  512. if (res.data.data.orderStatistics[field]) {
  513. this.orderTotalArr[field]['value'] = res.data.data.orderStatistics[field];
  514. } else {
  515. this.orderTotalArr[field]['value'] = '0.00';
  516. }
  517. }
  518. //支付统计
  519. that.rechargeArr = res.data.data.payment_data;
  520. }
  521. }).catch(e => {
  522. });
  523. },
  524. upButton(type) {
  525. if (this.butbuttonType == type) {
  526. return;
  527. }
  528. this.buttonType = type;
  529. this.memberAssets = [];
  530. if (type == 2) {
  531. this.memberAssets.push(...this.currencyInfo);
  532. } else {
  533. }
  534. },
  535. updateOrderTime(v) {
  536. this.order_time = v;
  537. this.getData();
  538. },
  539. }
  540. })
  541. </script>