Ver código fonte

优化一下细节

Joe 3 anos atrás
pai
commit
dbf963fe12

+ 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
+    })
+  }

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

@@ -0,0 +1,228 @@
+<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 {
+      // type: 3,
+      updateForm: {},
+      // collectClickDay: [],
+      // collectClickCalendar: [],
+      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: Number
+    },
+    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 = []
+        }
+        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 = []
+        }
+        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>

+ 10 - 4
src/views/coupon/Coupon_CreateCoupon.vue

@@ -300,15 +300,21 @@
         </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="isMarketFlag"
+          v-if="createForm.couponType == 1 || createForm.couponType == 2"
+        >
 
+        </el-form-item>
         <el-form-item
           label="优惠券的核销方"
           prop="couponType"
@@ -454,7 +460,7 @@ export default {
         verificationList: [],
         isCardFlag: "1",
         isGradeFlag: "1",
-        isMakertFlag: "1",
+        isMarketFlag: "1",
       },
       couponList: [],
       oilNameList: [],
@@ -729,7 +735,7 @@ export default {
         verificationList: [],
         isCardFlag: "1",
         isGradeFlag: "1",
-        isMakertFlag: "1",
+        isMarketFlag: "1",
       }
       this.open = true;
     },

Diferenças do arquivo suprimidas por serem muito extensas
+ 572 - 286
src/views/coupon/Coupon_CreateGetWay.vue


+ 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="优惠条件"

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff