index.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  4. ?>
  5. <style>
  6. .order_stat {
  7. background: #FFF;
  8. padding: 10px 10px 0;
  9. margin-bottom: 10px;
  10. }
  11. .title {
  12. font-size: 18px;
  13. font-weight: bold;
  14. display: flex;
  15. align-items: baseline;
  16. height: 40px;
  17. justify-content: space-between;
  18. flex-direction: row;
  19. padding: 10px;
  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: 15px 0;
  30. display: flex;
  31. }
  32. .default-avatar {
  33. width: 50px;
  34. height: 50px;
  35. border-radius: 50%;
  36. margin-right: 8px;
  37. }
  38. .uer-nickname {
  39. flex: 1;
  40. }
  41. .user_img {
  42. position: relative;
  43. margin-right: 8px;
  44. /* height: 50px;
  45. width: 50px; */
  46. }
  47. .flex {
  48. display: flex;
  49. align-items: center;
  50. }
  51. .el-table .cell {
  52. text-align: left;
  53. }
  54. </style>
  55. <div id="app" v-cloak>
  56. <div class="order_stat">
  57. <div class="title">
  58. <span>门店财务数据</span>
  59. <div style="display:flex;">
  60. <div style="margin-right:5px;">
  61. <el-date-picker
  62. stlye="float:left;"
  63. type="daterange"
  64. size="small"
  65. v-model="staticDate"
  66. value-format="yyyy-MM-dd"
  67. range-separator="至"
  68. start-placeholder="开始日期"
  69. end-placeholder="结束日期"
  70. @change="changeDate"
  71. >
  72. </el-date-picker>
  73. </div>
  74. <com-export-dialog :field_list='exportList' :action_url="exportUrl" :params="searchData"> </com-export-dialog>
  75. </div>
  76. </div>
  77. <div class="stat_details">
  78. <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
  79. <div class="oirder_modul_title">
  80. <div class="text">{{item.name}}</div>
  81. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  82. <i class="el-icon-question stat_icon"></i>
  83. </el-tooltip>
  84. </div>
  85. <div class="price">
  86. {{item.value}}
  87. </div>
  88. </div>
  89. </div>
  90. <div class="stat_details">
  91. <div class="order_module" v-for="(item,index) in orderTotalArr2" :key="item.type">
  92. <div class="oirder_modul_title">
  93. <div class="text">{{item.name}}</div>
  94. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  95. <i class="el-icon-question stat_icon"></i>
  96. </el-tooltip>
  97. </div>
  98. <div class="price">
  99. {{item.value}}
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <el-card shadow="never" style="border:0;min-width: 800px;">
  105. <el-tabs type="card" v-model="activityTab" @tab-click="handleTabClick">
  106. <el-tab-pane label="订单明细" name="order-detail">
  107. <div style="padding-bottom: 20px;">
  108. <div class="table-body">
  109. <el-form :inline="true" :model="searchData" size="small" class="demo-form-inline">
  110. <el-form-item label="">
  111. <el-date-picker
  112. stlye="float:left;"
  113. v-model="searchData.date"
  114. type="daterange"
  115. size="small"
  116. value-format="yyyy-MM-dd"
  117. range-separator="至"
  118. start-placeholder="开始日期"
  119. end-placeholder="结束日期">
  120. </el-date-picker>
  121. </el-form-item>
  122. <el-form-item label="">
  123. <el-input @keyup.enter.native="search" size="small" placeholder="请输入消费者ID/昵称/手机号" v-model="searchData.keyword" clearable></el-input>
  124. </el-form-item>
  125. <el-form-item label="">
  126. <el-input @keyup.enter.native="search" size="small" placeholder="请输入商品名称/ID" v-model="searchData.goods_keyword" clearable></el-input>
  127. </el-form-item>
  128. <el-form-item>
  129. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  130. </el-form-item>
  131. </el-form>
  132. </div>
  133. </div>
  134. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading" v-if="activityTab == 'order-detail'">
  135. <el-table-column prop="store_id" label="门店ID" min-width="100" align="center"></el-table-column>
  136. <el-table-column label="门店信息" width="200" prop="store_name" align="center">
  137. <template slot-scope="scope">
  138. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store.logo_img"></com-image>
  139. <div>{{scope.row.store.store_name}}</div>
  140. <div>{{scope.row.store.shop_mobile}}</div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="消费者" width="200">
  144. <template slot-scope="scope">
  145. <div class="table-info-img-text">
  146. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  147. <div slot="error" class="image-slot">
  148. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  149. </div>
  150. </el-image>
  151. <div class="table-info-text">
  152. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  153. <div>{{scope.row.user.mobile}}</div>
  154. </div>
  155. </div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column prop="user.mobile" label="手机号" min-width="120" align="center"></el-table-column>
  159. <el-table-column prop="order.order_no" label="订单编号" min-width="220" align="center"></el-table-column>
  160. <el-table-column label="商品信息" width="200" prop="store_name" align="center">
  161. <template slot-scope="scope">
  162. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.pic_url"></com-image>
  163. <div>{{scope.row.goods_name}}</div>
  164. <div>{{scope.row.goods_attr_name || '默认'}}</div>
  165. </template>
  166. </el-table-column>
  167. <el-table-column prop="order_money" label="价格/数量" min-width="100" align="center">
  168. <template slot-scope="scope">
  169. <div style="display:flex;flex-direction:column;">
  170. <span>¥{{scope.row.price}}</span>
  171. <span>{{scope.row.num}} 件</span>
  172. </div>
  173. </template>
  174. </el-table-column>
  175. <el-table-column prop="order_money" label="成交价(元)" min-width="100" align="center">
  176. <template slot-scope="scope">
  177. {{scope.row.goods_price}}
  178. </template>
  179. </el-table-column>
  180. <el-table-column prop="scope" min-width="150" label="成交时间" align="center">
  181. <template slot-scope="scope">
  182. {{scope.row.order.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
  183. </template>
  184. </el-table-column>
  185. <el-table-column prop="order_money" label="订单状态" min-width="100" align="center">
  186. <template slot-scope="scope">
  187. {{order_status_list[scope.row.order_status]}}
  188. </template>
  189. </el-table-column>
  190. <el-table-column prop="order_money" label="到账金额(元)" min-width="100" align="center">
  191. <template slot-scope="scope">
  192. {{scope.row.commission_data.amount_received}}
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="操作" fixed="right" align="center">
  196. <template slot-scope="scope">
  197. <el-button type="text" size="small" @click="showDetail(scope.row)">查看明细</el-button>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. <!--工具条 批量操作和分页-->
  202. <div style="display: flex; margin-top: 20px;">
  203. <el-col :span="24" class="toolbar">
  204. <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
  205. </el-pagination>
  206. </el-col>
  207. </div>
  208. </el-tab-pane>
  209. <el-tab-pane label="收银台" name="cashier">
  210. <div style="padding-bottom: 20px;">
  211. <div class="table-body">
  212. <el-form :inline="true" :model="searchData" size="small" class="demo-form-inline">
  213. <el-form-item label="">
  214. <el-date-picker
  215. stlye="float:left;"
  216. v-model="searchData.date"
  217. type="daterange"
  218. size="small"
  219. value-format="yyyy-MM-dd"
  220. range-separator="至"
  221. start-placeholder="开始日期"
  222. end-placeholder="结束日期">
  223. </el-date-picker>
  224. </el-form-item>
  225. <el-form-item label="">
  226. <el-input @keyup.enter.native="search" size="small" placeholder="请输入消费者ID/昵称/手机号" v-model="searchData.keyword" clearable></el-input>
  227. </el-form-item>
  228. <el-form-item>
  229. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  230. </el-form-item>
  231. </el-form>
  232. </div>
  233. </div>
  234. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading" v-if="activityTab == 'cashier'">
  235. <el-table-column prop="id" label="id" min-width="100" align="center"></el-table-column>
  236. <el-table-column prop="store_id" label="门店ID" min-width="100" align="center"></el-table-column>
  237. <el-table-column label="门店信息" width="200" prop="store_name" align="center">
  238. <template slot-scope="scope">
  239. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store.logo_img"></com-image>
  240. <div>{{scope.row.store.store_name}}</div>
  241. <div>{{scope.row.store.shop_mobile}}</div>
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="消费者" width="200">
  245. <template slot-scope="scope">
  246. <div class="table-info-img-text" v-if='scope.row.user != null'>
  247. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  248. <div slot="error" class="image-slot">
  249. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  250. </div>
  251. </el-image>
  252. <div class="table-info-text">
  253. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  254. <div>{{scope.row.user.mobile}}</div>
  255. </div>
  256. </div>
  257. <div v-else> - </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="user.mobile" label="手机号" min-width="120" align="center"></el-table-column>
  261. <el-table-column prop="order_no" label="订单编号" min-width="220" align="center"></el-table-column>
  262. <el-table-column prop="order_money" label="成交价(元)" min-width="100" align="center">
  263. <template slot-scope="scope">
  264. {{scope.row.pay_money}}
  265. </template>
  266. </el-table-column>
  267. <el-table-column prop="scope" min-width="150" label="成交时间" align="center">
  268. <template slot-scope="scope">
  269. {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
  270. </template>
  271. </el-table-column>
  272. <el-table-column prop="order_money" label="到账金额(元)" min-width="100" align="center">
  273. <template slot-scope="scope">
  274. {{scope.row.commission_data.amount_received}}
  275. </template>
  276. </el-table-column>
  277. <el-table-column label="操作" fixed="right" align="center">
  278. <template slot-scope="scope">
  279. <el-button type="text" size="small" @click="showDetail(scope.row)">查看明细</el-button>
  280. </template>
  281. </el-table-column>
  282. </el-table>
  283. <!--工具条 批量操作和分页-->
  284. <div style="display: flex; margin-top: 20px;">
  285. <el-col :span="24" class="toolbar">
  286. <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
  287. </el-pagination>
  288. </el-col>
  289. </div>
  290. </el-tab-pane>
  291. </el-tabs>
  292. </el-card>
  293. <el-dialog title="订单承担明细" :visible.sync="dialogTableVisible" width="80%">
  294. <el-table :data="commissionData">
  295. <el-table-column property="order_money" label="订单金额" min-width="80px"></el-table-column>
  296. <el-table-column property="discount_money" label="优惠金额" min-width="80px"></el-table-column>
  297. <el-table-column property="score_deduction_bear" label="积分抵扣承担" min-width="120px">
  298. <template slot-scope="scope">
  299. <span v-if='scope.row.score_deduction_bear == 0'>平台</span>
  300. <span v-if='scope.row.score_deduction_bear == 1'>门店</span>
  301. <span v-if='scope.row.score_deduction_bear == -1'>暂无</span>
  302. </template>
  303. </el-table-column>
  304. <el-table-column property="pay_money" label="支付金额" min-width="80px"></el-table-column>
  305. <el-table-column property="addons_bonus" label="插件(佣金)" min-width="100px"></el-table-column>
  306. <el-table-column prop="settle_type" label="佣金来源" min-width="80px" align="center">
  307. <template slot-scope="scope">
  308. <div v-if="scope.row.settle_type == '4'">门店承担</div>
  309. <div v-else>平台承担</div>
  310. </template>
  311. </el-table-column>
  312. <el-table-column prop="store_send_commission" label="门店股东(佣金)" min-width="120px" align="center"></el-table-column>
  313. <el-table-column prop="service_charge" label="服务费" min-width="80px" align="center"></el-table-column>
  314. <el-table-column prop="higo_reward" label="嗨呗不足扣除" min-width="120px" align="center" v-if="commission_data.higo_reward > 0"></el-table-column>
  315. <el-table-column prop="store_contributing_money" label="会员折扣金额" min-width="120px" align="center" v-if="commission_data.store_contributing_money > 0"></el-table-column>
  316. <el-table-column prop="amount_received" label="到账金额" min-width="80px" align="center"></el-table-column>
  317. <el-table-column prop="amount_received_score" label="到账积分" min-width="80px" align="center" v-if="commission_data.amount_received_score > 0"></el-table-column>
  318. </el-table>
  319. </el-dialog>
  320. </div>
  321. <script>
  322. const app = new Vue({
  323. el: '#app',
  324. created() {
  325. this.searchData.store_id = getQuery('store_id');
  326. this.getStoreStatics();
  327. },
  328. data() {
  329. return {
  330. searchData: {
  331. goods_keyword: '',
  332. date: [],
  333. keyword: '',
  334. tabname: 'order-detail',
  335. },
  336. activityTab: 'order-detail',
  337. form: [],
  338. pageCount: 0,
  339. page: 1,
  340. pagination: null,
  341. listLoading: false,
  342. store_name: '',
  343. staticDate: [],
  344. orderTotalArr: [{
  345. type: 'today_pay_money',
  346. name: '今日成交金额',
  347. value: '0.00',
  348. prompt: '',
  349. }, {
  350. type: 'today_refund_money',
  351. name: '今日退款金额',
  352. value: '0.00',
  353. prompt: '',
  354. }, {
  355. type: 'today_commission_money',
  356. name: '今日预计到账金额',
  357. value: '0.00',
  358. prompt: '',
  359. }, {
  360. type: 'today_order_num',
  361. name: '今日订单数量',
  362. value: '0.00',
  363. prompt: '',
  364. }],
  365. orderTotalArr2: [{
  366. type: 'total_pay_money',
  367. name: '累计成交金额',
  368. value: '0.00',
  369. prompt: '',
  370. }, {
  371. type: 'total_refund_money',
  372. name: '累计退款金额',
  373. value: '0.00',
  374. prompt: '',
  375. }, {
  376. type: 'total_commission_money',
  377. name: '累计到账金额',
  378. value: '0.00',
  379. prompt: '',
  380. }, {
  381. type: 'total_order_num',
  382. name: '累计已付款订单数量',
  383. value: '0.00',
  384. prompt: '',
  385. }],
  386. order_status_list: {
  387. '0': "待付款",
  388. '1': "待发货",
  389. '2': "已发货",
  390. '3': "已收货",
  391. '4': "已完成",
  392. '6': "待自提",
  393. '7': "自提成功",
  394. '-4': "已关闭",
  395. '-2': "退款中",
  396. '-1': "售后申请"
  397. },
  398. dialogTableVisible: false,
  399. commissionData: [],
  400. commission_data: [],
  401. exportList: [],
  402. exportUrl: 'store/client/store-finance/index',
  403. };
  404. },
  405. methods: {
  406. pageChange(currentPage) {
  407. this.page = currentPage;
  408. this.getList();
  409. },
  410. handleTabClick(e) {
  411. this.searchData.tabname = this.activityTab;
  412. this.getList();
  413. },
  414. search() {
  415. this.page = 1;
  416. this.getList();
  417. },
  418. getList() {
  419. let params = {
  420. r: 'store/client/store-finance/index',
  421. page: this.page,
  422. keyword: this.searchData.keyword,
  423. goods_keyword: this.searchData.goods_keyword,
  424. store_id: this.searchData.store_id,
  425. date: this.searchData.date,
  426. tabname: this.searchData.tabname,
  427. };
  428. request({
  429. params,
  430. }).then(e => {
  431. if (e.data.code === 0) {
  432. this.form = e.data.data.list;
  433. this.exportList = e.data.data.export_list;
  434. this.pagination = e.data.data.pagination;
  435. this.pageCount = e.data.data.page_count;
  436. // this.orderTotalArr = e.data.data.order_total_arr;
  437. // this.orderTotalArr2 = e.data.data.order_total_arr2;
  438. this.store_name = e.data.data.store_name
  439. console.log('form----'.this.form);
  440. } else {
  441. this.$message.error(e.data.msg);
  442. }
  443. this.listLoading = false;
  444. }).catch(e => {
  445. this.listLoading = false;
  446. });
  447. this.listLoading = true;
  448. },
  449. showDetail(data) {
  450. this.commissionData = [];
  451. this.commission_data = data.commission_data;
  452. this.commissionData.push(data.commission_data);
  453. this.dialogTableVisible = true;
  454. },
  455. changeDate(val) {
  456. this.staticDate = val;
  457. this.getStoreStatics();
  458. // console.log('changeDate', val);
  459. },
  460. getStoreStatics() {
  461. let params = {
  462. r: 'store/client/store-finance/get-store-statics',
  463. page: this.page,
  464. keyword: this.searchData.keyword,
  465. store_id: this.searchData.store_id,
  466. date: this.staticDate,
  467. };
  468. request({
  469. params,
  470. }).then(e => {
  471. if (e.data.code === 0) {
  472. this.orderTotalArr = e.data.data.order_total_arr;
  473. this.orderTotalArr2 = e.data.data.order_total_arr2;
  474. } else {
  475. this.$message.error(e.data.msg);
  476. }
  477. this.listLoading = false;
  478. }).catch(e => {
  479. this.listLoading = false;
  480. });
  481. this.listLoading = true;
  482. },
  483. },
  484. mounted: function() {
  485. this.searchData.user_id = getQuery('user_id');
  486. this.getList();
  487. }
  488. });
  489. </script>
  490. <style>
  491. .table-body {
  492. padding: 20px;
  493. background-color: #fff;
  494. }
  495. .input-item {
  496. display: inline-block;
  497. /* width: 250px; */
  498. margin: 0 0 20px 20px;
  499. }
  500. .date-item {
  501. display: inline-block;
  502. margin: 0 0 20px 20px;
  503. }
  504. .input-item .el-input__inner:hover {
  505. border: 1px solid #dcdfe6;
  506. border-right: 0;
  507. outline: 0;
  508. }
  509. .input-item .el-input__inner:focus {
  510. border: 1px solid #dcdfe6;
  511. border-right: 0;
  512. outline: 0;
  513. }
  514. .input-item .el-input-group__append {
  515. background-color: #fff;
  516. border-left: 0;
  517. width: 10%;
  518. padding: 0;
  519. }
  520. /* .input-item .el-input-group__append .el-button {
  521. padding: 0;
  522. }
  523. .input-item .el-input-group__append .el-button {
  524. margin: 0;
  525. }
  526. .table-body .el-button {
  527. padding: 0!important;
  528. border: 0;
  529. margin: 0 5px;
  530. } */
  531. .el-table th>.cell {
  532. color: #333;
  533. font-weight: bold;
  534. font-size: 14px;
  535. }
  536. .el-table__footer-wrapper,
  537. .el-table__header-wrapper {
  538. border-bottom: 1.4px solid #D6D6D6;
  539. }
  540. .stat_details {
  541. padding-bottom: 30px;
  542. display: flex;
  543. }
  544. .order_module {
  545. flex: 1;
  546. background: #F2F2F2;
  547. margin: 0 5px;
  548. padding: 20px 25px;
  549. }
  550. .order_module:last-child {
  551. margin-right: 0;
  552. }
  553. .order_module:first-child {
  554. margin-left: 0;
  555. }
  556. .price {
  557. font-size: 22px;
  558. font-weight: bold;
  559. }
  560. .oirder_modul_title {
  561. font-size: 12px;
  562. margin-bottom: 10px;
  563. display: flex;
  564. align-items: center;
  565. }
  566. .oirder_modul_title .text {
  567. margin-right: 10px;
  568. }
  569. .stat_icon {
  570. font-size: 19px;
  571. color: #BFBFBF;
  572. }
  573. </style>