Point_Bill.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. levelId: this.levelId
  114. },
  115. //积分明细 查询参数
  116. query: {
  117. pageNum: 1,
  118. pageSize: 10,
  119. unionId: null,
  120. customerName: null,
  121. recordType: null,
  122. integral: null,
  123. stationId: null,
  124. stationName: null,
  125. levelId: this.levelId
  126. },
  127. };
  128. },
  129. created() {
  130. this.init()
  131. },
  132. methods: {
  133. init(){
  134. this.getList();
  135. },
  136. recordTypeFotmat(row, column){
  137. if(row.recordType === '-'){
  138. return '兑换积分'
  139. }else if(row.recordType === '+'){
  140. return '增加积分'
  141. }
  142. },
  143. /** 查询用户积分列表 */
  144. getList() {
  145. this.queryParams.levelId = this.levelId;
  146. listPoints(this.queryParams).then(response => {
  147. this.pointsList = response.rows;
  148. this.total = response.total;
  149. });
  150. },
  151. /** 查询用户积分明细列表 */
  152. getInfoList() {
  153. this.query.levelId = this.levelId;
  154. listRecord(this.query).then(response => {
  155. this.recordList = response.rows;
  156. this.totalInfo = response.total;
  157. });
  158. },
  159. /** 搜索按钮操作 */
  160. handleQuery() {
  161. this.queryParams.pageNum = 1;
  162. this.getList();
  163. },
  164. /** 重置按钮操作 */
  165. resetQuery() {
  166. this.resetForm("queryForm");
  167. this.handleQuery();
  168. },
  169. //查看明细
  170. lookInfo(rows){
  171. this.query.unionId = rows.unionId;
  172. this.getInfoList();
  173. this.open = true;
  174. this.title = "查看客户积分记录";
  175. },
  176. }
  177. };
  178. </script>