index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <?php
  2. /*
  3. * @Descripttion:
  4. * @copyright: Copyright (c) 2021 广东七件事集团
  5. * @Author: lun
  6. * @Date: 2021-12-28 23:01:04
  7. */
  8. ?>
  9. <style>
  10. .link_url {
  11. text-align: left;
  12. font-size: 14px;
  13. }
  14. .showqr .el-dialog__body {
  15. text-align: center;
  16. padding-bottom: 10px;
  17. }
  18. .el-dialog {
  19. min-width: 400px;
  20. }
  21. </style>
  22. <div id="app" v-cloak>
  23. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  24. <div slot="header">
  25. <span>会员明细</span>
  26. </div>
  27. <div class="search-box">
  28. <!-- 搜索 -->
  29. <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
  30. <el-form-item label="创建日期">
  31. <el-date-picker
  32. size="small"
  33. v-model="searchForm.create_time"
  34. type="datetimerange"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期">
  39. </el-date-picker>
  40. </el-form-item>
  41. <el-form-item label="活动名称">
  42. <el-input placeholder="请输入活动名称" v-model="searchForm.name"></el-input>
  43. </el-form-item>
  44. <el-form-item label="会员">
  45. <el-input placeholder="请输入会员昵称或者手机号码" v-model="searchForm.user_name"></el-input>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button type="primary" @click="search">搜索</el-button>
  49. <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  50. </el-form-item>
  51. </el-form>
  52. </div>
  53. <div class="table-body">
  54. <el-tabs>
  55. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  56. <el-table-column prop="id" min-width="30" label="ID" align="center"></el-table-column>
  57. <el-table-column label="名称" align="center">
  58. <template slot-scope="scope">
  59. {{ scope.row.rule.name }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="会员" width="180" >
  63. <template slot-scope="scope">
  64. <div class="user_img" v-if="scope.row.user_id>0">
  65. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  66. <div slot="error" class="image-slot">
  67. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  68. </div>
  69. </el-image>
  70. </div>
  71. <div class="user_img" v-else>
  72. <el-image class="default-avatar" :src="scope.row.user_avatar_url">
  73. <div slot="error" class="image-slot">
  74. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  75. </div>
  76. </el-image>
  77. </div>
  78. <div>
  79. <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
  80. <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
  81. <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="对象类型" min-width="40" align="center">
  86. <template slot-scope="scope">
  87. <span v-if="scope.row.grant_object==1"> 全部会员</span>
  88. <span v-if="scope.row.grant_object==2">会员等级</span>
  89. <span v-if="scope.row.grant_object==3">会员标签</span>
  90. <span v-if="scope.row.grant_object==4">会员ID</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="use_time" label="发放内容" min-width="80" align="center">
  94. <template slot-scope="scope">
  95. <span @click="get_setting_data(scope.row)" style="cursor: pointer;">详情</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column prop="use_time" label="创建时间" min-width="80" align="center">
  99. <template slot-scope="scope">
  100. {{ scope.row.created_at | dateTimeFormat('Y-m-d H:i') }}
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. <div style="text-align: right;margin: 20px 0;">
  105. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  106. </div>
  107. </el-tabs>
  108. </div>
  109. </el-card>
  110. <!-- 弹框基本信息开始-->
  111. <el-dialog title="基本信息" width="30%" :visible.sync="setting_data"
  112. @close="setting_data = false" :modal-append-to-body="false">
  113. <el-form :model="addForm" ref="addForm" :inline="true" @submit.native.prevent label-width="300px">
  114. <el-form-item label="" style="width: 100%;margin-bottom:0px;" v-if="detail_one.rule">
  115. 活动名称:{{detail_one.rule.name}}
  116. </el-form-item>
  117. <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if="detail_one.rule && detail_one.rule.redpack">
  118. 红包充值:{{detail_one.rule.redpack}}
  119. <span v-if="detail_one.redpack_remark">备注:{{detail_one.rule.redpack_remark}}</span>
  120. </el-form-item>
  121. <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if="detail_one.rule && detail_one.rule.score">
  122. 积分充值:{{detail_one.rule.score}}
  123. <span v-if="detail_one.score_remark">备注:{{detail_one.rule.score_remark}}</span>
  124. </el-form-item>
  125. <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if="detail_one.rule && detail_one.rule.balance">
  126. 余额充值:{{detail_one.rule.balance}}
  127. <span v-if="detail_one.balance_remark">备注:{{detail_one.rule.balance_remark}}</span>
  128. </el-form-item>
  129. <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if="detail_one.rule && detail_one.rule.coupon_num ">
  130. 优惠卷:{{detail_one.rule.coupon_num}}张
  131. </el-form-item>
  132. <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if="detail_one.rule && detail_one.rule.e_coupon_num">
  133. 电子劵:{{detail_one.rule.e_coupon_num}}张
  134. </el-form-item>
  135. </el-form>
  136. <span slot="footer" class="dialog-footer">
  137. <el-button @click="setting_data = false">取 消</el-button>
  138. </span>
  139. </el-dialog>
  140. <!-- 弹框基本信息结束-->
  141. </div>
  142. <script>
  143. const app = new Vue({
  144. el: '#app',
  145. data: {
  146. loading: false,
  147. btnLoading:false,
  148. delLoading: false,
  149. dialogAddgsVisible:false,
  150. setting_data:false,
  151. page: 1,
  152. active_id:'',
  153. detail_one:[],
  154. pageCount: 0,
  155. list: [],
  156. now_time: 0,
  157. searchForm:{
  158. name:null,
  159. type:null,
  160. user_name:null,
  161. store_type:null,
  162. status:null,
  163. code:null,
  164. },
  165. addForm:{
  166. code:'',
  167. id:'',
  168. }
  169. },
  170. mounted() {
  171. if(getQuery('active_id')) this.active_id = getQuery('active_id');
  172. this.getList();
  173. },
  174. computed: {
  175. show_clear_search_btn: function() {
  176. return this.searchForm.name != null ||
  177. this.searchForm.type != null ||
  178. this.searchForm.user_name != null ||
  179. this.searchForm.store_type != null ||
  180. this.searchForm.create_time != null ||
  181. this.searchForm.status != null ||
  182. this.searchForm.code != null;
  183. },
  184. },
  185. methods: {
  186. get_setting_data(row){
  187. this.detail_one = row;
  188. this.setting_data = true;
  189. },
  190. pagination(currentPage) {
  191. let self = this;
  192. self.page = currentPage;
  193. self.getList();
  194. },
  195. search() {// 清空查询条件
  196. this.page = 1;
  197. this.getList(this.searchForm);
  198. this.addForm.code = this.searchForm.code;
  199. },
  200. handle(type, data = null) {
  201. switch (type){
  202. case 'send':
  203. this.dialogAddgsVisible = true;
  204. this.addForm.id = data.id;
  205. break;
  206. case 'edit':
  207. navigateTo({r:"issue-coupons/default/edit",id:data.id},true);
  208. break;
  209. case 'delecte':
  210. var param = {id: data.id,status:-1};
  211. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send('issue-coupons/default/handle',param)})
  212. break;
  213. }
  214. },
  215. send(url, params, callback = null) {
  216. let self = this;
  217. request({
  218. params: {
  219. r: url,
  220. },
  221. method: 'post',
  222. data: params
  223. }).then(e => {
  224. if (e.data.code == 0) {
  225. self.$message.success(e.data.msg);
  226. self.getList();
  227. } else {
  228. self.$message.error(e.data.msg);
  229. }
  230. }).catch(e => {
  231. console.log(e);
  232. });
  233. if(callback) return e.data;
  234. },
  235. resetSearch() {// 清空查询条件
  236. this.searchForm = {
  237. name: null,
  238. type: null,
  239. user_name: null,
  240. store_type: null,
  241. status: null,
  242. create_time:null,
  243. code:null,
  244. };
  245. this.page = 1;
  246. this.getList();
  247. },
  248. getList(search = {}) {
  249. let self = this;
  250. self.loading = true;
  251. let basic_params = {
  252. page: self.page,
  253. };
  254. params = Object.assign(basic_params, search);
  255. if(this.active_id) { params.active_id = this.active_id;}
  256. request({
  257. params: {
  258. r: 'issue-coupons/member/index'
  259. },
  260. method: 'post',
  261. data: params
  262. }).then(e => {
  263. this.loading = false;
  264. if (e.data.code == 0) {
  265. self.list = e.data.data.list;
  266. self.now_time = e.data.data.now_time;
  267. self.pageCount = e.data.data.page_count;
  268. } else {
  269. self.$message.error(e.data.msg);
  270. }
  271. }).catch(e => {
  272. self.loading = false;
  273. });
  274. }
  275. }
  276. });
  277. </script>
  278. <style>
  279. /*头像样式 start*/
  280. .default-avatar{
  281. width: 50px;
  282. height: 50px;
  283. border-radius: 50%;
  284. }
  285. .user_img{
  286. position: relative;
  287. margin-right: 8px;
  288. height: 50px;
  289. width: 50px;
  290. }
  291. .el-table_1_column_3 .cell { /*-2 表示在第二行*/
  292. display: flex;
  293. }
  294. /*头像样式 end*/
  295. .el-tabs__header {
  296. font-size: 16px;
  297. }
  298. .table-body {
  299. padding: 20px;
  300. background-color: #fff;
  301. }
  302. .table-body .el-button {
  303. padding: 0 !important;
  304. border: 0;
  305. margin: 0 5px;
  306. }
  307. .input-item {
  308. width: 250px;
  309. margin: 0 0 20px;
  310. display: inline-block;
  311. }
  312. .input-item .el-input__inner {
  313. border-right: 0;
  314. }
  315. .input-item .el-input__inner:hover {
  316. border: 1px solid #dcdfe6;
  317. border-right: 0;
  318. outline: 0;
  319. }
  320. .input-item .el-input__inner:focus {
  321. border: 1px solid #dcdfe6;
  322. border-right: 0;
  323. outline: 0;
  324. }
  325. .input-item .el-input-group__append {
  326. background-color: #fff;
  327. border-left: 0;
  328. width: 10%;
  329. padding: 0;
  330. }
  331. .input-item .el-input-group__append .el-button {
  332. padding: 0;
  333. }
  334. .input-item .el-input-group__append .el-button {
  335. margin: 0;
  336. }
  337. .batch {
  338. margin: 0 0 20px;
  339. display: inline-block;
  340. }
  341. .batch .el-button {
  342. padding: 9px 15px !important;
  343. }
  344. .el-table th>.cell{
  345. color: #333;
  346. font-weight: bold;
  347. font-size: 14px;
  348. }
  349. .el-table__footer-wrapper, .el-table__header-wrapper{
  350. border-bottom: 1.4px solid #D6D6D6;
  351. }
  352. .search-box {
  353. padding: 10px 0 0 10px;
  354. background-color: #fff;
  355. margin-bottom: 10px;
  356. }
  357. </style>