detail.php 22 KB

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