index.php 22 KB

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