index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  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: 8px 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. .stat_chart {
  157. height: 500px;
  158. /* width: 82rem; */
  159. width: 90%;
  160. }
  161. .top_title {
  162. display: flex;
  163. padding: 18px 0;
  164. background-color: white;
  165. margin: 10px 0;
  166. align-items: center;
  167. }
  168. .top_title div:nth-of-type(1) {
  169. padding: 0 30px 0 20px;
  170. font-weight: bold;
  171. font-size: 16px;
  172. }
  173. .div_text_center {
  174. text-align: center;
  175. }
  176. .table-body {
  177. padding: 20px;
  178. background-color: #fff;
  179. }
  180. .input-item {
  181. display: inline-block;
  182. width: 250px;
  183. margin: 0 0 20px 20px;
  184. }
  185. .input-item .el-input__inner {
  186. border-right: 0;
  187. }
  188. .input-item .el-input__inner:hover {
  189. border: 1px solid #dcdfe6;
  190. border-right: 0;
  191. outline: 0;
  192. }
  193. .input-item .el-input__inner:focus {
  194. border: 1px solid #dcdfe6;
  195. border-right: 0;
  196. outline: 0;
  197. }
  198. .input-item .el-input-group__append {
  199. background-color: #fff;
  200. border-left: 0;
  201. width: 10%;
  202. padding: 0;
  203. }
  204. .input-item .el-input-group__append .el-button {
  205. padding: 0;
  206. }
  207. .input-item .el-input-group__append .el-button {
  208. margin: 0;
  209. }
  210. </style>
  211. <div id="stat_pay" v-cloak>
  212. <div class="top_title">
  213. <div>商家让利明细</div>
  214. </div>
  215. <div class="order_stat">
  216. <div class="stat_details">
  217. <div class="order_module" v-for="(item,index) in dataOverview" :key="item.type">
  218. <div class="price div_text_center">
  219. {{item.value}}
  220. </div>
  221. <div class="oirder_modul_title">
  222. <div class="div_text_center">{{item.name}}</div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. <div class="table-body">
  228. <div class="input-item" v-if="!user_id">
  229. <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员ID" v-model="searchData.user_id" clearable @clear="search">
  230. <el-button slot="append" @click="search"></el-button>
  231. </el-input>
  232. </div>
  233. <div class="input-item">
  234. <el-input @keyup.enter.native="search" size="small" placeholder="请输入昵称/手机号" v-model="searchData.keyword" clearable @clear="search">
  235. <el-button slot="append" @click="search"></el-button>
  236. </el-input>
  237. </div>
  238. <div class="input-item">
  239. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  240. </div>
  241. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
  242. <el-table-column prop="id" label="ID" min-width="100" align="center"></el-table-column>
  243. <el-table-column label="商家名称" prop="mch_name" min-width="180">
  244. </el-table-column>
  245. <el-table-column label="用户信息" min-width="180">
  246. <template slot-scope="scope">
  247. <div class="table-info-img-text">
  248. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  249. <div slot="error" class="image-slot">
  250. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  251. </div>
  252. </el-image>
  253. <div class="table-info-text">
  254. <div class="over2" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  255. <div>{{scope.row.mobile}}</div>
  256. </div>
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="goods_name" label="商品名称">
  261. </el-table-column>
  262. <el-table-column prop="price" label="商品价格">
  263. </el-table-column>
  264. <el-table-column prop="order_no" label="订单编号">
  265. </el-table-column>
  266. <el-table-column prop="profit_price" label="让利总额">
  267. </el-table-column>
  268. <el-table-column prop="profit" label="扣除嗨贝">
  269. </el-table-column>
  270. <el-table-column prop="desc" label="说明">
  271. </el-table-column>
  272. <el-table-column label="创建时间" align="center">
  273. <template slot-scope="scope">
  274. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  275. </template>
  276. </el-table-column>
  277. </el-table>
  278. <!--工具条 批量操作和分页-->
  279. <el-col :span="24" class="toolbar">
  280. <div style="height:20px;"></div>
  281. <el-pagination background layout="prev, pager, next" @current-change="pageChange" :page-count="pageCount" style="float:right;margin:15px">
  282. </el-col>
  283. </div>
  284. </div>
  285. <script>
  286. new Vue({
  287. el: '#stat_pay',
  288. data() {
  289. return {
  290. searchData: {
  291. keyword: '',
  292. user_id: null,
  293. // date: '',
  294. // start_date: '',
  295. // end_at: '',
  296. },
  297. listLoading: false,
  298. user_id: null, // 外部链接传递进来的 user_id
  299. pageCount: 0,
  300. form: [],
  301. update_order_time: '',
  302. order_time: [],
  303. buttonType: 1,
  304. user_total: null,
  305. order_total: null,
  306. dataOverview: {
  307. "total_send_hi_bei": {
  308. type: 'total_send_hi_bei',
  309. name: '总发放嗨贝',
  310. value: '0.00',
  311. },
  312. "total_profit": {
  313. type: 'total_profit',
  314. name: '让利总额',
  315. value: '0.00',
  316. },
  317. "total_deduct_hi_bei": {
  318. type: 'total_deduct_hi_bei',
  319. name: '扣除嗨贝总额',
  320. value: '0.00',
  321. },
  322. },
  323. // 会员资产
  324. memberAssets: {},
  325. chartTimeType: 0,
  326. currencyInfo: [],
  327. chartTimeArr: [],
  328. paid_amount_arr: [],
  329. settle_income_arr: [],
  330. }
  331. },
  332. created() {
  333. this.getList();
  334. },
  335. methods: {
  336. pageChange(currentPage) {
  337. this.page = currentPage;
  338. this.getList();
  339. },
  340. search() {
  341. this.page = 1;
  342. this.getList();
  343. },
  344. getList() {
  345. let user_id = this.user_id ? this.user_id : this.searchData.user_id;
  346. let params = {
  347. r: 'hi-go/merchant/index',
  348. page: this.page,
  349. date: this.date,
  350. user_id: user_id,
  351. keyword: this.searchData.keyword,
  352. };
  353. if (this.searchData.date) {
  354. Object.assign(params, {
  355. start_time: this.searchData.date[0],
  356. end_time: this.searchData.date[1],
  357. });
  358. }
  359. request({
  360. params,
  361. }).then(e => {
  362. if (e.data.code === 0) {
  363. this.form = e.data.data.list;
  364. this.pagination = e.data.data.pagination;
  365. this.pageSize = e.data.data.page_size;
  366. this.pageCount = e.data.data.page_count
  367. //订单概况
  368. for (let field in this.dataOverview) {
  369. if (e.data.data.orderStatistics[field]) {
  370. this.dataOverview[field]['value'] = e.data.data.orderStatistics[field];
  371. } else {
  372. this.dataOverview[field]['value'] = '0.00';
  373. }
  374. }
  375. console.log(this.pageCount);
  376. } else {
  377. this.$message.error(e.data.msg);
  378. }
  379. this.listLoading = false;
  380. }).catch(e => {
  381. this.listLoading = false;
  382. });
  383. this.listLoading = true;
  384. },
  385. getData() {
  386. let that = this;
  387. that.currencyInfo = [];
  388. //that.memberAssets = [];
  389. let date = {
  390. r: '/mall/finance/stat'
  391. }
  392. if (this.order_time) {
  393. // date.start_date = this.order_time[0];
  394. // date.end_date = this.order_time[1];
  395. date.order_time = this.order_time;
  396. }
  397. request({
  398. params: date,
  399. method: 'get',
  400. }).then(res => {
  401. if (res.data.code == 0) {
  402. that.update_order_time = res.data.data.update_time;
  403. that.order_time = res.data.data.date;
  404. //订单概况
  405. for (let (k,v) in this.dataOverview) {
  406. console.log(1111);
  407. console.log(v);
  408. if (res.data.data.orderStatistics[field]) {
  409. this.dataOverview[field]['value'] = res.data.data.orderStatistics[field];
  410. } else {
  411. this.dataOverview[field]['value'] = '0.00';
  412. }
  413. }
  414. //支付统计
  415. that.rechargeArr = res.data.data.payment_data;
  416. }
  417. }).catch(e => {
  418. });
  419. },
  420. upButton(type) {
  421. if (this.butbuttonType == type) {
  422. return;
  423. }
  424. this.buttonType = type;
  425. this.memberAssets = [];
  426. if (type == 2) {
  427. this.memberAssets.push(...this.currencyInfo);
  428. } else {
  429. }
  430. },
  431. updateOrderTime(v) {
  432. this.order_time = v;
  433. this.getData();
  434. },
  435. toFormatDate: function(date) {
  436. let y = date.getFullYear();
  437. let MM = date.getMonth() + 1;
  438. MM = MM < 10 ? ('0' + MM) : MM;
  439. let d = date.getDate();
  440. d = d < 10 ? ('0' + d) : d;
  441. return y + '-' + MM + '-' + d;
  442. }
  443. }
  444. })
  445. </script>