index.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <?
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ComponentHelper::loadComponentView('com-image' );
  5. ?>
  6. <style>
  7. .distrow {
  8. height: 50px !important;
  9. }
  10. .distpopup {
  11. position: absolute;
  12. right: -2px;
  13. top: -4px;
  14. background: #fff;
  15. box-shadow: 7px 5px 11px grey;
  16. width: 83px;
  17. z-index: 5;
  18. }
  19. </style>
  20. <div id="app" v-cloak>
  21. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  22. <!-- <div slot="header">
  23. <span>门店列表</span>
  24. <el-button type="primary" size="small" style="padding: 9px 15px !important; float: right; position: relative; bottom: 8px;" @click="addStore">添加门店</el-button>
  25. </div> -->
  26. <div class="table-body">
  27. <el-tabs type="card" v-model="activityTab" @tab-click="handleTabClick">
  28. <div style="padding-bottom: 20px;">
  29. <div class="flex">
  30. <div class="flex" style="margin-right: 20px;">
  31. <div class="input-title" style="flex-shrink: 0;">门店名称</div>
  32. <el-input size="small" style="width: 130px;" placeholder="请输入门店名称" v-model="searchData.store_name"> </el-input>
  33. </div>
  34. <div class="flex" style="margin-right: 20px;">
  35. <div class="input-title" style="flex-shrink: 0;">用户ID</div>
  36. <el-input size="small" style="width: 130px;" placeholder="请输入用户ID" v-model="searchData.user_id">
  37. </el-input>
  38. </div>
  39. <div class="flex" style="margin-right: 20px;">
  40. <div class="input-title" style="flex-shrink: 0;">用户昵称</div>
  41. <el-input size="small" style="width: 130px;" placeholder="请输入用户昵称" v-model="searchData.nickname">
  42. </el-input>
  43. </div>
  44. <div class="flex" style="margin-right: 20px;">
  45. <div class="input-title" style="flex-shrink: 0;">手机号</div>
  46. <el-input size="small" style="width: 140px;" placeholder="请输入用户手机号" v-model="searchData.mobile">
  47. </el-input>
  48. </div>
  49. <br>
  50. <div class="flex" style="margin-right: 20px;">
  51. <div class="input-title" style="flex-shrink: 0;">订单编号</div>
  52. <el-input size="small" style="width: 130px;" placeholder="请输入订单编号" v-model="searchData.order_no">
  53. </el-input>
  54. </div>
  55. <div class="item-box" flex="dir:left cross:center">
  56. <div class="label">订单状态</div>
  57. <el-select v-model="searchData.order_status" @change='searchs' class="select" size="small" style="width: 130px;">
  58. <el-option :key="0" label="全部" :value="0"></el-option>
  59. <el-option :key="1" label="待结算" :value="1"></el-option>
  60. <el-option :key="2" label="已结算" :value="2"></el-option>
  61. </el-select>
  62. </div>
  63. </div>
  64. <div class="flex" style="margin-top: 20px">
  65. <div class="flex" style="margin-right: 20px;">
  66. <div class="input-title" style="flex-shrink: 0;">下单时间</div>
  67. <el-date-picker v-model="dates" size="small" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="selectedDates"> </el-date-picker>
  68. </div>
  69. <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索</el-button>
  70. <el-button type="warning" @click="clereSearch" v-if="searchData.store_name || searchData.user_id || searchData.nickname || searchData.mobile || searchData.order_no || searchData.order_status" style="padding: 9px 15px !important;">清除搜索条件</el-button>
  71. </div>
  72. </div>
  73. <div class="stat-item">
  74. <span>订单总金额:{{totalOrderAmounts}}</span>
  75. <span>已结算金额:{{settleOrderAmounts}}</span>
  76. <span>未结算金额:{{notSettleOrderAmounts}}</span>
  77. </div>
  78. <el-table :data="orderDetailList" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
  79. <el-table-column label="门店名称" prop="store_name" width="200">
  80. <template slot-scope="scope">
  81. <div class="user_img" flex="cross:center">
  82. <el-image class="default-avatar" :src="scope.row.store_logo">
  83. <div slot="error" class="image-slot">
  84. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store_logo"></com-image>
  85. </div>
  86. </el-image>
  87. <div>{{scope.row.store_name}}</div>
  88. </div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="用户ID" prop="user_id" width="80" align="center">
  92. <template slot-scope="scope">
  93. <div>{{scope.row.user_id}}</div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="用户信息" align="center" width="200">
  97. <template slot-scope="scope">
  98. <div class="user_img" flex="cross:center">
  99. <el-image class="default-avatar" :src="scope.row.avatar_url">
  100. <div slot="error" class="image-slot">
  101. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  102. </div>
  103. </el-image>
  104. <div>{{scope.row.nickname}}<br/>{{scope.row.mobile}}</div>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="订单编号" prop="order_no" width="250" align="center">
  109. <template slot-scope="scope">
  110. <div>{{scope.row.order_no}}</div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="订单金额" prop="order_money" width="100" align="center">
  114. <template slot-scope="scope">
  115. <div> <span>{{scope.row.order_money}}</span> </div>
  116. </template>
  117. </el-table-column>
  118. <!-- <el-table-column label="优惠金额" prop="discount_money" width="100" align="center">-->
  119. <!-- <template slot-scope="scope">-->
  120. <!-- <div><span style="color: #409EFF;">{{scope.row.discount_money}}</span> </div>-->
  121. <!-- </template>-->
  122. <!-- </el-table-column>-->
  123. <el-table-column label="支付金额" prop="pay_money" width="100" align="center">
  124. <template slot-scope="scope">
  125. <div> <span>{{scope.row.pay_money}}</span> </div>
  126. </template>
  127. </el-table-column>
  128. <!-- <el-table-column label="插件(佣金)分红" prop="addons_bonus" width="150" height="50" align="center">
  129. <template slot-scope="scope">
  130. <div>
  131. <div>
  132. </div>
  133. <el-popover placement="right-end" width="200" trigger="click">
  134. <div v-for="item in addonsCommissions">
  135. <div class="text1">{{item.name}}: ¥{{item.value}}</div>
  136. </div>
  137. <el-button slot="reference" type="text" style="color: #409EFF;" @click="getAddonsCommission(scope.row)">{{scope.row.addons_bonus}}</el-button>
  138. </el-popover>
  139. </div>
  140. </template>
  141. </el-table-column> -->
  142. <!-- <el-table-column label="服务费" prop="service_charge" width="100" align="center">-->
  143. <!-- <template slot-scope="scope">-->
  144. <!-- <div> <span>{{scope.row.service_charge}}</span> </div>-->
  145. <!-- </template>-->
  146. <!-- </el-table-column>-->
  147. <el-table-column label="货款收益比例" prop="store_scale" width="120" align="center">
  148. <template slot-scope="scope">
  149. <div> <span>{{scope.row.store_scale}}%</span> </div>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="总佣金" prop="all_commission" width="100" align="center">
  153. <template slot-scope="scope">
  154. <div> <span>{{scope.row.all_commission}}</span> </div>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="用户分享收益" prop="share_commission" width="120" align="center">
  158. <template slot-scope="scope">
  159. <div> <span>{{scope.row.share_commission}}</span> </div>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="店主分享收益" prop="store_share_commission" width="120" align="center">
  163. <template slot-scope="scope">
  164. <div> <span>{{scope.row.store_share_commission}}</span> </div>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="实际货款收益" prop="amount_received" width="120" align="center">
  168. <template slot-scope="scope">
  169. <div> <span>{{scope.row.amount_received}}</span> </div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="订单类型" prop="settle_status" width="100" align="center">
  173. <template slot-scope="scope">
  174. <div>
  175. <span v-if="scope.row.type==1">线上订单</span>
  176. <span v-if="scope.row.type==2">收款码订单</span>
  177. </div>
  178. </template>
  179. </el-table-column>
  180. <el-table-column label="状态" prop="settle_status" width="100" align="center">
  181. <template slot-scope="scope">
  182. <div> <span>{{settleStatus[scope.row.settle_status]}}</span> </div>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="创建时间" prop="user_count" width="200" align="center">
  186. <template slot-scope="scope">
  187. <div>
  188. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  189. </div>
  190. </template>
  191. </el-table-column>
  192. <!-- <el-table-column label="操作" style="width: 180px;" fixed="right" align="center">
  193. <template slot-scope="scope">
  194. <template v-if="scope.row.check_status==1">
  195. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'adopt')">通过</el-button>
  196. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'reject')">不通过</el-button>
  197. </template>
  198. <template v-if="scope.row.check_status==2">
  199. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'adopt')">通过</el-button>
  200. </template>
  201. </template>
  202. </el-table-column> -->
  203. </el-table>
  204. <div style="text-align: right;margin: 20px 0;">
  205. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  206. </div>
  207. </el-tabs>
  208. </div>
  209. </el-card>
  210. </div>
  211. <script>
  212. const app = new Vue({
  213. el: '#app',
  214. data: {
  215. searchData: {
  216. store_name: '',
  217. user_id: null,
  218. nickname: '',
  219. mobile: '',
  220. order_no: '',
  221. order_status: 0,
  222. min_amount: null,
  223. max_mount: null,
  224. start_time: '',
  225. end_time: '',
  226. },
  227. dates: null,
  228. activityTab: 'order-detail',
  229. currPage: 1,
  230. pageCount: 0,
  231. loading: false,
  232. orderDetailList: [],
  233. cashierList: [],
  234. dialogLoading: false,
  235. settleStatus: {
  236. 0: '全部',
  237. 1: '待结算',
  238. 2: '已结算',
  239. 3: '已失效',
  240. },
  241. totalOrderAmounts: 0,
  242. settleOrderAmounts: 0,
  243. notSettleOrderAmounts: 0,
  244. totalRealPayAmounts: 0,
  245. totalOrderNumbers: 0,
  246. totalReceiveAmounts: 0,
  247. // 导出路径
  248. exportUrl: 'happiness/store-assets/index',
  249. exportList: {},
  250. addonsCommissions: [],
  251. install_platform_store_clerk : 0,
  252. install_secondary_card : 0,
  253. },
  254. mounted() {
  255. this.loadData();
  256. },
  257. methods: {
  258. // 选中时间
  259. selectedDates(e) {
  260. if (e) {
  261. this.searchData.start_time = e[0];
  262. this.searchData.end_time = e[1];
  263. } else {
  264. this.searchData.start_time = '';
  265. this.searchData.end_time = '';
  266. this.dates = null;
  267. }
  268. },
  269. searchs() {
  270. this.currPage = 1;
  271. this.loadData();
  272. },
  273. clereSearch() {
  274. this.searchData.store_name = '';
  275. this.searchData.user_id = null;
  276. this.searchData.nickname = '';
  277. if (this.activityTab == 'order-detail' || this.activityTab == 'platform-store-clerk' ) {
  278. this.searchData.mobile = '';
  279. this.searchData.order_no = '';
  280. this.searchData.order_status = 0;
  281. } else if(this.activityTab=='cashier') {
  282. this.searchData.min_amount = null;
  283. this.searchData.max_amount = null;
  284. this.searchData.start_time = '';
  285. this.searchData.end_time = '';
  286. this.dates = null;
  287. } else if(this.activityTab=='secondary_card') {
  288. this.searchData.min_amount = null;
  289. this.searchData.max_amount = null;
  290. this.searchData.start_time = '';
  291. this.searchData.end_time = '';
  292. this.searchData.mobile = '';
  293. this.searchData.order_no = '';
  294. this.searchData.order_status = 0;
  295. }
  296. this.currPage = 1;
  297. this.loadData();
  298. },
  299. // 选中时间
  300. selectedDates(e) {
  301. if (e) {
  302. this.searchData.start_time = e[0];
  303. this.searchData.end_time = e[1];
  304. } else {
  305. this.searchData.start_time = '';
  306. this.searchData.end_time = '';
  307. }
  308. this.currPage = 1;
  309. this.loadData();
  310. },
  311. // 标签页切换
  312. handleTabClick(e) {
  313. this.loadData();
  314. },
  315. loadData() {
  316. this.loading = true;
  317. request({
  318. params: {
  319. r: 'happiness/store-assets/index',
  320. page: this.currPage,
  321. tabname: this.activityTab,
  322. ...this.searchData,
  323. },
  324. method: 'get',
  325. }).then(e => {
  326. this.loading = false;
  327. if (e.data.code == 0) {
  328. this.orderDetailList = e.data.data.list;
  329. this.totalOrderAmounts = e.data.data.total_order_amounts;
  330. this.settleOrderAmounts = e.data.data.settle_order_amounts;
  331. this.notSettleOrderAmounts = e.data.data.not_settle_order_amounts;
  332. this.install_platform_store_clerk = e.data.data.install_platform_store_clerk;
  333. this.install_secondary_card = e.data.data.install_secondary_card;
  334. this.pageCount = e.data.data.page_count;
  335. } else {
  336. this.$message.error(e.data.msg);
  337. }
  338. }).catch(e => {
  339. this.loading = false;
  340. });
  341. },
  342. pagination(currentPage) {
  343. let self = this;
  344. self.currPage = currentPage;
  345. self.loadData();
  346. },
  347. // 获取插件分佣
  348. getAddonsCommission(row) {
  349. // console.log(row, 'getAddonsCommission ============= ');
  350. let self = this;
  351. self.addonsCommissions = [];
  352. request({
  353. params: {
  354. r: 'happiness/store-assets/addons-commission',
  355. user_id: row.user_id,
  356. id: row.id,
  357. order_no: row.order_no,
  358. is_settlement: row.is_settlement,
  359. },
  360. method: 'get',
  361. }).then(e => {
  362. if (e.data.code == 0) {
  363. this.addonsCommissions = e.data.data;
  364. } else {
  365. self.$message.error(e.data.msg);
  366. }
  367. }).catch(e => {
  368. console.log(e);
  369. self.$message.error('网络错误');
  370. });
  371. },
  372. }
  373. });
  374. </script>
  375. <style>
  376. .el-tabs__header {
  377. font-size: 16px;
  378. }
  379. .table-body {
  380. padding: 20px;
  381. background-color: #fff;
  382. }
  383. .input-item {
  384. width: 250px;
  385. margin-right: 40px;
  386. }
  387. .input-item .el-input__inner {
  388. border-right: 0;
  389. }
  390. .input-item .el-input__inner:hover {
  391. border: 1px solid #dcdfe6;
  392. border-right: 0;
  393. outline: 0;
  394. }
  395. .input-item .el-input__inner:focus {
  396. border: 1px solid #dcdfe6;
  397. border-right: 0;
  398. outline: 0;
  399. }
  400. .input-item .el-input-group__append {
  401. background-color: #fff;
  402. border-left: 0;
  403. width: 10%;
  404. padding: 0;
  405. }
  406. .input-item .el-input-group__append .el-button {
  407. padding: 0;
  408. }
  409. .input-item .el-input-group__append .el-button {
  410. margin: 0;
  411. }
  412. .table-body {
  413. padding: 20px;
  414. background-color: #fff;
  415. }
  416. .table-body .el-button {
  417. /* padding: 0 !important; */
  418. padding: 9px;
  419. border: 0;
  420. margin: 0 5px;
  421. }
  422. .input-item {
  423. width: 250px;
  424. margin: 0 0 20px;
  425. display: inline-block;
  426. }
  427. .input-item .el-input__inner {
  428. border-right: 0;
  429. }
  430. .input-item .el-input__inner:hover {
  431. border: 1px solid #dcdfe6;
  432. border-right: 0;
  433. outline: 0;
  434. }
  435. .input-item .el-input__inner:focus {
  436. border: 1px solid #dcdfe6;
  437. border-right: 0;
  438. outline: 0;
  439. }
  440. .input-item .el-input-group__append {
  441. background-color: #fff;
  442. border-left: 0;
  443. width: 10%;
  444. padding: 0;
  445. }
  446. .input-item .el-input-group__append .el-button {
  447. padding: 0;
  448. }
  449. .input-item .el-input-group__append .el-button {
  450. margin: 0;
  451. }
  452. .batch {
  453. margin: 0 0 20px;
  454. display: inline-block;
  455. }
  456. .batch .el-button {
  457. padding: 9px 15px !important;
  458. }
  459. .el-table th>.cell {
  460. color: #333;
  461. font-weight: bold;
  462. font-size: 14px;
  463. }
  464. .el-table__footer-wrapper,
  465. .el-table__header-wrapper {
  466. border-bottom: 1.4px solid #D6D6D6;
  467. }
  468. .el-table .el-button {
  469. padding: 0 !important;
  470. border: 0;
  471. margin: 0 5px;
  472. }
  473. #app .copy .el-input-group__append {
  474. background-color: #409EFF;
  475. border-color: #409EFF;
  476. padding: 0 10px;
  477. }
  478. #app .table-body .copybtn {
  479. color: #fff;
  480. padding: 0 30px;
  481. }
  482. .el-alert {
  483. padding: 0;
  484. padding-left: 5px;
  485. padding-bottom: 5px;
  486. }
  487. .el-alert--info .el-alert__description {
  488. color: #606266;
  489. }
  490. .el-alert .el-button {
  491. margin-left: 20px;
  492. }
  493. .el-alert__content {
  494. display: flex;
  495. align-items: center;
  496. }
  497. .table-body .el-alert__title {
  498. margin-top: 5px;
  499. font-weight: 400;
  500. }
  501. .el-table th>.cell {
  502. color: #333;
  503. font-weight: bold;
  504. font-size: 14px;
  505. }
  506. .el-table__footer-wrapper,
  507. .el-table__header-wrapper {
  508. border-bottom: 1.4px solid #D6D6D6;
  509. }
  510. .item-box {
  511. margin-right: 20px;
  512. }
  513. .flex {
  514. display: flex;
  515. align-items: center;
  516. }
  517. .input-title {
  518. margin-right: 15px;
  519. }
  520. .item-box .label {
  521. margin-right: 8px;
  522. }
  523. .com-share-pop {
  524. display: inline-block;
  525. }
  526. .stat-item {
  527. margin: 10px 0px;
  528. padding-left: 7px;
  529. color: #A2A2A2;
  530. }
  531. .stat-item>span {
  532. margin: 0px 10px;
  533. }
  534. .user_img{
  535. position: relative;
  536. margin-right: 8px;
  537. /* height: 50px;
  538. width: 50px; */
  539. }
  540. .default-avatar{
  541. width: 50px;
  542. height: 50px;
  543. border-radius: 50%;
  544. margin-right: 8px;
  545. }
  546. .uer-nickname {
  547. flex: 1;
  548. }
  549. </style>