Customer_Info.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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="customerName">
  5. <el-input
  6. v-model="queryParams.customerName"
  7. placeholder="请输入客户姓名"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="联系电话" prop="phoneNumber">
  14. <el-input
  15. v-model="queryParams.phoneNumber"
  16. placeholder="请输入"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="油品" prop="oilName">
  23. <el-select
  24. v-model="queryParams.oilName"
  25. placeholder="请选择油品"
  26. clearable
  27. size="small">
  28. <el-option
  29. v-for="dict in oilNameOptions"
  30. :key="dict.oilPriceId"
  31. :label="dict.oilName"
  32. :value="dict.oilName"
  33. ></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  38. <el-button type="info" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  39. </el-form-item>
  40. </el-form>
  41. <el-table :data="manageList">
  42. <af-table-column label="客户姓名" align="center" prop="customerName" />
  43. <af-table-column label="手机号" align="center" prop="phoneNumber" />
  44. <af-table-column label="油品" align="center" prop="oilName" />
  45. <af-table-column label="汽油余额" align="center" prop="qyAmt" />
  46. <af-table-column label="柴油余额" align="center" prop="cyAmt" />
  47. <af-table-column label="积分" align="center" prop="integral" />
  48. <af-table-column label="操作" align="center" class-name="small-padding fixed-width">
  49. <template slot-scope="scope">
  50. <el-button
  51. size="mini"
  52. type="text"
  53. icon="el-icon-search"
  54. @click="detail(scope.row)"
  55. >
  56. 订单查询
  57. </el-button>
  58. </template>
  59. </af-table-column>
  60. </el-table>
  61. <pagination
  62. v-show="total>0"
  63. :total="total"
  64. :page.sync="queryParams.pageNum"
  65. :limit.sync="queryParams.pageSize"
  66. @pagination="getList"
  67. />
  68. <el-dialog :title="titleOrderInfo" :visible.sync="openOrderInfo" width="700px" append-to-body>
  69. <el-table :data="orderList" >
  70. <af-table-column v-if="false" label="订单id" align="center" prop="orderId" />
  71. <af-table-column label="订单号" width="200" align="center" prop="orderNo" />
  72. <af-table-column label="油品名称" align="center" prop="oilName" />
  73. <af-table-column label="油品价格" align="center" prop="oilPirce" />
  74. <af-table-column label="加油升数" align="center" prop="orderLiters" />
  75. <af-table-column label="金额" align="center" prop="amt" />
  76. <af-table-column label="消费者" width="120" align="center" prop="consumer" />
  77. <af-table-column label="加油员" width="120" align="center" prop="oilPersonnel" />
  78. <af-table-column label="加油枪号" align="center" prop="oilGun" />
  79. <af-table-column label="支付类型" align="center" prop="payType" :formatter="payTypeFotmat"/>
  80. <af-table-column label="油站名称" width="120" align="center" prop="stationName" v-if="false"/>
  81. <af-table-column label="用户id(消费者)" align="center" prop="consumerId" v-if="false" />
  82. <af-table-column label="油站id" align="center" prop="stationId" v-if="false" />
  83. <af-table-column label="状态" align="center" prop="status" :formatter="statusFotmat" width="80px"/>
  84. <af-table-column label="支付时间" align="center" prop="payDate" width="160px">
  85. <template slot-scope="scope">
  86. <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  87. </template>
  88. </af-table-column>
  89. <af-table-column label="创建时间" align="center" prop="createdDate" width="160px">
  90. <template slot-scope="scope">
  91. <span>{{ parseTime(scope.row.createdDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  92. </template>
  93. </af-table-column>
  94. <af-table-column label="订单类型" align="center" prop="orderType" v-if="false" />
  95. </el-table>
  96. <pagination
  97. v-show="totalOrder>0"
  98. :total="totalOrder"
  99. :page.sync="queryOrder.pageNum"
  100. :limit.sync="queryOrder.pageSize"
  101. @pagination="listPage"
  102. />
  103. </el-dialog>
  104. </div>
  105. </template>
  106. <script>
  107. import { listManage, getOrderInfo } from "@/api/customer/manage";
  108. import {stationinfo} from "@/api/station/gun";
  109. import { listPrice } from "@/api/station/price";
  110. export default {
  111. name: "Customer_Info",
  112. data() {
  113. return {
  114. // 总条数
  115. total: 0,
  116. totalOrder: 0,
  117. // 客户管理表格数据
  118. manageList: [],
  119. orderList:[],
  120. // 是否显示弹出层
  121. openOrderInfo: false,
  122. titleOrderInfo:"",
  123. oilNameOptions:[],
  124. // 查询参数
  125. queryParams: {
  126. pageNum: 1,
  127. pageSize: 10,
  128. customerName: null,
  129. commendMan: null,
  130. memberGrade: null,
  131. phoneNumber: null,
  132. oilName: null
  133. },
  134. queryOrder:{
  135. pageNum: 1,
  136. pageSize: 10,
  137. oilName: null,
  138. stationId: null,
  139. consumerId: null
  140. },
  141. };
  142. },
  143. created() {
  144. this.getList();
  145. listPrice().then((response) => {
  146. this.oilNameOptions = response.rows;
  147. console.log('oilNameOptions', this.oilNameOptions);
  148. });
  149. },
  150. methods: {
  151. payTypeFotmat(row, column){
  152. if(row.payType === 'sxf'){
  153. return '随行付'
  154. }else if(row.payType === 'dzk'){
  155. return '电子卡'
  156. }else if(row.payType === 'wx'){
  157. return '微信'
  158. }else if(row.payType === 'zfb'){
  159. return '支付宝'
  160. }else if(row.payType === 'xj'){
  161. return '现金'
  162. }
  163. },
  164. statusFotmat(row, column){
  165. if(row.status === '0'){
  166. return '未支付'
  167. }else if(row.status === '1'){
  168. return '已支付'
  169. }
  170. },
  171. /** 查询客户管理列表 */
  172. getList() {
  173. listManage(this.queryParams).then(response => {
  174. this.manageList = response.rows;
  175. this.total = response.total;
  176. });
  177. },
  178. /** 搜索按钮操作 */
  179. handleQuery() {
  180. this.queryParams.pageNum = 1;
  181. this.getList();
  182. },
  183. /** 重置按钮操作 */
  184. resetQuery() {
  185. this.resetForm("queryForm");
  186. this.handleQuery();
  187. },
  188. detail(row){
  189. console.log("row",row);
  190. row.page= this.queryOrder.pageNum;
  191. row.limit= this.queryOrder.pageSize;
  192. this.listPage(row);
  193. },
  194. listPage(row){
  195. this.queryOrder.consumerId = row.minaUserId;
  196. getOrderInfo(this.queryOrder).then(response => {
  197. this.orderList = response.rows;
  198. this.openOrderInfo = true;
  199. this.totalOrder = response.total;
  200. this.titleOrderInfo = "查看客户订单信息";
  201. });
  202. }
  203. }
  204. };
  205. </script>