use-log.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <div>
  9. <span>使用记录</span>
  10. <el-form size="small" :inline="true" style="float: right;margin-top: -5px;">
  11. <el-form-item>
  12. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>
  13. </el-form-item>
  14. </el-form>
  15. </div>
  16. </div>
  17. <div class="table-body">
  18. 卡编号:
  19. <div class="input-item">
  20. <el-input @keyup.enter.native="search" size="small" placeholder="请输入卡编号" v-model="searchData.order_no" clearable @clear="search"></el-input>
  21. </div>
  22. 开卡用户:
  23. <div class="input-item">
  24. <el-input @keyup.enter.native="search" size="small" placeholder="请输入用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
  25. </div>
  26. 核销门店:
  27. <div class="input-item">
  28. <el-input @keyup.enter.native="search" size="small" placeholder="请输入核销门店" v-model="searchData.store_name" clearable @clear="search"></el-input>
  29. </div>
  30. 核销人:
  31. <div class="input-item">
  32. <el-input @keyup.enter.native="search" size="small" placeholder="请输入核销人" v-model="searchData.clerk_nickname" clearable @clear="search"></el-input>
  33. </div>
  34. 核销时间:
  35. <el-date-picker
  36. size="small"
  37. v-model="searchData.date_time"
  38. type="datetimerange"
  39. range-separator="至"
  40. start-placeholder="开始时间"
  41. end-placeholder="结束时间"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. >
  44. </el-date-picker>
  45. <div style="display: inline-block;margin-left: 10px;">
  46. <el-button type="primary" size="small" @click="search">查询</el-button>
  47. <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
  48. </div>
  49. </div>
  50. <div class="table-body">
  51. <template>
  52. <el-table ref="multipleTable" :data="list" @sort-change="sortChange"
  53. >
  54. <!-- 空数据 -->
  55. <template slot="empty">
  56. <el-empty description="暂无数据"></el-empty>
  57. </template>
  58. <el-table-column prop="order_no" label="卡号" align="center"></el-table-column>
  59. <el-table-column prop="secondary_card_name" label="次卡名称" align="center"></el-table-column>
  60. <el-table-column prop="user_id" label="会员ID" align="center"></el-table-column>
  61. <el-table-column label="开卡用户" width="200">
  62. <template slot-scope="scope">
  63. <div class="user_img" flex="cross:center">
  64. <el-image class="default-avatar" :src="scope.row.avatar_url">
  65. <div slot="error" class="image-slot">
  66. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  67. </div>
  68. </el-image>
  69. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}
  70. <br/>{{scope.row.mobile}}
  71. </div>
  72. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  73. </div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="开卡时间" prop="open_time" align="center" width="200" sortable="open_time">
  77. <template slot-scope="scope">
  78. {{scope.row.open_time|dateTimeFormat('Y-m-d H:i:s')}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="clerk_nums" label="单次核销次数" align="center" ></el-table-column>
  82. <el-table-column prop="store_name" label="核销门店" align="center" ></el-table-column>
  83. <el-table-column prop="clerk_nickname" label="核销人" align="center" ></el-table-column>
  84. <el-table-column label="核销时间" prop="created_at" align="center" width="200" sortable="created_at">
  85. <template slot-scope="scope">
  86. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. </template>
  91. <!-- 分页 -->
  92. <el-row type="flex" class="page" justify="end">
  93. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="list"></el-pagination>
  94. </el-row>
  95. </div>
  96. </div>
  97. </el-card>
  98. </div>
  99. <script>
  100. const app = new Vue({
  101. el: '#app',
  102. data() {
  103. return {
  104. loading: false,
  105. list: [],
  106. searchData: {
  107. order_no: '',
  108. nickname: '',
  109. store_name: '',
  110. clerk_nickname: '',
  111. date_time: '',
  112. },
  113. pageCount: 0,
  114. page: 1,
  115. currentPage: null,
  116. listLoading: false,
  117. type: '',
  118. sort: '',
  119. sort_column:'',
  120. sort_order:'',
  121. exportList: {},
  122. export_url: 'secondary-card/default/use-log',
  123. };
  124. },
  125. created() {
  126. this.searchData.order_no = getQuery('order_no')
  127. },
  128. methods: {
  129. exportConfirm(){},
  130. //搜索
  131. search() {
  132. this.page = 1;
  133. this.loadData();
  134. },
  135. pagination(currentPage) {
  136. this.page = currentPage;
  137. this.loadData();
  138. },
  139. loadData() {
  140. this.listLoading = true;
  141. var param = {
  142. r: 'secondary-card/default/use-log',
  143. page: this.page,
  144. order_no: this.searchData.order_no,
  145. nickname: this.searchData.nickname,
  146. store_name: this.searchData.store_name,
  147. clerk_nickname: this.searchData.clerk_nickname,
  148. date_time: this.searchData.date_time,
  149. sort_column:this.sort_column,
  150. sort_order:this.sort_order,
  151. limit: 15
  152. }
  153. request({
  154. params: param,
  155. }).then(e => {
  156. if (e.data.code === 0) {
  157. this.list = e.data.data.list;
  158. this.exportList = e.data.data.export_list;
  159. this.pageCount = e.data.data.page_count;
  160. this.currentPage = e.data.data.pagination.current_page;
  161. } else {
  162. this.$message.error(e.data.msg);
  163. }
  164. this.listLoading = false;
  165. }).catch(e => {
  166. this.listLoading = false;
  167. });
  168. },
  169. //重置
  170. resetForm() {
  171. this.searchData.order_no = '';
  172. this.searchData.date_time = '';
  173. this.searchData.nickname = '';
  174. this.searchData.store_name = '';
  175. this.searchData.clerk_nickname = '';
  176. },
  177. sortChange( column, prop, order){
  178. this.sort_order = column.order;
  179. this.sort_column = column.prop;
  180. this.loadData();
  181. },
  182. },
  183. mounted: function() {
  184. this.page = getQuery('page') ? getQuery('page') : 1;
  185. this.loadData();
  186. },
  187. });
  188. </script>
  189. <style>
  190. .table-body {
  191. padding: 20px;
  192. background-color: #fff;
  193. }
  194. /* .table-info .el-button {
  195. padding: 0 !important;
  196. border: 0;
  197. margin: 0 5px;
  198. } */
  199. .input-item {
  200. display: inline-block;
  201. width: 150px;
  202. margin: 0 0 20px;
  203. margin-right: 10px;
  204. }
  205. .input-item .el-input__inner {
  206. border-right: 1px solid #dcdfe6;
  207. }
  208. .input-item .el-input__inner:hover {
  209. border: 1px solid #dcdfe6;
  210. border-right: 0;
  211. outline: 0;
  212. }
  213. .input-item .el-input__inner:focus {
  214. border: 1px solid #dcdfe6;
  215. border-right: 0;
  216. outline: 0;
  217. }
  218. .input-item .el-input-group__append {
  219. background-color: #fff;
  220. border-left: 0;
  221. width: 10%;
  222. padding: 0;
  223. }
  224. .input-item .el-input-group__append .el-button {
  225. padding: 0;
  226. }
  227. .input-item .el-input-group__append .el-button {
  228. margin: 0;
  229. }
  230. .select {
  231. float: left;
  232. width: 100px;
  233. margin-right: 10px;
  234. }
  235. .el-table th>.cell {
  236. color: #333;
  237. font-weight: bold;
  238. font-size: 14px;
  239. }
  240. .el-table__footer-wrapper,
  241. .el-table__header-wrapper {
  242. border-bottom: 1.4px solid #D6D6D6;
  243. }
  244. .search-sort {
  245. display: inline-block;
  246. margin: 0px 10px;
  247. cursor: pointer;
  248. color: rgb(51, 51, 51);
  249. }
  250. .caret-wrapper {
  251. display: inline-flex;
  252. flex-direction: column;
  253. align-items: center;
  254. height: 25px;
  255. width: 11px;
  256. vertical-align: middle;
  257. cursor: pointer;
  258. overflow: initial;
  259. position: relative;
  260. }
  261. .caret-top {
  262. border: 5px solid transparent;
  263. margin: 1px 0;
  264. border-bottom-color: rgb(51, 51, 51);
  265. }
  266. .caret-bottom {
  267. border: 5px solid transparent;
  268. margin: 1px 0;
  269. border-top-color: rgb(51, 51, 51);
  270. }
  271. .active {
  272. border-top-color: rgb(41, 186, 156);
  273. }
  274. .ellipsis {
  275. font-size: 14px;
  276. color: #333;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. }
  280. .goods-wrapper {
  281. border: 2px solid #CCCCCC;
  282. display: inline-block
  283. }
  284. .goods-select {
  285. border: 2px solid #bb730c;
  286. }
  287. .goods-price {
  288. text-align: center;
  289. }
  290. .goods-price .number {
  291. color: red;
  292. font-weight: 600;
  293. font-size: 18px;
  294. }
  295. .goods-price .title {
  296. padding: 5px 0;
  297. color: #999;
  298. ;
  299. font-size: 10px;
  300. font-weight: 600;
  301. }
  302. .bottom-price .title {
  303. padding: 5px 0;
  304. color: #8b8888;
  305. ;
  306. font-size: 10px;
  307. }
  308. .bottom-price .number {
  309. color: #ff5100;
  310. font-size: 10px;
  311. }
  312. .goods-action {
  313. margin-top: 8px;
  314. }
  315. .goods-action .title {
  316. color: #0634aa;
  317. }
  318. .bottom-active {
  319. border-bottom-color: rgb(186, 41, 92);
  320. }
  321. .top-active {
  322. border-top-color: rgb(186, 41, 92);
  323. }
  324. .price {
  325. white-space: nowrap;
  326. }
  327. .goods-image {
  328. display: flex;
  329. justify-content: center;
  330. }
  331. .page {
  332. padding: 10px 0;
  333. }
  334. .user_img{
  335. position: relative;
  336. margin-right: 8px;
  337. /* height: 50px;
  338. width: 50px; */
  339. }
  340. .default-avatar{
  341. width: 50px;
  342. height: 50px;
  343. border-radius: 50%;
  344. margin-right: 8px;
  345. }
  346. .uer-nickname {
  347. flex: 1;
  348. }
  349. </style>