index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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. </style>
  52. <div id="app" v-cloak>
  53. <div class="order_stat">
  54. <div class="title">
  55. <span>门店财务数据</span>
  56. <div style="display:flex;">
  57. <!-- <el-button type="primary" size="small" @click="handle('edit')">添加商品</el-button>-->
  58. <!-- <el-button type="primary" size="small">订单导出</el-button>-->
  59. <div style="margin-right:5px;">
  60. <el-date-picker
  61. stlye="float:left;"
  62. type="daterange"
  63. size="small"
  64. v-model="staticDate"
  65. value-format="yyyy-MM-dd"
  66. range-separator="至"
  67. start-placeholder="开始日期"
  68. end-placeholder="结束日期"
  69. @change="changeDate"
  70. >
  71. </el-date-picker>
  72. </div>
  73. <com-export-dialog :field_list='exportList' :action_url="exportUrl" :params="searchData"> </com-export-dialog>
  74. </div>
  75. </div>
  76. <div class="stat_details">
  77. <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
  78. <div class="oirder_modul_title">
  79. <div class="text">{{item.name}}</div>
  80. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  81. <i class="el-icon-question stat_icon"></i>
  82. </el-tooltip>
  83. </div>
  84. <div class="price">
  85. {{item.value}}
  86. </div>
  87. </div>
  88. </div>
  89. <div class="stat_details">
  90. <div class="order_module" v-for="(item,index) in orderTotalArr2" :key="item.type">
  91. <div class="oirder_modul_title">
  92. <div class="text">{{item.name}}</div>
  93. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  94. <i class="el-icon-question stat_icon"></i>
  95. </el-tooltip>
  96. </div>
  97. <div class="price">
  98. {{item.value}}
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <el-card shadow="never" style="border:0;min-width: 800px;">
  104. <div style="padding-bottom: 20px;">
  105. <div class="flex">
  106. <div class="flex" style="margin-right: 20px;">
  107. <div class="input-title" style="flex-shrink: 0;">门店信息:</div>
  108. <el-input @keyup.enter.native="search" size="small" placeholder="请输入门店ID/名称/手机号" v-model="searchData.keyword" style="width:300px;" clearable>
  109. </el-input>
  110. <div style="margin-left:10px;">
  111. <el-date-picker
  112. v-model="searchData.date"
  113. type="daterange"
  114. size="small"
  115. value-format="yyyy-MM-dd"
  116. range-separator="至"
  117. start-placeholder="开始日期"
  118. end-placeholder="结束日期">
  119. </el-date-picker>
  120. </div>
  121. </div>
  122. <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
  123. </div>
  124. </div>
  125. <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
  126. <el-table-column prop="id" label="门店ID" min-width="100" align="center"></el-table-column>
  127. <el-table-column label="门店名称" width="200" prop="store_name" align="center">
  128. <template slot-scope="scope">
  129. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.logo_img"></com-image>
  130. <div>{{scope.row.store_name}}</div>
  131. <div>{{scope.row.shop_mobile}}</div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="order_no" label="今日成交金额" min-width="220" align="center">
  135. <template slot-scope="scope">
  136. {{scope.row.total_data.today_pay_money}}
  137. </template>
  138. </el-table-column>
  139. <el-table-column prop="order_no" label="今日退款金额" min-width="220" align="center">
  140. <template slot-scope="scope">
  141. {{scope.row.total_data.today_refund_money}}
  142. </template>
  143. </el-table-column>
  144. <el-table-column prop="order_no" label="今日预计到账金额" min-width="220" align="center">
  145. <template slot-scope="scope">
  146. {{scope.row.total_data.today_commission_money}}
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="order_no" label="今日订单数量" min-width="220" align="center">
  150. <template slot-scope="scope">
  151. {{scope.row.total_data.today_order_num}}
  152. </template>
  153. </el-table-column>
  154. <el-table-column prop="order_no" label="累计成交金额" min-width="220" align="center">
  155. <template slot-scope="scope">
  156. {{scope.row.total_data.total_pay_money}}
  157. </template>
  158. </el-table-column>
  159. <el-table-column prop="order_no" label="累计退款金额" min-width="220" align="center">
  160. <template slot-scope="scope">
  161. {{scope.row.total_data.total_refund_money}}
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="order_no" label="累计到账金额" min-width="220" align="center">
  165. <template slot-scope="scope">
  166. {{scope.row.total_data.total_commission_money}}
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="order_no" label="累计已付款订单数量" min-width="220" align="center">
  170. <template slot-scope="scope">
  171. {{scope.row.total_data.total_order_num}}
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="操作" fixed="right" align="center">
  175. <template slot-scope="scope">
  176. <el-button type="text" size="small" @click="goToDetail(scope.row.id)">查看详情</el-button>
  177. </template>
  178. </el-table-column>
  179. </el-table>
  180. <!--工具条 批量操作和分页-->
  181. <div style="display: flex; margin-top: 20px;">
  182. <el-col :span="24" class="toolbar">
  183. <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
  184. </el-pagination>
  185. </el-col>
  186. </div>
  187. </el-card>
  188. </div>
  189. <script>
  190. const app = new Vue({
  191. el: '#app',
  192. created() {
  193. this.searchData.store_id = getQuery('store_id')
  194. this.getStoreStatics();
  195. },
  196. data() {
  197. return {
  198. searchData: {
  199. keyword: '',
  200. date: [],
  201. },
  202. form: [],
  203. pageCount: 0,
  204. page: 1,
  205. pagination: null,
  206. listLoading: false,
  207. store_name: '',
  208. staticDate: [],
  209. orderTotalArr: [{
  210. type: 'today_pay_money',
  211. name: '今日成交金额',
  212. value: '0.00',
  213. prompt: '',
  214. }, {
  215. type: 'today_refund_money',
  216. name: '今日退款金额',
  217. value: '0.00',
  218. prompt: '',
  219. }, {
  220. type: 'today_commission_money',
  221. name: '今日预计到账金额',
  222. value: '0.00',
  223. prompt: '',
  224. }, {
  225. type: 'today_order_num',
  226. name: '今日订单数量',
  227. value: '0.00',
  228. prompt: '',
  229. }],
  230. orderTotalArr2: [{
  231. type: 'total_pay_money',
  232. name: '累计成交金额',
  233. value: '0.00',
  234. prompt: '',
  235. }, {
  236. type: 'total_refund_money',
  237. name: '累计退款金额',
  238. value: '0.00',
  239. prompt: '',
  240. }, {
  241. type: 'total_commission_money',
  242. name: '累计到账金额',
  243. value: '0.00',
  244. prompt: '',
  245. }, {
  246. type: 'total_order_num',
  247. name: '累计已付款订单数量',
  248. value: '0.00',
  249. prompt: '',
  250. }],
  251. exportList: [],
  252. exportUrl: 'store/store-finance/index',
  253. };
  254. },
  255. methods: {
  256. pageChange(currentPage) {
  257. this.page = currentPage;
  258. this.getList();
  259. },
  260. search() {
  261. this.page = 1;
  262. this.getList();
  263. },
  264. getList() {
  265. let params = {
  266. r: 'store/store-finance/index',
  267. page: this.page,
  268. keyword: this.searchData.keyword,
  269. store_id: this.searchData.store_id,
  270. date: this.searchData.date,
  271. };
  272. request({
  273. params,
  274. }).then(e => {
  275. if (e.data.code === 0) {
  276. this.form = e.data.data.list;
  277. this.exportList = e.data.data.export_list
  278. this.pagination = e.data.data.pagination;
  279. this.pageCount = e.data.data.page_count;
  280. // this.orderTotalArr = e.data.data.order_total_arr;
  281. // this.orderTotalArr2 = e.data.data.order_total_arr2;
  282. this.store_name = e.data.data.store_name
  283. } else {
  284. this.$message.error(e.data.msg);
  285. }
  286. this.listLoading = false;
  287. }).catch(e => {
  288. this.listLoading = false;
  289. });
  290. this.listLoading = true;
  291. },
  292. goToDetail(id) {
  293. navigateTo({
  294. r: 'store/store-finance/detail',
  295. store_id: id,
  296. });
  297. },
  298. changeDate(val) {
  299. this.staticDate = val;
  300. this.getStoreStatics();
  301. // console.log('changeDate', val);
  302. },
  303. getStoreStatics() {
  304. let params = {
  305. r: 'store/store-finance/get-store-statics',
  306. page: this.page,
  307. keyword: this.searchData.keyword,
  308. store_id: this.searchData.store_id,
  309. date: this.staticDate,
  310. };
  311. request({
  312. params,
  313. }).then(e => {
  314. if (e.data.code === 0) {
  315. this.orderTotalArr = e.data.data.order_total_arr;
  316. this.orderTotalArr2 = e.data.data.order_total_arr2;
  317. } else {
  318. this.$message.error(e.data.msg);
  319. }
  320. this.listLoading = false;
  321. }).catch(e => {
  322. this.listLoading = false;
  323. });
  324. this.listLoading = true;
  325. },
  326. },
  327. mounted: function() {
  328. this.searchData.user_id = getQuery('user_id');
  329. this.getList();
  330. }
  331. });
  332. </script>
  333. <style>
  334. .table-body {
  335. padding: 20px;
  336. background-color: #fff;
  337. }
  338. .input-item {
  339. display: inline-block;
  340. /* width: 250px; */
  341. margin: 0 0 20px 20px;
  342. }
  343. .date-item {
  344. display: inline-block;
  345. margin: 0 0 20px 20px;
  346. }
  347. .input-item .el-input__inner:hover {
  348. border: 1px solid #dcdfe6;
  349. border-right: 0;
  350. outline: 0;
  351. }
  352. .input-item .el-input__inner:focus {
  353. border: 1px solid #dcdfe6;
  354. border-right: 0;
  355. outline: 0;
  356. }
  357. .input-item .el-input-group__append {
  358. background-color: #fff;
  359. border-left: 0;
  360. width: 10%;
  361. padding: 0;
  362. }
  363. /* .input-item .el-input-group__append .el-button {
  364. padding: 0;
  365. }
  366. .input-item .el-input-group__append .el-button {
  367. margin: 0;
  368. }
  369. .table-body .el-button {
  370. padding: 0!important;
  371. border: 0;
  372. margin: 0 5px;
  373. } */
  374. .el-table th>.cell {
  375. color: #333;
  376. font-weight: bold;
  377. font-size: 14px;
  378. }
  379. .el-table__footer-wrapper,
  380. .el-table__header-wrapper {
  381. border-bottom: 1.4px solid #D6D6D6;
  382. }
  383. .stat_details {
  384. padding-bottom: 30px;
  385. display: flex;
  386. }
  387. .order_module {
  388. flex: 1;
  389. background: #F2F2F2;
  390. margin: 0 5px;
  391. padding: 20px 25px;
  392. }
  393. .order_module:last-child {
  394. margin-right: 0;
  395. }
  396. .order_module:first-child {
  397. margin-left: 0;
  398. }
  399. .price {
  400. font-size: 22px;
  401. font-weight: bold;
  402. }
  403. .oirder_modul_title {
  404. font-size: 12px;
  405. margin-bottom: 10px;
  406. display: flex;
  407. align-items: center;
  408. }
  409. .oirder_modul_title .text {
  410. margin-right: 10px;
  411. }
  412. .stat_icon {
  413. font-size: 19px;
  414. color: #BFBFBF;
  415. }
  416. </style>