Ver Fonte

数据录入 优惠券部分

Joe há 3 anos atrás
pai
commit
0619e2e774

+ 2 - 1
.env.development

@@ -2,7 +2,8 @@
 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

+ 70 - 188
src/views/coupon/Coupon_CreateIssue.vue

@@ -35,6 +35,7 @@
               <el-option label="消费发放" value="1"></el-option>
               <el-option label="网页 静态二维码" value="2"></el-option>
               <el-option label="支付成功后的展示位" value="3"></el-option>
+              <el-option label="数据预录入模板" value="4"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="发放名称" prop="issueName">
@@ -134,147 +135,6 @@
                   </template>
                 </af-table-column>
               </el-table>
-
-              <!--
-            <el-table :data="props.row.couponIssueRelations">
-              <af-table-column
-                label="优惠券标识"
-                align="left"
-                prop="couponRemark"
-                disabled
-              />
-              <af-table-column label="状态" align="left">
-                <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="left">
-                <template slot-scope="scope">
-                  {{
-                    scope.row.couponType == 1
-                      ? "现金劵" + "--面值:" + scope.row.couponAmt + "元"
-                      : ""
-                  }}
-                  {{
-                    scope.row.couponType == 2
-                      ? "折扣券" + "--折扣:" + scope.row.couponAmt + "% "
-                      : ""
-                  }}
-                  {{
-                    scope.row.couponType == 3
-                      ? "兑换券" + "--商品:" + scope.row.couponName
-                      : ""
-                  }}
-                </template>
-              </af-table-column>
-              <af-table-column
-                label="优惠券说明"
-                align="left"
-                prop="couponDetails"
-              />
-              <af-table-column label="使用门槛" align="left">
-                <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="left">
-                <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="left">
-                <template slot-scope="scope">
-                  {{
-                    "共生成了" +
-                    scope.row.couponNum +
-                    "张,已领取" +
-                    scope.row.couponCumulativeNum +
-                    "张,已使用" +
-                    scope.row.couponUseNum +
-                    "张"
-                  }}
-                </template>
-              </af-table-column>
-
-              <af-table-column label="有效期内使用限制" align="left">
-                <template slot-scope="scope">
-                  {{
-                    (scope.row.effectiveTimeType == 1
-                      ? scope.row.effectiveTime[0] +
-                        "到" +
-                        scope.row.effectiveTime[1]
-                      : "用户领取" + scope.row.effectiveDayNum + "天内有效") +
-                    "内有效"
-                  }}
-                  {{ translateTime(scope.row) }}
-                </template>
-              </af-table-column>
-
-              <af-table-column label="领取限制" align="left">
-                <template slot-scope="scope">
-                  {{
-                    "单用户最多持有" +
-                    scope.row.couponHoldNum +
-                    "张,累计可拥有" +
-                    scope.row.couponReceiveNum +
-                    "张"
-                  }}
-                </template>
-              </af-table-column>
-
-              <af-table-column label="优惠叠加" align="left">
-                <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="left"
-                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)"
-                    v-if="scope.row.editFlag"
-                    >修改</el-button
-                  >
-                </template>
-              </af-table-column>
-            </el-table>
-            -->
             </template>
           </af-table-column>
 
@@ -299,12 +159,13 @@
               {{ scope.row.issueType == "1" ? "消费发放" : "" }}
               {{ scope.row.issueType == "2" ? "网页方式、二维码-静态码" : "" }}
               {{ scope.row.issueType == "3" ? "支付成功后的领取位" : "" }}
+              {{ scope.row.issueType == "4" ? "数据预录入模板" : "" }}
             </template>
           </af-table-column>
           <af-table-column label="操作" align="left">
             <template slot-scope="scope">
               {{
-                scope.row.issueType == "1" || scope.row.issueType == "3"
+                scope.row.issueType == "1" || scope.row.issueType == "3" || scope.row.issueType == "4"
                   ? "-------"
                   : ""
               }}
@@ -333,8 +194,9 @@
           <af-table-column label="领取限制" align="left">
             <template slot-scope="scope">
               {{ scope.row.issueType == "1" ? "-------" : "" }}
