used-list.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1500px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div flex="cross:center box:first">
  5. <div><span @click="$navigate({r:'members-card/default/list'})" class="text">亲友卡列表 </span>/消费明细</div>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. <div class="input-item">
  10. <el-input @keyup.enter.native="loadData" size="small" placeholder="门店名称" v-model="search.keyword"
  11. clearable @clear="toSearch">
  12. </el-input>
  13. </div>
  14. <div class="input-item">
  15. <el-input @keyup.enter.native="loadData" size="small" placeholder="商品名称" v-model="search.keyword1"
  16. clearable @clear="toSearch">
  17. </el-input>
  18. </div>
  19. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  20. <el-tabs v-model="activeName" @tab-click="handleClick">
  21. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  22. @selection-change="handleSelectionChange">
  23. <el-table-column prop="id" label="编码" align="center"></el-table-column>
  24. <el-table-column label="门店名称" prop="mobile" align="center" >
  25. <template slot-scope="scope">
  26. <div>{{scope.row.store_name}}</div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="商品名称" prop="mobile" align="center" >
  30. <template slot-scope="scope">
  31. <div>{{scope.row.goods_name}}</div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="订单编号" prop="mobile" align="center" >
  35. <template slot-scope="scope">
  36. <div>{{scope.row.order_no}}</div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="订单金额" prop="mobile" align="center" >
  40. <template slot-scope="scope">
  41. <div>{{scope.row.order_money}}</div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="折扣金额" prop="mobile" align="center" >
  45. <template slot-scope="scope">
  46. <div>{{scope.row.discount_money}}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="实付金额" prop="mobile" align="center" >
  50. <template slot-scope="scope">
  51. <div>{{scope.row.pay_money}}</div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="创建时间" align="center">
  55. <template slot-scope="scope">
  56. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. </el-tabs>
  61. <div flex="box:last cross:center">
  62. <div></div>
  63. <div>
  64. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  65. style="display: inline-block;float: right;" background @current-change="pageChange"
  66. layout="prev, pager, next" :total="pagination.totalCount">
  67. </el-pagination>
  68. </div>
  69. </div>
  70. </div>
  71. </el-card>
  72. </div>
  73. <script>
  74. const app = new Vue({
  75. el: '#app',
  76. data: {
  77. avatar: '',
  78. nickname: '',
  79. search: {
  80. keyword: '',
  81. keyword1:'',
  82. page: 1,
  83. id:0,
  84. },
  85. loading: false,
  86. activeName: '-1',
  87. list: [],
  88. pagination: null,
  89. dialogChild: false,
  90. dialogLoading: false,
  91. dialogContent: false,
  92. remarksForm: {
  93. remarks: '',
  94. user_id: '',
  95. id: '',
  96. },
  97. remarksLoading: false,
  98. exportList: {},
  99. userEdit: {
  100. show: false,
  101. },
  102. level: {
  103. show: false,
  104. agent: null,
  105. },
  106. commission_arr: {},
  107. agentLevelList: [],
  108. levelList: {},
  109. choose_list: [],
  110. sort: 0,
  111. sort_id: 0,
  112. incomeCapitalTypeList:[
  113. {
  114. value:1,
  115. label:'已结算',
  116. },
  117. {
  118. value:2,
  119. label:'待结算',
  120. },
  121. ],
  122. selectData:'',
  123. },
  124. mounted() {
  125. if (getQuery('id')) {
  126. this.search.id = getQuery('id');
  127. }
  128. this.loadData();
  129. },
  130. methods: {
  131. loadData() {
  132. this.loading = true;
  133. let params = {
  134. r: 'members-card/default/used-list'
  135. };
  136. params = Object.assign(params, this.search);
  137. request({
  138. params: params,
  139. method: 'get',
  140. }).then(e => {
  141. this.loading = false;
  142. if (e.data.code == 0) {
  143. this.list = e.data.data.list;
  144. this.pagination = e.data.data.pagination;
  145. } else {
  146. this.$message.error(e.data.msg);
  147. }
  148. }).catch(e => {
  149. this.loading = false;
  150. });
  151. },
  152. pageChange(page) {
  153. this.search.page = page;
  154. this.loadData();
  155. },
  156. handleClick(tab, event) {
  157. this.search.page = 1;
  158. this.search.status = this.activeName;
  159. this.loadData()
  160. },
  161. toSearch() {
  162. if(this.selectData && this.selectData[0]){
  163. this.search.start = this.selectData[0];
  164. this.search.end = this.selectData[1];
  165. }else{
  166. this.search.start = '';
  167. this.search.end = '';
  168. }
  169. this.search.page = 1;
  170. this.loadData();
  171. },
  172. switchFun(event,id){
  173. console.log(event);
  174. this.listLoading = true;
  175. request({
  176. params: {
  177. r: 'members-card/default/update-status'
  178. },
  179. method: 'post',
  180. data:{
  181. id:id,
  182. is_enable:event,
  183. }
  184. }).then(e => {
  185. this.listLoading = false;
  186. if (e.data.code == 0) {
  187. this.$message.success('更改状态成功');
  188. } else {
  189. this.$message.error(e.data.msg);
  190. }
  191. this.loadData();
  192. }).catch(e => {
  193. this.$message.error(e.data.msg);
  194. this.listLoading = false;
  195. this.loadData();
  196. });
  197. },
  198. // 跳转编辑页
  199. edit(id) {
  200. id = parseInt(id);
  201. let params = {
  202. r: 'members-card/default/edit',
  203. };
  204. if (id) params = Object.assign(params, {
  205. id: id
  206. });
  207. navigateTo(params);
  208. },
  209. operate(type, data = null) {
  210. let param = { id: data.id, type: type };
  211. switch (type) {
  212. case 'destroy':
  213. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  214. type: 'warning'
  215. }).then(() => {
  216. this.send(param)
  217. })
  218. break;
  219. }
  220. },
  221. send(params) {
  222. let self = this;
  223. request({
  224. params: {
  225. r: 'members-card/default/label',
  226. },
  227. method: 'post',
  228. data: params
  229. }).then(e => {
  230. if (e.data.code == 0) {
  231. self.$message.success(e.data.msg);
  232. self.loadData();
  233. } else {
  234. self.$message.error(e.data.msg);
  235. }
  236. }).catch(e => {
  237. console.log(e);
  238. });
  239. },
  240. }
  241. });
  242. </script>
  243. <style>
  244. .el-tabs__header {
  245. font-size: 16px;
  246. }
  247. .table-body {
  248. padding: 20px;
  249. background-color: #fff;
  250. }
  251. .table-body .el-button {
  252. padding: 0 !important;
  253. border: 0;
  254. margin: 0 5px;
  255. }
  256. .input-item {
  257. width: 250px;
  258. margin: 0 0 20px;
  259. display: inline-block;
  260. }
  261. /*.input-item .el-input__inner {*/
  262. /* border-right: 0;*/
  263. /*}*/
  264. .input-item .el-input__inner:hover {
  265. border: 1px solid #dcdfe6;
  266. /*border-right: 0;*/
  267. outline: 0;
  268. }
  269. .input-item .el-input__inner:focus {
  270. border: 1px solid #dcdfe6;
  271. /*border-right: 0;*/
  272. outline: 0;
  273. }
  274. .input-item .el-input-group__append {
  275. background-color: #fff;
  276. border-left: 0;
  277. width: 10%;
  278. padding: 0;
  279. }
  280. .input-item .el-input-group__append .el-button {
  281. padding: 0;
  282. }
  283. .input-item .el-input-group__append .el-button {
  284. margin: 0;
  285. }
  286. .batch {
  287. margin: 0 0 20px;
  288. display: inline-block;
  289. }
  290. .batch .el-button {
  291. padding: 9px 15px !important;
  292. }
  293. .el-table th>.cell{
  294. color: #333;
  295. font-weight: bold;
  296. font-size: 14px;
  297. }
  298. .el-table__footer-wrapper, .el-table__header-wrapper{
  299. border-bottom: 1.4px solid #D6D6D6;
  300. }
  301. .el-table th>.cell {
  302. color: #333;
  303. font-weight: bold;
  304. font-size: 14px;
  305. }
  306. .table1 .el-table__footer-wrapper,
  307. .table1 .el-table__header-wrapper {
  308. border-bottom: 1.4px solid #D6D6D6;
  309. }
  310. .user_img{
  311. position: relative;
  312. margin-right: 8px;
  313. /* height: 50px;
  314. width: 50px; */
  315. }
  316. .default-avatar{
  317. width: 50px;
  318. height: 50px;
  319. border-radius: 50%;
  320. margin-right: 8px;
  321. }
  322. .uer-nickname {
  323. flex: 1;
  324. }
  325. </style>