Point_Bill.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  4. <el-form-item label="手机号码" prop="mobilePhone">
  5. <el-input
  6. v-model="queryParams.mobilePhone"
  7. placeholder="请输入用户手机号码"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15. <el-button type="info" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16. <!-- <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> -->
  17. </el-form-item>
  18. </el-form>
  19. <el-table :data="pointsList">
  20. <el-table-column label="id" align="center" prop="id" v-if ="false" />
  21. <el-table-column label="微信用户unionID" align="center" prop="unionId" v-if="false"/>
  22. <el-table-column label="公众号的openID" align="center" prop="blogOpenid" v-if="false"/>
  23. <el-table-column label="小程序的openID" align="center" prop="minaOpenid" v-if="false" />
  24. <el-table-column label="会员名" align="center" prop="customerName" />
  25. <el-table-column label="手机号码" align="center" prop="mobilePhone" />
  26. <el-table-column label="账户积分余额" align="center" prop="points" />
  27. <el-table-column label="使用积分累计" align="center" prop="consumptionPoints" />
  28. <el-table-column label="获得积分累计" align="center" prop="accumulatePoints" />
  29. <el-table-column label="失效积分累计" align="center" prop="invalidPoints" />
  30. <el-table-column label="最近积分变化日期" align="center" prop="recentConsumptionDate" width="180">
  31. <template slot-scope="scope">
  32. <span>{{ parseTime(scope.row.recentConsumptionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="油站ID" align="center" prop="stationId" v-if="false"/>
  36. <el-table-column label="油站名称" align="center" prop="stationName" v-if="false" />
  37. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  38. <template slot-scope="scope">
  39. <el-button
  40. size="mini"
  41. type="text"
  42. icon="el-icon-edit"
  43. @click="lookInfo(scope.row)"
  44. >明细</el-button>
  45. </template>
  46. </el-table-column>
  47. </el-table>
  48. <pagination
  49. v-show="total>0"
  50. :total="total"
  51. :page.sync="queryParams.pageNum"
  52. :limit.sync="queryParams.pageSize"
  53. @pagination="getList"
  54. />
  55. <!-- 添加或修改客户积分记录对话框 -->
  56. <el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
  57. <div class="app-container">
  58. <el-table :data="recordList" >
  59. <el-table-column label="主键自增" align="center" prop="id" v-if ="false"/>
  60. <el-table-column label="微信用户唯一标识" align="center" prop="unionId" v-if ="false"/>
  61. <el-table-column label="客户名称" align="center" prop="customerName" />
  62. <el-table-column label="积分记录类型" align="center" prop="recordType" :formatter="recordTypeFotmat" />
  63. <el-table-column label="消耗或增加积分" align="center" prop="integral" />
  64. <el-table-column label="时间" align="center" prop="createTime" />
  65. <el-table-column label="油站ID" align="center" prop="stationId" v-if ="false" />
  66. <el-table-column label="油站名称" align="center" prop="stationName" />
  67. <el-table-column label="订单号" align="center" prop="orderNo" />
  68. </el-table>
  69. <pagination
  70. v-show="totalInfo>0"
  71. :total="totalInfo"
  72. :page.sync="query.pageNum"
  73. :limit.sync="query.pageSize"
  74. @pagination="getInfoList"
  75. />
  76. </div>
  77. </el-dialog>
  78. </div>
  79. </template>
  80. <script>
  81. import { listPoints } from "@/api/integral/points";
  82. import { listRecord } from "@/api/integral/record";
  83. export default {
  84. name: "Points",
  85. data() {
  86. return {
  87. // 总条数
  88. total: 0,
  89. totalInfo: 0,
  90. // 用户积分表格数据
  91. pointsList: [],
  92. //用户积分明细
  93. recordList: [],
  94. // 弹出层标题
  95. title: "",
  96. // 是否显示弹出层
  97. open: false,
  98. // 查询参数
  99. queryParams: {
  100. pageNum: 1,
  101. pageSize: 10,
  102. unionId: null,
  103. blogOpenid: null,
  104. minaOpenid: null,
  105. mobilePhone: null,
  106. points: null,
  107. consumptionPoints: null,
  108. accumulatePoints: null,
  109. invalidPoints: null,
  110. recentConsumptionDate: null,
  111. stationId: null,
  112. stationName: null
  113. },
  114. //积分明细 查询参数
  115. query: {
  116. pageNum: 1,
  117. pageSize: 10,
  118. unionId: null,
  119. customerName: null,
  120. recordType: null,
  121. integral: null,
  122. stationId: null,
  123. stationName: null
  124. },
  125. };
  126. },
  127. created() {
  128. this.init()
  129. },
  130. methods: {
  131. init(){
  132. this.getList();
  133. },
  134. recordTypeFotmat(row, column){
  135. if(row.recordType === '-'){
  136. return '兑换积分'
  137. }else if(row.recordType === '+'){
  138. return '增加积分'
  139. }
  140. },
  141. /** 查询用户积分列表 */
  142. getList() {
  143. listPoints(this.queryParams).then(response => {
  144. this.pointsList = response.rows;
  145. this.total = response.total;
  146. });
  147. },
  148. /** 查询用户积分明细列表 */
  149. getInfoList() {
  150. listRecord(this.query).then(response => {
  151. this.recordList = response.rows;
  152. this.totalInfo = response.total;
  153. });
  154. },
  155. /** 搜索按钮操作 */
  156. handleQuery() {
  157. this.queryParams.pageNum = 1;
  158. this.getList();
  159. },
  160. /** 重置按钮操作 */
  161. resetQuery() {
  162. this.resetForm("queryForm");
  163. this.handleQuery();
  164. },
  165. //查看明细
  166. lookInfo(rows){
  167. this.query.unionId = rows.unionId;
  168. this.getInfoList();
  169. this.open = true;
  170. this.title = "查看客户积分记录";
  171. },
  172. }
  173. };
  174. </script>