+              {{ scope.row.issueType == "4" ? "-------" : "" }}
               {{
-                scope.row.issueType != "1"
+                (scope.row.issueType == "2"||scope.row.issueType == "3")
                   ? "单个用户能进入这个领取界面" +
                     scope.row.giveCount +
                     "次,一次可以领取" +
@@ -346,29 +208,10 @@
           </af-table-column>
           <af-table-column label="可领取时间段" align="left">
             <template slot-scope="scope">
-              {{ translateTime(scope.row) }}
+              {{scope.row.issueType == "4" ? "-------":"" }}
+              {{ scope.row.issueType == "1" || scope.row.issueType == "2" || scope.row.issueType == "3" ? translateTime(scope.row) : "" }}
             </template>
           </af-table-column>
-          <!-- <af-table-column label="面值" align="left" prop="gunNo" /> -->
-          <!-- <af-table-column label="有效期" align="left" prop="deviceFactory" /> -->
-          <!--
-        <af-table-column
-          label="操作"
-          align="left"
-          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"
@@ -445,14 +288,17 @@
               <div>
                 <el-radio label="3">支付成功后的领取位(只能设置一次)</el-radio>
               </div>
+              <div>
+                <el-radio label="4">数据预录入模板</el-radio>
+              </div>
             </el-radio-group>
           </el-form-item>
           <el-form-item
             label="能进入的次数"
             prop="giveCount"
-            v-if="createForm.issueType != 1"
+            v-if="createForm.issueType == 2 || createForm.issueType == 3"
             :rules="{
-              required: createForm.issueType != 1,
+              required: createForm.issueType == 2 || createForm.issueType == 3,
               message: '请填入能进入的次数',
               trigger: 'blur',
             }"
@@ -470,9 +316,9 @@
           <el-form-item
             label="一次能领取几张次数"
             prop="giveLimit"
-            v-if="createForm.issueType != 1"
+            v-if="createForm.issueType == 2 || createForm.issueType == 3"
             :rules="{
-              required: createForm.issueType != 1,
+              required: createForm.issueType == 2 || createForm.issueType == 3,
               message: '请填入一次能领取几张次数',
               trigger: 'blur',
             }"
@@ -497,7 +343,22 @@
               style="width: 80px"
             />元时,系统自动发放
           </el-form-item>
-          <el-form-item label="可领取时间段" prop="availableControl">
+          <el-form-item
+            label="可领取时间段"
+            prop="availableControl"
+            v-if="this.createForm.issueType == 1 || this.createForm.issueType == 2 || this.createForm.issueType == 3"
+            :rules="[
+              {
+                required: this.availableControlRequired,
+                message: '请选择有效期内时间控制',
+                trigger: 'change',
+              },
+              {
+                validator: this.validateAvailableControl,
+                trigger: 'change',
+              },
+            ]"
+          >
             <div>
               <el-radio-group
                 v-model="createForm.availableControl"
