index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <?php
  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: 800px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <span>资金明细</span>
  9. <span style="float: right">
  10. <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' action_url="qi-ding-dong/fund/download" :params="searchData">
  11. </com-export-dialog>
  12. </span>
  13. </div>
  14. <el-row :gutter="10" style="margin-bottom: 10px;">
  15. <el-col :span="is_master ? 12 : 8">
  16. <el-card shadow="never">
  17. <template #header>
  18. <strong>
  19. 累计充值金额
  20. <el-tooltip v-if="is_master" class="item" effect="dark" content="所有子商城累计充值金额" placement="top">
  21. <i class="el-icon-question"></i>
  22. </el-tooltip>
  23. </strong>
  24. </template>
  25. <template>
  26. <div>
  27. <strong class="text-danger" style="font-size: 32px">{{statistics.recharge | amount}}</strong><span class="text-info" style="font-size: 12px; margin-left: 5px">元</span>
  28. </div>
  29. </template>
  30. </el-card>
  31. </el-col>
  32. <el-col :span="is_master ? 12 : 8">
  33. <el-card shadow="never">
  34. <template #header>
  35. <strong>
  36. 累计已使用金额
  37. <el-tooltip v-if="is_master" class="item" effect="dark" content="所有子商城累计支出金额" placement="top">
  38. <i class="el-icon-question"></i>
  39. </el-tooltip>
  40. </strong>
  41. </template>
  42. <template>
  43. <div>
  44. <span class="text-info" style="font-size: 12px;">¥</span><strong class="text-danger" style="font-size: 32px">{{statistics.deduct | amount}}</strong><span class="text-info" style="font-size: 12px; margin-left: 5px">元</span>
  45. </div>
  46. </template>
  47. </el-card>
  48. </el-col>
  49. <el-col :span="8" v-if="!is_master">
  50. <el-card shadow="never">
  51. <template #header>
  52. <strong>
  53. 平台联系方式: {{config.mobile ? config.mobile : '-'}}
  54. </strong>
  55. </template>
  56. <template>
  57. <div>
  58. <div style="width: 43px; height: 43px; overflow: hidden">
  59. <el-image :preview-src-list="[config.contact_image]" class="table-info-img" :src="config.contact_image">
  60. <div slot="error" class="image-slot">
  61. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  62. </div>
  63. </el-image>
  64. </div>
  65. </div>
  66. </template>
  67. </el-card>
  68. </el-col>
  69. </el-row>
  70. <div class="table-body">
  71. <el-form size="small" :inline="true">
  72. <el-form-item v-if="is_master">
  73. <el-input style="width: 200px" v-model="searchData.keyword" placeholder="商城名称/ID" clearable></el-input>
  74. </el-form-item>
  75. <el-form-item>
  76. <el-date-picker size="small" v-model="searchData.date" type="datetimerange" style="float: left"
  77. value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="更新开始日期"
  78. @change="selectDateTime" end-placeholder="更新结束日期">
  79. </el-date-picker>
  80. </el-form-item>
  81. <el-form-item>
  82. <el-button type="primary" @click="searchs">搜索</el-button>
  83. </el-form-item>
  84. </el-form>
  85. <el-tabs v-model="activeName" @tab-click="handleClick">
  86. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  87. <el-table-column label="商城信息">
  88. <template slot-scope="scope">
  89. <div class="table-info-img-text">
  90. <el-image class="table-info-img circle" :src="scope.row.mall.logo">
  91. <div slot="error" class="image-slot">
  92. <com-image src="/resources/img/admin/mall-logo.png"></com-image>
  93. </div>
  94. </el-image>
  95. <div class="table-info-text">
  96. <div style="color:#000;">{{scope.row.mall.name}}</div>
  97. <div style="font-size: 12px;">{{scope.row.mall.id}}</div>
  98. </div>
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="单号" align="center">
  103. <template slot-scope="scope">
  104. {{scope.row.order_no}}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="异动类型" align="center">
  108. <template slot-scope="scope">
  109. {{scope.row.type_txt}}
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="异动金额" align="center">
  113. <template slot-scope="scope">
  114. <el-tag size="mini" :type="scope.row.direction == 1 ? 'success' : 'danger'">
  115. {{scope.row.direction == 1 ? '+' : '-'}} {{scope.row.amount|amount}}
  116. </el-tag>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="异动后金额" align="center">
  120. <template slot-scope="scope">
  121. <el-tag size="mini">
  122. {{scope.row.after_amount|amount}}
  123. </el-tag>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="异动说明" prop="remark" align="left"></el-table-column>
  127. <el-table-column label="创建时间" align="center">
  128. <template slot-scope="scope">
  129. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. </el-tabs>
  134. <div flex="box:last cross:center">
  135. <div></div>
  136. <div>
  137. <el-pagination v-if="list && list.length > 0" style="display: inline-block;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :total="pagination.totalCount">
  138. </el-pagination>
  139. </div>
  140. </div>
  141. </div>
  142. </el-card>
  143. </div>
  144. <script>
  145. const app = new Vue({
  146. el: '#app',
  147. data: {
  148. searchData: {
  149. keyword: '',
  150. start_date: '',
  151. end_date: '',
  152. page: 1,
  153. limit: 10,
  154. },
  155. loading: false,
  156. activeName: '-1',
  157. list: [],
  158. pagination: null,
  159. edit: {
  160. show: false,
  161. },
  162. status: {
  163. 0: {
  164. title: '待结算',
  165. type: 'warning'
  166. },
  167. 1: {
  168. title: '已结算',
  169. type: 'success'
  170. },
  171. 50: {
  172. title: '已关闭',
  173. type: 'danger'
  174. }
  175. },
  176. statistics: {
  177. recharge: 0,
  178. deduct: 0
  179. },
  180. is_master: <?= $is_master ? 1 : 0 ?>,
  181. export_list: <?= $export_list ?>,
  182. config: {
  183. mobile: '',
  184. contact_image: ''
  185. },
  186. },
  187. mounted() {
  188. this.loadData();
  189. },
  190. methods: {
  191. confirmSubmit() {
  192. this.search.status = this.activeName
  193. },
  194. selectDateTime(e) {
  195. if (e != null) {
  196. this.searchData.start_date = e[0];
  197. this.searchData.end_date = e[1];
  198. } else {
  199. this.searchData.start_date = '';
  200. this.searchData.end_date = '';
  201. }
  202. this.searchs();
  203. },
  204. loadData() {
  205. this.loading = true;
  206. request({
  207. params: {
  208. r: 'qi-ding-dong/fund/index',
  209. ...this.searchData
  210. },
  211. }).then(e => {
  212. this.loading = false;
  213. if (e.data.code === 0) {
  214. this.list = e.data.data.list
  215. this.pagination = e.data.data.pagination;
  216. this.statistics = e.data.data.statistics
  217. this.config = e.data.data.config
  218. } else {
  219. this.$message.error(e.data.msg);
  220. }
  221. }).catch(e => {
  222. this.loading = false;
  223. });
  224. },
  225. pageChange(page) {
  226. this.searchData.page = page;
  227. this.loadData();
  228. },
  229. handleClick(tab, event) {},
  230. searchs() {
  231. this.searchData.page = 1;
  232. this.loadData();
  233. },
  234. },
  235. filters: {
  236. amount: function(val) {
  237. return parseFloat(val * 0.01).toFixed(2)
  238. }
  239. }
  240. });
  241. </script>
  242. <style>
  243. .el-tabs__header {
  244. font-size: 16px;
  245. }
  246. .table-body {
  247. padding: 20px;
  248. background-color: #fff;
  249. }
  250. .input-item {
  251. width: 250px;
  252. margin: 0 0 20px;
  253. display: inline-block;
  254. }
  255. .input-item .el-input__inner {
  256. border-right: 0;
  257. }
  258. .input-item .el-input__inner:hover {
  259. border: 1px solid #dcdfe6;
  260. border-right: 0;
  261. outline: 0;
  262. }
  263. .input-item .el-input__inner:focus {
  264. border: 1px solid #dcdfe6;
  265. border-right: 0;
  266. outline: 0;
  267. }
  268. .input-item .el-input-group__append {
  269. background-color: #fff;
  270. border-left: 0;
  271. width: 10%;
  272. padding: 0;
  273. }
  274. /* .input-item .el-input-group__append .el-button {
  275. padding: 0;
  276. }
  277. .input-item .el-input-group__append .el-button {
  278. margin: 0;
  279. } */
  280. .batch {
  281. margin: 0 0 20px;
  282. display: inline-block;
  283. }
  284. /* .batch .el-button {
  285. padding: 9px 15px !important;
  286. } */
  287. .el-table th>.cell {
  288. color: #333;
  289. font-weight: bold;
  290. font-size: 14px;
  291. }
  292. .el-table__footer-wrapper,
  293. .el-table__header-wrapper {
  294. border-bottom: 1.4px solid #D6D6D6;
  295. }
  296. </style>