index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <style>
  2. .table-body {
  3. padding: 20px;
  4. background-color: #fff;
  5. }
  6. .input-item {
  7. display: inline-block;
  8. width: 250px;
  9. margin: 0 0 20px;
  10. }
  11. .input-item .el-input__inner {
  12. border-right: 0;
  13. }
  14. .input-item .el-input__inner:hover {
  15. border: 1px solid #dcdfe6;
  16. border-right: 0;
  17. outline: 0;
  18. }
  19. .input-item .el-input__inner:focus {
  20. border: 1px solid #dcdfe6;
  21. border-right: 0;
  22. outline: 0;
  23. }
  24. .input-item .el-input-group__append {
  25. background-color: #fff;
  26. border-left: 0;
  27. width: 10%;
  28. padding: 0;
  29. }
  30. .input-item .el-input-group__append .el-button {
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. margin: 0;
  35. }
  36. .table-body .el-button {
  37. padding: 0 !important;
  38. border: 0;
  39. margin: 0 5px;
  40. }
  41. .el-table th > .cell {
  42. color: #333;
  43. font-weight: bold;
  44. font-size: 14px;
  45. }
  46. .el-table__footer-wrapper, .el-table__header-wrapper {
  47. border-bottom: 1.4px solid #D6D6D6;
  48. }
  49. .label {
  50. margin-right: 10px;
  51. }
  52. .default-goods{
  53. max-width: 50px;
  54. max-height: 50px;
  55. }
  56. .flex-x-between {
  57. display: -webkit-box;
  58. display: -webkit-flex;
  59. display: flex;
  60. -webkit-box-pack: space-between;
  61. -webkit-justify-content: space-between;
  62. -ms-flex-pack: space-between;
  63. justify-content: space-between;
  64. }
  65. .cont-title {
  66. font-size: 15px;
  67. padding-top: 20px;
  68. padding-bottom: 10px;
  69. font-weight: 700;
  70. }
  71. .cont-num {
  72. font-size: 14px;
  73. font-weight: 700;
  74. padding-bottom: 10px;
  75. }
  76. .center {
  77. text-align: center;
  78. }
  79. .el-dialog__header .el-dialog__title{
  80. font-size: 18px;
  81. }
  82. .el-dialog__wrapper .el-dialog__body{
  83. padding: 3px 20px;
  84. }
  85. /*头像样式 start*/
  86. .default-avatar{
  87. width: 50px;
  88. height: 50px;
  89. border-radius: 50%;
  90. }
  91. .user_img{
  92. position: relative;
  93. margin-right: 8px;
  94. height: 50px;
  95. width: 50px;
  96. }
  97. .el-table_1_column_2 .cell { /*-2 表示在第二行*/
  98. display: flex;
  99. }
  100. /*头像样式 end*/
  101. #qrcode-info{
  102. margin: 20px 31%;
  103. }
  104. .stat_details{
  105. margin-top: 30px;
  106. padding-bottom: 30px;
  107. display: flex;
  108. }
  109. .order_module{
  110. flex: 1;
  111. background: #F2F2F2;
  112. margin: 0 5px;
  113. padding: 20px 25px;
  114. }
  115. .order_module:last-child{
  116. margin-right: 0;
  117. }
  118. .order_module:first-child{
  119. margin-left: 0;
  120. }
  121. .price{
  122. font-size: 22px;
  123. font-weight: bold;
  124. }
  125. .oirder_modul_title{
  126. font-size: 12px;
  127. margin-bottom: 10px;
  128. display: flex;
  129. align-items: center;
  130. }
  131. .oirder_modul_title .text{
  132. margin-right: 10px;
  133. }
  134. .stat_icon{
  135. font-size: 19px;
  136. color: #BFBFBF;
  137. }
  138. </style>
  139. <div id="app" v-cloak>
  140. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  141. <div slot="header">
  142. <div>
  143. <span>{{ score_name }}明细</span>
  144. <div style="float: right;">
  145. <el-button type="primary" size="small" @click="toRechargePage">批量充值</el-button>
  146. </div>
  147. </div>
  148. <div class="stat_details">
  149. <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
  150. <div class="oirder_modul_title">
  151. <div class="text">{{item.name}}</div>
  152. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  153. <i class="el-icon-question stat_icon"></i>
  154. </el-tooltip>
  155. </div>
  156. <div class="price">
  157. {{item.value}}
  158. </div>
  159. </div>
  160. </div>
  161. </template>
  162. </div>
  163. <div class="table-body el-input--small">
  164. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  165. <div class="item-box" flex="dir:left cross:center">
  166. <div class="label">创建时间</div>
  167. <el-date-picker
  168. v-model="time"
  169. type="datetimerange"
  170. value-format="yyyy-MM-dd HH:mm:ss"
  171. range-separator="至"
  172. start-placeholder="开始日期"
  173. end-placeholder="结束日期">
  174. </el-date-picker>
  175. </div>
  176. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  177. <div class="label">会员ID</div>
  178. <el-input style="width: 80px" v-model="search.user_id" placeholder="会员ID"></el-input>
  179. </div>
  180. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  181. <div class="label">会员名称</div>
  182. <el-input style="width: 150px" v-model="search.user_name" placeholder="会员名称"></el-input>
  183. </div>
  184. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  185. <div class="label">会员手机号</div>
  186. <el-input style="width: 150px" v-model="search.mobile" placeholder="请输完整手机号码"></el-input>
  187. </div>
  188. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  189. <div class="label">类型</div>
  190. <el-select size="small" v-model="search.from_type" class="select">
  191. <el-option :key="index" :label="item" :value="index"
  192. v-for="(item, index) in from_type"></el-option>
  193. </el-select>
  194. </div>
  195. <div class="item-box" flex="dir:left cross:center">
  196. <el-button type="primary" size="mini" style="padding: 10px 20px !important;" @click="searchs">搜索
  197. </el-button>
  198. <el-button type="danger" size="small" style="padding: 10px 20px !important;" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  199. </div>
  200. </el-form>
  201. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  202. <el-table-column label="ID" min-width="80" align="center">
  203. <template slot-scope="scope">
  204. <p>{{scope.row.user.id}}</p>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="会员" width="180" class="user_data" >
  208. <template slot-scope="scope">
  209. <div class="user_img" v-if = "scope.row.user">
  210. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  211. <div slot="error" class="image-slot">
  212. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  213. </div>
  214. </el-image>
  215. </div>
  216. <div v-if = "scope.row.user">
  217. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  218. <div style="font-size: 13px;">{{scope.row.user.mobile}}</div>
  219. </div>
  220. </template>
  221. </el-table-column>
  222. <el-table-column :label="score_name+'类型'" min-width="80" align="center">
  223. <template slot-scope="scope">
  224. <p>{{redpack_type[scope.row.integral_wallet_type]}}</p>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="类型" min-width="80" align="center">
  228. <template slot-scope="scope">
  229. <p>{{from_type[scope.row.from_type]}}</p>
  230. </template>
  231. </el-table-column>
  232. <el-table-column :label="score_name+'数额'" min-width="80" align="center">
  233. <template slot-scope="scope">
  234. <div style="font-size: 18px;color: #68CF3D" v-if="scope.row.change_type == 'add'">+{{scope.row.change_num}}</div>
  235. <div style="font-size: 18px;color: #F6AA5A" v-if="scope.row.change_type == 'sub'">{{ -Math.abs(scope.row.change_num)}}</div>
  236. </template>
  237. </el-table-column>
  238. <el-table-column prop="after_num" :label="'变动前'+score_name+'数额'" min-width="60" align="center"></el-table-column>
  239. <el-table-column prop="scope" width="160" label="创建时间">
  240. <template slot-scope="scope">
  241. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="备注" min-width="80" align="center">
  245. <template slot-scope="scope">
  246. <p>{{ scope.row.desc }}</p>
  247. </template>
  248. </el-table-column>
  249. </el-table>
  250. <div style="text-align: right;margin: 20px 0;">
  251. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  252. style="display: inline-block;float: right;" background @current-change="pageChange"
  253. layout="prev, pager, next" :total="pagination.total_count">
  254. </el-pagination>
  255. </div>
  256. </div>
  257. </el-card>
  258. </div>
  259. <script>
  260. const app = new Vue({
  261. el: '#app',
  262. data() {
  263. return {
  264. qrodestatus:false,
  265. listLoading: false,
  266. page: 1,
  267. pageCount: 0,
  268. //基础数据
  269. editBasisData: {
  270. materialTypeList: [],
  271. },
  272. //本地存时间,请求时不发送
  273. time: [],
  274. search: {
  275. user_id: "",
  276. user_name: "",
  277. mobile: "",
  278. date_start: "",
  279. date_end: "",
  280. from_type: "",
  281. },
  282. list: [],
  283. user_grab_list:[],
  284. from_type:[],
  285. redpack_type:[],
  286. new_time:[],
  287. //弹框配置
  288. addForm: {
  289. id: '',
  290. name: '',
  291. },
  292. title: "",
  293. dialogFormVisible: false, //数据弹窗
  294. data_list: {},//数据
  295. goods_data:[],//详细数据
  296. dialogAddgsVisible: false,
  297. redpack_links:'',//前端红包链接
  298. redpack_url:'',//前端红包链接
  299. // 对话框显示与否
  300. dialogVisible: false,
  301. dataloading: false,
  302. pagination:null,
  303. grab_list:'', //红包记录
  304. grab_pagination:null,
  305. grab_page: 1,
  306. grab_pageCount: 0,
  307. score_name: '积分',
  308. orderTotalArr: [
  309. {
  310. type: 'total_integral',
  311. name: '平台激活积分',
  312. value: '0.00',
  313. prompt: '平台全部发放的激活积分',
  314. },
  315. {
  316. type: 'total_frozen_integral',
  317. name: '平台冻结积分',
  318. value: '0.00',
  319. prompt: '平台全部发放的冻结积分',
  320. }
  321. ]
  322. };
  323. },
  324. computed: {
  325. show_clear_search_btn: function() {
  326. return !isEmpty(this.search.user_id)
  327. || !isEmpty(this.search.user_name)
  328. || !isEmpty(this.search.mobile)
  329. || !isEmpty(this.time)
  330. || !isEmpty(this.search.from_type)
  331. }
  332. },
  333. methods: {
  334. resetSearch(){
  335. this.search = {
  336. user_id: '',
  337. user_name: '',
  338. mobile: '',
  339. from_type:'',
  340. }
  341. this.time = '';
  342. this.searchs()
  343. },
  344. searchs() {
  345. this.page = 1;
  346. this.getList();
  347. },
  348. pageChange(currentPage) {
  349. let self = this;
  350. self.page = currentPage;
  351. self.getList();
  352. },
  353. getList() {
  354. let self = this;
  355. self.listLoading = true;
  356. if(getQuery('user_id')) self.search.user_id = getQuery('user_id');
  357. // 检查是否选择了搜索时间
  358. if (!self.time) {
  359. self.search.date_start = '';
  360. self.search.date_end = '';
  361. } else {
  362. self.search.date_start = self.time[0];
  363. self.search.date_end = self.time[1];
  364. }
  365. request({
  366. method: 'post',
  367. params: {
  368. r: 'score-expansion/score-log/index',
  369. },
  370. data: {
  371. page: self.page,
  372. user_id: self.search.user_id,
  373. user_name: self.search.user_name,
  374. mobile: self.search.mobile,
  375. date_start: self.search.date_start,
  376. date_end: self.search.date_end,
  377. from_type: self.search.from_type,
  378. },
  379. }).then(e => {
  380. self.listLoading = false;
  381. self.list = e.data.data.list;
  382. self.redpack_type = e.data.data.redpack_type;
  383. self.redpack_name = e.data.data.redpack_name;
  384. this.pagination = e.data.data.pagination;
  385. this.pagination.pageSize = e.data.data.page_size;
  386. this.pagination.total_count = e.data.data.count;
  387. this.from_type = e.data.data.from_type;
  388. this.new_time = e.data.data.new_time;
  389. this.redpack_links = e.data.data.redpacklinks;
  390. console.log(this.pagination);
  391. }).catch(e => {
  392. console.log(e);
  393. });
  394. },
  395. detail(data) {
  396. console.log(data);
  397. this.data_list = [];
  398. this.goods_data = [];
  399. this.dialogFormVisible = true;
  400. this.data_list = data;
  401. this.goods_data.push(data);
  402. },
  403. handle(type,data = null){
  404. switch (type) {
  405. case 'edit':// 编辑
  406. navigateTo({
  407. r: 'redpack/default/edit',
  408. id:data.id,
  409. });
  410. break;
  411. case 'copy':// 复制
  412. navigateTo({
  413. r: 'redpack/default/edit',
  414. id:data.id,
  415. type:1,
  416. });
  417. break;
  418. case 'qrode'://推广二维码
  419. this.qrodestatus = true;
  420. this.redpack_url = this.redpack_links + '/#/?id=' + data.id;
  421. this.createQrcode(this.redpack_links);
  422. break;
  423. case 'delete':// 删除
  424. data.type = 2;
  425. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.delect(data);})
  426. break;
  427. case 'enable':
  428. data.type = 1;
  429. this.delect(data);
  430. break;
  431. }
  432. },
  433. delect(data){
  434. let self = this;
  435. self.listLoading = true;
  436. request({
  437. params: {
  438. r: 'redpack/default/del-or-enable',
  439. },
  440. method: 'post',
  441. data: {id:data.id,type:data.type},
  442. }).then(e => {
  443. self.listLoading = false;
  444. if (e.data.code === 0) {
  445. self.$message.success(e.data.msg);
  446. } else {
  447. self.$message.error(e.data.msg);
  448. }
  449. self.getList();
  450. }).catch(e => {
  451. console.log(e);
  452. });
  453. },
  454. send(data){
  455. let self = this;
  456. self.listLoading = true;
  457. request({
  458. params: {
  459. r: 'redpack/default/edit',
  460. },
  461. method: 'post',
  462. data:data,
  463. }).then(e => {
  464. self.listLoading = false;
  465. if (e.data.code === 0) {
  466. self.$message.success(e.data.msg);
  467. } else {
  468. self.$message.error(e.data.msg);
  469. }
  470. self.getList();
  471. }).catch(e => {
  472. console.log(e);
  473. });
  474. },
  475. /**
  476. *关闭或取消模态框,清空值
  477. * @param
  478. */
  479. closeDialogAddgsVisible() {
  480. this.$refs.addForm.resetFields();//element封装的方法,清空模态框的值
  481. this.title = "" //初始化title的值
  482. this.addForm = {//初始化addForm中的值
  483. title: "",
  484. }
  485. },
  486. getTotal() {
  487. let self = this;
  488. request({
  489. params: {
  490. r: 'score-expansion/score-log/total'
  491. },
  492. method: 'get',
  493. }).then(e => {
  494. if (e.data.code == 0) {
  495. for (const key in e.data.data.total) {
  496. let info = this.orderTotalArr.filter(v => v.type == key); //订单概况
  497. if(info.length){
  498. let index = this.orderTotalArr.findIndex(v => v.type==info[0].type);
  499. this.orderTotalArr[index].value = Number(e.data.data.total[key]).toFixed(2);
  500. }
  501. }
  502. } else {
  503. self.$message.error(e.data.msg);
  504. }
  505. }).catch(e => {
  506. });
  507. },
  508. toRechargePage() {
  509. navigateTo({
  510. r: 'score-expansion/score-log/import'
  511. });
  512. }
  513. },
  514. mounted: function () {
  515. this.getList();
  516. this.getTotal();
  517. }
  518. });
  519. </script>