@@ -706,6 +567,8 @@ export default {
   name: "Coupon_CreateIssue",
   data() {
     let validateAvailableControl = (rule, value, callback) => {
+      if (this.createForm.availableControl == 4) {
+      }
       if (
         this.createForm.availableControl == 1 ||
         this.createForm.availableControl == 2
@@ -790,11 +653,11 @@ export default {
       // 表单校验
       rules: {
         availableControl: [
-          {
-            required: true,
-            message: "请选择有效期内时间控制",
-            trigger: "change",
-          },
+          // {
+          //   required: this.availableControlRequired,
+          //   message: "请选择有效期内时间控制",
+          //   trigger: "change",
+          // },
           { validator: validateAvailableControl, trigger: "change" },
         ],
         couponIssueRelationList: [
@@ -857,6 +720,14 @@ export default {
     this.init();
   },
   computed: {
+    availableControlRequired() {
+      // this.rules = { ...this.rules };
+      return (
+        this.createForm.issueType == 1 ||
+        this.createForm.issueType == 2 ||
+        this.createForm.issueType == 3
+      );
+    },
     toggleable() {
       if (this.moveRightData.length === 0 && this.moveLeftData.length === 0) {
         return true;
@@ -890,22 +761,34 @@ export default {
     },
   },
   methods: {
+    validateAvailableControl(rule, value, callback){
+      if(this.createForm.issueType == 4){
+        callback();
+      }
+
+      if (
+        this.createForm.availableControl == 1 ||
+        this.createForm.availableControl == 2
+      ) {
+        if (this.createForm.cycleDaysList.length == 0) {
+          callback(new Error("请选择时间"));
+          return;
+        }
+      }
+      if (this.createForm.availableControl == 3) {
+        if (this.createForm.appointedDaysList.length == 0) {
+          callback(new Error("请选择日期"));
+          return;
+        }
+      }
+      callback();
+    },
     onCopySuccess() {
       this.msgSuccess("网址已经拷贝到剪切板");
     },
     onCopyError() {
       this.msgError("网址拷贝失败,请手动复制");
     },
-    // exportUrl(url){
-    //   this.currentExport.name = emp.personnelName;
-    //   this.currentExport.type = 1;
-
-    //   const encodeStr = "e" + emp.personnelId + "/l" + this.currentExport.labelId + "/";
-    //   const encodedStr = this.base.encode(encodeStr);
-    //   const trimEqualStr = encodedStr.replace(/={1,}$/g, "");
-    //   this.currentExport.text = "https://goto.huijy.net/" + this.deptId + "/" + trimEqualStr;
-    //   this.exportQrDialog = true;
-    // },
     handleExport(row) {
       this.currentExport.name = row.issueName;
       const base64 = Base64.getInstance();
@@ -916,8 +799,7 @@ export default {
       this.currentExport.text =
         settings.baseURL + this.deptId + "/" + trimEqualStr;
     },
-    downloadImg() {
-    },
+    downloadImg() {},
     translateTime(row) {
       let timeString = "";
       const availableControleType = row.availableControl;
@@ -1090,9 +972,9 @@ export default {
       this.$refs.leftTable.clearSelection();
     },
     init() {
-      this.getOilList();
+      // this.getOilList();
       this.getCoupon();
-      this.getVerificationList();
+      // this.getVerificationList();
       this.getIssueList();
     },
     // 取消按钮

+ 1 - 1
src/views/login.vue

@@ -48,7 +48,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2018-2020 智慧易加 All Rights Reserved.</span>
+      <span>Copyright © 2018-2021 智慧易加科技有限公司 All Rights Reserved.</span>
     </div>
   </div>
 </template>

+ 244 - 0
src/views/preData/PreData_DataEntry.vue

@@ -0,0 +1,244 @@
+<template>
+  <div>
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      label-width="88px"
+      style="margin-top: 20px"
+    >
+      <el-form-item label="使用状态" prop="couponIsUsed">
+        <el-select
+          v-model="queryParams.couponIsUsed"
+          clearable
+          placeholder="请选择"
+        >
+          <el-option label="已使用" value="1"></el-option>
+          <el-option label="未使用" value="0"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="核销手机号" prop="verificationUserPhone">
+        <el-input
+          v-model="queryParams.verificationUserPhone"
+          placeholder="请输入手机号"
+          clearable
+          size="small"
+        />
+      </el-form-item>
+      <el-form-item label="领取时间" prop="getCouponTime">
+        <el-date-picker
+          style="width: 350px"
+          v-model="dateRangeCreatedDate"
+          size="mini"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-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
+          type="info"
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+          >重置</el-button
+        >
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleUpdate"
+          >导入</el-button
+        >
+
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          @click="handleDelete"
+          >删除</el-button
+        >
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          >导出</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-table :data="couponUserList">
+      <af-table-column label="发放方式标识" align="left" prop="issueRemark" />
+      <af-table-column label="活动名称" align="left" prop="issueName" />
+
+      <af-table-column
+        label="手机"
+        align="left"
+        prop="couponRemark"
+        fixed="left"
+      />
+      <af-table-column label="等级" align="left">
+        <template slot-scope="scope">
+          {{
+            scope.row.couponType == 1
+              ? "现金劵" + "--面值:" + scope.row.couponAmt + "元"
+              : ""
+          }}
+          {{
+            scope.row.couponType == 2
+              ? "折扣券" + "--折扣:" + scope.row.couponAmt + "% "
+              : ""
+          }}
+          {{
+            scope.row.couponType == 3
+              ? "兑换券" + "--商品:" + scope.row.couponName
+              : ""
+          }}
+        </template>
+      </af-table-column>
+      <af-table-column label="标签" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.couponIsUsed == "0" ? "未使用" : "" }}
+          {{ scope.row.couponIsUsed == "1" ? "已使用" : "" }}
+          {{ scope.row.couponIsUsed == "2" ? "已核销" : "" }}
+        </template>
+      </af-table-column>
+      <af-table-column label="优惠券" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.couponIsEffective == "0" ? "无效" : "" }}
+          {{ scope.row.couponIsEffective == "1" ? "有效" : "" }}
+        </template>
+      </af-table-column>
+      <af-table-column
+        label="用户保存id"
+        align="center"
+        prop="userId"
+        v-if="false"
+      />
+      <af-table-column label="电子卡余额" align="center" prop="mobilePhone" />
+      <af-table-column label="积分余额" align="center" prop="blogNickName" />
+      <af-table-column
+        label="核销员手机号"
+        align="center"
+        prop="verificationUserPhone"
+      />
+      <af-table-column
+        label="优惠券截止时间"
+        align="center"
+        prop="couponEffectiveTime"
+      >
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.couponEffectiveTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
+        </template>
+      </af-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, exportOrder, printOrderInfo } from "@/api/station/order";
+import { stationinfo } from "@/api/station/gun";
+import { listPrice, getPrice } from "@/api/station/price";
+import { queryCouponUserList } from "@/api/coupon";
+import { listManage } from "@/api/station/manage";
+
+export default {
+  name: "coupon_user",
+  data() {
+    return {
+      //创建订单时间间隔
+      dateRangeCreatedDate: [],
+      // 总条数
+      total: 0,
+      // 优惠券的信息
+      couponUserList: [],
+      oilNameOptions: [],
+      // 字典
+      payTypeOptions: [],
+      // 下拉油站
+      stationOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        levelId: this.levelId,
+        pageNum: 1,
+        pageSize: 10,
+        issueId: null,
+        couponId: null,
+        stationId: null,
+        couponIsUsed: null,
+        couponIsEffective: null,
+        getCouponTime: null,
+        verificationUserPhone: null,
+      },
+      // 表单校验
+      rules: {},
+      reprint: false,
+    };
+  },
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    /** 查询订单支付列表 */
+    getList() {
+      this.queryParams.levelId = this.levelId;
+      queryCouponUserList(
+        this.addDateRange(this.queryParams, this.dateRangeCreatedDate)
+      ).then((response) => {
+        this.couponUserList = response.rows;
+        this.total = response.total;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRangeCreatedDate = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm("是否确认导出所有订单支付数据项?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return exportOrder(queryParams);
+        })
+        .then((response) => {
+          this.download(response.msg);
+        });
+    },
+  },
+};
+</script>