Joe пре 4 година
родитељ
комит
d6ea774158
4 измењених фајлова са 156 додато и 248 уклоњено
  1. 7 0
      src/api/system/dept.js
  2. 29 114
      src/views/dzk/Dzk_Report.vue
  3. 0 134
      src/views/dzk/index(15).vue
  4. 120 0
      src/views/station/Station_Group.vue

+ 7 - 0
src/api/system/dept.js

@@ -33,6 +33,13 @@ export function getDept(deptId) {
   })
 }
 
+// 查询当前登录人集团详细
+export function getGroupInfo() {
+  return request({
+    url: '/system/dept/getGroupInfo',
+    method: 'get'
+  })
+}
 // 查询部门下拉树结构
 export function treeselect() {
   return request({

+ 29 - 114
src/views/dzk/Dzk_Report.vue

@@ -1,31 +1,14 @@
 <template>
-  <el-scrollbar style="height: 100%">
     <div>
-      <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>
-          </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>
-          </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-form :model="sumForm">
+        <el-form-item label="电子卡总余额">
+          {{ hzAmt }}元
+        </el-form-item>
+        <el-form-item label="总会员个数">
+          {{ cardNum }}个
+        </el-form-item>
+        <el-form-item label="电子卡每日动态变化值">
+        <div>
         <el-table :data="dayReportList">
           <el-table-column label="日期" align="center" prop="createTime">
             <template slot-scope="scope">
@@ -36,31 +19,17 @@
           <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"
-            @size-change="findSizeChange"
-            @current-change="findPage"
-            :current-page.sync="pageNow"
-            background
-            :pager-count="7"
-            :page-sizes="[5, 10, 20, 50, 100]"
-            :page-size="size"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-          >
-          </el-pagination> -->
-              <pagination
-                v-show="total > 0"
-                :total="total"
-                :page.sync="queryParams.pageNo"
-                :limit.sync="queryParams.pageSetting"
-                @pagination="getList"
-              />
-        </div>
+         <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNo"
+          :limit.sync="queryParams.pageSetting"
+          @pagination="getList"
+        />
       </div>
+        </el-form-item>
+      </el-form>
     </div>
-  </el-scrollbar>
 </template>
 
 <script>
@@ -69,96 +38,42 @@ export default {
   name: "Dzk_Report",
   data() {
     return {
-      charts: null,
-      size: 10,
-      pageNow: 1,
       // 总条数
       total: 0,
       hzAmt: 0,
       cardNum: 0,
-      // 弹出层标题
-      rows: [],
       // 查询参数
       queryParams: {
         pageSetting: 10,
-        pageNum: 1,
-        createdDate: null,
-        stationId: null,
-        stationName: null,
-        beginTime: null,
-        endTime: null,
-        payDate: null,
-        status: "1",
+        pageNo: 1
       },
-      //数据
       dayReportList: [],
-      // 表单参数
-      form: {
-        czAmt: 0,
-        xfAmt: 0,
-      },
-      // 表单校验
-      rules: {},
+      sumForm:{}
     };
   },
 
   created() {
-    this.getHZlist();
-    this.getList();
+    this.init();
   },
   methods: {
-    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";
-      }
-    },
-    cardOilsTypeFotmat(row, column) {
-      if (row.cardOilsType === "1") {
-        return "汽油";
-      } else if (row.cardOilsType === "2") {
-        return "柴油";
-      }
+    init(){
+      this.getHZlist();
+      this.getList();
     },
-    /** 查询电子会员数据 */
     getList() {
-      this.dayReportDetail();
+      selectCard(this.queryParams).then((response) => {
+        this.dayReportList = response.rows;
+        this.total = response.total;
+      });
     },
     getHZlist() {
-      //汇总电子会员数据
       listSum().then((response) => {
         if (response.hasOwnProperty("data")) {
           this.cardNum = response.data.num;
           this.hzAmt = response.data.amt;
         }
       });
-    },
-    findPage(val) {
-      this.pageNow = val;
-      this.dayReportDetail();
-    },
-    findSizeChange(size) {
-      //将val赋值给size
-      this.size = size;
-      //重新去后台查询数据
-      this.dayReportDetail();
-    },
-    dayReportDetail() {
-      // this.queryParams.pageNo = this.pageNow;
-      // this.queryParams.pageSetting = this.size;
-      selectCard(this.queryParams).then((response) => {
-        this.dayReportList = response.rows;
-        this.total = response.total;
-      });
-    },
+    }
   },
 };
 </script>

+ 0 - 134
src/views/dzk/index(15).vue

@@ -1,134 +0,0 @@
-<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
-            v-for="item in oilOptions"
-            :key="item.dictValue"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></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" >
-      <el-table-column label="id" align="center" prop="id" v-if="false"/>
-      <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="usageType"  :formatter="usageTypeFotmat"/>
-      <el-table-column label="电子会员卡充值消费类型:1.微信;2.POS机" align="center" prop="payType" v-if="false" />
-      <el-table-column label="油类" align="center" prop="cardOilsType"  :formatter="cardOilsTypeFotmat"/>
-      <el-table-column label="充值,消费金额" align="center" prop="amt" />
-      <el-table-column label="赠送金额" align="center" prop="presentAmt" />
-      <el-table-column label="余额" align="center" prop="balance" />
-      <el-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: "Record",
-  data() {
-    return {
-      // 总条数
-      total: 0,
-      // 客户电子会员卡充值消费记录表格数据
-      recordList:[],
-      oilOptions:[],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        orderNo: null,
-        customerNo: null,
-        customerName: null,
-        usageType: null,
-        payType: null,
-        cardOilsType: null,
-      }
-    };
-  },
-  created() {
-    this.getList();
-    this.getDicts("oil").then(response => {
-      this.oilOptions = response.data;
-    });
-  },
-  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 === '4'){
-        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>

+ 120 - 0
src/views/station/Station_Group.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="app-container" v-if="jiBie==1">    
+    <el-form ref="form" :model="form" :rules="rules" label-width="160px">
+      <el-form-item label="集团内共享积分" prop="integralRuleFlag">
+        <el-radio-group v-model="form.integralRuleFlag" :disabled="disabled">
+          <el-radio label="0">不共享</el-radio>
+          <el-radio label="1">共享</el-radio>
+        </el-radio-group>
+        <div style="color: red; font-size: 12px">
+          不共享:每个站点单独设置积分规则,每个集团下站点的积分不统一
+        </div>
+        <div style="color: red; font-size: 12px">
+          共享:集团站点统一设置积分规则,每个集团下的站点积分统一,每个站点下的商品需要站点单独配置
+        </div>
+      </el-form-item>
+      <el-form-item label="集团内共享电子卡" prop="cardRuleFlag">
+        <el-radio-group v-model="form.cardRuleFlag" :disabled="disabled">
+          <el-radio label="0">不共享</el-radio>
+          <el-radio label="1">共享</el-radio>
+        </el-radio-group>
+        <div style="color: red; font-size: 12px">
+          不共享:每个站点单独设置电子卡规则,每个集团下电子卡不统一
+        </div>
+        <div style="color: red; font-size: 12px">
+          共享:集团站点统一设置电子卡规则,每个集团下的站点电子卡统一
+        </div>
+      </el-form-item>
+      <el-form-item label="集团内共享优惠劵" prop="couponFlag">
+        <el-radio-group v-model="form.couponFlag" disabled="true">
+          <el-radio label="0">不共享</el-radio>
+          <el-radio label="1">共享</el-radio>
+        </el-radio-group>
+        <div style="color: red; font-size: 12px">
+          此功能暂未开放,不支持设置
+        </div>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-row>
+        <el-col :span="4" :offset="1">
+          <el-button
+            type="warning"
+            icon="el-icon-edit"
+            size="mini"
+            @click="edit"
+            >{{this.disabled ? "修改配置": "取消修改"}}</el-button
+          >
+        </el-col>
+        <el-col :span="4" :offset="4">
+          <el-button
+            type="cyan"
+            icon="el-icon-success"
+            size="mini"
+            @click="submitForm"
+            :disabled="disabled"
+            >确认设置</el-button
+          >
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+  <div v-else>
+    该页面只对集团账号开放
+  </div>
+</template>
+
+<script>
+import { getGroupInfo, updateDept } from "@/api/system/dept";
+export default {
+  name: "Station_Group",
+  data() {
+    return {
+      // 表单参数
+      form: {},
+      disabled: true,
+      rules: {
+        integralRuleFlag: [
+          { required: true, message: "请选择是否", trigger: "change" },
+        ],
+        cardRuleFlag: [
+          { required: true, message: "请选择是否开启积分", trigger: "change" },
+        ],
+        couponFlag: [
+          { required: true, message: "请选择是否开启积分", trigger: "change" },
+        ],
+      },
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    init(){
+      this.getGroupInfo();
+    },
+    edit() {
+      this.disabled = !this.disabled;
+    },
+    /** 修改按钮操作 */
+    getGroupInfo() {
+      getGroupInfo().then((response) => {
+        this.form = response.data;
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.deptId != null) {
+            updateDept(this.form).then((response) => {
+              this.msgSuccess("修改成功");
+              this.disabled=true
+            });
+          }
+        }
+      });
+    },
+  },
+};
+</script>