Ver código fonte

营销管理-前台页面

XF--LRQYEJOKYDS\Administrator 4 anos atrás
pai
commit
bf4db11fbe

+ 7 - 1
Yijia-SaaS/yijia-ui/src/api/customer/setting.js

@@ -8,6 +8,12 @@ export function listSetting(query) {
     params: query
   })
 }
+export function getSettingDT(query) {
+  return request({
+    url: '/customer/setting/onely',
+    method: 'get'
+  })
+}
 
 // 查询客户优惠等级设置详细
 export function getSetting(id) {
@@ -50,4 +56,4 @@ export function exportSetting(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 53 - 0
Yijia-SaaS/yijia-ui/src/api/market/coupon.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询优惠劵管理列表
+export function listCoupon(query) {
+  return request({
+    url: '/market/coupon/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询优惠劵管理详细
+export function getCoupon(couponId) {
+  return request({
+    url: '/market/coupon/' + couponId,
+    method: 'get'
+  })
+}
+
+// 新增优惠劵管理
+export function addCoupon(data) {
+  return request({
+    url: '/market/coupon',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优惠劵管理
+export function updateCoupon(data) {
+  return request({
+    url: '/market/coupon',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优惠劵管理
+export function delCoupon(couponId) {
+  return request({
+    url: '/market/coupon/' + couponId,
+    method: 'delete'
+  })
+}
+
+// 导出优惠劵管理
+export function exportCoupon(query) {
+  return request({
+    url: '/market/coupon/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
Yijia-SaaS/yijia-ui/src/api/market/plan.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询营销方案列表
+export function listPlan(query) {
+  return request({
+    url: '/market/plan/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询营销方案详细
+export function getPlan(id) {
+  return request({
+    url: '/market/plan/' + id,
+    method: 'get'
+  })
+}
+
+// 新增营销方案
+export function addPlan(data) {
+  return request({
+    url: '/market/plan',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改营销方案
+export function updatePlan(data) {
+  return request({
+    url: '/market/plan',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除营销方案
+export function delPlan(id) {
+  return request({
+    url: '/market/plan/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出营销方案
+export function exportPlan(query) {
+  return request({
+    url: '/market/plan/export',
+    method: 'get',
+    params: query
+  })
+}

+ 11 - 11
Yijia-SaaS/yijia-ui/src/views/customer/setting/index.vue

@@ -82,16 +82,16 @@
         </el-col>
       </el-row>
       <el-row>
-        <el-col :span="6">
-          <el-form-item label="会员充值"  prop="memberRecharge">
-            <el-input size="small" v-model="ruleForm.memberRecharge" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="获得成长值"  prop="payPrintNum">
-            <el-input size="small" v-model="ruleForm.memberGrowthValue" />
-          </el-form-item>
-        </el-col>
+<!--        <el-col :span="6">-->
+<!--          <el-form-item label="会员充值"  prop="memberRecharge">-->
+<!--            <el-input size="small" v-model="ruleForm.memberRecharge" />-->
+<!--          </el-form-item>-->
+<!--        </el-col>-->
+<!--        <el-col :span="6">-->
+<!--          <el-form-item label="获得成长值"  prop="payPrintNum">-->
+<!--            <el-input size="small" v-model="ruleForm.memberGrowthValue" />-->
+<!--          </el-form-item>-->
+<!--        </el-col>-->
       </el-row>
       <el-row v-show="false">
         <el-col :span="6">
@@ -284,7 +284,7 @@ export default {
       this.selectParams.gradeType="2";
       this.loading = true;
       listSetting(this.selectParams).then(response => {
-        this.ruleForm  = response.rows;
+        this.ruleForm  = response.data;
       });
     },
     // 取消按钮

+ 379 - 0
Yijia-SaaS/yijia-ui/src/views/market/coupon/index.vue

@@ -0,0 +1,379 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="油站编码" prop="stationNo">
+        <el-input
+          v-model="queryParams.stationNo"
+          placeholder="请输入油站编码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="油站名称" prop="stationName">
+        <el-input
+          v-model="queryParams.stationName"
+          placeholder="请输入油站名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠卷名称" prop="couponName">
+        <el-input
+          v-model="queryParams.couponName"
+          placeholder="请输入优惠卷名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠劵规则" prop="couponRule">
+        <el-input
+          v-model="queryParams.couponRule"
+          placeholder="请输入优惠劵规则"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠类型" prop="couponType">
+        <el-select v-model="queryParams.couponType" placeholder="请选择优惠类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="优惠金额" prop="couponAmt">
+        <el-input
+          v-model="queryParams.couponAmt"
+          placeholder="请输入优惠金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="满减金额" prop="couponReulAmt">
+        <el-input
+          v-model="queryParams.couponReulAmt"
+          placeholder="请输入满减金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠油品" prop="couponOil">
+        <el-input
+          v-model="queryParams.couponOil"
+          placeholder="请输入优惠油品"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="有效期" prop="validityDate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.validityDate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择有效期">
+        </el-date-picker>
+      </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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['market:coupon:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['market:coupon:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['market:coupon:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['market:coupon:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="couponList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="有效期" align="center" prop="couponId" />
+      <el-table-column label="油站编码" align="center" prop="stationNo" />
+      <el-table-column label="油站名称" align="center" prop="stationName" />
+      <el-table-column label="优惠卷名称" align="center" prop="couponName" />
+      <el-table-column label="优惠劵规则" align="center" prop="couponRule" />
+      <el-table-column label="优惠类型" align="center" prop="couponType" />
+      <el-table-column label="优惠金额" align="center" prop="couponAmt" />
+      <el-table-column label="满减金额" align="center" prop="couponReulAmt" />
+      <el-table-column label="优惠油品" align="center" prop="couponOil" />
+      <el-table-column label="有效期" align="center" prop="validityDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.validityDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['market:coupon:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['market:coupon:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改优惠劵管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="油站编码" prop="stationNo">
+          <el-input v-model="form.stationNo" placeholder="请输入油站编码" />
+        </el-form-item>
+        <el-form-item label="油站名称" prop="stationName">
+          <el-input v-model="form.stationName" placeholder="请输入油站名称" />
+        </el-form-item>
+        <el-form-item label="优惠卷名称" prop="couponName">
+          <el-input v-model="form.couponName" placeholder="请输入优惠卷名称" />
+        </el-form-item>
+        <el-form-item label="优惠劵规则" prop="couponRule">
+          <el-input v-model="form.couponRule" placeholder="请输入优惠劵规则" />
+        </el-form-item>
+        <el-form-item label="优惠类型" prop="couponType">
+          <el-select v-model="form.couponType" placeholder="请选择优惠类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="优惠金额" prop="couponAmt">
+          <el-input v-model="form.couponAmt" placeholder="请输入优惠金额" />
+        </el-form-item>
+        <el-form-item label="满减金额" prop="couponReulAmt">
+          <el-input v-model="form.couponReulAmt" placeholder="请输入满减金额" />
+        </el-form-item>
+        <el-form-item label="优惠油品" prop="couponOil">
+          <el-input v-model="form.couponOil" placeholder="请输入优惠油品" />
+        </el-form-item>
+        <el-form-item label="有效期" prop="validityDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.validityDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择有效期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon, exportCoupon } from "@/api/market/coupon";
+
+export default {
+  name: "Coupon",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 优惠劵管理表格数据
+      couponList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        stationNo: null,
+        stationName: null,
+        couponName: null,
+        couponRule: null,
+        couponType: null,
+        couponAmt: null,
+        couponReulAmt: null,
+        couponOil: null,
+        validityDate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询优惠劵管理列表 */
+    getList() {
+      this.loading = true;
+      listCoupon(this.queryParams).then(response => {
+        this.couponList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        couponId: null,
+        stationNo: null,
+        stationName: null,
+        couponName: null,
+        couponRule: null,
+        couponType: null,
+        couponAmt: null,
+        couponReulAmt: null,
+        couponOil: null,
+        validityDate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.couponId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加优惠劵管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const couponId = row.couponId || this.ids
+      getCoupon(couponId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改优惠劵管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.couponId != null) {
+            updateCoupon(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCoupon(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const couponIds = row.couponId || this.ids;
+      this.$confirm('是否确认删除优惠劵管理编号为"' + couponIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delCoupon(couponIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有优惠劵管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportCoupon(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>

+ 35 - 0
Yijia-SaaS/yijia-ui/src/views/market/marketTable/marketTable.vue

@@ -0,0 +1,35 @@
+<template>
+  <div class="tabjian">
+    <el-tabs v-model="activeName" >
+      <el-tab-pane label="优惠方案" name="fangan" :key="'fangan'">
+        <child1></child1>
+      </el-tab-pane>
+<!--      <el-tab-pane label="积分设置" name="jifen" :key="'jifen'">-->
+<!--        <child2></child2>-->
+<!--      </el-tab-pane>-->
+    </el-tabs>
+  </div>
+</template>
+<script>
+  import tabChild1 from "../plan/index.vue";
+  export default {
+    name: 'tabjian',
+    components:{
+      child1:tabChild1
+    },
+    data() {
+      return {
+        activeName: 'fangan'
+      };
+    },
+    methods: {
+    }
+  }
+</script>
+
+<style>
+  .tabjian {
+    margin-left: 20px;
+    margin-top: 20px;
+  }
+</style>

+ 391 - 0
Yijia-SaaS/yijia-ui/src/views/market/plan/index.vue

@@ -0,0 +1,391 @@
+<template>
+  <div class="app-container">
+    <!--满减方案-->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button icon="el-icon-refresh" size="mini" @click="handleAdd" v-hasPermi="['market:setting:add']" >添加等级</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="planList" >
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="等级名称" align="center" prop="grade" />
+      <el-table-column label="优惠条件" align="center" prop="discountTerm" />
+      <el-table-column label="优惠条件金额" v-show="false" align="center" prop="discountAmt" />
+      <el-table-column label="汽油优惠金额" align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="柴油优惠金额" align="center" prop="dieseloilDiscountAmt" />
+      <el-table-column label="会员优惠是否叠加" align="center" prop="vipDiscountyPlus" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" />
+      <el-table-column label="优惠方案类型" v-show="false" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['market:plan:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['market:plan:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 添加或修改客户优惠等级设置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
+        <el-form-item label="等级名称" prop="grade">
+          <el-input v-model="form.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="优惠条件" prop="discountTerm">
+          <el-input v-model="form.discountTerm" placeholder="请输入优惠条件" />
+        </el-form-item>
+        <el-form-item label="优惠条件金额" prop="discountAmt">
+          <el-input v-model="form.discountAmt" placeholder="请输入优惠条件金额" />
+        </el-form-item>
+        <el-form-item label="汽油优惠金额" prop="gasoilDiscountAmt">
+          <el-input v-model="form.gasoilDiscountAmt" placeholder="请输入汽油优惠金额" />
+        </el-form-item>
+        <el-form-item label="柴油优惠金额" prop="dieseloilDiscountAmt">
+          <el-input v-model="form.dieseloilDiscountAmt" placeholder="请输入柴油优惠金额" />
+        </el-form-item>
+        <el-form-item label="会员优惠是否叠加" prop="vipDiscountyPlus">
+          <el-input v-model="form.vipDiscountyPlus" placeholder="请输入会员优惠是否叠加" />
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-input v-model="form.couponPlus" placeholder="请输入可否叠加劵" />
+        </el-form-item>
+        <el-form-item label="优惠方案类型" prop="discountPlanType">
+          <el-select v-model="form.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!--立减方案-->
+    <el-form :model="selectParams" ref="selectFrom" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button icon="el-icon-refresh" size="mini" @click="handleAddDT" v-hasPermi="['market:setting:add']" >添加动态等级</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="DTplanList" >
+      <el-table-column label="id" align="center" prop="id" v-if="false" />
+      <el-table-column label="等级名称" align="center" prop="grade" />
+      <el-table-column label="优惠条件" align="center" prop="discountTerm" />
+      <el-table-column label="优惠条件金额" v-show="false" align="center" prop="discountAmt" />
+      <el-table-column label="汽油优惠金额" align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="柴油优惠金额" align="center" prop="dieseloilDiscountAmt" />
+      <el-table-column label="会员优惠是否叠加" align="center" prop="vipDiscountyPlus" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" />
+      <el-table-column label="优惠方案类型" v-show="false" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope1">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdateDT(scope1.row)"
+            v-hasPermi="['market:setting:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDeleteDT(scope1.row)"
+            v-hasPermi="['market:setting:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 添加或修改动态客户优惠等级设置对话框 -->
+    <el-dialog :title="title" :visible.sync="opendt" width="500px" append-to-body>
+      <el-form ref="dtform" :model="dtform" :rules="dtrules" label-width="110px">
+        <el-form-item label="等级名称" prop="grade">
+          <el-input v-model="dtform.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="优惠条件" prop="discountTerm">
+          <el-input v-model="dtform.discountTerm" placeholder="请输入优惠条件" />
+        </el-form-item>
+        <el-form-item label="优惠条件金额" prop="discountAmt">
+          <el-input v-model="dtform.discountAmt" placeholder="请输入优惠条件金额" />
+        </el-form-item>
+        <el-form-item label="汽油优惠金额" prop="gasoilDiscountAmt">
+          <el-input v-model="dtform.gasoilDiscountAmt" placeholder="请输入汽油优惠金额" />
+        </el-form-item>
+        <el-form-item label="柴油优惠金额" prop="dieseloilDiscountAmt">
+          <el-input v-model="dtform.dieseloilDiscountAmt" placeholder="请输入柴油优惠金额" />
+        </el-form-item>
+        <el-form-item label="会员优惠是否叠加" prop="vipDiscountyPlus">
+          <el-input v-model="dtform.vipDiscountyPlus" placeholder="请输入会员优惠是否叠加" />
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-input v-model="dtform.couponPlus" placeholder="请输入可否叠加劵" />
+        </el-form-item>
+        <el-form-item label="优惠方案类型" prop="discountPlanType">
+          <el-select v-model="dtform.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormDT">确 定</el-button>
+        <el-button @click="cancelDT">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { listPlan, getPlan, delPlan, addPlan, updatePlan, exportPlan } from "@/api/market/plan";
+
+  export default {
+    name: "Setting",
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 客户优惠等级设置表格数据
+        planList: [],
+        DTplanList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        opendt: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        },// 查询参数
+
+        selectParams: {
+          pageNum: 1,
+          pageSize: 10,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        },
+        // 表单参数
+        form: {},
+        dtform: {},
+        ruleForm: {},
+        // 表单校验
+        rules: {
+        },
+        dtrules: {
+        }
+      };
+    },
+    created() {
+      this.getList();
+      this.getList2();
+    },
+    methods: {
+      /** 查询客户优惠等级设置列表 */
+      getList() {
+        this.queryParams.gradeType="1";
+        this.loading = true;
+        listPlan(this.queryParams).then(response => {
+          this.planList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      getList2() {
+        this.selectParams.gradeType="3";
+        this.loading = true;
+        listPlan(this.selectParams).then(response => {
+          this.DTplanList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+
+        });
+      },
+
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelDT() {
+        this.opendt = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          id: null,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        };
+        this.resetForm("form");
+      },
+
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        this.open = true;
+        this.title = "添加客户优惠等级设置";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const id = row.id || this.ids
+        getPlan(id).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改客户优惠等级设置";
+        });
+      },
+      /** 新增按钮操作 */
+      handleAddDT() {
+        this.reset();
+        this.opendt = true;
+        this.title = "添加客户优惠等级设置";
+      },
+      /** 修改按钮操作 */
+      handleUpdateDT(row) {
+        this.reset();
+        const id = row.id || this.ids
+        getPlan(id).then(response => {
+          this.dtform = response.data;
+          this.opendt = true;
+          this.title = "修改客户优惠等级设置";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.form.gradeType="1";
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null) {
+              updatePlan(this.form).then(response => {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addPlan(this.form).then(response => {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 提交按钮 */
+      submitFormDT() {
+        this.dtform.gradeType="3";
+        this.$refs["dtform"].validate(valid => {
+          if (valid) {
+            if (this.dtform.id != null) {
+              updatePlan(this.dtform).then(response => {
+                this.msgSuccess("修改成功");
+                this.opendt = false;
+                this.getList2();
+              });
+            } else {
+              addPlan(this.dtform).then(response => {
+                this.msgSuccess("新增成功");
+                this.opendt= false;
+                this.getList2();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const ids = row.id || this.ids;
+        this.$confirm('是否确认删除客户优惠等级设置编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+      },
+      /** 删除按钮操作 */
+      handleDeleteDT(row) {
+        const ids = row.id || this.ids;
+        this.$confirm('是否确认删除客户优惠等级设置编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        const queryParams = this.queryParams;
+        this.$confirm('是否确认导出所有客户优惠等级设置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPlan(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+      }
+    }
+  };
+</script>

+ 356 - 0
Yijia-SaaS/yijia-ui/src/views/market/plan/index1.vue

@@ -0,0 +1,356 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="等级名称" prop="grade">
+        <el-input
+          v-model="queryParams.grade"
+          placeholder="请输入等级名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠条件" prop="discountTerm">
+        <el-input
+          v-model="queryParams.discountTerm"
+          placeholder="请输入优惠条件"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠条件金额" prop="discountAmt">
+        <el-input
+          v-model="queryParams.discountAmt"
+          placeholder="请输入优惠条件金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="汽油优惠金额" prop="gasoilDiscountAmt">
+        <el-input
+          v-model="queryParams.gasoilDiscountAmt"
+          placeholder="请输入汽油优惠金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="柴油优惠金额" prop="dieseloilDiscountAmt">
+        <el-input
+          v-model="queryParams.dieseloilDiscountAmt"
+          placeholder="请输入柴油优惠金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="会员优惠是否叠加" prop="vipDiscountyPlus">
+        <el-input
+          v-model="queryParams.vipDiscountyPlus"
+          placeholder="请输入会员优惠是否叠加"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="可否叠加劵" prop="couponPlus">
+        <el-input
+          v-model="queryParams.couponPlus"
+          placeholder="请输入可否叠加劵"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="优惠方案类型" prop="discountPlanType">
+        <el-select v-model="queryParams.discountPlanType" placeholder="请选择优惠方案类型" clearable size="small">
+          <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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['market:plan:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['market:plan:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['market:plan:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['market:plan:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="等级名称" align="center" prop="grade" />
+      <el-table-column label="优惠条件" align="center" prop="discountTerm" />
+      <el-table-column label="优惠条件金额" align="center" prop="discountAmt" />
+      <el-table-column label="汽油优惠金额" align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="柴油优惠金额" align="center" prop="dieseloilDiscountAmt" />
+      <el-table-column label="会员优惠是否叠加" align="center" prop="vipDiscountyPlus" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" />
+      <el-table-column label="优惠方案类型" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['market:plan:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['market:plan:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改营销方案对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="等级名称" prop="grade">
+          <el-input v-model="form.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="优惠条件" prop="discountTerm">
+          <el-input v-model="form.discountTerm" placeholder="请输入优惠条件" />
+        </el-form-item>
+        <el-form-item label="优惠条件金额" prop="discountAmt">
+          <el-input v-model="form.discountAmt" placeholder="请输入优惠条件金额" />
+        </el-form-item>
+        <el-form-item label="汽油优惠金额" prop="gasoilDiscountAmt">
+          <el-input v-model="form.gasoilDiscountAmt" placeholder="请输入汽油优惠金额" />
+        </el-form-item>
+        <el-form-item label="柴油优惠金额" prop="dieseloilDiscountAmt">
+          <el-input v-model="form.dieseloilDiscountAmt" placeholder="请输入柴油优惠金额" />
+        </el-form-item>
+        <el-form-item label="会员优惠是否叠加" prop="vipDiscountyPlus">
+          <el-input v-model="form.vipDiscountyPlus" placeholder="请输入会员优惠是否叠加" />
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-input v-model="form.couponPlus" placeholder="请输入可否叠加劵" />
+        </el-form-item>
+        <el-form-item label="优惠方案类型" prop="discountPlanType">
+          <el-select v-model="form.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPlan, getPlan, delPlan, addPlan, updatePlan, exportPlan } from "@/api/market/plan";
+
+export default {
+  name: "Plan",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 营销方案表格数据
+      planList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        grade: null,
+        discountTerm: null,
+        discountAmt: null,
+        gasoilDiscountAmt: null,
+        dieseloilDiscountAmt: null,
+        vipDiscountyPlus: null,
+        couponPlus: null,
+        discountPlanType: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询营销方案列表 */
+    getList() {
+      this.loading = true;
+      listPlan(this.queryParams).then(response => {
+        this.planList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        grade: null,
+        discountTerm: null,
+        discountAmt: null,
+        gasoilDiscountAmt: null,
+        dieseloilDiscountAmt: null,
+        vipDiscountyPlus: null,
+        couponPlus: null,
+        discountPlanType: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加营销方案";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getPlan(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改营销方案";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updatePlan(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPlan(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除营销方案编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有营销方案数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPlan(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>