index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <?
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div class="table-body">
  8. <div style="padding-bottom: 20px;">
  9. <div class="flex">
  10. <div class="flex" style="margin-right: 20px;">
  11. <div class="input-title" style="flex-shrink: 0;">多商户名称</div>
  12. <el-input size="small" style="width: 130px;" placeholder="请输入多商户名称" v-model="searchData.store_name"> </el-input>
  13. </div>
  14. <div class="flex" style="margin-right: 20px;">
  15. <div class="input-title" style="flex-shrink: 0;">会员ID</div>
  16. <el-input size="small" style="width: 130px;" placeholder="请输入会员ID" v-model="searchData.user_id">
  17. </el-input>
  18. </div>
  19. <div class="flex" style="margin-right: 20px;">
  20. <div class="input-title" style="flex-shrink: 0;">会员昵称</div>
  21. <el-input size="small" style="width: 130px;" placeholder="请输入会员昵称" v-model="searchData.nickname">
  22. </el-input>
  23. </div>
  24. <div class="flex" style="margin-right: 20px;">
  25. <div class="input-title" style="flex-shrink: 0;">手机号</div>
  26. <el-input size="small" style="width: 140px;" placeholder="请输入会员手机号" v-model="searchData.mobile">
  27. </el-input>
  28. </div>
  29. <div class="flex" style="margin-right: 20px;">
  30. <div class="input-title" style="flex-shrink: 0;">订单编号</div>
  31. <el-input size="small" style="width: 130px;" placeholder="请输入订单编号" v-model="searchData.order_no">
  32. </el-input>
  33. </div>
  34. <div class="item-box" flex="dir:left cross:center">
  35. <div class="label">订单状态</div>
  36. <el-select v-model="searchData.order_status" @change='searchs' class="select" size="small" style="width: 130px;">
  37. <el-option :key="0" label="全部" :value="0"></el-option>
  38. <el-option :key="1" label="待结算" :value="1"></el-option>
  39. <el-option :key="2" label="已结算" :value="2"></el-option>
  40. <el-option :key="3" label="已失效" :value="3"></el-option>
  41. </el-select>
  42. </div>
  43. <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索</el-button>
  44. <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>
  45. <com-export-dialog style="float: right;" :field_list='orderDetailFieldsList' :action_url="exportUrl" :params="searchData"> </com-export-dialog>
  46. </div>
  47. </div>
  48. <div class="stat-item">
  49. <span>订单总货款:{{totalOrderAmounts}}</span>
  50. <span>已结算货款:{{settleOrderAmounts}}</span>
  51. <span>待结算货款:{{notSettleOrderAmounts}}</span>
  52. </div>
  53. <el-table :data="orderDetailList" @selection-change="handleOrderDetailListChange" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
  54. <el-table-column type="selection" width="55"></el-table-column>
  55. <el-table-column label="商户名称" width="150" prop="store_name">
  56. <template slot-scope="scope">
  57. <div class="user_img" flex="cross:center">
  58. <el-image class="default-avatar" :src="scope.row.store_logo">
  59. <div slot="error" class="image-slot">
  60. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store_logo"></com-image>
  61. </div>
  62. </el-image>
  63. <div>{{scope.row.store_name}}</div>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="会员ID" prop="user_id" width="100" align="center">
  68. <template slot-scope="scope">
  69. <div>{{scope.row.user_id}}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="会员信息" align="center" width="200">
  73. <template slot-scope="scope">
  74. <div class="user_img" flex="cross:center">
  75. <el-image class="default-avatar" :src="scope.row.avatar_url">
  76. <div slot="error" class="image-slot">
  77. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  78. </div>
  79. </el-image>
  80. <div>{{scope.row.nickname}}<br/>{{scope.row.mobile}}</div>
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="订单编号" prop="order_no" width="250" align="center">
  85. <template slot-scope="scope">
  86. <div>{{scope.row.order_no}}</div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="订单金额" prop="order_money" width="100" align="center">
  90. <template slot-scope="scope">
  91. <div> <span>{{scope.row.order_money}}</span> </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="优惠金额" prop="discount_money" width="100" align="center">
  95. <template slot-scope="scope">
  96. <div><span style="color: #409EFF;">{{scope.row.discount_money}}</span> </div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="支付金额" prop="pay_money" width="100" align="center">
  100. <template slot-scope="scope">
  101. <div> <span>{{scope.row.pay_money}}</span> </div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="插件(佣金)分红" prop="addons_bonus" width="150" align="center">
  105. <template slot-scope="scope">
  106. <div><span style="color: #409EFF;">{{scope.row.addons_bonus}}</span> </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="服务费" prop="service_charge" width="100" align="center">
  110. <template slot-scope="scope">
  111. <div> <span>{{scope.row.service_charge}}</span> </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="订单货款" prop="amount_received" width="100" align="center">
  115. <template slot-scope="scope">
  116. <div> <span>{{scope.row.amount_received}}</span> </div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="状态" prop="settle_status" width="100" align="center">
  120. <template slot-scope="scope">
  121. <div> <span>{{settleStatus[scope.row.settle_status]}}</span> </div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="创建时间" prop="user_count" width="200" align="center">
  125. <template slot-scope="scope">
  126. <div>
  127. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  128. </div>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <div style="text-align: right;margin: 20px 0;">
  133. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  134. </div>
  135. </div>
  136. </el-card>
  137. </div>
  138. <script>
  139. const app = new Vue({
  140. el: '#app',
  141. data: {
  142. searchData: {
  143. store_name: '',
  144. user_id: null,
  145. nickname: '',
  146. mobile: '',
  147. order_no: '',
  148. order_status: 0,
  149. min_amount: null,
  150. max_mount: null,
  151. start_time: '',
  152. end_time: '',
  153. order_ids: [],
  154. activityTab: 'order-detail'
  155. },
  156. dates: null,
  157. activityTab: 'order-detail',
  158. currPage: 1,
  159. pageCount: 0,
  160. loading: false,
  161. orderDetailList: [],
  162. cashierList: [],
  163. dialogLoading: false,
  164. settleStatus: {
  165. 0: '全部',
  166. 1: '待结算',
  167. 2: '已结算',
  168. 3: '已失效',
  169. },
  170. totalOrderAmounts: 0,
  171. settleOrderAmounts: 0,
  172. notSettleOrderAmounts: 0,
  173. totalRealPayAmounts: 0,
  174. totalOrderNumbers: 0,
  175. totalReceiveAmounts: 0,
  176. // 导出路径
  177. exportUrl: 'mch/store-assets/index',
  178. exportList: {},
  179. // 订单明细导出
  180. orderDetailFieldsList: {},
  181. },
  182. mounted() {
  183. this.loadData();
  184. this.loadDataTotal();
  185. },
  186. methods: {
  187. handleOrderDetailListChange(val) {
  188. // 获取选中的订单id
  189. this.searchData.order_ids = val.map(item => item.id);
  190. },
  191. searchs() {
  192. this.currPage = 1;
  193. this.loadData();
  194. },
  195. clereSearch() {
  196. this.searchData.store_name = '';
  197. this.searchData.user_id = null;
  198. this.searchData.nickname = '';
  199. if (this.activityTab == 'order-detail') {
  200. this.searchData.mobile = '';
  201. this.searchData.order_no = '';
  202. this.searchData.order_status = 0;
  203. } else {
  204. this.searchData.min_amount = null;
  205. this.searchData.max_amount = null;
  206. this.searchData.start_time = '';
  207. this.searchData.end_time = '';
  208. this.dates = null;
  209. }
  210. this.currPage = 1;
  211. this.loadData();
  212. },
  213. // 选中时间
  214. selectedDates(e) {
  215. if (e) {
  216. this.searchData.start_time = e[0];
  217. this.searchData.end_time = e[1];
  218. } else {
  219. this.searchData.start_time = '';
  220. this.searchData.end_time = '';
  221. }
  222. this.currPage = 1;
  223. this.loadData();
  224. },
  225. // 标签页切换
  226. handleTabClick(e) {
  227. this.loadData();
  228. },
  229. loadData() {
  230. this.loading = true;
  231. request({
  232. params: {
  233. r: 'mch/store-assets/index',
  234. page: this.currPage,
  235. tabname: this.activityTab,
  236. ...this.searchData,
  237. },
  238. method: 'get',
  239. }).then(e => {
  240. this.loading = false;
  241. if (e.data.code == 0) {
  242. if (this.activityTab == 'order-detail') {
  243. this.orderDetailList = e.data.data.list;
  244. // this.totalOrderAmounts = e.data.data.total_order_amounts;
  245. // this.settleOrderAmounts = e.data.data.settle_order_amounts;
  246. // this.notSettleOrderAmounts = e.data.data.not_settle_order_amounts;
  247. this.orderDetailFieldsList = e.data.data.orderDetailFieldsList;
  248. } else {
  249. this.cashierList = e.data.data.list;
  250. // this.totalRealPayAmounts = e.data.data.total_real_pay_amounts;
  251. // this.totalOrderNumbers = e.data.data.total_order_numbers;
  252. // this.totalReceiveAmounts = e.data.data.total_receive_amounts;
  253. this.exportList = e.data.data.export_list;
  254. }
  255. this.pageCount = e.data.data.page_count;
  256. } else {
  257. this.$message.error(e.data.msg);
  258. }
  259. }).catch(e => {
  260. this.loading = false;
  261. });
  262. },
  263. loadDataTotal() {
  264. this.loading = true;
  265. request({
  266. params: {
  267. r: 'mch/store-assets/total',
  268. },
  269. method: 'get',
  270. }).then(e => {
  271. this.loading = false;
  272. if (e.data.code == 0) {
  273. this.totalOrderAmounts = e.data.data.total_order_amounts;
  274. this.settleOrderAmounts = e.data.data.settle_order_amounts;
  275. this.notSettleOrderAmounts = e.data.data.not_settle_order_amounts;
  276. } else {
  277. this.$message.error(e.data.msg);
  278. }
  279. }).catch(e => {
  280. this.loading = false;
  281. });
  282. },
  283. pagination(currentPage) {
  284. let self = this;
  285. self.currPage = currentPage;
  286. self.loadData();
  287. },
  288. }
  289. });
  290. </script>
  291. <style>
  292. .el-tabs__header {
  293. font-size: 16px;
  294. }
  295. .table-body {
  296. padding: 20px;
  297. background-color: #fff;
  298. }
  299. .input-item {
  300. width: 250px;
  301. margin-right: 40px;
  302. }
  303. .input-item .el-input__inner {
  304. border-right: 0;
  305. }
  306. .input-item .el-input__inner:hover {
  307. border: 1px solid #dcdfe6;
  308. border-right: 0;
  309. outline: 0;
  310. }
  311. .input-item .el-input__inner:focus {
  312. border: 1px solid #dcdfe6;
  313. border-right: 0;
  314. outline: 0;
  315. }
  316. .input-item .el-input-group__append {
  317. background-color: #fff;
  318. border-left: 0;
  319. width: 10%;
  320. padding: 0;
  321. }
  322. .input-item .el-input-group__append .el-button {
  323. padding: 0;
  324. }
  325. .input-item .el-input-group__append .el-button {
  326. margin: 0;
  327. }
  328. .table-body {
  329. padding: 20px;
  330. background-color: #fff;
  331. }
  332. .table-body .el-button {
  333. /* padding: 0 !important; */
  334. padding: 9px;
  335. border: 0;
  336. margin: 0 5px;
  337. }
  338. .input-item {
  339. width: 250px;
  340. margin: 0 0 20px;
  341. display: inline-block;
  342. }
  343. .input-item .el-input__inner {
  344. border-right: 0;
  345. }
  346. .input-item .el-input__inner:hover {
  347. border: 1px solid #dcdfe6;
  348. border-right: 0;
  349. outline: 0;
  350. }
  351. .input-item .el-input__inner:focus {
  352. border: 1px solid #dcdfe6;
  353. border-right: 0;
  354. outline: 0;
  355. }
  356. .input-item .el-input-group__append {
  357. background-color: #fff;
  358. border-left: 0;
  359. width: 10%;
  360. padding: 0;
  361. }
  362. .input-item .el-input-group__append .el-button {
  363. padding: 0;
  364. }
  365. .input-item .el-input-group__append .el-button {
  366. margin: 0;
  367. }
  368. .batch {
  369. margin: 0 0 20px;
  370. display: inline-block;
  371. }
  372. .batch .el-button {
  373. padding: 9px 15px !important;
  374. }
  375. .el-table th>.cell {
  376. color: #333;
  377. font-weight: bold;
  378. font-size: 14px;
  379. }
  380. .el-table__footer-wrapper,
  381. .el-table__header-wrapper {
  382. border-bottom: 1.4px solid #D6D6D6;
  383. }
  384. .el-table .el-button {
  385. padding: 0 !important;
  386. border: 0;
  387. margin: 0 5px;
  388. }
  389. #app .copy .el-input-group__append {
  390. background-color: #409EFF;
  391. border-color: #409EFF;
  392. padding: 0 10px;
  393. }
  394. #app .table-body .copybtn {
  395. color: #fff;
  396. padding: 0 30px;
  397. }
  398. .el-alert {
  399. padding: 0;
  400. padding-left: 5px;
  401. padding-bottom: 5px;
  402. }
  403. .el-alert--info .el-alert__description {
  404. color: #606266;
  405. }
  406. .el-alert .el-button {
  407. margin-left: 20px;
  408. }
  409. .el-alert__content {
  410. display: flex;
  411. align-items: center;
  412. }
  413. .table-body .el-alert__title {
  414. margin-top: 5px;
  415. font-weight: 400;
  416. }
  417. .el-table th>.cell {
  418. color: #333;
  419. font-weight: bold;
  420. font-size: 14px;
  421. }
  422. .el-table__footer-wrapper,
  423. .el-table__header-wrapper {
  424. border-bottom: 1.4px solid #D6D6D6;
  425. }
  426. .item-box {
  427. margin-right: 20px;
  428. }
  429. .flex {
  430. display: flex;
  431. align-items: center;
  432. }
  433. .input-title {
  434. margin-right: 15px;
  435. }
  436. .item-box .label {
  437. margin-right: 8px;
  438. }
  439. .com-share-pop {
  440. display: inline-block;
  441. }
  442. .stat-item {
  443. margin: 10px 0px;
  444. padding-left: 7px;
  445. color: #A2A2A2;
  446. }
  447. .stat-item>span {
  448. margin: 0px 10px;
  449. }
  450. .user_img{
  451. position: relative;
  452. margin-right: 8px;
  453. /* height: 50px;
  454. width: 50px; */
  455. }
  456. .default-avatar{
  457. width: 50px;
  458. height: 50px;
  459. border-radius: 50%;
  460. margin-right: 8px;
  461. }
  462. .uer-nickname {
  463. flex: 1;
  464. }
  465. </style>