Bladeren bron

电子卡初步完成

Joe 4 jaren geleden
bovenliggende
commit
9aa9d68993
3 gewijzigde bestanden met toevoegingen van 243 en 298 verwijderingen
  1. 166 0
      src/views/dzk/Dzk_Bill.vue
  2. 76 297
      src/views/dzk/Dzk_Report.vue
  3. 1 1
      src/views/dzk/Dzk_RuleList.vue

+ 166 - 0
src/views/dzk/Dzk_Bill.vue

@@ -0,0 +1,166 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      label-width="68px"
+    >
+      <el-form-item label="会员名" prop="customerName">
+        <el-input
+          v-model="queryParams.customerName"
+          placeholder="请输入客户名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="油品" prop="cardOilsType">
+        <el-select
+          v-model="queryParams.cardOilsType"
+          placeholder="请选择油品"
+          clearable
+          size="small"
+        >
+          <el-option label="汽油卡" value="1"></el-option>
+          <el-option label="柴油卡" value="2"></el-option>
+          <el-option label="非油品卡" value="3"></el-option>
+          <el-option label="LNG卡" value="4"></el-option>
+          <el-option label="CNG卡" value="5"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="类型" prop="usageType">
+        <el-select
+          v-model="queryParams.usageType"
+          placeholder="请选择消费充值类型"
+          clearable
+          size="small"
+        >
+          <el-option label="充值" value="+" />
+          <el-option label="消费" value="-" />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="cyan"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-table :data="recordList">
+      <af-table-column label="id" align="center" prop="id" v-if="false" />
+      <af-table-column label="充值/消费单号" align="center" prop="orderNo" />
+      <!-- <af-table-column label="会员号ID" align="center" prop="customerNo" /> -->
+      <!-- <af-table-column label="客户名" align="center" prop="customerName" /> -->
+      <af-table-column
+        label="消费充值类型"
+        align="center"
+        prop="usageType"
+        :formatter="usageTypeFotmat"
+      />
+      <af-table-column
+        label="电子会员卡充值消费类型:1.微信;2.POS机"
+        align="center"
+        prop="payType"
+        v-if="false"
+      />
+      <af-table-column
+        label="油类"
+        align="center"
+        prop="cardOilsType"
+        :formatter="cardOilsTypeFotmat"
+      />
+      <af-table-column label="充值,消费金额" align="center" prop="amt" />
+      <af-table-column label="赠送金额" align="center" prop="presentAmt" />
+      <af-table-column label="余额" align="center" prop="balance" />
+      <af-table-column
+        label="油站ID"
+        align="center"
+        prop="stationId"
+        v-if="false"
+      />
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listRecord } from "@/api/customer/record";
+
+export default {
+  name: "Dzk_Bill",
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      // 客户电子会员卡充值消费记录表格数据
+      recordList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderNo: null,
+        customerNo: null,
+        customerName: null,
+        usageType: null,
+        payType: null,
+        cardOilsType: null,
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    usageTypeFotmat(row, column) {
+      if (row.usageType === "+") {
+        return "充值";
+      } else if (row.usageType === "-") {
+        return "消费";
+      }
+    },
+    cardOilsTypeFotmat(row, column) {
+      if (row.cardOilsType === "1") {
+        return "汽油";
+      } else if (row.cardOilsType === "2") {
+        return "柴油";
+      } else if (row.cardOilsType === "3") {
+        return "非油品";
+      } else if (row.cardOilsType === "4") {
+        return "LNG";
+      } else if (row.cardOilsType === "5") {
+        return "CNG";
+      }
+    },
+    /** 查询客户电子会员卡充值消费记录列表 */
+    getList() {
+      listRecord(this.queryParams).then((response) => {
+        this.recordList = response.rows;
+        this.total = response.total;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  },
+};
+</script>

+ 76 - 297
src/views/dzk/Dzk_Report.vue

@@ -1,225 +1,147 @@
 <template>
-  <el-scrollbar style="height:100%">
+  <el-scrollbar style="height: 100%">
     <div>
-      <div style="width:99%;">
-        <span style="color:#ff9955;font-size:25px;">|</span>
-        <span style="font-size:20px;">数据概览</span>
+      <div style="width: 99%">
+        <span style="color: #ff9955; font-size: 25px">|</span>
+        <span style="font-size: 20px">数据概览</span>
         <el-row :gutter="10" class="panel-group">
           <el-col :xs="12" :sm="12" :lg="6">
             <div class="flex xiaoliang">
-              <div style="font-size: 28px;">电子会员余额</div>
-              <div style="line-height: 62px;font-size: 32px;">{{hzAmt }}元</div>
+              <div style="font-size: 28px">电子会员余额</div>
+              <div style="line-height: 62px; font-size: 32px">
+                {{ hzAmt }}元
+              </div>
             </div>
           </el-col>
           <el-col :xs="12" :sm="12" :lg="6">
             <div class="flex xiaoe">
-              <div style="font-size: 28px;">电子会员总数</div>
-              <div style="line-height: 62px;font-size: 32px;">{{ cardNum }}个</div>
+              <div style="font-size: 28px">电子会员总数</div>
+              <div style="line-height: 62px; font-size: 32px">
+                {{ cardNum }}个
+              </div>
             </div>
           </el-col>
         </el-row>
       </div>
-      <div style="width:99%; height: 181px;">
-        <span style="color:#ff9955;font-size:25px;">|</span>
-        <span style="font-size:20px;">详情:</span>
-        <el-table v-loading="loading"  :data="dayReportList">
+      <div style="width: 99%; height: 181px">
+        <span style="color: #ff9955; font-size: 25px">|</span>
+        <span style="font-size: 20px">详情:</span>
+        <el-table :data="dayReportList">
           <el-table-column label="日期" align="center" prop="createTime">
-              <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
             </template>
           </el-table-column>
           <el-table-column label="充值金额" align="center" prop="czamt" />
-          <el-table-column label="消费金额" align="center" prop="xfamt"/>
+          <el-table-column label="消费金额" align="center" prop="xfamt" />
           <el-table-column label="新增电子会员" align="center" prop="cardnum" />
         </el-table>
-        <div  style="float:right;">
-          <el-pagination
-            style="padding-top: 15px;"
+        <div style="float: right">
+          <!-- <el-pagination
+            style="padding-top: 15px"
             @size-change="findSizeChange"
             @current-change="findPage"
             :current-page.sync="pageNow"
             background
-            :pager-count="6"
-            :page-sizes="[5,10,20,50,100]"
+            :pager-count="7"
+            :page-sizes="[5, 10, 20, 50, 100]"
             :page-size="size"
             layout="total, sizes, prev, pager, next, jumper"
-            :total="total">
-          </el-pagination>
-        </div>
-      </div> 
-      <el-dialog :title="title" width="800px"  :visible.sync="open" append-to-body>
-        <el-table v-loading="loading" :data="dayReportDetailsList">
-          <el-table-column label="订单单号" align="center" prop="orderNo" />
-          <el-table-column label="微信用户唯一标识" align="center" prop="unionId" v-if="false" />
-          <el-table-column label="会员号ID" align="center" prop="customerNo" />
-          <el-table-column label="会员名" align="center" prop="customerName" />
-          <el-table-column label="油品" align="center" prop="cardOilsType" :formatter="cardOilsTypeFotmat"/>
-          <el-table-column label="订单类型" align="center" prop="usageType" :formatter="usageTypeFotmat"/>
-          <el-table-column label="消费金额" align="center" prop="amt" />
-          <el-table-column label="余额" align="center" prop="balance" />
-          <el-table-column label="消费方式" align="center" prop="payType" :formatter="payTypeFotmat"/>
-          <el-table-column label="油站ID" align="center" prop="stationId" v-if="false"/>
-          <el-table-column label="油站名称" align="center" prop="stationName" />
-          <el-table-column label="油站名称" align="center" prop="create_time" v-if="false"/>
-        </el-table>
-        <div  class="pagination-container">
-          <el-pagination
-            style="padding-top: 15px"
-            @size-change="sizeChange"
-            @current-change="currentChange"
-            :current-page.sync="pageNow2"
-            background
-            :pager-count="6"
-            :page-sizes="[5,10,20,50,100]"
-            :page-size="setting"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total1">
-          </el-pagination>
+            :total="total"
+          >
+          </el-pagination> -->
+              <pagination
+                v-show="total > 0"
+                :total="total"
+                :page.sync="queryParams.pageNo"
+                :limit.sync="queryParams.pageSetting"
+                @pagination="getList"
+              />
         </div>
-      </el-dialog>
+      </div>
     </div>
   </el-scrollbar>
 </template>
 
 <script>
-
-import {listSum,selectCard} from "@/api/customer/card";
-import { xfAmtQuery } from "@/api/customer/consumption";
-import { czAmtQuery,selectCardDetail } from "@/api/customer/recharge";
+import { listSum, selectCard } from "@/api/customer/card";
 export default {
-  name: "source",
+  name: "Dzk_Report",
   data() {
     return {
       charts: null,
-      size:10,
-      pageNow:1,
-      pageNow2:1,
-      setting:10,
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
+      size: 10,
+      pageNow: 1,
       // 总条数
       total: 0,
-      total1: 0,
       hzAmt: 0,
-      cardNum:0,
-      // 优惠劵管理表格数据
-      couponList: [],
-      dayReportDetailsList: [],
-      dateRangeCreatedDate: [],
-      //x轴数据
-      xdata: [],
-      //92#汽油数据
-      czdata: [],
-      //95#汽油数据
-      xfdata: [],
+      cardNum: 0,
       // 弹出层标题
-      title: "",
-      rows:[],
-      // 是否显示弹出层
-      open: false,
+      rows: [],
       // 查询参数
       queryParams: {
-        pageSetting:10,
-        pageNum:1,
+        pageSetting: 10,
+        pageNum: 1,
         createdDate: null,
-        stationId:null,
+        stationId: null,
         stationName: null,
         beginTime: null,
         endTime: null,
         payDate: null,
-        status:"1"
-      },
-      // 查询参数
-      queryInfo: {
-        pageSetting:10,
-        pageNo:1,
-        createDate: null
-      },
-      query:{
-        stationId:null
+        status: "1",
       },
-      //日报数据
+      //数据
       dayReportList: [],
       // 表单参数
       form: {
         czAmt: 0,
-        xfAmt: 0
+        xfAmt: 0,
       },
       // 表单校验
-      rules: {}
+      rules: {},
     };
   },
- 
+
   created() {
-    this.dayDataSource();
     this.getHZlist();
-    //获取折线图的数据
-    this.reset();
-    this.queryParams.beginTime = this.getMonthDate();
-    this.queryParams.endTime = this.getEndFormatDate(new Date());
-    this.queryParams.stationId=this.$store.selectDeptId;
+    this.getList();
   },
   methods: {
-    usageTypeFotmat(row, column){
-      if(row.usageType === '+'){
-        return '充值'
-      }else if(row.usageType === '-'){
-        return '消费'
+    usageTypeFotmat(row, column) {
+      if (row.usageType === "+") {
+        return "充值";
+      } else if (row.usageType === "-") {
+        return "消费";
       }
     },
-    payTypeFotmat(row, column){
-      if(row.payType === '1'){
-        return '小程序'
-      }else if(row.payType === '2'){
-        return 'POS'
+    payTypeFotmat(row, column) {
+      if (row.payType === "1") {
+        return "小程序";
+      } else if (row.payType === "2") {
+        return "POS";
       }
     },
-    cardOilsTypeFotmat(row, column){
-      if(row.cardOilsType === '1'){
-        return '汽油'
-      }else if(row.cardOilsType === '2'){
-        return '柴油'
+    cardOilsTypeFotmat(row, column) {
+      if (row.cardOilsType === "1") {
+        return "汽油";
+      } else if (row.cardOilsType === "2") {
+        return "柴油";
       }
     },
     /** 查询电子会员数据 */
     getList() {
-      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
-        this.queryParams.stationId =this.$store.state.user.deptId;
-      }
-      xfAmtQuery(this.queryParams).then(response => {
-        if (response.hasOwnProperty('data')) {
-          this.form.xfAmt = response.data.amt;
-        }
-      });
-      czAmtQuery(this.queryParams).then(response => {
-        if (response.hasOwnProperty('data')) {
-          this.form.czAmt = response.data.amt;
-        }
-      });
       this.dayReportDetail();
     },
-    getHZlist(){
+    getHZlist() {
       //汇总电子会员数据
-      this.query.stationId=this.$store.selectDeptId;
-      if(this.query.stationId==null || this.query.stationId==""){
-        this.query.stationId =this.$store.state.user.deptId;
-      }
-      listSum(this.query).then(response => {
-        if (response.hasOwnProperty('data')) {
-          this.cardNum= response.data.num;
+      listSum().then((response) => {
+        if (response.hasOwnProperty("data")) {
+          this.cardNum = response.data.num;
           this.hzAmt = response.data.amt;
         }
       });
     },
-    findPage(val){
+    findPage(val) {
       this.pageNow = val;
       this.dayReportDetail();
     },
@@ -229,158 +151,15 @@ export default {
       //重新去后台查询数据
       this.dayReportDetail();
     },
-    dayReportDetail(){
-      this.loading = false;
-      this.queryParams.pageNo =this.pageNow;
-      this.queryParams.pageSetting =this.size;
-      selectCard(this.queryParams).then(response => {
-       this.dayReportList= response.rows;
+    dayReportDetail() {
+      // this.queryParams.pageNo = this.pageNow;
+      // this.queryParams.pageSetting = this.size;
+      selectCard(this.queryParams).then((response) => {
+        this.dayReportList = response.rows;
         this.total = response.total;
       });
     },
-    //本日的数据
-    dayDataSource() {
-      this.reset();
-      this.queryParams.beginTime = this.getNowFormatDate(new Date());
-      this.queryParams.endTime = this.getEndFormatDate(new Date());
-      this.queryParams.stationId=this.$store.selectDeptId;
-      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
-        this.queryParams.stationId =this.$store.state.user.deptId;
-      }
-      this.getList();
-    },
-    //今天
-    getNowFormatDate(date) {
-      let seperator1 = "-";
-      let month = date.getMonth() + 1;
-      let strDate = date.getDate();
-      if (month >= 1 && month <= 9) {
-        month = "0" + month;
-      }
-      if (strDate >= 0 && strDate <= 9) {
-        strDate = "0" + strDate;
-      }
-      let currentdate1 =
-        date.getFullYear() + seperator1 + month + seperator1 + strDate;
-      return currentdate1;
-    },
-    //明天
-    getEndFormatDate(myDate) {
-      let date = myDate.getDate();
-      date = date + 1;
-      myDate.setDate(date);
-      let seperator2 = "-";
-      let month = myDate.getMonth() + 1;
-      let strDate = myDate.getDate();
-      if (month >= 1 && month <= 9) {
-        month = "0" + month;
-      }
-      if (strDate >= 0 && strDate <= 9) {
-        strDate = "0" + strDate;
-      }
-      let currentdate2 =
-        myDate.getFullYear() + seperator2 + month + seperator2 + strDate;
-      return currentdate2;
-    },
-    //昨天
-    getFormatDate(myDate) {
-      let date = myDate.getDate();
-      date = date - 1;
-      myDate.setDate(date);
-      let seperator3 = "-";
-      let month = myDate.getMonth() + 1;
-      let strDate = myDate.getDate();
-      if (month >= 1 && month <= 9) {
-        month = "0" + month;
-      }
-      if (strDate >= 0 && strDate <= 9) {
-        strDate = "0" + strDate;
-      }
-      let currentdate3 =
-        myDate.getFullYear() + seperator3 + month + seperator3 + strDate;
-      return currentdate3;
-    },
-    getDates() {
-      var new_Date = new Date();
-      var timesStamp = new_Date.getTime();
-      var currenDay = new_Date.getDay();
-      var dates = new Date(
-        timesStamp + 24 * 60 * 60 * 1000 * (0 - ((currenDay + 6) % 7))
-      )
-        .toLocaleDateString()
-        .replace(/[年月]/g, "-")
-        .replace(/[日上下午]/g, "");
-      let s = dates.replace(/-/g, "/");
-      var dt = new Date(s);
-      var m = dt.getMonth() + 1;
-      var d = dt.getDate();
-      m = m < 10 ? "0" + m : m;
-      d = d < 10 ? "0" + d : d;
-      dates = dt.getFullYear() + "-" + m + "-" + d;
-      return dates;
-    },
-    //本月第一天
-    getMonthDate() {
-      let date = new Date();
-      let seperator1 = "-";
-      let month = date.getMonth() + 1;
-      if (month >= 1 && month <= 9) {
-        month = "0" + month;
-      }
-      let currentdate =
-        date.getFullYear() + seperator1 + month + seperator1 + "01";
-      return currentdate;
-    },
-    // 表单重置
-    reset() {
-      this.queryParams = {
-        pageSetting:10,
-        pageNo:1,
-        createDate: null,
-        stationId: null,
-        stationName: null,
-        beginTime:null,
-        endTime:null
-      };
-      this.form = {
-        czAmt: 0,
-        xfAmt: 0
-      };
-      this.queryInfo={
-        pageSetting:10,
-        pageNo:1,
-        createDate: null
-      };
-    },
-
-    /** 查看详情按钮操作 */
-    handleLook(row) {
-      this.rows=row;
-      this.getLookOrder(row);
-    },
-    sizeChange(psize){
-      //将val赋值给size
-      this.setting = psize;
-      this.getLookOrder(this.rows);
-    },
-    currentChange(val) {
-      this.pageNow2 = val;
-      //重新去后台查询数据
-      this.getLookOrder(this.rows);
-    },
-    getLookOrder(row) {
-      const createDate = row.createTime;
-      this.queryInfo.createDate =createDate.substring(0,10);
-      this.queryInfo.pageNo =this.pageNow2;
-      this.queryInfo.pageSetting =this.setting;
-      return selectCardDetail(this.queryInfo).then(response => {
-        this.dayReportDetailsList = response.rows;
-        this.total1 = response.total;
-        this.open = true;
-        this.title = "电子会员明细";
-      });
-    }
-  }
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 1 - 1
src/views/dzk/Dzk_RuleList.vue

@@ -99,7 +99,7 @@
 import { listDetailInfo } from "@/api/customer/cardSettingDetail";
 import { selectCustomerCardSetting } from "@/api/customer/cardSetting";
 export default {
-  name: "Detail",
+  name: "Dzk_RuleList",
   data() {
     return {
       // 总条数