list.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>会员核销码</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <!-- <div class="item-box" flex="dir:left cross:center">
  19. <div class="label">会员:</div>
  20. <el-input size="small" style="width: 200px" v-model="search.keyword" placeholder="请输入会员昵称、id、手机号"></el-input>
  21. </div -->
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">订单编号:</div>
  24. <el-input size="small" style="width: 200px" v-model="search.order_no" placeholder="请输入订单编号"></el-input>
  25. </div>
  26. <div class="item-box" flex="dir:left cross:center">
  27. <div class="label">创建时间:</div>
  28. <el-date-picker
  29. size="small"
  30. v-model="time"
  31. type="datetimerange"
  32. value-format="yyyy-MM-dd HH:mm:ss"
  33. range-separator="至"
  34. start-placeholder="开始日期"
  35. end-placeholder="结束日期">
  36. </el-date-picker>
  37. </div>
  38. <div class="item-box" flex="dir:left cross:center">
  39. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  40. </el-button>
  41. </div>
  42. </el-form>
  43. <el-tabs v-model="activeName" @tab-click="handleClick">
  44. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  45. @selection-change="handleSelectionChange">
  46. <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
  47. <el-table-column label="领取/使用次数" prop="change_num" align="center" min-width="200">
  48. <template slot-scope="scope">
  49. <div v-if="scope.row.change_type == 'sub'">{{'-' + scope.row.change_num}}</div>
  50. <div v-else>{{'+' + scope.row.change_num}}</div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="订单编号" prop="order_no" align="center" min-width="200">
  54. <template slot-scope="scope">
  55. <div>{{scope.row.order_no}}</div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="说明" prop="desc" align="center" min-width="200">
  59. <template slot-scope="scope">
  60. <div>{{scope.row.desc}}</div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="创建时间" prop="created_at" min-width="160" align="center">
  64. <template slot-scope="scope">
  65. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. </el-tabs>
  70. <!-- 分页器 -->
  71. <div flex="box:last cross:center">
  72. <div></div>
  73. <div>
  74. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  75. style="display: inline-block;float: right;" background @current-change="pageChange"
  76. layout="prev, pager, next" :total="pagination.totalCount">
  77. </el-pagination>
  78. </div>
  79. </div>
  80. </div>
  81. </el-card>
  82. </div>
  83. <script>
  84. const app = new Vue({
  85. el: '#app',
  86. data: {
  87. page:1,
  88. time:[], //本地存时间,请求时不发送
  89. search: {
  90. user_id : '',
  91. keyword:'',
  92. date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
  93. date_start : '',
  94. order_no: '',
  95. },
  96. loading: false,
  97. activeName: '-1',
  98. list: [], //列表数据
  99. pagination: null,
  100. },
  101. mounted() {
  102. this.search.user_id = getQuery('user_id');
  103. // 获取列表首页数据
  104. this.loadData(this.page,this.search); //获取列表数据
  105. },
  106. methods: {
  107. // 1.0 获取列表
  108. loadData(page,others) {
  109. this.loading = true;
  110. console.log(this.search);
  111. if(!this.time){
  112. this.search.date_start = '';
  113. this.search.date_end = '';
  114. }else{
  115. this.search.date_start = this.time[0];
  116. this.search.date_end = this.time[1];
  117. }
  118. request({
  119. method: 'get',
  120. params: {
  121. r: 'write-off/default/list',
  122. page: page,
  123. ...others, //其他搜索字段
  124. },
  125. }).then(e => {
  126. this.loading = false;
  127. if (e.data.code === 0) {
  128. this.list = e.data.data.list;
  129. this.pagination = e.data.data.pagination;
  130. } else {
  131. this.$message.error(e.data.msg);
  132. }
  133. }).catch(e => {
  134. });
  135. },
  136. pageChange(page) {
  137. this.page = page;
  138. this.loadData(this.page,this.search);
  139. },
  140. handleClick(tab, event) {
  141. this.page = 1;
  142. this.search.status = this.activeName;
  143. this.loadData(this.page,this.search)
  144. },
  145. handleSelectionChange(val) {
  146. let self = this;
  147. self.choose_list = [];
  148. val.forEach(function (item) {
  149. self.choose_list.push(item.id);
  150. })
  151. },
  152. searchs() {
  153. this.page = 1;
  154. this.loadData(this.page,this.search);
  155. },
  156. }
  157. });
  158. </script>
  159. <style>
  160. .el-tabs__header {
  161. font-size: 16px;
  162. }
  163. .table-body {
  164. padding: 20px;
  165. background-color: #fff;
  166. }
  167. .table-body .el-button {
  168. padding: 0 !important;
  169. border: 0;
  170. margin: 0 5px;
  171. }
  172. .input-item {
  173. width: 250px;
  174. margin: 0 0 20px;
  175. display: inline-block;
  176. }
  177. .input-item .el-input__inner {
  178. border-right: 0;
  179. }
  180. .input-item .el-input__inner:hover {
  181. border: 1px solid #dcdfe6;
  182. border-right: 0;
  183. outline: 0;
  184. }
  185. .input-item .el-input__inner:focus {
  186. border: 1px solid #dcdfe6;
  187. border-right: 0;
  188. outline: 0;
  189. }
  190. .input-item .el-input-group__append {
  191. background-color: #fff;
  192. border-left: 0;
  193. width: 10%;
  194. padding: 0;
  195. }
  196. .input-item .el-input-group__append .el-button {
  197. padding: 0;
  198. }
  199. .input-item .el-input-group__append .el-button {
  200. margin: 0;
  201. }
  202. .batch {
  203. margin: 0 0 20px;
  204. display: inline-block;
  205. }
  206. .batch .el-button {
  207. padding: 9px 15px !important;
  208. }
  209. .item-box{
  210. margin-right: 20px;
  211. }
  212. .item-box .label{
  213. margin-right: 8px;
  214. }
  215. .form-nickname{
  216. width: 180px;
  217. white-space:nowrap;
  218. overflow:hidden;
  219. text-overflow:ellipsis;
  220. }
  221. .index-video-url{
  222. width: 300px;
  223. }
  224. .index-video-url video{
  225. width: 100%;
  226. }
  227. .index-related-info{
  228. width: 500px;
  229. }
  230. .video-top{
  231. width: 100%;
  232. display: flex;
  233. align-items: flex-start;
  234. box-sizing: border-box;
  235. padding: 20px;
  236. /* opacity: .5; */
  237. background-color: #FFFFFF;
  238. }
  239. .video-top .top-right{
  240. line-height: 26px;
  241. }
  242. .video-top .top-right .top-title{
  243. font-size: 18px;
  244. white-space:nowrap;
  245. overflow:hidden;
  246. text-overflow:ellipsis;
  247. width: 360px;
  248. }
  249. .video-top .top-right .wrapper{
  250. display: flex;
  251. /* align-items: flex-start; */
  252. }
  253. .video-top .top-right .wrapper .to-copy{
  254. /* color: #03C5FF; */
  255. margin-left: 20px;
  256. }
  257. .video-top .top-right .detail-price{
  258. color: #BC0100;
  259. font-size: 18px;
  260. font-family: Microsoft YaHei;
  261. font-weight: bold;
  262. }
  263. /* .atooltip {
  264. background: #FFFFFF !important;
  265. border: none !important;
  266. } */
  267. .el-table th>.cell{
  268. color: #333;
  269. font-weight: bold;
  270. font-size: 14px;
  271. }
  272. .el-table__footer-wrapper, .el-table__header-wrapper{
  273. border-bottom: 1.4px solid #D6D6D6;
  274. }
  275. .award-money{
  276. color: #BC0100;
  277. }
  278. </style>