MS-QJVSRANLTYEO\Administrator 4 роки тому
батько
коміт
7e09092cc7

+ 53 - 0
Yijia-SaaS/yijia-ui/src/api/integral/order.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询积分消费订单列表
+export function listOrder(query) {
+  return request({
+    url: '/integral/order/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询积分消费订单详细
+export function getOrder(id) {
+  return request({
+    url: '/integral/order/' + id,
+    method: 'get'
+  })
+}
+
+// 新增积分消费订单
+export function addOrder(data) {
+  return request({
+    url: '/integral/order',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改积分消费订单
+export function updateOrder(data) {
+  return request({
+    url: '/integral/order',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除积分消费订单
+export function delOrder(id) {
+  return request({
+    url: '/integral/order/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出积分消费订单
+export function exportOrder(query) {
+  return request({
+    url: '/integral/order/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
Yijia-SaaS/yijia-ui/src/api/integral/points.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询用户积分列表
+export function listPoints(query) {
+  return request({
+    url: '/integral/points/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户积分详细
+export function getPoints(id) {
+  return request({
+    url: '/integral/points/' + id,
+    method: 'get'
+  })
+}
+
+// 新增用户积分
+export function addPoints(data) {
+  return request({
+    url: '/integral/points',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户积分
+export function updatePoints(data) {
+  return request({
+    url: '/integral/points',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户积分
+export function delPoints(id) {
+  return request({
+    url: '/integral/points/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出用户积分
+export function exportPoints(query) {
+  return request({
+    url: '/integral/points/export',
+    method: 'get',
+    params: query
+  })
+}

+ 70 - 0
Yijia-SaaS/yijia-ui/src/api/integral/rule.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询积分规则列表
+export function listRule(query) {
+  return request({
+    url: '/integral/rule/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询规则详细
+export function getRule(id) {
+  return request({
+    url: '/integral/rule/' + id,
+    method: 'get'
+  })
+}
+// 查询油站对应的油品名称
+export function oilNameList(query) {
+  return request({
+    url: '/station/price/oilNameList',
+    method: 'get',
+    params: query
+  })
+}
+// 查询油站,油品,对应的等级
+export function gradeList(query) {
+  return request({
+    url: '/customer/setting/gradeList',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 新增规则
+export function addRule(data) {
+  return request({
+    url: '/integral/rule',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改【请填写功能名称】
+export function updateRule(data) {
+  return request({
+    url: '/integral/rule',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除【请填写功能名称】
+export function delRule(id) {
+  return request({
+    url: '/integral/rule/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出【请填写功能名称】
+export function exportRule(query) {
+  return request({
+    url: '/integral/rule/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
Yijia-SaaS/yijia-ui/src/api/integral/wares.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询【请填写功能名称】列表
+export function listWares(query) {
+  return request({
+    url: '/integral/wares/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询【请填写功能名称】详细
+export function getWares(id) {
+  return request({
+    url: '/integral/wares/' + id,
+    method: 'get'
+  })
+}
+
+// 新增【请填写功能名称】
+export function addWares(data) {
+  return request({
+    url: '/integral/wares',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改【请填写功能名称】
+export function updateWares(data) {
+  return request({
+    url: '/integral/wares',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除【请填写功能名称】
+export function delWares(id) {
+  return request({
+    url: '/integral/wares/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出【请填写功能名称】
+export function exportWares(query) {
+  return request({
+    url: '/integral/wares/export',
+    method: 'get',
+    params: query
+  })
+}

+ 186 - 0
Yijia-SaaS/yijia-ui/src/views/integral/order/index.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="积分订单号" prop="integralOrderNo">
+        <el-input
+          v-model="queryParams.integralOrderNo"
+          placeholder="请输入积分订单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="商品名称" prop="waresName">
+        <el-input
+          v-model="queryParams.waresName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <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="exchangeTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.exchangeTime"
+          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-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="积分订单id" align="center" prop="id" v-if="false"/>
+      <el-table-column label="订单号" align="center" prop="integralOrderNo" />
+      <el-table-column label="商品类型" align="center" prop="waresType" v-if="false"/>
+      <el-table-column label="商品名称" align="center" prop="waresName" />
+      <el-table-column label="微信唯一标识" align="center" prop="unionId"  v-if="false"/>
+      <el-table-column label="会员名称" align="center" prop="customerName" />
+      <el-table-column label="兑换数量" align="center" prop="exchangeNum" />
+      <el-table-column label="兑换时间" align="center" prop="exchangeTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.exchangeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单状态" align="center" prop="status" />
+      <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="detail(scope.row)"
+            v-hasPermi="['integral:order:edit']"
+          >订单明细</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"
+    />
+
+  </div>
+</template>
+
+<script>
+import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/integral/order";
+
+export default {
+  name: "Order",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 积分消费订单表格数据
+      orderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        integralOrderNo: null,
+        waresType: null,
+        waresName: null,
+        unionId: null,
+        customerName: null,
+        exchangeNum: null,
+        exchangeTime: null,
+        status: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询积分消费订单列表 */
+    getList() {
+      this.loading = true;
+      listOrder(this.queryParams).then(response => {
+        this.orderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        integralOrderNo: null,
+        waresType: null,
+        waresName: null,
+        unionId: null,
+        customerName: null,
+        exchangeNum: null,
+        exchangeTime: null,
+        status: "0"
+      };
+      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
+    },
+    detail(row){
+
+    }
+  }
+};
+</script>

+ 229 - 0
Yijia-SaaS/yijia-ui/src/views/integral/points/index.vue

@@ -0,0 +1,229 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="手机号码" prop="mobilePhone">
+        <el-input
+          v-model="queryParams.mobilePhone"
+          placeholder="请输入用户手机号码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="pointsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id"  v-if ="false" />
+      <el-table-column label="微信用户unionID" align="center" prop="unionId" v-if="false"/>
+      <el-table-column label="公众号的openID" align="center" prop="blogOpenid" v-if="false"/>
+      <el-table-column label="小程序的openID" align="center" prop="minaOpenid" v-if="false" />
+      <el-table-column label="手机号码" align="center" prop="mobilePhone" />
+      <el-table-column label="账户积分余额" align="center" prop="points" />
+      <el-table-column label="使用积分累计" align="center" prop="consumptionPoints" />
+      <el-table-column label="获得积分累计" align="center" prop="accumulatePoints" />
+      <el-table-column label="失效积分累计" align="center" prop="invalidPoints" />
+      <el-table-column label="最近积分消费日期" align="center" prop="recentConsumptionDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.recentConsumptionDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="油站ID" align="center" prop="stationId" v-if="false"/>
+      <el-table-column label="油站名称" align="center" prop="stationName" v-if="false" />
+      <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="lookInfo(scope.row)"
+          >明细</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="750px" append-to-body>
+      <div class="app-container">
+        <el-table v-loading="loadingInfo" :data="recordList" @selection-change="handleSelectionChange">
+          <el-table-column label="主键自增" align="center" prop="id"  v-if ="false"/>
+          <el-table-column label="微信用户唯一标识" align="center" prop="unionId" />
+          <el-table-column label="客户名称" align="center" prop="customerName" />
+          <el-table-column label="积分记录类型" align="center" prop="recordType" />
+          <el-table-column label="消耗或增加积分" align="center" prop="integral" />
+          <el-table-column label="油站ID" align="center" prop="stationId"  v-if ="false" />
+          <el-table-column label="油站名称" align="center" prop="stationName" />
+        </el-table>
+        <pagination
+          v-show="totalInfo>0"
+          :total="totalInfo"
+          :page.sync="query.pageNum"
+          :limit.sync="query.pageSize"
+          @pagination="getInfoList"
+        />
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPoints, exportPoints } from "@/api/integral/points";
+import { listRecord } from "@/api/integral/record";
+export default {
+  name: "Points",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      loadingInfo: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      totalInfo: 0,
+      // 用户积分表格数据
+      pointsList: [],
+      //用户积分明细
+      recordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        unionId: null,
+        blogOpenid: null,
+        minaOpenid: null,
+        mobilePhone: null,
+        points: null,
+        consumptionPoints: null,
+        accumulatePoints: null,
+        invalidPoints: null,
+        recentConsumptionDate: null,
+        stationId: null,
+        stationName: null
+      },
+      //积分明细 查询参数
+      query: {
+        pageNum: 1,
+        pageSize: 10,
+        unionId: null,
+        customerName: null,
+        recordType: null,
+        integral: null,
+        stationId: null,
+        stationName: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询用户积分列表 */
+    getList() {
+      this.loading = true;
+      listPoints(this.queryParams).then(response => {
+        this.pointsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询用户积分明细列表 */
+    getInfoList() {
+      this.loadingInfo = true;
+      listRecord(this.query).then(response => {
+        this.recordList = response.rows;
+        this.totalInfo = response.total;
+        this.loadingInfo = false;
+      });
+    },
+    
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        unionId: null,
+        blogOpenid: null,
+        minaOpenid: null,
+        mobilePhone: null,
+        points: null,
+        consumptionPoints: null,
+        accumulatePoints: null,
+        invalidPoints: null,
+        recentConsumptionDate: null,
+        stationId: null,
+        stationName: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    //查看明细
+    lookInfo(rows){
+        this.query.unionId = rows.unionId;
+        this.getInfoList();
+        this.open = true;
+        this.title = "查看客户积分记录";
+    },
+
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有用户积分数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPoints(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>

+ 488 - 0
Yijia-SaaS/yijia-ui/src/views/integral/rule/index.vue

@@ -0,0 +1,488 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="油品名称" prop="oilName">
+        <el-input
+          v-model="queryParams.oilName"
+          placeholder="请输入油品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-button icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键id" align="center" prop="id" v-if="false"/>
+      <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="ruleType" />
+      <el-table-column label="有效期设置" align="center" prop="termDateManage" />
+      <el-table-column label="清空积分时间" align="center" prop="emptyDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.emptyDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="到期提醒设置" align="center" prop="expirationReminder" />
+      <el-table-column label="提醒时间设置" align="center" prop="remindDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.remindDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="积分活动设置" align="center" prop="integralActivity" />
+      <el-table-column label="日期选择" align="center" prop="datePicker" />
+      <el-table-column label="积分比例" align="center" prop="integralProportion" />
+      <el-table-column label="积分抵扣油品规则" align="center" prop="integralDeductionOil" />
+      <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="['integral:rule:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['integral:rule: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"   append-to-body>
+      <div class="app-container">
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+          <el-form-item label="油站名称" prop="stationId" >
+            <el-select
+              v-model="form.stationId"
+              placeholder="请选择油站"
+              clearable
+              size="small"
+              @change="onInstitutionChang"
+            >
+              <el-option
+                v-for="item in stationOptions"
+                :key="item.deptId"
+                :label="item.deptName"
+                :value="item.deptId"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item v-show="false" label="油站名称" prop="stationName">
+            <el-input v-model="form.stationName"  placeholder="请输入油站名称" />
+          </el-form-item>
+          <el-form-item  label="油品积分规则" ></el-form-item>
+          <div>
+            <el-row v-for="(item, index) in form.itemsDetail"  :key="index" >
+              <el-form
+                :inline="true"
+                :model="form.itemsDetail[index]"
+                :rules="rules"
+                ref="ruleForms"
+                class="demo-form-inline"
+                size="small"
+              >
+                <el-form-item>
+                  <span>规则类型</span>
+                  <el-select v-model="item.ruleType" placeholder="请选择油品" style="width:150px;" clearable size="small" @change="oilNameChang" >
+                    <el-option
+                      v-for="item in ruleTypeOptions"
+                      :key="item.dictValue"
+                      :label="item.dictLabel"
+                      :value="item.dictValue"
+                    ></el-option>
+                  </el-select>
+                  <span>满</span>
+                  <el-input-number v-model="item.ruleTerms" :min="0" size="small" />
+                  <span>元</span>
+                  <span>L</span>
+                  <span>起累计 </span>
+                  <el-select v-model="item.oilName" placeholder="请选择油品" style="width:150px;" clearable size="small" @change="oilNameChang" >
+                    <el-option
+                      v-for="item in oilNameOptions"
+                      :key="item.oilName"
+                      :label="item.oilName"
+                      :value="item.oilName"
+                    ></el-option>
+                  </el-select>
+                  <el-select
+                    v-model="item.gread"
+                    placeholder="请选择等级"
+                    clearable
+                    size="small"
+                    style="width:150px;"
+                  >
+                    <el-option
+                      v-for="item in gradeOptions"
+                      :key="item.grade"
+                      :label="item.grade"
+                      :value="item.grade"
+                    ></el-option>
+                  </el-select>
+                  <span>每消费</span>
+                  <el-input-number v-model="item.saleAmt"  size="small" :min="0"/>
+                  <span>元</span>
+                  <el-input-number v-model="item.integral" size="small" :min="0"/>
+                  <span>积分</span>
+                </el-form-item>
+                <el-form-item>
+                  <el-button
+                    type="danger"
+                    @click="del(index)"
+                    size="small"
+                  >删除</el-button>
+                  <el-button
+                    type="success"
+                    @click="addItem"
+                    size="small"
+                  >新增</el-button>
+                </el-form-item>
+              </el-form>
+            </el-row>
+          </div>
+          <el-form-item  label="非油品积分规则" ></el-form-item>
+          <div>
+            <el-row v-for="(item, index) in form.notOilList"  :key="index" style="margin-left: 80px;">
+              <el-form
+                :inline="true"
+                :model="form.notOilList[index]"
+                :rules="rules"
+                ref="ruleForms"
+                class="demo-form-inline"
+                size="small"
+              >
+                <el-form-item>
+                  <span>满</span>
+                  <el-input-number v-model="item.ruleTerms" :min="0" size="small" />
+                  <span></span>
+                  <span>元  起累计 </span>
+                  <span>每消费</span>
+                  <el-input-number v-model="item.saleAmt"  size="small" :min="0"/>
+                  <span>元</span>
+                  <el-input-number v-model="item.integral" size="small" :min="0"/>
+                  <span>积分</span>
+                </el-form-item>
+              </el-form>
+            </el-row>
+          </div>
+          <el-form-item label="有效期设置" prop="termDateManage">
+            <el-radio-group v-model="form.termDateManage">
+              <el-radio
+                v-for="dict in termDateManageOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group>
+            <el-date-picker clearable size="small" style="width: 200px;margin-left: 10px;"
+                            v-model="form.emptyDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择清空积分时间">
+            </el-date-picker>
+            <span>清空积分</span>
+          </el-form-item>
+          <el-form-item label=  "到期提醒设置" prop="expirationReminder">
+            <el-radio-group v-model="form.expirationReminder">
+              <el-radio
+                v-for="dict in expirationOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group>
+            <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                            v-model="form.remindDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择提醒时间设置">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="积分活动设置" ></el-form-item>
+          <el-form-item >
+            <el-radio-group v-model="form.integralActivity">
+              <el-radio
+                v-for="dict in integralActivityOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-row>
+            <el-col :span="8" style="margin-left: 80px;">
+              <el-form-item  label="日期选择" prop="datePicker">
+                <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                                v-model="form.datePicker"
+                                type="dates"
+                                value-format="yyyy-MM-dd"
+                                placeholder="选择提醒时间设置">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item  label="积分比例" prop="integralProportion">
+                <el-input-number v-model="form.integralProportion" :min="1" placeholder="请输入加倍比例" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-form-item label="抵扣油品规则" prop="integralDeductionOil">
+            <el-radio-group v-model="form.integralDeductionOil">
+              <el-radio
+                v-for="dict in integralDeductionOilOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="积分轮播图">
+            <el-upload
+              ref="upload"
+              action="#"
+              multiple
+              list-type="picture-card"
+              :limit='5'
+              :file-list="form.imgFileList"
+              accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
+              :on-preview="handlePictureCardPreview"
+              :on-change="pictureChange"
+              :on-remove="handleRemove">
+              <i class="el-icon-plus"></i>
+              <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,最多上传5张且单张图片不超过5M</div>
+            </el-upload>
+            <el-dialog :visible.sync="dialogVisible">
+              <img width="100%" :src="dialogImageUrl" alt="" />
+            </el-dialog>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer"> 
+            <el-button type="primary" @click="submitUpload">确 定</el-button>      
+          <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRule, getRule, delRule, addRule, updateRule, exportRule } from "@/api/integral/rule";
+import {stationinfo} from "@/api/station/gun";
+
+export default {
+  name: "Rule",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 弹出层标题
+      title: "",
+      uploadUrl:"",
+      stationOptions:[],
+      oilNameOptions:[],
+      ruleTypeOptions:[],
+      termDateManageOptions:[],
+      expirationOptions:[],
+      integralDeductionOilOptions:[],
+      integralActivityOptions:[],
+      gradeOptions:[],
+      imgInfoList: [], //包含图片的id,name,size的集合
+      imgNameList: [], //后端返回的上传图片的name集合,传到后端
+      imgSize: [], //后端返回的上传图片的imgSize集合,传到后端
+      deleteImgFileList: [], //存已被删除了的图片的id
+      dialogImageUrl: '',
+      dialogVisible: false,
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        stationId: null,
+        stationName: null,
+        ruleType: null,
+        oilName: null
+      },
+      // 表单参数
+      form: {
+        itemsDetail: [{}],
+        notOilList: [{}],
+        imgFileList:[]
+      },
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
+    this.getDicts("rule_type").then(response => {
+      this.ruleTypeOptions = response.data;
+    });
+    this.getDicts("term_date").then(response => {
+      this.termDateManageOptions = response.data;
+    });
+    this.getDicts("expiration").then(response => {
+      this.expirationOptions = response.data;
+    });
+    this.getDicts("integral_deduction_oil").then(response => {
+      this.integralDeductionOilOptions = response.data;
+    });
+    this.getDicts("integral_manage").then(response => {
+      this.integralActivityOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      listRule(this.queryParams).then(response => {
+        this.ruleList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        stationId: null,
+        stationName: null,
+        ruleType: null,
+        ruleAmt: null,
+        gread: null,
+        oilName: null,
+        saleAmt: null,
+        integral: null,
+        termDateManage: null,
+        emptyDate: null,
+        expirationReminder: null,
+        remindDate: null,
+        integralActivity: null,
+        datePicker: null,
+        integralProportion: null,
+        integralDeductionOil: null,
+        itemsDetail: [{}],
+        notOilList: [{}],
+        imgFileList:[]
+      };
+      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
+      getRule(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改";
+      });
+      this.queryParams.stationId =row.stationId;
+      oilNameList(this.queryParams).then(response => {
+        this.oilNameOptions = response.rows;
+      });
+    },
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.deptId === e;//筛选出匹配数据
+      })
+      this.form.stationName=obj.deptName;
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateRule(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRule(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 delRule(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportRule(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>

+ 262 - 0
Yijia-SaaS/yijia-ui/src/views/integral/rule/index1.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="油品名称" prop="oilName">
+        <el-input
+          v-model="queryParams.oilName"
+          placeholder="请输入油品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-button icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键id" align="center" prop="id" v-if="false"/>
+      <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="ruleType" />
+      <el-table-column label="有效期设置" align="center" prop="termDateManage" />
+      <el-table-column label="清空积分时间" align="center" prop="emptyDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.emptyDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="到期提醒设置" align="center" prop="expirationReminder" />
+      <el-table-column label="提醒时间设置" align="center" prop="remindDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.remindDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="积分活动设置" align="center" prop="integralActivity" />
+      <el-table-column label="日期选择" align="center" prop="datePicker" />
+      <el-table-column label="积分比例" align="center" prop="integralProportion" />
+      <el-table-column label="积分抵扣油品规则" align="center" prop="integralDeductionOil" />
+      <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="['integral:rule:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['integral:rule: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"
+    />
+  </div>
+</template>
+
+<script>
+import { listRule, getRule, delRule, addRule, updateRule, exportRule } from "@/api/integral/rule";
+import {stationinfo} from "@/api/station/gun";
+export default {
+  name: "Rule",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 【请填写功能名称】表格数据
+      ruleList: [],
+      // 弹出层标题
+      title: "",
+      stationOptions:[],
+      // 是否显示弹出层
+      open: false,
+      lists:[1],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        stationId: null,
+        stationName: null,
+        oilName: null
+      },
+      // 表单参数
+      form: {
+        itemsDetail: [{}]
+      },
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
+    this.getDicts("rule_type").then(response => {
+      this.ruleTypeOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询规则设置列表 */
+    getList() {
+      this.loading = true;
+      listRule(this.queryParams).then(response => {
+        this.ruleList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        stationId: null,
+        stationName: null,
+        ruleType: null,
+        termDateManage: null,
+        emptyDate: null,
+        expirationReminder: null,
+        remindDate: null,
+        integralActivity: null,
+        datePicker: null,
+        integralProportion: null,
+        integralDeductionOil: 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 = "添加";
+      this.$router.push({path:'/integral/ruledetail',query:{stationId:"",parentId:""}});
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.$router.push({path:'/integral/ruledetail',query:{stationId:row.stationId,parentId:row.id}});
+    },
+    queryreset() {
+      this.params={
+        stationId: null,
+        stationName: null,
+        oilName: null
+      }
+    },
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.deptId === e;//筛选出匹配数据
+      })
+      this.queryreset();
+      this.form.stationName=obj.deptName;
+      this.params.stationId=obj.deptId;
+      oilNameList(this.params).then(response => {
+        this.oilNameOptions = response.rows;
+      });
+    },
+    oilNameChang(e){
+      let obj = {};
+      obj = this.oilNameOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.oilName === e;//筛选出匹配数据
+      })
+      this.queryreset();
+      //获取油站名称
+      this.params.stationId = this.form.stationId;
+      this.params.oilName=obj.oilName;
+      gradeList(this.params).then(response => {
+        this.gradeOptions = response.rows;
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            updateRule(this.form).then(response => {
+              this.msgSuccess("修改成功");
+            });
+          } else {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            addRule(this.form).then(response => {
+              this.msgSuccess("新增成功");
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除积分规则编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delRule(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportRule(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>

+ 222 - 0
Yijia-SaaS/yijia-ui/src/views/integral/rule/ruledetail.vue

@@ -0,0 +1,222 @@
+<template>
+  <div class="app-container">
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-form-item label="油站名称" prop="stationId" >
+        <el-select
+          v-model="form.stationId"
+          placeholder="请选择油站"
+          clearable
+          size="small"
+          @change="onInstitutionChang"
+        >
+          <el-option
+            v-for="item in stationOptions"
+            :key="item.deptId"
+            :label="item.deptName"
+            :value="item.deptId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-show="false" label="油站名称" prop="stationName">
+        <el-input v-model="form.stationName"  placeholder="请输入油站名称" />
+      </el-form-item>
+      <el-form-item label="规则类型" prop="ruleType">
+        <el-radio-group v-model="form.ruleType">
+          <el-radio
+            v-for="dict in ruleTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <div  v-for="(item, index) in lists" >
+        <el-row style="margin-left: 120px;">
+          <!-- <el-input v-if="item.type=='text'" type='text'  v-model="myForm[item.prop]"></el-input>-->
+          <span>满</span>
+            <el-input v-model="item.ruleTerms" size="min" style="width: 80px;"></el-input>
+          <span>元 起累计 </span>
+          <el-input v-model="item.oilName" size="min" style="width: 80px;"></el-input>
+          <el-input v-model="item.gread" size="min" style="width: 80px;"></el-input>
+          <span>每消费</span>
+          <el-input v-model="item.saleAmt"  size="min" style="width: 80px;"></el-input>
+          <span>元</span>
+          <el-input v-model="item.integral" size="min" style="width: 80px;"></el-input>
+          <span>积分</span>
+        </el-row>
+      </div>
+      <el-form-item label="有效期设置" prop="termDateManage">
+        <el-radio-group v-model="form.termDateManage">
+          <el-radio
+            v-for="dict in termDateManageOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+        <el-date-picker clearable size="small" style="width: 200px;margin-left: 10px;"
+                        v-model="form.emptyDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择清空积分时间">
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item label=  "到期提醒设置" prop="expirationReminder">
+        <el-radio-group v-model="form.expirationReminder">
+          <el-radio
+            v-for="dict in expirationOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+        <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                        v-model="form.remindDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择提醒时间设置">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="积分活动设置" ></el-form-item>
+      <el-form-item >
+        <el-radio-group v-model="form.integralActivity">
+          <el-radio
+            v-for="dict in integralActivityOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-row>
+        <el-col :span="8" style="margin-left: 80px;">
+          <el-form-item  label="日期选择" prop="datePicker">
+            <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                            v-model="form.datePicker"
+                            type="dates"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择提醒时间设置">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item  label="积分比例" prop="integralProportion">
+            <el-input-number v-model="form.integralProportion" :min="1" placeholder="请输入加倍比例" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="抵扣油品规则" prop="integralDeductionOil">
+        <el-radio-group v-model="form.integralDeductionOil">
+          <el-radio
+            v-for="dict in integralDeductionOilOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </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>
+  </div>
+</template>
+
+<script>
+import {stationinfo} from "@/api/station/gun";
+import {  addRule, updateRule } from "@/api/integral/rule";
+export default {
+name: "ruledetail",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 弹出层标题
+      title: "",
+      stationOptions:[],
+      ruleTypeOptions:[],
+      termDateManageOptions:[],
+      expirationOptions:[],
+      integralDeductionOilOptions:[],
+      integralActivityOptions:[],
+      // 是否显示弹出层
+      open: false,
+      lists:[1],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        stationId: null,
+        stationName: null,
+        oilName: null
+      },
+      // 表单参数
+      form: {
+      },
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
+    this.getDicts("rule_type").then(response => {
+      this.ruleTypeOptions = response.data;
+    });
+    this.getDicts("term_date").then(response => {
+      this.termDateManageOptions = response.data;
+    });
+    this.getDicts("expiration").then(response => {
+      this.expirationOptions = response.data;
+    });
+    this.getDicts("integral_deduction_oil").then(response => {
+      this.integralDeductionOilOptions = response.data;
+    });
+    this.getDicts("integral_manage").then(response => {
+      this.integralActivityOptions = response.data;
+    });
+  },
+  methods: {
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.deptId === e;//筛选出匹配数据
+      })
+      this.form.stationName=obj.deptName;
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+
+          if (this.form.id != null) {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            updateRule(this.form).then(response => {
+              this.msgSuccess("修改成功");
+            });
+          } else {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            addRule(this.form).then(response => {
+              this.msgSuccess("新增成功");
+
+            });
+          }
+        }
+      });
+    }
+  },
+
+
+}
+</script>
+
+

+ 495 - 0
Yijia-SaaS/yijia-ui/src/views/integral/ruledetail/index.vue

@@ -0,0 +1,495 @@
+<template>
+  <div class="app-container">
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-form-item label="油站名称" prop="stationId" >
+        <el-select
+          v-model="form.stationId"
+          placeholder="请选择油站"
+          clearable
+          size="small"
+          @change="onInstitutionChang"
+        >
+          <el-option
+            v-for="item in stationOptions"
+            :key="item.deptId"
+            :label="item.deptName"
+            :value="item.deptId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-show="false" label="油站名称" prop="stationName">
+        <el-input v-model="form.stationName"  placeholder="请输入油站名称" />
+      </el-form-item>
+      <el-form-item  label="油品积分规则" ></el-form-item>
+      <div>
+        <el-row v-for="(item, index) in form.itemsDetail"  :key="index" style="margin-left: 80px;">
+          <el-form
+            :inline="true"
+            :model="form.itemsDetail[index]"
+            :rules="rules"
+            ref="ruleForms"
+            class="demo-form-inline"
+            size="small"
+          >
+            <el-form-item>
+              <span>规则类型</span>
+              <el-select v-model="item.ruleType" placeholder="请选择油品" clearable size="small" @change="changeType" >
+                <el-option
+                  v-for="item in ruleTypeOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                ></el-option>
+              </el-select>
+              <span>满</span>
+              <el-input-number v-model="item.ruleTerms" :min="0" size="small" />
+              <span v-if="item.ruleType=='1'">L</span>
+              <span v-else>元</span>
+              <span>起累计 </span>
+              <el-select v-model="item.oilName" placeholder="请选择油品" clearable size="small" @change="changeType(index)" >
+                <el-option
+                  v-for="item in oilNameOptions"
+                  :key="item.oilName"
+                  :label="item.oilName"
+                  :value="item.oilName"
+                ></el-option>
+              </el-select>
+              <el-select
+                v-model="item.gread"
+                placeholder="请选择等级"
+                clearable
+                size="small"
+              >
+                <el-option
+                  v-for="item in gradeOptions"
+                  :key="item.grade"
+                  :label="item.grade"
+                  :value="item.grade"
+                ></el-option>
+              </el-select>
+              <span>每消费</span>
+              <el-input-number v-model="item.saleAmt"  size="small" :min="0"/>
+              <span>元</span>
+              <el-input-number v-model="item.integral" size="small" :min="0"/>
+              <span>积分</span>
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                type="danger"
+                @click="del(index)"
+                size="small"
+              >删除</el-button>
+              <el-button
+                type="success"
+                @click="addItem"
+                size="small"
+              >新增</el-button>
+            </el-form-item>
+          </el-form>
+        </el-row>
+      </div>
+      <el-form-item  label="非油品积分规则" ></el-form-item>
+       <div>
+        <el-row v-for="(item, index) in form.notOilList"  :key="index" style="margin-left: 80px;">
+          <el-form
+            :inline="true"
+            :model="form.notOilList[index]"
+            :rules="rules"
+            ref="ruleForms"
+            class="demo-form-inline"
+            size="small"
+          >
+            <el-form-item>
+              <span>满</span>
+              <el-input-number v-model="item.ruleTerms" :min="0" size="small" />
+              <span></span>
+              <span>元  起累计 </span>
+              <span>每消费</span>
+              <el-input-number v-model="item.saleAmt"  size="small" :min="0"/>
+              <span>元</span>
+              <el-input-number v-model="item.integral" size="small" :min="0"/>
+              <span>积分</span>
+            </el-form-item>
+          </el-form>
+        </el-row>
+      </div>
+      <el-form-item label="有效期设置" prop="termDateManage">
+        <el-radio-group v-model="form.termDateManage">
+          <el-radio
+            v-for="dict in termDateManageOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+        <el-date-picker clearable size="small" style="width: 200px;margin-left: 10px;"
+                        v-model="form.emptyDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择清空积分时间">
+        </el-date-picker>
+        <span>清空积分</span>
+      </el-form-item>
+      <el-form-item label=  "到期提醒设置" prop="expirationReminder">
+        <el-radio-group v-model="form.expirationReminder">
+          <el-radio
+            v-for="dict in expirationOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+        <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                        v-model="form.remindDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择提醒时间设置">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="积分活动设置" ></el-form-item>
+      <el-form-item >
+        <el-radio-group v-model="form.integralActivity">
+          <el-radio
+            v-for="dict in integralActivityOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-row>
+        <el-col :span="8" style="margin-left: 80px;">
+          <el-form-item  label="日期选择" prop="datePicker">
+            <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
+                            v-model="form.datePicker"
+                            type="dates"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择提醒时间设置">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item  label="积分比例" prop="integralProportion">
+            <el-input-number v-model="form.integralProportion" :min="1" placeholder="请输入加倍比例" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="抵扣油品规则" prop="integralDeductionOil">
+        <el-radio-group v-model="form.integralDeductionOil">
+          <el-radio
+            v-for="dict in integralDeductionOilOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="积分轮播图">
+        <el-upload
+          class="avatar-uploader"
+          action="http://localhost:8080/common/upload"
+          :headers=headers
+          multiple
+          list-type="picture-card"
+          :limit='5'
+          :file-list="form.imgFileList"
+          accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
+          :before-upload="beforeAvatarUpload"
+          :on-remove="handleRemove"
+          :on-success="handlepaymentSuccess">
+          <i class="el-icon-plus"></i>
+          <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,最多上传5张且单张图片不超过5M</div>
+        </el-upload>
+        <el-dialog :visible.sync="dialogVisible" append-to-body>
+          <img width="100%" :src="dialogImageUrl" alt="" />
+        </el-dialog>
+      </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>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/utils/auth";
+import {getGun, stationinfo} from "@/api/station/gun";
+import {  addRule, updateRule,oilNameList,gradeList,getRule } from "@/api/integral/rule";
+export default {
+name: "ruleDetail",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 弹出层标题
+      title: "",
+      uploadUrl:"",
+      stationOptions:[],
+      oilNameOptions:[],
+      ruleTypeOptions:[],
+      termDateManageOptions:[],
+      expirationOptions:[],
+      integralDeductionOilOptions:[],
+      integralActivityOptions:[],
+      gradeOptions:[],
+      imgInfoList: [], //包含图片的id,name,size的集合
+      imgNameList: [], //后端返回的上传图片的name集合,传到后端
+      imgSize: [], //后端返回的上传图片的imgSize集合,传到后端
+      deleteImgFileList: [], //存已被删除了的图片的id
+      dialogImageUrl: '',
+      dialogVisible: false,
+      
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        stationId: null,
+        stationName: null,
+        ruleType: null,
+        oilName: null
+      },
+      // 表单参数
+      form: {
+        itemsDetail: [{}],
+        notOilList: [{}],
+        imgFileList:[]
+      },
+      // 表单校验
+      rules: {
+      },
+      headers: { Authorization: "Bearer " + getToken() }
+    };
+  },
+  created() {
+    //判断是否是做修改
+    if(this.$route.query.stationId!=null && this.$route.query.stationId!="" && this.$route.query.parentId !=null &&this.$route.query.parentId !=""){
+      this.queryParams.stationId=this.$route.query.stationId;
+      //this.form.imgFileList=[];
+      let id=this.$route.query.parentId;
+      if(id!=null && id != ""){
+        getRule(id).then(response => {
+          this.form = response.data;
+          if(this.form.notOilList.length==0 ){
+            this.form.notOilList=[{}];
+          }
+          if(this.form.itemsDetail.length==0 ){
+            this.form.itemsDetail=[{}];
+          }
+        });
+        oilNameList(this.queryParams).then(response => {
+          this.oilNameOptions = response.rows;
+        });
+      }
+    }
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
+    this.getDicts("rule_type").then(response => {
+      this.ruleTypeOptions = response.data;
+    });
+    this.getDicts("term_date").then(response => {
+      this.termDateManageOptions = response.data;
+    });
+    this.getDicts("expiration").then(response => {
+      this.expirationOptions = response.data;
+    });
+    this.getDicts("integral_deduction_oil").then(response => {
+      this.integralDeductionOilOptions = response.data;
+    });
+    this.getDicts("integral_manage").then(response => {
+      this.integralActivityOptions = response.data;
+    });
+  },
+  methods: {
+    //添加行
+    addItem() {
+      this.form.itemsDetail.push({
+        ruleTerms: '',
+        oilName: '',
+        gread: '',
+        saleAmt: '' ,
+        integral: '',
+        ruleType: ''
+      });
+    },
+    // 删除行
+    del(index) {
+      this.form.itemsDetail.splice(index, 1);
+    },
+    queryreset() {
+      this.queryParams={
+        stationId: null,
+        stationName: null,
+        oilName: null
+      }
+    },
+    changeGread(e){
+      //获取等级名称和id
+      console.log(e);
+    },
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.deptId === e;//筛选出匹配数据
+      })
+      this.queryreset();
+      this.form.stationName=obj.deptName;
+      this.queryParams.stationId=obj.deptId;
+      oilNameList(this.queryParams).then(response => {
+        this.oilNameOptions = response.rows;
+      });
+    },
+
+    oilNameChang(e){
+      let obj = {};
+      obj = this.oilNameOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.oilName === e;//筛选出匹配数据
+      })
+      this.queryreset();
+      //获取油站名称
+      this.queryParams.stationId = this.form.stationId;
+      this.queryParams.oilName=obj.oilName;
+      gradeList(this.queryParams).then(response => {
+        this.gradeOptions = response.rows;
+      });
+    },
+
+    handlePictureCardPreview(file) {
+      console.log("file",file);
+      this.dialogImageUrl = file.url;
+      this.dialogVisible = true;
+    },
+    handleRemove(file, fileList) {
+      // if (file.id) {
+      //   console.log('删除了已被上传过的图片')
+      //   console.log(file.id)
+      //   this.deleteImgFileList.push(file.id)
+      // }
+      // console.log("wewewewew");
+      // this.form.imgFileList = fileList;
+      //this.hideUpload = fileList.length >= this.limit
+    },
+    beforeAvatarUpload(file) {
+      const isType = file.type === 'image/jpeg' || 'image/png';
+      const isLt5M = file.size / 1024 / 1024 < 1;
+      if (!isType) {
+        this.$message.error('上传头像图片只能是 JPG 或 PNG格式!');
+      }
+      if (!isLt5M) {
+        this.$message.error('上传头像图片大小不能超过 1MB!');
+      }
+      return isType && isLt5M;
+    },
+    picture1Change(file, fileList) {
+      const isType = file.type === 'image/jpeg' || 'image/png'
+      const isLt5M = file.size / 1024 / 1024 < 1
+      if (!isType) {
+        this.$message.error('上传头像图片只能是 JPG 或 PNG格式!');
+        fileList.pop();
+      }
+      if (!isLt5M) {
+        this.$message.error('上传头像图片大小不能超过 1MB!');
+        fileList.pop();
+      }
+      console.log("file",file);
+      console.log("this.form.imgFileList",this.form.imgFileList);
+      console.log("this.form",this.form);
+      // if(this.form.imgFileList!=null){
+      //   this.form.imgFileList.push(file); 
+      // }else{
+      //   this.form.imgFileList=[];
+      //   this.form.imgFileList.push(file);
+      // }
+      // // this.hideUpload = fileList.length >= this.limit;
+      // console.log("this.form.imgFileList1",this.form.imgFileList);
+    },
+   //上传成功
+    handlepaymentSuccess(response,file, fileList){
+        console.log("fileList",fileList);
+        console.log("response",response);
+        console.log("file",file);
+        //this.form.imgFileList.push(file);
+
+
+        this.form.imgFileList.push({name:file.name,url:response.url});
+       //this.form.imgFileList=fileList;
+        console.log("11:",this.form.imgFileList);
+    },
+    // submitUpload() {
+    //   this.uploadUrl =  this.$http.adornUrl(`/common/upload?token=${this.$cookie.get('token')}`);
+    //   console.log("uploadUrl", this.uploadUrl);
+    //   let formData = new FormData(); //  用FormData存放上传文件
+    //   this.form.imgFileList.forEach(file => {
+    //     console.log(file.raw)
+    //     console.log(file.size)
+    //     formData.append('file', file.raw)
+    //   })
+    //   console.log("formData",formData);
+    //   this.$http({
+    //     url: this.uploadUrl,
+    //     method: 'post',
+    //     data: formData,
+    //     headers: {
+    //       "Content-Type": "multipart/form-data"
+    //     }
+    //   }).then(({
+    //              data
+    //            }) => {
+    //     if (data && data.code === 0) {
+    //          console.log("data",data);
+    //       for (var i = 0; i < data.imgNameList.length; i++) {
+    //         this.imgNameList.push(data.imgNameList[i].name)
+    //         this.imgSize.push(data.imgNameList[i].size)
+    //       }
+    //       //this.submitForm()
+    //       this.$refs.upload.clearFiles();
+    //     } else {
+    //       this.$message.error(data.msg)
+    //     }
+    //   })
+    // },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            if(this.form.notOilList!=null&&this.form.notOilList.length>0||this.form.notOilList[0].hasOwnProperty(saleAmt)){
+                if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
+                  this.form.notOilList=[];
+                }
+            }
+            updateRule(this.form).then(response => {
+              this.msgSuccess("修改成功");
+            });
+          } else {
+            if(this.form.datePicker != null){
+              this.form.datePicker =this.form.datePicker.toString();
+            }
+            console.log("notOilList",this.form.notOilList);
+            if(this.form.notOilList!=null&&this.form.notOilList.length>0||this.form.notOilList[0].hasOwnProperty(saleAmt)){
+                if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
+                  this.form.notOilList=[];
+                }
+            }
+            addRule(this.form).then(response => {
+              this.msgSuccess("新增成功");
+            });
+          }
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.queryreset();
+    }
+  },
+}
+</script>
+
+

+ 358 - 0
Yijia-SaaS/yijia-ui/src/views/integral/wares/index.vue

@@ -0,0 +1,358 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商品名称" prop="waresName">
+        <el-input
+          v-model="queryParams.waresName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-button icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="waresList" @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="waresType"  v-if="false" />
+      <el-table-column label="商品名称" align="center" prop="waresName" />
+      <el-table-column label="消费积分" align="center" prop="saleIntegral" />
+      <el-table-column label="商品图片" align="center" prop="waresPic" v-if="false" />
+      <el-table-column label="商品详情" align="center" prop="waresDetail"  width="155" />
+      <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="waresCount" />
+      <el-table-column label="商品状态" align="center" prop="waresStatus" :formatter="waresStatusFotmat" />
+      <el-table-column label="创建人名称" align="center" prop="createName"  v-if="false" />
+      <el-table-column label="更新人名称" align="center" prop="updateName" v-if="false"  />
+      <el-table-column label="更新人时间" align="center" prop="updateTime" v-if="false"  />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <div  v-if="scope.row.waresStatus==2">
+            <el-button
+                       size="mini"
+                       type="text"
+                       icon="el-icon-edit"
+                       @click="updateSJ(scope.row)"
+            >上架</el-button>
+          </div>
+          <div  v-if="scope.row.waresStatus==1">
+            <el-button size="mini"
+                       type="text"
+                       icon="el-icon-edit"
+                       @click="updateSJ(scope.row)"
+            >下架</el-button>
+          </div>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['integral:wares:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['integral:wares: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="waresPic">
+<!--          <el-input v-model="form.waresPic" placeholder="请输入商品图片" />-->
+          <el-upload
+            class="avatar-uploader"
+            action="http://localhost:8080/common/upload"
+            :show-file-list="false"
+            :headers=headers
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeAvatarUpload">
+            <img v-if="form.waresPic" :src="form.waresPic" style="width:150px;height: 150px;" class="avatar">
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="商品名称" prop="waresName">
+          <el-input v-model="form.waresName" placeholder="请输入商品名称" />
+        </el-form-item>
+        <el-form-item label="商品详情" prop="waresDetail">
+          <el-input v-model="form.waresDetail" placeholder="请输入商品详情" />
+        </el-form-item>
+        <el-form-item label="消费积分" prop="saleIntegral">
+          <el-input-number v-model="form.saleIntegral" :min="0" placeholder="请输入消费积分" />
+        </el-form-item>
+        <el-form-item label="油站名称" prop="stationId" >
+          <el-select
+            v-model="form.stationId"
+            placeholder="请选择油站"
+            clearable
+            size="small"
+            @change="onInstitutionChang"
+          >
+            <el-option
+              v-for="item in stationOptions"
+              :key="item.deptId"
+              :label="item.deptName"
+              :value="item.deptId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="油站名称" v-show="false" prop="stationName">
+          <el-input v-model="form.stationName" placeholder="请输入油站名称" />
+        </el-form-item>
+        <el-form-item label="库存"  prop="waresCount">
+          <el-input-number v-model="form.waresCount" :min="0" placeholder="请输入库存数量" />
+        </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 { listWares, getWares, delWares, addWares, updateWares, exportWares } from "@/api/integral/wares";
+import {getToken} from "@/utils/auth";
+import {stationinfo} from "@/api/station/gun";
+
+export default {
+  name: "Wares",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 【请填写功能名称】表格数据
+      waresList: [],
+      stationOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        waresType: null,
+        waresName: null,
+        saleIntegral: null,
+        waresPic: null,
+        waresDetail: null,
+        waresStatus: null,
+        createName: null,
+        updateName: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      headers: { Authorization: "Bearer " + getToken() }
+    };
+  },
+  created() {
+    this.getList();
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
+  },
+  methods: {
+    waresStatusFotmat(row, column) {
+      if (row.waresStatus === '1') {
+        return '已上架'
+      } else if (row.waresStatus === '2') {
+        return '已下架'
+      }
+    },
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.deptId === e;//筛选出匹配数据
+      })
+      this.form.stationName=obj.deptName;
+    },
+    /** 查询【请填写功能名称】列表 */
+    getList() {
+      this.loading = true;
+      listWares(this.queryParams).then(response => {
+        this.waresList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        waresType: null,
+        waresName: null,
+        saleIntegral: null,
+        waresPic: null,
+        waresDetail: null,
+        waresStatus: "0",
+        createTime: null,
+        createBy: null,
+        createName: null,
+        updateTime: null,
+        updateBy: null,
+        updateName: null,
+        waresCount: null,
+        stationId: null,
+        stationName: 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
+      console.log(row.waresStatus);
+      getWares(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改商品信息";
+      });
+    },
+    updateSJ(row){
+      this.reset();
+      this.form.id= row.id;
+      if(row.waresStatus==1){
+        this.form.waresStatus=2;
+      }else{
+        this.form.waresStatus = 1;
+      }
+      if (this.form.id != null) {
+        updateWares(this.form).then(response => {
+          this.msgSuccess("修改成功");
+          this.getList();
+        });
+      }
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateWares(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWares(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 delWares(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有商品数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportWares(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+    // 文件上传成功处理++ =
+    handleFileSuccess(response, file, fileList) {
+      this.upload.isUploading = false;
+      this.form.filePath = response.url;
+      this.msgSuccess(response.msg);
+    },
+    handleAvatarSuccess(res, file) {
+      this.form.waresPic = res.url;
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === 'image/jpeg';
+      const isLt2M = file.size / 1024 / 1024 < 2;
+      if (!isJPG) {
+        this.$message.error('上传头像图片只能是 JPG 格式!');
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!');
+      }
+      return isJPG && isLt2M;
+    }
+  }
+};
+</script>

+ 14 - 1
Yijia-SaaS/yijia-ui/src/views/station/gun/index.vue

@@ -112,6 +112,16 @@
             >{{dict.dictLabel}}</el-radio>
           </el-radio-group>
         </el-form-item>
+        <el-form-item label="油枪类型">
+          <el-radio-group v-model="form.oilGunType">
+            <el-radio
+              v-for="dict in oilGunTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -146,6 +156,7 @@ export default {
       stationOptions:[],
       statusOptions:[],
       oilNameOptions:[],
+      oilGunTypeOptions:[],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -173,13 +184,15 @@ export default {
     stationinfo().then(response => {
       this.stationOptions = response.rows;
     });
-
     this.getDicts("station_gun_status").then(response => {
       this.statusOptions = response.data;
     });
     this.getDicts("oil_name").then(response => {
       this.oilNameOptions = response.data;
     });
+    this.getDicts("oil_gun_type").then(response => {
+      this.oilGunTypeOptions = response.data;
+    });
   },
   methods: {
     /** 查询油枪管理列表 */

+ 1 - 1
Yijia-SaaS/yijia-ui/src/views/station/order/index.vue

@@ -183,7 +183,7 @@
           createdMinDate: null,
           oilPersonnel: null,
           createdDate: null,
-          orderType: null,
+          orderType: 1,
           likeConsumer: null,
           likeCustomerPhone: null,
           likeCarNo: null

+ 14 - 4
Yijia-SaaS/yijia-ui/src/views/station/pay/index.vue

@@ -7,9 +7,6 @@
           list-type="picture-card"
           :auto-upload="false">
           <i slot="default" class="el-icon-plus"></i>
-          <!--              <div slot="file" slot-scope="{file}">-->
-          <!--                <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" >-->
-          <!--              </div>-->
         </el-upload>
       </el-form-item>
       <el-form-item label="油站名称" prop="stationId" >
@@ -28,7 +25,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="油站名称" v-show="false" prop="personnelName">
+      <el-form-item label="油站名称" v-show="false" prop="stationName">
         <el-input v-model="ruleForm.stationName" placeholder="请输入油站名称" />
       </el-form-item>
       <el-form-item label="支付页面形象照" >
@@ -84,6 +81,15 @@
           >{{dict.dictLabel}}</el-radio>
         </el-radio-group>
       </el-form-item>
+      <el-form-item label="开启非油品" >
+        <el-radio-group v-model="ruleForm.isNoOil">
+          <el-radio
+            v-for="dict in isNoOilOptions"
+            :key="dict.dictValue"
+            :label="dict.dictValue"
+          >{{dict.dictLabel}}</el-radio>
+        </el-radio-group>
+      </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
       <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -106,6 +112,7 @@ export default {
       cardEnabledFlagOptions:[],
       discountSettingOptions:[],
       stationOptions:[],
+      isNoOilOptions:[],
       ruleForm:{
       },
       // 表单校验
@@ -133,6 +140,9 @@ export default {
     this.getDicts("discount_setting").then(response => {
       this.discountSettingOptions = response.data;
     });
+    this.getDicts("is_flag").then(response => {
+      this.isNoOilOptions = response.data;
+    });
 
   },
   methods: {