Browse Source

Merge remote-tracking branch 'origin/master'

zangguocen 4 years ago
parent
commit
44e5edf4b9

+ 2 - 2
.env.development

@@ -2,7 +2,7 @@
 ENV = 'development'
 
 # 智慧易加管理系统/开发环境
-VUE_APP_BASE_API = 'http://test.huijy.net/prod-api'
-
+ VUE_APP_BASE_API = 'http://test.huijy.net/prod-api'
+# VUE_APP_BASE_API = '/dev-api'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 26 - 0
src/api/coupon.js

@@ -71,4 +71,30 @@ export function changeCouponStatus(data) {
     method: 'put',
     data: data
   })
+}
+
+// 新增优惠劵发放方式
+export function addIssue(data) {
+  return request({
+    url: '/coupon/issue',
+    method: 'post',
+    data: data
+  })
+}
+// 查询发放方式
+export function listIssue(query) {
+  return request({
+    url: '/coupon/issue/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增优惠劵发放方式
+export function upIssueStatus(data) {
+  return request({
+    url: '/coupon/issue/updateCouponIssueStatus',
+    method: 'put',
+    data: data
+  })
 }

+ 47 - 0
src/api/issue.js

@@ -0,0 +1,47 @@
+import request from '@/utils/request'
+
+// 查询优惠劵发放方式列表
+
+
+// 单条 查询优惠劵发放方式详细
+export function getIssue(id) {
+  return request({
+    url: '/coupon/issue/' + id,
+    method: 'get'
+  })
+}
+
+// 新增优惠劵发放方式
+export function addIssue(data) {
+  return request({
+    url: '/coupon/issue',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优惠劵发放方式
+export function updateIssue(data) {
+  return request({
+    url: '/coupon/issue',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优惠劵发放方式
+// export function delIssue(id) {
+//   return request({
+//     url: '/coupon/issue/' + id,
+//     method: 'delete'
+//   })
+// }
+
+// 导出优惠劵发放方式
+export function exportIssue(query) {
+  return request({
+    url: '/coupon/issue/export',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
src/api/lng.js

@@ -61,3 +61,11 @@ export function updatePlan(data) {
     })
   }
 
+// 查询站点余额
+  export function selectDeptBalance(query) {
+    return request({
+      url: '/system/dept/selectDeptBalance',
+      method: 'get',
+      params: query
+    })
+  }

+ 230 - 0
src/components/SelectDay/index.vue

@@ -0,0 +1,230 @@
+<template>
+  <div class="selectDay">
+    <div
+      v-show="type != 3"
+      style="
+        display: flex;
+        flex-wrap: wrap;
+        border-style: solid;
+        border-color: #f5f7fa;
+      "
+    >
+      <div
+        v-for="(item, index) in timeSelect[type]"
+        :key="index"
+        style="margin: 3px"
+      >
+        <div
+          class="hover-style"
+          style="
+            border-radius: 5px;
+            font-weight: bold;
+            font-size: 12px;
+            cursor: pointer;
+          "
+          @click="clickCalendar(index)"
+        >
+          <div>{{ item }}</div>
+          <div
+            v-if="collectClickCalendar.indexOf(index) > -1"
+            style="
+              width: 4px;
+              height: 4px;
+              border-radius: 50%;
+              background-color: red;
+              position: relative;
+              left: calc(50% - 2px);
+            "
+          ></div>
+          <div v-else style="width: 4px; height: 4px"></div>
+        </div>
+      </div>
+    </div>
+    <div v-show="type == 3">
+      <el-date-picker
+        clearable
+        size="small"
+        style="margin-top: 10px; width: 200px"
+        v-model="collectClickDay"
+        type="dates"
+        value-format="yyyy-MM-dd"
+        placeholder="选择提醒时间设置"
+      >
+      </el-date-picker>
+    </div>
+  </div>
+</template>
+
+<script>
+import { scrollTo } from "@/utils/scroll-to";
+
+export default {
+  name: "SelectDay",
+  data() {
+    return {
+      updateForm: {},
+      timeSelect: [
+        ,
+        ["周天", "周一", "周二", "周三", "周四", "周五", "周六"],
+        [
+          "01",
+          "02",
+          "03",
+          "04",
+          "05",
+          "06",
+          "07",
+          "08",
+          "09",
+          "10",
+          "11",
+          "12",
+          "13",
+          "14",
+          "15",
+          "16",
+          "17",
+          "18",
+          "19",
+          "20",
+          "21",
+          "22",
+          "23",
+          "24",
+          "25",
+          "26",
+          "27",
+          "28",
+          "29",
+          "30",
+          "31",
+        ],
+      ],
+    };
+  },
+  props: {
+    // total: {
+    //   required: true,
+    //   type: Number
+    // },
+    // page: {
+    //   type: Number,
+    //   default: 1
+    // },
+    // limit: {
+    //   type: Number,
+    //   default: 10
+    // },
+    type: {
+      required: true,
+      type: String,
+      default() {
+        return "0"
+      }
+    },
+    pageSizes: {
+      type: Array,
+      default() {
+        return [10, 20, 30, 50];
+      },
+    },
+    day: {
+      type: Array,
+      required: true,
+      default() {
+        return [];
+      },
+    },
+    cycle:{
+      type: Array,
+      required: true,
+      default() {
+        return [];
+      },
+    }
+  },
+  computed: {
+    currentPage: {
+      get() {
+        return this.page;
+      },
+      set(val) {
+        this.$emit("update:page", val);
+      },
+    },
+    pageSize: {
+      get() {
+        return this.limit;
+      },
+      set(val) {
+        this.$emit("update:limit", val);
+      },
+    },
+    collectClickDay:{
+      get() {
+        return this.day;
+      },
+      set(val) {
+        if(val == null ){
+          val = []
+        }
+        val = [...val]
+        console.log(val);
+        this.$emit("update:day", val);
+      },
+    },
+
+    collectClickCalendar: {
+      get() {
+        if(this.cycle == null ){
+          this.cycle = []
+        }
+        return this.cycle;
+      },
+      set(val) {
+        if( val == null ){
+          val = []
+        }
+        val = [...val]
+        console.log(val);
+        this.$emit("update:cycle", val);
+      },
+    },
+  },
+  methods: {
+    clickCalendar(index) {
+      if (this.collectClickCalendar.indexOf(index) === -1) {
+        this.collectClickCalendar.push(index);
+      } else if (this.collectClickCalendar.indexOf(index) > -1) {
+        const temp = this.collectClickCalendar.findIndex((ele) => {
+          return ele == index;
+        });
+        this.collectClickCalendar.splice(temp, 1);        
+      }
+      this.collectClickCalendar = [...this.collectClickCalendar]
+    },
+    handleSizeChange(val) {
+      this.$emit("pagination", { page: this.currentPage, limit: val });
+      if (this.autoScroll) {
+        scrollTo(0, 800);
+      }
+    },
+    handleCurrentChange(val) {
+      this.$emit("pagination", { page: val, limit: this.pageSize });
+      if (this.autoScroll) {
+        scrollTo(0, 800);
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+.pagination-container {
+  background: #fff;
+  padding: 32px 16px;
+}
+.pagination-container.hidden {
+  display: none;
+}
+</style>

+ 121 - 59
src/views/coupon/Coupon_CreateCoupon.vue

@@ -71,7 +71,54 @@
       </el-form>
       <el-table :data="couponList">
         <af-table-column label="优惠券名称" align="center" prop="couponName" />
-        <af-table-column label="状态" align="center" width="100">
+        <af-table-column label="卡片类型" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 ? '现金劵' + '--面值:' + scope.row.couponAmt + '元' : ''}}
+          {{scope.row.couponType == 2 ? '折扣券' + '--折扣:' + scope.row.couponAmt + '% ' : ''}}
+          {{scope.row.couponType == 3 ? '兑换券' + '--商品:' + scope.row.couponDetails  : ''}}
+          </template>
+        </af-table-column>
+        <af-table-column label="使用门槛" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?  (scope.row.couponThresholdAmt == 0 ? '无门槛':'满' + scope.row.couponThresholdAmt + '元可用') : ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+        <af-table-column label="适用油品" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?  ((scope.row.oilNameList||[]).toString()) : ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="使用状态" align="center">
+          <template slot-scope="scope">
+          {{"共生成了" + scope.row.couponNum + "张,已领取" + scope.row.couponCumulativeNum + '张,已使用'+ scope.row.couponUseNum +'张' }}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="有效期和限制" align="center">
+          <template slot-scope="scope">
+          {{ (scope.row.effectiveTimeType == 1 ? scope.row.effectiveTime[0] + '到' + scope.row.effectiveTime[1]   : '用户领取'+ scope.row.effectiveDayNum +'天内有效' ) + '内有效'}}
+          {{ ',且用户只能在1号领取'}}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="领取限制" align="center">
+          <template slot-scope="scope">
+          {{ "单用户最多持有" + scope.row.couponHoldNum + '张,累计可拥有'+ scope.row.couponReceiveNum +'张' }}
+          </template>
+        </af-table-column>
+
+        <af-table-column label="优惠叠加" align="center">
+          <template slot-scope="scope">
+          {{scope.row.couponType == 1 || scope.row.couponType == 2 ?   ['不',''][scope.row.isCardFlag] + '可用电子卡,' + ['不',''][scope.row.isGradeFlag] + '可用等级优惠,' + ['不',''][scope.row.isMarketFlag] + '可用优惠方案': ''}}
+          {{scope.row.couponType == 3 ? '------------'  : ''}}
+          </template>
+        </af-table-column>
+
+        
+        <af-table-column label="状态" align="center">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.status"
@@ -81,8 +128,6 @@
             ></el-switch>
           </template>
         </af-table-column>
-        <!-- <af-table-column label="面值" align="center" prop="gunNo" /> -->
-        <!-- <af-table-column label="有效期" align="center" prop="deviceFactory" /> -->
         <af-table-column
           label="操作"
           align="center"
@@ -98,13 +143,6 @@
               v-if="scope.row.editFlag"
               >修改</el-button
             >
-            <!-- <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="handleDelete(scope.row)"
-              >删除</el-button
-            > -->
           </template>
         </af-table-column>
       </el-table>
@@ -122,6 +160,7 @@
     </div>
 
     <!-- 添加或修改油站设备管理对话框 -->
+
     <el-dialog
       :title="title"
       :visible.sync="open"
@@ -258,7 +297,7 @@
         </el-form-item>
         <el-form-item label="单人可持有数量" prop="couponHoldNum">
-          单个用户最多
+          单个用户最多
           <input
             type="text"
             class="form-control d-inline"
@@ -300,15 +339,35 @@
         </el-form-item>
         <el-form-item
           label="用劵时叠加优惠方案"
-          prop="isMakertFlag"
+          prop="isMarketFlag"
           v-if="createForm.couponType == 1 || createForm.couponType == 2"
         >
-          <el-radio-group v-model="createForm.isMakertFlag">
+          <el-radio-group v-model="createForm.isMarketFlag">
             <el-radio label="1">叠加优惠方案</el-radio>
             <el-radio label="0">不叠加优惠方案</el-radio>
           </el-radio-group>
         </el-form-item>
-
+        <el-form-item
+          label="有效期内可用时间控制"
+          prop="isMarketFlag2"
+          v-if="createForm.couponType == 1 || createForm.couponType == 2"
+        >
+          <el-radio-group v-model="createForm.availableControl" @change="availableControlChange">
+            <el-radio label="0">有效期内一直都可用</el-radio>
+            <el-radio label="1">有效期内每周指定日</el-radio>
+            <el-radio label="2">有效期内每月指定日</el-radio>
+            <el-radio label="3">有效期内固定指定日</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          label="可用时间选择"
+          prop="isMarketFlag1"
+          v-if="createForm.availableControl == 1 || createForm.availableControl == 2 || createForm.availableControl == 3"
+        >
+          <div>
+            <select-day :type="createForm.availableControl" :day.sync="createForm.appointedDaysList" :cycle.sync="createForm.cycleDaysList"></select-day>
+          </div>
+        </el-form-item>
         <el-form-item
           label="优惠券的核销方"
           prop="couponType"
@@ -412,17 +471,8 @@
 </template>
 
 <script>
-import {
-  listManage,
-  getManage,
-  delManage,
-  addManage,
-  updateManage,
-  exportManage,
-  changeManageStatus,
-} from "@/api/station/manage";
-import { listGun } from "@/api/station/gun";
 import { listPrice } from "@/api/station/price";
+import SelectDay from "@/components/SelectDay";
 
 import { addInfo, verificationList, listInfo, updateInfo, changeCouponStatus } from "@/api/coupon";
 import { updateDept } from "@/api/system/dept";
@@ -442,7 +492,7 @@ export default {
         couponDetails: "",
         couponThresholdAmt: 0,
         couponType: "1",
-        couponAmt: 0,
+        couponAmt: '',
         oilNameList: [],
         effectiveTimeType: "", //有效时间类型: 1,固定时间;2,领取后x天内有效
         effectiveTime: [],
@@ -454,20 +504,18 @@ export default {
         verificationList: [],
         isCardFlag: "1",
         isGradeFlag: "1",
-        isMakertFlag: "1",
+        isMarketFlag: "1",
+        availableControl:"0",
+        appointedDaysList:[], 
+        cycleDaysList:[],
       },
       couponList: [],
       oilNameList: [],
       allVerificationList: [
       ],
-      equipmentList: [],
-      // 油枪复选
-      allGunList: [],
-      // 已选的油枪
-      checkedGunList: [],
-      //设备状态
-      deviceStatusOptions: [],
-      //设备类型
+      day:[],
+      cycle:[],
+
       deviceTypeOptions: [],
       stationOptions: [],
       // 弹出层标题
@@ -518,13 +566,27 @@ export default {
         }
         return !!!this.createForm.verificationList.includes(ele.deptId);
       });
-    },
-    getTodayDateString() {
-      const today = new Date();
-      return;
-    },
+    },    
+  },
+  components: {
+    'SelectDay': SelectDay
   },
   methods: {
+    getTodayDateString(){
+      const date = new Date()
+      let y = date.getFullYear();
+      let m = date.getMonth().toString();
+      let s = date.getDate().toString();
+      m = '' + (m.length == 1 ? '0':'') + m
+      s = '' + (s.length == 1 ? '0':'') + s
+      console.log('' + h + ':' + m +':' + s)
+      return '' + y + ':' + m +':' + s
+    },
+    availableControlChange(){
+      this.createForm.appointedDaysList = [];
+      this.createForm.cycleDaysList = [];
+      this.createForm = {...this.createForm}
+    },
     handleMoveLabel(direction, row){
       console.log(row)
       if(this.createForm.verificationList == null) {
@@ -598,10 +660,7 @@ export default {
         });
     },
     getCoupon() {
-      listInfo({
-        pageNum: 1,
-        pageSize: 10,
-      })
+      listInfo(this.queryForm)
         .then((res) => {
           if (res.code == 200) {
             console.log(res);
@@ -717,9 +776,9 @@ export default {
         couponDetails: "",
         couponThresholdAmt: 0,
         couponType: "1",
-        couponAmt: 0,
+        couponAmt: '',
         oilNameList: [],
-        effectiveTimeType: "", 
+        effectiveTimeType: "", //有效时间类型: 1,固定时间;2,领取后x天内有效
         effectiveTime: [],
         effectiveDayNum: 30,
         couponHoldNum: 1,
@@ -729,7 +788,10 @@ export default {
         verificationList: [],
         isCardFlag: "1",
         isGradeFlag: "1",
-        isMakertFlag: "1",
+        isMarketFlag: "1",
+        availableControl:"0",
+        appointedDaysList:[], 
+        cycleDaysList:[],
       }
       this.open = true;
     },
@@ -776,19 +838,19 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const deviceIds = row.deviceId;
-      this.$confirm("是否确认删除油站设备管理", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(function () {
-          return delManage(deviceIds);
-        })
-        .then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        });
+      // const deviceIds = row.deviceId;
+      // this.$confirm("是否确认删除油站设备管理", "警告", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(function () {
+      //     return delManage(deviceIds);
+      //   })
+      //   .then(() => {
+      //     this.getList();
+      //     this.msgSuccess("删除成功");
+      //   });
     },
   },
 };

+ 0 - 494
src/views/coupon/Coupon_CreateGetWay.vue

@@ -1,494 +0,0 @@
-<template>
-  <div v-if="pageStatus == 0">配置加载中...</div>
-  <div v-else-if="pageStatus == 1">此页面不对此账号开放</div>
-  <div v-else-if="pageStatus == 2">
-    没有此页内容的配置权限,请检查集团上的配置
-  </div>
-  <div v-else-if="pageStatus == 3">加载发生错误</div>
-  <div v-else-if="pageStatus == 4" class="app-container">
-    <el-form
-      :model="queryForm"
-      ref="queryForm"
-      :inline="true"
-      label-width="88px"
-    >
-      <el-form-item label="设备类型" prop="deviceType">
-        <el-select
-          v-model="queryForm.deviceType"
-          clearable
-          placeholder="请选择"
-        >
-          <el-option label="小票打印机" value="1"></el-option>
-          <el-option label="POS" value="2"></el-option>
-        </el-select>
-      </el-form-item>
-
-      <el-form-item label="密钥" prop="deviceSerialNum">
-        <el-input
-          v-model="queryForm.deviceSerialNum"
-          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
-          type="info"
-          icon="el-icon-refresh"
-          size="mini"
-          @click="resetQuery"
-          >重置</el-button
-        >
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          >新增</el-button
-        >
-      </el-form-item>
-    </el-form>
-
-    <el-table :data="equipmentList">
-      <af-table-column label="优惠" align="center" prop="deviceType">
-        <template slot-scope="scope">
-          {{
-            scope.row.deviceType == "1"
-              ? "小票打印机"
-              : scope.row.deviceType == "2"
-              ? "POS"
-              : "不明设备"
-          }}
-        </template>
-      </af-table-column>
-      <af-table-column label="优惠券名称" align="center" prop="deviceNo" />
-      <af-table-column label="面值" align="center" prop="gunNo" />
-      <af-table-column label="有效期" align="center" prop="deviceFactory" />
-      <af-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-        width="120px"
-      >
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            >修改</el-button
-          >
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            >删除</el-button
-          >
-        </template>
-      </af-table-column>
-    </el-table>
-
-    <pagination
-      :hidden="total > 0 ? false : true"
-      :total="total"
-      :page.sync="queryForm.pageNum"
-      :limit.sync="queryForm.pageSize"
-      @pagination="getList"
-      :autoScroll="true"
-    />
-
-    <!-- 添加或修改油站设备管理对话框 -->
-    <el-dialog
-      :title="title"
-      :visible.sync="open"
-      width="550px"
-      append-to-body
-      status-icon
-    >
-      <el-form
-        ref="dialogForm"
-        :model="dialogForm"
-        :rules="rules"
-        label-width="150px"
-      >
-        <el-form-item label="名称" prop="couponName">
-          <input
-            type="text"
-            class="form-control"
-            v-model.number="queryParams.couponName"
-            style="width: 150px"
-          />
-        </el-form-item>
-        <el-form-item label="条件" prop="couponThresholdAmt">
-          <div>
-            满
-            <input
-              type="text"
-              class="form-control d-inline"
-              v-model.number="queryParams.couponThresholdAmt"
-              style="width: 100px"
-            />
-            元 可用
-          </div>
-        </el-form-item>
-        <el-form-item label="类型" prop="couponType">
-          <el-radio-group v-model="queryParams.couponType">
-            <el-radio label="1">现金券</el-radio>
-            <el-radio label="2">折扣劵</el-radio>
-            <el-radio label="3">兑换劵</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="优惠" prop="couponAmt">
-          <div>
-            面值金额—<input
-              type="text"
-              class="form-control d-inline"
-              v-model.number="queryParams.couponAmt"
-              style="width: 100px"
-            />
-            元
-          </div>
-          <div>
-            折扣比例—<input
-              type="text"
-              class="form-control d-inline"
-              v-model.number="queryParams.couponAmt"
-              style="width: 100px"
-            />
-            %
-          </div>
-        </el-form-item>
-        <el-form-item label="油品" prop="deviceName">
-          <el-checkbox-group v-model="queryParams.oilName">
-            <el-checkbox label="92#"></el-checkbox>
-            <el-checkbox label="93#"></el-checkbox>
-            <el-checkbox label="94#"></el-checkbox>
-          </el-checkbox-group>
-        </el-form-item>
-
-        <el-form-item label="有效期类型" prop="effectiveTimeType">
-          <el-radio-group v-model="queryParams.effectiveTimeType">
-            <el-radio label="1">固定时间段</el-radio>
-            <el-radio label="2">领取后设定有效时段</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="有效时间" prop="deviceName">
-        <div>
-          <el-date-picker
-            style="margin: 0px 10px; width: 300px"
-            v-model="queryParams.dateRangeCreatedDate"
-            type="datetimerange"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            size="mini"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          >
-          </el-date-picker>
-        </div>
-        <div>
-          自用户领取后 <input
-              type="text"
-              class="form-control d-inline"
-              v-model.number="queryParams.effectiveDayNum"
-              style="width: 100px"
-            /> 天内有效
-        </div>
-          
-        </el-form-item>
-
-        <el-form-item label="生成数量" prop="couponNum">
-          共生成
-          <input
-            type="text"
-            class="form-control d-inline"
-            v-model.number="queryParams.couponNum"
-            style="width: 100px"
-          />
-          张
-        </el-form-item>
-        <el-form-item label="每人限领" prop="couponReceiveNum">
-          单个用户最多领取
-          <input
-            type="text"
-            class="form-control d-inline"
-            v-model.number="queryParams.couponReceiveNum"
-            style="width: 100px"
-          />
-          张
-        </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 {
-  listManage,
-  getManage,
-  delManage,
-  addManage,
-  updateManage,
-  exportManage,
-  changeManageStatus,
-} from "@/api/station/manage";
-import { listGun } from "@/api/station/gun";
-export default {
-  name: "Station_Equipment",
-  data() {
-    let validateGunNo = (rule, value, callback) => {
-      callback();
-    };
-    return {
-      pageStatus: 4,
-      // 油站设备管理表格数据
-      queryParams: {
-        couponName: "",
-        couponThresholdAmt:0,
-        couponType:"1",
-        couponAmt:0,
-        oilName:[],
-        effectiveTimeType:'', //有效时间类型: 1,固定时间;2,领取后x天内有效
-        effectiveTime:[],
-        effectiveDayNum :3,
-        couponReceiveNum:1,
-        couponNum :100,
-        status:1
-
-      },
-      equipmentList: [],
-      // 油枪复选
-      allGunList: [],
-      // 已选的油枪
-      checkedGunList: [],
-      //设备状态
-      deviceStatusOptions: [],
-      //设备类型
-      deviceTypeOptions: [],
-      stationOptions: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 总条数
-      total: 100,
-      // 查询参数
-      queryForm: {
-        pageNum: 1,
-        pageSize: 10, // 初始值只能比10大
-        deviceNo: null,
-        deviceSerialNum: null, // 设备密钥
-      },
-      // 弹窗表单参数
-      dialogForm: {
-        checkedGunList: [],
-        deviceStatus: "1",
-        deviceType: "1",
-      },
-      currentList: [],
-      // 表单校验
-      rules: {
-        deviceNo: [
-          { required: true, message: "请输入设备编号", trigger: "blur" },
-        ],
-        deviceName: [
-          { required: true, message: "请输入设备名", trigger: "blur" },
-        ],
-        // deviceSerialNum: [
-        //   { required: true, message: "请输入设备密钥", trigger: "blur" },
-        // ],
-        deviceType: [
-          { required: true, message: "请选择设备类型", trigger: "blur" },
-        ],
-        checkedGunList: [{ validator: validateGunNo, trigger: "change" }],
-        deviceStatus: [
-          { required: true, message: "请选择设备状态", trigger: "blur" },
-        ],
-        deviceFactory: [
-          // { required: true, message: '请输入设备厂家', trigger: 'blur' }
-        ],
-      },
-      updateAble: false,
-      deviceTypeAble: false,
-    };
-  },
-  created() {
-    this.init();
-    this.setPageStatus();
-  },
-  computed: {
-    posList() {
-      // 排除其他pos已经添加过的
-      const temp = this.allGunList.filter((item) => {
-        let flag = false;
-        this.equipmentList.map((ele) => {
-          if (ele.deviceType == 2) {
-            if (ele.gunNo.split(",").includes(item.oilGunNo)) {
-              flag = true;
-              return;
-            }
-          }
-        });
-        return flag;
-      });
-      // 查找自己的
-      const temp2 = this.allGunList.filter((item) => {
-        let flag = true;
-        temp.map((ele) => {
-          if (item.oilGunNo == ele.oilGunNo) {
-            flag = false;
-          }
-        });
-        return flag;
-      });
-      return this.currentList.concat(temp2);
-    },
-    printList() {
-      const temp = this.allGunList.filter((item) => {
-        let flag = false;
-        this.equipmentList.map((ele) => {
-          if (ele.deviceType == 1) {
-            if (ele.gunNo.split(",").includes(item.oilGunNo)) {
-              flag = true;
-              return;
-            }
-          }
-        });
-        return flag;
-      });
-      const temp2 = this.allGunList.filter((item) => {
-        let flag = true;
-        temp.map((ele) => {
-          if (item.oilGunNo == ele.oilGunNo) {
-            flag = false;
-          }
-        });
-        return flag;
-      });
-      return this.currentList.concat(temp2);
-    },
-  },
-  methods: {
-    init() {
-      this.getList();
-      //字典设备状态
-      this.getDicts("device_status").then((response) => {
-        this.deviceStatusOptions = response.data;
-      });
-      //字典设备类型
-      this.getDicts("device_type").then((response) => {
-        this.deviceTypeOptions = response.data;
-      });
-      listGun({
-        stationId: this.deptId,
-      }).then((response) => {
-        this.allGunList = response.rows;
-      });
-    },
-    setPageStatus() {
-      this.queryPageStatus([2]).then((res) => {
-        this.pageStatus = res;
-      });
-    },
-    /** 查询油站设备管理列表 首页表单 */
-    getList() {
-      listManage(this.queryForm).then((response) => {
-        this.equipmentList = response.rows;
-        this.total = response.total;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryForm.pageNum = 1;
-      this.getList();
-    },
-    deviceNoInput(value) {
-      this.dialogForm.posQueue = value;
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.updateAble = false;
-      this.currentList = [];
-      this.title = "添加油站设备管理";
-      this.dialogForm = {
-        checkedGunList: [],
-        deviceStatus: "1",
-        deviceType: "1",
-        posFanoutExchange: "posFanoutExchange-" + this.deptId,
-      };
-      this.open = true;
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      // 查找自己已经选中的枪号
-      this.updateAble = true;
-      this.currentList = this.allGunList.filter((ele) => {
-        return row.gunNo.split(",").includes(ele.oilGunNo);
-      });
-      let checkedGunList;
-      // 将自己有的抢号 默认勾选
-      if (Object.prototype.toString.call(row.gunNo) === "[object String]") {
-        checkedGunList = [...new Set(row.gunNo.split(","))].filter((ele) => {
-          return ele.toString().trim() !== "";
-        });
-      } else {
-        checkedGunList = [];
-      }
-      this.dialogForm = { ...row, checkedGunList };
-      this.title = "修改油站设备管理";
-      this.open = true;
-    },
-
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["dialogForm"].validate((valid) => {
-        if (valid) {
-          //this.dialogForm.gunNo = this.dialogForm.checkedGunList.toString();
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const deviceIds = row.deviceId;
-      this.$confirm("是否确认删除油站设备管理", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(function () {
-          return delManage(deviceIds);
-        })
-        .then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        });
-    },
-  },
-};
-</script>
-<style scoped>
-
-</style>

+ 685 - 0
src/views/coupon/Coupon_CreateIssue.vue

@@ -0,0 +1,685 @@
+<template>
+  <div v-if="pageStatus == 0">配置加载中...</div>
+  <div v-else-if="pageStatus == 1">此页面不对此账号开放</div>
+  <div v-else-if="pageStatus == 2">
+    没有此页内容的配置权限,请检查集团上的配置
+  </div>
+  <div v-else-if="pageStatus == 3">加载发生错误</div>
+  <div v-else-if="pageStatus == 4" class="app-container">
+    <div>
+      <el-form
+        :model="createForm"
+        ref="createForm"
+        :inline="true"
+        label-width="88px"
+      >
+        <el-form-item label="设备类型" prop="deviceType">
+          <el-select
+            v-model="createForm.deviceType"
+            clearable
+            placeholder="请选择"
+          >
+            <el-option label="小票打印机" value="1"></el-option>
+            <el-option label="POS" value="2"></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="密钥" prop="deviceSerialNum">
+          <el-input
+            v-model="createForm.deviceSerialNum"
+            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
+            type="info"
+            icon="el-icon-refresh"
+            size="mini"
+            @click="resetQuery"
+            >重置</el-button
+          >
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="mini"
+            @click="handleAdd"
+            >新增</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <el-table :data="issueList">
+        <af-table-column label="id" align="center" prop="id" />
+        <af-table-column label="状态" align="center" width="100">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.status"
+              active-value="1"
+              inactive-value="0"
+              @change="handleStatusChange(scope.row)"
+            ></el-switch>
+          </template>
+        </af-table-column>
+        <!-- <af-table-column label="面值" align="center" prop="gunNo" /> -->
+        <!-- <af-table-column label="有效期" align="center" prop="deviceFactory" /> -->
+        <af-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+          width="120px"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              >修改</el-button
+            >
+          </template>
+        </af-table-column>
+      </el-table>
+      <pagination
+        :hidden="total > 0 ? false : true"
+        :total="total"
+        :page.sync="queryForm.pageNum"
+        :limit.sync="queryForm.pageSize"
+        @pagination="getCoupon"
+        :autoScroll="true"
+      />
+    </div>
+
+    <!-- 添加或修改油站设备管理对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="600px"
+      append-to-body
+      status-icon
+    >
+      <el-form
+        ref="dialogForm"
+        :model="createForm"
+        :rules="rules"
+        label-width="180px"
+      >
+        <el-form-item label="发放方式名称" prop="issueName">
+          <input
+            type="text"
+            class="form-control"
+            v-model="createForm.issueName"
+            style="width: 180px"
+          />
+        </el-form-item>
+        <el-form-item label="发放类型" prop="couponName">
+          <el-radio-group v-model="createForm.issueType">
+            <div>
+              <el-radio label="1">消费发放</el-radio>
+              <el-radio label="2">展示位发放</el-radio>
+            </div>
+            <div>
+              <el-radio label="3">二维码、网页</el-radio>
+              <el-radio label="4" disabled>更多方式后续开放</el-radio>
+            </div>
+            
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="展示位选择" prop="showIdList" v-if="createForm.issueType==2">
+          <el-checkbox-group v-model="createForm.showIdList">
+            <div>
+              <el-checkbox label="1">支付成功后的展示位</el-checkbox>
+              <el-checkbox label="2" disabled>待定</el-checkbox>
+            </div>
+            <div>
+              <el-checkbox label="3" disabled>更多位置后续开放</el-checkbox>
+            </div>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item label="发放门槛" prop="discountThresholdAmt" v-if="createForm.issueType==1">
+          消费达到
+          <input
+            type="text"
+            class="form-control d-inline-block"
+            v-model.number="createForm.discountThresholdAmt"
+            style="width: 80px"
+          />元时,系统自动发放
+        </el-form-item>
+        <el-form-item label="可领取时间段" prop="availableControl">
+          <el-radio-group
+            v-model="createForm.availableControl"
+            @change="availableControlChange"
+          >
+            <div>
+              <div>
+                <el-radio label="0">一直都可用</el-radio>
+                <el-radio label="1">每周指定日</el-radio>
+              </div>
+              <div>
+                <el-radio label="2">每月指定日</el-radio>
+                <el-radio label="3">固定指定日</el-radio>
+              </div>
+            </div>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          label="可用时间选择"
+          prop="isMarketFlag1"
+          v-if="
+            createForm.availableControl == 1 ||
+            createForm.availableControl == 2 ||
+            createForm.availableControl == 3
+          "
+        >
+          <div>
+            <select-day
+              :type="createForm.availableControl"
+              :day.sync="createForm.appointedDaysList"
+              :cycle.sync="createForm.cycleDaysList"
+            ></select-day>
+          </div>
+        </el-form-item>
+        <el-form-item
+          label="此领取方式下的优惠券"
+          prop="couponIssueRelationList"
+        >
+        </el-form-item>
+
+        <div>
+          <el-col :span="11">
+            <el-table
+              :data="unselectedCouponList"
+              border
+              size="mini"
+              :resizable="false"
+              highlight-current-row
+              height="500"
+              @selection-change="handleLeftChange"
+              disabled
+              ref="leftTable"
+            >
+              >
+              <el-table-column label="可选">
+                <el-table-column
+                  prop="phone"
+                  label="姓名"
+                  type="selection"
+                ></el-table-column>
+                <el-table-column
+                  prop="couponName"
+                  label="优惠券"
+                ></el-table-column>
+                <el-table-column label="添加" width="60px" align="center">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      icon="el-icon-circle-plus-outline"
+                      class="underline btn24"
+                      size="mini"
+                      @click="handleMoveLabel('right', scope.row)"
+                      >添加</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col :span="2" style="text-align: center">
+            <el-button
+              type="primary"
+              size="mini"
+              @click="toggleLabel"
+              style="
+                margin-top: 200px;
+                text-align: center;
+                width: 30px;
+                padding-right: 0;
+                padding-left: 0;
+              "
+              :disabled="toggleable"
+              >切换</el-button
+            >
+          </el-col>
+          <el-col :span="11">
+            <el-table
+              :data="selectedCouponList"
+              border
+              size="mini"
+              highlight-current-row
+              :resizable="false"
+              height="500"
+              @selection-change="handleRightChange"
+              :loading="true"
+              ref="rightTable"
+            >
+              <el-table-column label="已选" :resizable="false">
+                <el-table-column
+                  prop="phone"
+                  type="selection"
+                ></el-table-column>
+                <el-table-column
+                  prop="couponName"
+                  label="优惠券"
+                ></el-table-column>
+                <el-table-column label="移除" width="60px" align="center">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      icon="el-icon-remove-outline"
+                      class="underline btn24"
+                      size="mini"
+                      @click="handleMoveLabel('left', scope.row)"
+                      >移除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+        </div>
+      </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 {
+  listManage,
+  getManage,
+  delManage,
+  addManage,
+  updateManage,
+  exportManage,
+  changeManageStatus,
+} from "@/api/station/manage";
+import { listPrice } from "@/api/station/price";
+
+import {
+  addInfo,
+  listInfo,
+  updateInfo,
+  changeCouponStatus,
+  addIssue,
+  listIssue,
+  upIssueStatus
+} from "@/api/coupon";
+import SelectDay from "@/components/SelectDay";
+
+export default {
+  name: "Coupon_CreateIssue",
+  data() {
+    let validateGunNo = (rule, value, callback) => {
+      callback();
+    };
+    return {
+      couponEnabledFlag: "1",
+
+      pageStatus: 4,
+      createForm: {
+        issueName:'',
+        showIdList: [],
+        availableControl: "0",
+        appointedDaysList: [],
+        cycleDaysList: [],
+        issueType: "2",
+        discountThresholdAmt: "0",
+        couponIssueRelationList: [],
+      },
+      couponList: [],
+      oilNameList: [],
+      allVerificationList: [],
+      equipmentList: [],
+      // 油枪复选
+      allGunList: [],
+      // 已选的油枪
+      checkedGunList: [],
+      //设备状态
+      deviceStatusOptions: [],
+      //设备类型
+      deviceTypeOptions: [],
+      stationOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 总条数
+      total: 100,
+      leftQuery: {},
+      rightQuery: {},
+      leftData: [],
+      rightData: [],
+      moveRightData: [],
+      moveLeftData: [],
+      // 查询参数
+      queryForm: {
+        pageNum: 1,
+        pageSize: 10, // 初始值只能比10大
+      },
+      // 表单校验
+      rules: {},
+      day: [],
+      cycle: [],
+      issueList:[],
+    };
+  },
+  components: {
+    SelectDay: SelectDay,
+  },
+  created() {
+    // this.init();
+    this.getCoupon();
+    // this.setPageStatus();
+    this.getIssueList();
+  },
+  computed: {
+    toggleable() {
+      if (this.moveRightData.length === 0 && this.moveLeftData.length === 0) {
+        return true;
+      }
+      return false;
+    },
+    selectedCouponList() {
+      return this.couponList.filter((ele) => {
+        if(this.createForm.couponIssueRelationList == null) {
+          this.createForm.couponIssueRelationList = [];
+        }
+        return this.createForm.couponIssueRelationList.includes(ele.id);
+      });
+    },
+    unselectedCouponList() {
+      return this.couponList.filter((ele) => {
+        if(this.createForm.couponIssueRelationList == null) {
+          this.createForm.couponIssueRelationList = [];
+        }
+        return !!!this.createForm.couponIssueRelationList.includes(ele.id);
+      });
+    },
+    getTodayDateString(){
+      const date = new Date()
+      let y = date.getFullYear();
+      let m = date.getMonth().toString();
+      let s = date.getDate().toString();
+      m = '' + (m.length == 1 ? '0':'') + m
+      s = '' + (s.length == 1 ? '0':'') + s
+      console.log('' + h + ':' + m +':' + s)
+      return '' + y + ':' + m +':' + s
+    }
+  },
+  methods: {
+    getIssueList(){
+      listIssue(this.queryForm).then((res) => {
+          if (res.code == 200) {
+            if (res.rows == null) {
+              this.total = 0;
+              this.issueList = [];
+            } else {
+              this.total = res.total;
+              this.issueList = res.rows;
+            }
+          } else {
+            throw new Error("");
+          }
+        })
+        .catch((err) => {
+          this.msgError("亲,拉取领取方式列表失败~");
+        });
+    },
+    getCoupon() {
+      listInfo({
+        pageNum: 1,
+        pageSize: 1000,
+        status:1
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            if (res.rows == null) {
+              this.couponList = [];
+            } else {
+              this.couponList = res.rows;
+            }
+          } else {
+            throw new Error("");
+          }
+        })
+        .catch((err) => {
+          this.msgError("亲,拉取优惠券列表失败~");
+        });
+    },
+    availableControlChange() {
+      this.createForm.appointedDaysList = [];
+      this.createForm.cycleDaysList = [];
+      this.createForm = { ...this.createForm };
+    },
+    handleMoveLabel(direction, row){
+      console.log(row)
+      if(this.createForm.couponIssueRelationList == null) {
+        this.createForm.couponIssueRelationList = [];
+      }
+
+      if(direction == "right"){
+        this.createForm.couponIssueRelationList.push(row.id)
+      }else{
+        this.createForm.couponIssueRelationList = this.createForm.couponIssueRelationList.filter((ele)=>{
+          return ele != row.id
+        })
+      }
+    },
+    handleFlagChange() {
+      const that = this;
+      let text = this.couponEnabledFlag === "1" ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '"优惠券功能吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return changeCouponStatus({
+            deptId: that.deptId,
+            couponEnabledFlag: that.couponEnabledFlag,
+          });
+        })
+        .then(() => {
+          that.msgSuccess(text + "成功");
+        })
+        .catch(function () {
+          that.couponEnabledFlag = that.couponEnabledFlag === "0" ? "1" : "0";
+        });
+    },
+    handleStatusChange(row) {
+      console.log(row);
+      let text = row.status === "1" ? "启用" : "停用";
+      this.$confirm(
+        '确认要"' + text + '""' + row.couponName + '"该优惠券吗?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(function () {
+          return upIssueStatus({
+            id: row.id,
+            status: row.status,
+          });
+        })
+        .then(() => {
+          this.msgSuccess(text + "成功");
+        })
+        .catch(function () {
+          row.status = row.status === "0" ? "1" : "0";
+        });
+    },
+    toggleLabel() {
+      if (this.moveLeftData.length !== 0) {
+        this.createForm.couponIssueRelationList =
+          this.createForm.couponIssueRelationList.filter((ele) => {
+            return ele != this.moveLeftData;
+          });
+        this.createForm = { ...this.createForm };
+        return;
+      }
+      if (this.moveRightData.length !== 0) {
+        this.createForm.couponIssueRelationList = [
+          ...new Set(
+            this.createForm.couponIssueRelationList.concat(this.moveRightData)
+          ),
+        ].filter((ele) => {
+          return !!ele;
+        });
+        this.createForm = { ...this.createForm };
+        return;
+      }
+      return;
+    },
+    handleLeftChange(val) {
+      let changeArr = [];
+      val.map((ele) => {
+        changeArr.push(ele.id);
+      });
+      console.log(changeArr);
+      this.moveLeftData = [];
+      this.moveRightData = changeArr;
+      // console.log(this.moveRightData);
+      this.$refs.rightTable.clearSelection();
+    },
+    handleRightChange(val) {
+      let changeArr = [];
+      val.map((ele) => {
+        changeArr.push(ele.id);
+      });
+      this.moveLeftData = changeArr;
+      this.moveRightData = [];
+      this.$refs.leftTable.clearSelection();
+    },
+    init() {
+      this.getOilList();
+      this.getCoupon();
+      this.getVerificationList();
+    },
+    setPageStatus() {
+      this.queryPageStatus([2]).then((res) => {
+        this.pageStatus = res;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.createForm.pageNum = 1;
+      this.getList();
+    },
+    deviceNoInput(value) {
+      this.dialogForm.posQueue = value;
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("createForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.title = "添加优惠券";
+      // this.createForm = {
+      //   couponName: "",
+      //   couponDetails: "",
+      //   couponThresholdAmt: 0,
+      //   couponType: "1",
+      //   couponAmt: 0,
+      //   oilNameList: [],
+      //   effectiveTimeType: "",
+      //   effectiveTime: [],
+      //   effectiveDayNum: 30,
+      //   couponHoldNum: 1,
+      //   couponReceiveNum: 100,
+      //   couponNum: 100,
+      //   status: "1",
+      //   couponIssueRelationList: [],
+      //   isCardFlag: "1",
+      //   isGradeFlag: "1",
+      //   isMarketFlag: "1",
+      // };
+      this.open = true;
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      // // 查找自己已经选中的枪号
+      this.createForm = JSON.parse(JSON.stringify(row));
+      this.title = "修改油站设备管理";
+      this.open = true;
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["dialogForm"].validate((valid) => {
+        if (valid) {
+          if (!!this.createForm.id) {
+            updateInfo(this.createForm)
+              .then((res) => {
+                if (res.code == 200) {
+                  this.msgSuccess("亲,修改成功了~");
+                  this.getCoupon();
+                  this.open = false;
+                } else {
+                  throw new Error("");
+                }
+              })
+              .catch((err) => {
+                this.msgError("修改失败了呀~");
+              });
+          } else {
+            addIssue(this.createForm)
+              .then((res) => {
+                if (res.code == 200) {
+                  this.msgSuccess("亲,新增成功了~");
+                  this.getCoupon();
+                  this.open = false;
+                } else {
+                  throw new Error("");
+                }
+              })
+              .catch((err) => {
+                this.msgError("创建优惠劵失败了~");
+              });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const deviceIds = row.deviceId;
+      this.$confirm("是否确认删除油站设备管理", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return delManage(deviceIds);
+        })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.el-transfer__buttons {
+}
+</style>

+ 28 - 3
src/views/lng/Lng_BalaceRecord.vue

@@ -1,5 +1,10 @@
 <template>
   <div class="app-container">
+  <div v-if="jiBie==2">
+    <el-form>
+      <el-form-item label="当前站点余额">{{balance||0}}</el-form-item>
+    </el-form>
+  </div>
     <el-form :model="queryParams" ref="queryForm" :inline="true"  label-width="68px">
       <el-form-item label="类型" prop="type">
         <el-select
@@ -44,7 +49,7 @@
 </template>
 
 <script>
-import { listAdjust, listBanlaceAdjust  } from "@/api/lng";
+import { listAdjust, listBanlaceAdjust,selectDeptBalance  } from "@/api/lng";
 
 
 export default {
@@ -61,6 +66,7 @@ export default {
       open: false,
       // 查询参数
       queryParams: {
+        levelId: this.levelId,
         pageNum: 1,
         pageSize: 10,
         settlementPrice: null,
@@ -72,15 +78,33 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      balance:0
     };
   },
   created() {
-    this.getList();
+    
+    this.init();
   },
   methods: {
+    init() {
+      this.getList();
+      this.selectDeptBalance()
+    },
+    selectDeptBalance(){
+      selectDeptBalance().then((res)=>{
+        if(res.code == 200){
+          this.balance = res.data.balance;
+        }else{
+          throw new Error('')
+        }
+      }).catch((err)=>{
+        this.msgError("加载余额失败~")
+      })
+    },
     /** 查询结算价格,司机价格优惠调整列表 */
     getList() {
+      this.queryParams.levelId = this.levelId;
       listBanlaceAdjust(this.queryParams).then(response => {
         this.balanceAdjustList = response.rows;
         this.total = response.total;
@@ -88,6 +112,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      this.queryParams.levelId = this.levelId;
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 0 - 12
src/views/market/Market_Discount.vue

@@ -285,18 +285,6 @@
           -->
         </el-form-item>
 
-        <!--
-        <el-form-item label="可否叠加劵" prop="couponPlus">
-          <el-radio-group v-model="updateForm.couponPlus">
-            <el-radio label="1">是</el-radio>
-            <el-radio label="0">否</el-radio>
-          </el-radio-group>
-          <div style="margin-left: 20px; color: red; font-size: 12px">
-            注:"否" 客户只享受 {{ discountName }} 优惠
-          </div>
-        </el-form-item>
-        -->
-
         <!-- 只有阶梯直降有此规则 -->
         <el-form-item
           label="优惠条件"

+ 2 - 1
vue.config.js

@@ -35,7 +35,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8080`,
+        // target: `http://localhost:8080`,
+        target: `http://localhost:8081`,
         // target:"http://www.huiyj.com:9002/prod-api",
         //target:"http://demo.huijy.net/prod-api",
         changeOrigin: true,