Explorar el Código

营销管理 临时版

Joe hace 4 años
padre
commit
f145ed3db5

+ 271 - 0
src/views/customer/grade.vue

@@ -0,0 +1,271 @@
+<template>
+  <div class="app-container" style="padding-top: 5px">
+    <!--固态等级-->
+    <p style="margin: 5px">
+      <el-button
+        class="settingButton"
+        type="primary"
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleAdd"
+        >添加等级</el-button
+      >
+    </p>
+    <el-table :data="settingList">
+      <af-table-column label="油品名称" align="center" prop="oilName" />
+      <af-table-column label="等级名称" align="center" prop="grade" />
+      <af-table-column label="会员条件(元)" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.memberConditStart }} ≤累计历史消费金额&lt;{{
+            scope.row.memberConditEnd
+          }}
+        </template>
+      </af-table-column>
+
+      <af-table-column label="优惠 (元/L)" align="center" prop="discountAmt" />
+      <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>
+    <!-- 添加或修改客户优惠等级设置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
+        <el-form-item label="油品名称" prop="oilName">
+          <el-select
+            v-model="form.oilName"
+            placeholder="油品名称"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="dict in oilNameOptions"
+              :key="dict.oilName"
+              :label="dict.oilName"
+              :value="dict.oilName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="等级名称" prop="grade">
+          <el-input v-model="form.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="会员条件" prop="memberConditEnd" required>
+          <div>
+            <el-input-number
+              v-model="form.memberConditStart"
+              style="width: 110px"
+              size="mini"
+              :min="0"
+            />
+            ≤累计消费金额(元)&lt;
+            <el-input-number
+              v-model="form.memberConditEnd"
+              style="width: 110px"
+              size="mini"
+              :min="0"
+            />
+          </div>
+          <span
+            ><font style="color: red; size: 10px"
+              >注:优惠条件按照累计历史消费金额计算</font
+            ></span
+          >
+        </el-form-item>
+        <el-form-item label="优惠金额" prop="discountAmt">
+          <el-input-number
+            v-model="form.discountAmt"
+            size="mini"
+            :min="0"
+            placeholder="请输入优惠金额"
+          />
+          元/L
+        </el-form-item>
+        <el-form-item label="类型" v-show="false" prop="growthValue">
+          <el-input v-model="form.gradeType" value="1" />
+        </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 {
+  listSetting,
+  getSetting,
+  delSetting,
+  addSetting,
+  updateSetting,
+} from "@/api/customer/setting";
+
+import { listPrice } from "@/api/station/price";
+export default {
+  name: "grade",
+  data() {
+    const validatorMemberConditEnd = (rule, value, callback) => {
+      if (!value) {
+        callback(new Error("请填入会员条件"));
+        return;
+      }
+      const start = +this.form.memberConditStart;
+      const end = +value;
+      if (isNaN(start) || isNaN(end)) {
+        callback(new Error("请填入数字"));
+        return;
+      }
+      if (start >= end) {
+        console.log(start, end);
+        callback(new Error("请检查数字逻辑有效性"));
+        return;
+      }
+      callback();
+    };
+    return {
+      // 总条数
+      total: 0,
+      settingList: [],
+      //下拉油品名称
+      oilNameOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 100,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        oilName: [{ required: true, message: "请填写联系人", trigger: "blur" }],
+        grade: [{ required: true, message: "请填写等级名称", trigger: "blur" }],
+        memberConditEnd: [
+          { validator: validatorMemberConditEnd, trigger: "change" },
+        ],
+        discountAmt: [
+          { required: true, message: "请填写优惠金额", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getList();
+    listPrice().then((response) => {
+      this.oilNameOptions = response.rows;
+    });
+  },
+  methods: {
+    /** 查询客户优惠等级设置列表 */
+    getList() {
+      listSetting(this.queryParams).then((response) => {
+        this.settingList = response.rows;
+        this.total = response.total;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.open = true;
+      this.title = "添加客户优惠等级";
+      this.form = {};
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      const id = row.id;
+      this.form = row;
+      this.open = true;
+      this.title = "修改客户优惠等级";
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateSetting(this.form).then((response) => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSetting(this.form).then((response) => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id;
+      this.$confirm("确认删除该条等级优惠信息?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return delSetting(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        });
+    },
+  },
+};
+</script>
+<style>
+.two {
+  margin-top: 30px;
+}
+.settingButton {
+  border: 0px;
+  float: right;
+}
+.cutLine {
+  width: 65px;
+  height: 2px;
+  background: #71f332;
+  /*margin-top: 5px;*/
+  margin-left: 5px;
+  margin-bottom: 20px;
+}
+.textlineHeader {
+  /*margin-bottom: 20px;*/
+  font-family: Bahnschrift;
+  /*text-shadow: #32a9f3 1px 1px 1px;*/
+  /*font-size: ;*/
+  color: #32a9f3;
+}
+</style>

+ 932 - 0
src/views/market/discount.vue

@@ -0,0 +1,932 @@
+<template>
+  <div class="app-container">
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="130px">
+      <el-form-item label="当前执行优惠方案" >
+        <el-input v-model="fangan" :disabled="true" style="width:200px;"/>
+      </el-form-item>
+      <el-form-item label="优惠方案" >
+        <el-select
+          v-model="ruleForm.discountSetting"
+          placeholder="请选择优惠方案"
+          clearable
+          size="small"
+          @change="discountSettingChang"
+        >
+          <el-option
+            v-for="item in discountSettingOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+        <el-button  size="mini" @click="save"  type="primary">确定执行该优惠方案</el-button>
+      </el-form-item>
+    </el-form>  
+    <el-form :model="zjParams" ref="zjParams" :inline="true" v-show="showZJ" label-width="68px">
+      <div>
+        <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:25px;">直降方案</span>
+        <el-button icon="el-icon-plus" size="mini" @click="handleAddZJ" style="float:right" type="warning" v-hasPermi="['market:plan:add']" >添加直降信息</el-button>
+      </div>
+    </el-form>
+
+
+    <el-table :data="ZJplanList"  v-show="showZJ">
+      <el-table-column label="id" align="center" prop="id" v-if="false" />
+      <el-table-column label="方案名称" align="center" prop="grade" />
+      <el-table-column label="油品名称" align="center" prop="oilName" />
+      <el-table-column label="油品名称" align="center" prop="discountTerm" v-if="false" :formatter="discountTermFormat" />
+      <el-table-column label="优惠条件" align="center" :formatter="planFormat"/>
+      <el-table-column label="优惠条件金额" v-if="false" align="center" prop="discountAmt" />
+      <el-table-column label="优惠金额" v-if="false"  align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="等级优惠是否叠加" align="center" prop="vipDiscountyPlus" :formatter="vipDiscountyPlusFotmat" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" :formatter="couponPlusFotmat"
+      />
+      <el-table-column label="优惠方案类型" v-if="false" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope2">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdateZJ(scope2.row)"
+            v-hasPermi="['market:plan:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDeleteZJ(scope2.row)"
+            v-hasPermi="['market:plan:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-dialog :title="titlezj" :visible.sync="openzj" width="550px" append-to-body>
+      <el-form ref="zjform" :model="zjform" :rules="zjrules" label-width="130px">
+        <el-form-item label="方案名称" prop="grade">
+          <el-input v-model="zjform.grade" placeholder="请输入方案名称" />
+        </el-form-item>
+        <el-form-item label="油品名称" prop="oilName">
+          <el-select v-model="zjform.oilName" placeholder="油品名称" clearable size="small">
+            <el-option
+              v-for="dict in oilNameOptionsZJ"
+              :key="dict.oilName"
+              :label="dict.oilName"
+              :value="dict.oilName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="优惠条件" prop="discountTerm">
+          <el-radio-group v-model="zjform.discountTerm" @change="changeHandler">
+            <el-radio
+              v-for="dict in discountTermOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+          <div>
+            满
+            <el-input-number v-model="zjform.discountAmt"  size="mini" :min="0"  />
+            <span v-show=laters>L</span>
+            <span v-show=yuan>元</span>
+              每升优惠
+            <el-input-number v-model="zjform.gasoilDiscountAmt"   size="mini" :min="0" />元
+          </div>
+        </el-form-item>
+        <el-form-item label="等级优惠是否叠加" prop="vipDiscountyPlus">
+          <el-radio-group v-model="zjform.vipDiscountyPlus">
+            <el-radio
+              v-for="dict in vipDiscountyPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+           <span style="margin-left:20px;color:red;">注:"否" 客户只享受直降优惠</span>
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-radio-group v-model="zjform.couponPlus">
+            <el-radio
+              v-for="dict in couponPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+           <span style="margin-left:20px;color:red;">注:"否" 客户只享受直降优惠</span>
+        </el-form-item>
+        <el-form-item v-show="false" label="优惠方案类型" prop="discountPlanType">
+          <el-select v-model="zjform.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormZJ">确 定</el-button>
+        <el-button @click="cancelZJ">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!--满减方案-->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showMJ" label-width="68px">
+      <div>
+        <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:25px;">满减方案</span>
+        <el-button icon="el-icon-plus" size="mini" @click="handleAdd" style="float:right" type="warning" >添加满减信息</el-button>
+      </div>
+    </el-form>
+    
+    <el-table :data="planList" v-show="showMJ">
+      <el-table-column label="id" align="center" prop="id" v-if="false" />
+      <el-table-column label="方案名称" align="center" prop="grade" />
+      <el-table-column label="油品名称" align="center" prop="oilName" />
+      <el-table-column label="优惠条件" align="center"  >
+        <template slot-scope="scope">
+         每满 {{scope.row.discountAmt}} 减 {{scope.row.gasoilDiscountAmt}}
+        </template>
+      </el-table-column>
+      <el-table-column label="优惠条件金额" v-if="false" align="center" prop="discountAmt" />
+      <el-table-column label="优惠金额" v-if="false"  align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="等级优惠是否叠加" align="center" prop="vipDiscountyPlus" :formatter="vipDiscountyPlusFotmat" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" :formatter="couponPlusFotmat"
+      />
+      <el-table-column label="优惠方案类型" v-if="false" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['market:plan:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['market:plan:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改满减 -->
+    <el-dialog :title="title" :visible.sync="open"  width="550px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item label="方案名称" prop="grade">
+          <el-input v-model="form.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="油品名称" prop="oilName">
+          <el-select v-model="form.oilName" placeholder="油品名称" clearable size="small">
+            <el-option
+              v-for="dict in oilNameOptions"
+              :key="dict.oilName"
+              :label="dict.oilName"
+              :value="dict.oilName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="优惠条件" prop="discountTerm">
+           每满
+            <el-input-number v-model="form.discountAmt"  size="mini" :min="0"  />
+             元 减
+            <el-input-number v-model="form.gasoilDiscountAmt"   size="mini" :min="0" /> 元
+        </el-form-item>
+        <el-form-item label="等级优惠是否叠加" prop="vipDiscountyPlus">
+          <el-radio-group v-model="form.vipDiscountyPlus">
+            <el-radio
+              v-for="dict in vipDiscountyPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+          <span style="margin-left:20px;color:red;">注:"否" 客户只享受满减优惠</span>
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-radio-group v-model="form.couponPlus">
+            <el-radio
+              v-for="dict in couponPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+           <span style="margin-left:20px;color:red;">注:"否" 客户只享受满减优惠</span>
+        </el-form-item>
+        <el-form-item v-show="false" label="优惠方案类型" prop="discountPlanType">
+          <el-select v-model="form.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!--立减方案-->
+    <el-form :model="selectParams" ref="selectFrom" :inline="true" v-show="showLJ" label-width="68px" style="margin-top: 25px;">
+      <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:25px;">立减方案</span>
+      <el-button icon="el-icon-plus" size="mini" @click="handleAddDT" style="float:right"  type="warning" v-hasPermi="['market:plan:add']" >添加立减方案</el-button>
+    </el-form>
+    
+    <el-table :data="DTplanList" v-show="showLJ" >
+      <el-table-column label="id" align="center" prop="id" v-if="false" />
+      <el-table-column label="方案名称" align="center" prop="grade" />
+      <el-table-column label="油品名称" align="center" prop="oilName" />
+      <el-table-column label="优惠条件" align="center"  >
+        <template slot-scope="scope1">
+          满 {{scope1.row.discountAmt}} 减 {{scope1.row.gasoilDiscountAmt}}
+        </template>
+      </el-table-column>
+      <el-table-column label="优惠条件金额" v-if="false" align="center" prop="discountAmt" />
+      <el-table-column label="优惠金额" v-if="false" align="center" prop="gasoilDiscountAmt" />
+      <el-table-column label="等级优惠是否叠加" align="center" prop="vipDiscountyPlus" :formatter="vipDiscountyPlusFotmat" />
+      <el-table-column label="可否叠加劵" align="center" prop="couponPlus" :formatter="couponPlusFotmat" />
+      <el-table-column label="优惠方案类型" v-if="false" align="center" prop="discountPlanType" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope2">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdateDT(scope2.row)"
+            v-hasPermi="['market:plan:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDeleteDT(scope2.row)"
+            v-hasPermi="['market:plan:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 添加或修改立减方案 -->
+    <el-dialog :title="title" :visible.sync="opendt" width="550px" append-to-body>
+      <el-form ref="dtform" :model="dtform" :rules="dtrules" label-width="130px">
+        <el-form-item label="方案名称" prop="grade">
+          <el-input v-model="dtform.grade" placeholder="请输入等级名称" />
+        </el-form-item>
+        <el-form-item label="油品名称" prop="oilName">
+          <el-select v-model="dtform.oilName" placeholder="油品名称" clearable size="small">
+            <el-option
+              v-for="dict in oilNameOptionsDT"
+              :key="dict.oilName"
+              :label="dict.oilName"
+              :value="dict.oilName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="优惠条件">
+          满
+          <el-input-number v-model="dtform.discountAmt"  size="mini" :min="0"  />
+          元 减
+          <el-input-number v-model="dtform.gasoilDiscountAmt"   size="mini" :min="0" />
+          元
+        </el-form-item>
+        <el-form-item label="等级优惠是否叠加"  prop="vipDiscountyPlus">
+          <el-radio-group v-model="dtform.vipDiscountyPlus">
+            <el-radio
+              v-for="dict in vipDiscountyPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+          <span style="margin-left:20px;color:red;">注:"否" 客户只享受立减优惠</span>
+        </el-form-item>
+        <el-form-item label="可否叠加劵" prop="couponPlus">
+          <el-radio-group v-model="dtform.couponPlus">
+            <el-radio
+              v-for="dict in couponPlusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+          <span style="margin-left:20px;color:red;">注:"否" 客户只享受立减优惠</span>
+        </el-form-item>
+        <el-form-item label="优惠方案类型" v-show="false" prop="discountPlanType">
+          <el-select v-model="dtform.discountPlanType" placeholder="请选择优惠方案类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormDT">确 定</el-button>
+        <el-button @click="cancelDT">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { listPlan, getPlan, delPlan, addPlan, updatePlan, exportPlan } from "@/api/market/plan";
+  import {getStationPay,updatePay} from "@/api/station/pay";
+  import { getDept } from "@/api/system/dept";
+  import { listPrice } from "@/api/station/price";
+  export default {
+    name: "Setting",
+    data() {
+      return {
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 客户优惠等级设置表格数据
+        planList: [],
+        DTplanList: [],
+        ZJplanList: [],
+        couponPlusOptions:[],
+        vipDiscountyPlusOptions:[],
+        discountSettingOptions:[],
+        stationOptions:[],
+        oilNameOptions:[],
+        oilNameOptionsDT:[],
+        oilNameOptionsZJ:[],
+        discountTermOptions:[],
+        // 弹出层标题
+        title: "",
+        titlezj: "",
+        fangan:"",
+        // 是否显示弹出层
+        open: false,
+        yuan: true,
+        laters: false,
+        opendt: false,
+        openzj: false,
+        showZJ:false,
+        showMJ:false,
+        showLJ:false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        },// 查询参数
+        selectParams: {
+          pageNum: 1,
+          pageSize: 10,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        },
+        zjParams: {
+          pageNum: 1,
+          pageSize: 10,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          deductionGrowthValue: null
+        },
+        // 表单参数
+        form: {},
+        dtform: {},
+        zjform: {},
+        ruleForm:{
+          imgFileList:[]
+        },
+        query:{
+          deptId: null
+        },
+        queryRule:{
+          stationId: null
+        },
+        // 表单校验
+        rules: {
+        },
+        dtrules: {
+        },
+        zjrules: {
+          discountTerm: [
+            { required: true, message: "选择优惠执行规则", trigger: "blur" }
+          ]
+        },
+        queryInfo:{
+          stationId: null
+        },
+        deptInfo:{}
+
+      };
+    },
+    created() {
+      this.getList();
+      this.getList2();
+      this.getList3();
+      this.getDicts("coupon_plus").then(response => {
+        this.couponPlusOptions = response.data;
+      });
+      this.getDicts("discount_term").then(response => {
+        this.discountTermOptions = response.data;
+      });
+      this.getDicts("vip_discounty_plus").then(response => {
+        this.vipDiscountyPlusOptions = response.data;
+      });
+      //查看当前优惠设置
+      this.queryRule.stationId= this.deptId;
+
+      getStationPay(this.queryRule).then(response => {
+        this.ruleForm = response.data;
+        let e= this.ruleForm.discountSetting;
+        if(e=="1"){
+          this.showZJ=false;
+          this.showMJ=false;
+          this.showLJ=false;
+          this.fangan="不执行优惠";
+        }else if(e=="2"){
+          this.showZJ=false;
+          this.showMJ=true;
+          this.showLJ=false;
+           this.fangan="满减";
+        }else if(e=="3"){
+          this.showZJ=false;
+          this.showMJ=false;
+          this.showLJ=true;
+          this.fangan="立减";
+        }else if(e=="4"){
+          this.showZJ=true;
+          this.showMJ=false;
+          this.showLJ=false;
+          this.fangan="直降";
+        }
+      });
+      this.getDicts("discount_setting").then(response => {
+        this.discountSettingOptions = response.data;
+      });
+    },
+    methods: {
+      save(){
+        this.$refs["ruleForm"].validate(valid => {
+          if (valid) {
+            if (this.ruleForm.payId != null) {
+              let e= this.ruleForm.discountSetting;
+              if(e=="1"){
+                updatePay(this.ruleForm).then(response => {
+                  this.fangan="不执行优惠";
+                  this.msgSuccess("优惠方案设置成功");
+                });
+              }else if(e=="2"){
+                if(this.planList!=null&&this.planList.length>0){
+                  updatePay(this.ruleForm).then(response => {
+                    this.fangan="满减";
+                    this.msgSuccess("优惠方案设置成功");
+                  });
+                }else{
+                  this.msgSuccess("满减规则下无方案");
+                }
+              }else if(e=="3"){
+                if(this.DTplanList!=null&&this.DTplanList.length>0){
+                  updatePay(this.ruleForm).then(response => {
+                    this.fangan="立减";
+                    this.msgSuccess("优惠方案设置成功");
+                  });
+                }else{
+                  this.msgSuccess("立减规则下无方案");
+                }
+              }else if(e=="4"){
+                if(this.ZJplanList!=null&&this.ZJplanList.length>0){
+                  updatePay(this.ruleForm).then(response => {
+                    this.fangan="直降";
+                    this.msgSuccess("优惠方案设置成功");
+                  });
+                }else{
+                  this.msgSuccess("直降规则下无方案");
+                }
+              }
+            }
+          }
+        });
+      },
+      discountSettingChang(e){
+        if(e=="1"){
+          this.showZJ=false;
+          this.showMJ=false;
+          this.showLJ=false;
+        }else if(e=="2"){
+          this.showZJ=false;
+          this.showMJ=true;
+          this.showLJ=false;
+        }else if(e=="3"){
+          this.showZJ=false;
+          this.showMJ=false;
+          this.showLJ=true;
+        }else if(e=="4"){
+          this.showZJ=true;
+          this.showMJ=false;
+          this.showLJ=false;
+        }
+      },
+      changeHandler(value) {
+        if(value=="2"){
+          this.laters=false;
+          this.yuan=true;
+          this.zjform.discountTerm="2";
+        }else if(value=="1"){
+          this.yuan=false;
+          this.laters=true;
+          this.zjform.discountTerm="1";
+        }
+      },
+      onInstitutionChang(e){
+        let obj = {};
+        obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+          return item.stationId === e;//筛选出匹配数据
+        })
+        this.form.stationName=obj.deptName;
+      },
+      onInstitutionChang1(e){
+        let obj = {};
+        obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+          return item.stationId === e;//筛选出匹配数据
+        })
+        this.dtform.stationName=obj.deptName;
+      },
+      /** 查询客户优惠等级设置列表 */
+      getList() {
+        this.queryParams.discountPlanType="1";
+        this.queryParams.stationId= this.deptId;
+      
+        listPlan(this.queryParams).then(response => {
+          this.planList = response.rows;
+          this.total = response.total;
+        });
+      },
+      getList2() {
+        this.selectParams.discountPlanType="2";
+        this.selectParams.stationId= this.deptId;
+      
+        listPlan(this.selectParams).then(response => {
+          this.DTplanList = response.rows;
+          this.total = response.total;
+
+        });
+      },
+      getList3() {
+        this.zjParams.discountPlanType="3";
+        this.zjParams.stationId= this.deptId;
+        listPlan(this.zjParams).then(response => {
+          if(response.hasOwnProperty('rows')){
+            this.ZJplanList = response.rows;
+          }
+        });
+      },
+      vipDiscountyPlusFotmat(row, column){
+        if(row.vipDiscountyPlus === '1'){
+          return '是'
+        }else if(row.vipDiscountyPlus === '2'){
+          return '否'
+        }
+      },
+      couponPlusFotmat(row, column){
+        if(row.couponPlus === '1'){
+          return '是'
+        }else if(row.couponPlus === '2'){
+          return '否'
+        }
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelDT() {
+        this.opendt = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelZJ() {
+        this.openzj = false;
+        this.resetZJ();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          id: null,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          stationId:null,
+          stationName:null,
+          deductionGrowthValue: null
+        };
+        this.resetForm("form");
+      },
+      resetDT() {
+        this.dtform = {
+          id: null,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          stationId:null,
+          stationName:null,
+          date: null,
+          deductionGrowthValue: null
+        };
+        this.resetForm("dtform");
+      },
+      resetZJ() {
+        this.zjform = {
+          id: null,
+          grade: null,
+          discountWay: null,
+          gasoilDiscountLitre: null,
+          dieseloilDiscountLitre: null,
+          gradeType: null,
+          gasoilConsume: null,
+          gasoilGrowthValue: null,
+          dieseloilConsume: null,
+          dieseloilGrowthValue: null,
+          growthValue: null,
+          date: null,
+          stationId:null,
+          stationName:null,
+          deductionGrowthValue: null
+        };
+        this.resetForm("zjform");
+      },
+
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        getDept(this.deptId).then(response => {
+          this.deptInfo = response.data;
+          if(this.deptInfo.jiBie==2){
+            this.open = true;
+            this.title = "添加满减优惠";
+            this.form.stationId=this.deptInfo.deptId;
+            this.form.stationName=this.deptInfo.deptName;
+            this.queryInfo.stationId=this.deptInfo.deptId;
+            listPrice(this.queryInfo).then(response => {
+              this.oilNameOptions = response.rows;
+            });
+          }else{
+              this.msgSuccess("请选择油站");
+          }
+        }); 
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const id = row.id 
+        getPlan(id).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改满减优惠";
+        });
+      },
+      /** 新增按钮操作 */
+      handleAddDT() {
+        this.resetDT();
+        getDept(this.deptId).then(response => {
+          this.deptInfo = response.data;
+          if(this.deptInfo.jiBie==2){
+            this.opendt = true;
+            this.title = "添加立减优惠";
+            this.dtform.stationId=this.deptInfo.deptId;
+            this.dtform.stationName=this.deptInfo.deptName;
+            this.queryInfo.stationId=this.deptInfo.deptId;
+            listPrice(this.queryInfo).then(response => {
+              this.oilNameOptionsDT = response.rows;
+            });
+          }else{
+              this.msgSuccess("请选择油站");
+          }
+        }); 
+      },
+      /** 修改按钮操作 */
+      handleUpdateDT(row) {
+        this.resetDT();
+        const id = row.id 
+        getPlan(id).then(response => {
+          this.dtform = response.data;
+          this.opendt = true;
+          this.title = "修改立减优惠";
+        });
+      },
+      /** 新增按钮操作 */
+      handleAddZJ() {
+        this.resetZJ();
+        getDept(this.deptId).then(response => {
+          this.deptInfo = response.data;
+          if(this.deptInfo.jiBie==2){
+            this.openzj = true;
+            //this.zjform.discountTerm="1";
+            this.titlezj = "添加直降优惠";
+            this.zjform.stationId=this.deptInfo.deptId;
+            this.zjform.stationName=this.deptInfo.deptName;
+            this.queryInfo.stationId=this.deptInfo.deptId;
+            listPrice(this.queryInfo).then(response => {
+              this.oilNameOptionsZJ = response.rows;
+            });
+          }else{
+              this.msgSuccess("请选择油站");
+          }
+        }); 
+      },
+      /** 修改按钮操作 */
+      handleUpdateZJ(row) {
+        this.resetZJ();
+        const id = row.id || this.ids
+        getPlan(id).then(response => {
+          this.zjform = response.data;
+          this.openzj = true;
+          this.titlezj = "修改直降优惠";
+          if(this.zjform.discountTerm=="2"){
+            this.yuan=true;
+            this.laters=false;
+          }else if(this.zjform.discountTerm=="1"){
+            this.laters=true;
+            this.yuan=false;
+          }
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.form.discountPlanType="1";
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null) {
+              updatePlan(this.form).then(response => {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addPlan(this.form).then(response => {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+
+      },
+      /** 提交按钮 */
+      submitFormDT() {
+        this.dtform.discountPlanType="2";
+        this.$refs["dtform"].validate(valid => {
+          if (valid) {
+            if (this.dtform.id != null) {
+              updatePlan(this.dtform).then(response => {
+                this.msgSuccess("修改成功");
+                this.opendt = false;
+                this.getList2();
+              });
+            } else {
+              addPlan(this.dtform).then(response => {
+                this.msgSuccess("新增成功");
+                this.opendt= false;
+                this.getList2();
+              });
+            }
+          }
+        });
+      },
+        /** 提交按钮 */
+      submitFormZJ() {
+        this.zjform.discountPlanType="3";
+        this.$refs["zjform"].validate(valid => {
+          if (valid) {
+            if (this.zjform.id != null) {
+              updatePlan(this.zjform).then(response => {
+                this.msgSuccess("修改成功");
+                this.openzj = false;
+                this.getList3();
+              });
+            } else {
+              addPlan(this.zjform).then(response => {
+                this.msgSuccess("新增成功");
+                this.openzj= false;
+                this.getList3();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const ids = row.id || this.ids;
+        this.$confirm('是否确认删除满减优惠方案?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+      },
+      /** 删除按钮操作 */
+      handleDeleteDT(row) {
+        const ids = row.id || this.ids;
+        this.$confirm('是否确认删除立减优惠方案?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList2();
+          this.msgSuccess("删除成功");
+        })
+      },
+      /** 删除按钮操作 */
+      handleDeleteZJ(row) {
+        const ids = row.id || this.ids;
+        this.$confirm('是否确认删除直降优惠方案?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlan(ids);
+        }).then(() => {
+          this.getList3();
+          this.msgSuccess("删除成功");
+        })
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        const queryParams = this.queryParams;
+        this.$confirm('是否确认导出所有优惠设置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPlan(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+      },
+      discountTermFormat(row, column) {
+        if (row.discountTerm === "1") {
+          return '按加油升数优惠'
+        } else  {
+          return '按加油金额优惠'
+        }
+      },
+      planFormat(row, column) {
+        if (row.discountTerm === "1") {
+          let ss = "满 " +row.discountAmt +"L,每升优惠 "+row.gasoilDiscountAmt+"元";
+          return ss
+        } else  {
+          let ss = "满 " +row.discountAmt +"元,每升优惠 "+row.gasoilDiscountAmt+"元";
+          return ss
+        }
+      }
+    }
+  };
+</script>
+<style>
+
+</style>

+ 84 - 84
src/views/station/configuration/applet.vue

@@ -1,13 +1,18 @@
 <template>
   <div class="app-container">
-    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="130px">
-      <el-form-item label="油站名称"  prop="stationName" v-show="false">
+    <el-form
+      ref="ruleForm"
+      :model="ruleForm"
+      :rules="rules"
+      label-width="130px"
+    >
+      <el-form-item label="油站名称" prop="stationName" v-show="false">
         <el-input v-model="ruleForm.stationName" placeholder="请输入油站名称" />
       </el-form-item>
-      <el-form-item label="首页轮播图"  prop="payMode">
+      <el-form-item label="首页轮播图" prop="payMode">
         <el-upload
           class="avatar-uploader"
-          :class="[ruleForm.imgFileList.length<=3?'':'uploader-hidden']"
+          :class="[ruleForm.imgFileList.length <= 3 ? '' : 'uploader-hidden']"
           :action="addressUrl"
           :headers="headers"
           multiple
@@ -21,40 +26,50 @@
           :auto-upload="true"
         >
           <i class="el-icon-plus"></i>
-          <div class="el-upload__tip" slot="tip">只能上传图片文件,单张图片不要太大</div>
+          <div class="el-upload__tip" slot="tip">
+            只能上传图片文件,单张图片不要太大
+          </div>
         </el-upload>
         <el-dialog :visible.sync="dialogVisible" append-to-body>
           <img width="100%" :src="dialogImageUrl" alt="" />
         </el-dialog>
       </el-form-item>
-      <el-form-item label="公告信息" prop="notice" >
-          <textarea cols="40" rows="3" v-model="ruleForm.notice"  placeholder="请输入公告信息"></textarea>
-        </el-form-item>
-      <el-form-item label="班结是否打印" >
+      <el-form-item label="公告信息" prop="notice">
+        <textarea
+          cols="40"
+          rows="3"
+          v-model="ruleForm.notice"
+          placeholder="请输入公告信息"
+        ></textarea>
+      </el-form-item>
+      <el-form-item label="班结是否打印">
         <el-radio-group v-model="ruleForm.wsPrintFlag">
           <el-radio
             v-for="dict in wsPrintFlagOptions"
             :key="dict.dictValue"
             :label="dict.dictValue"
-          >{{dict.dictLabel}}</el-radio>
+            >{{ dict.dictLabel }}</el-radio
+          >
         </el-radio-group>
       </el-form-item>
-      <el-form-item label="小票打印模板" >
+      <el-form-item label="小票打印模板">
         <el-radio-group v-model="ruleForm.printSetting">
           <el-radio
             v-for="dict in printSettingOptions"
             :key="dict.dictValue"
             :label="dict.dictValue"
-          >{{dict.dictLabel}}</el-radio>
+            >{{ dict.dictLabel }}</el-radio
+          >
         </el-radio-group>
       </el-form-item>
-      <el-form-item label="兑换积分小票打印" >
+      <el-form-item label="兑换积分小票打印">
         <el-radio-group v-model="ruleForm.integralPrintFlag">
           <el-radio
             v-for="dict in integralPrintFlagOptions"
             :key="dict.dictValue"
             :label="dict.dictValue"
-          >{{dict.dictLabel}}</el-radio>
+            >{{ dict.dictLabel }}</el-radio
+          >
         </el-radio-group>
       </el-form-item>
     </el-form>
@@ -66,127 +81,112 @@
 
 <script>
 import { getToken } from "@/utils/auth";
-import {addPay, updatePay,getStationPay} from "@/api/station/pay";
-import {stationinfo} from "@/api/station/gun";
+import { addPay, updatePay, getStationPay } from "@/api/station/pay";
 export default {
-  name: "Pay",
+  name: "applet",
   data() {
     return {
       // 遮罩层
-      wsPrintFlagOptions:[],
-      printSettingOptions:[],
-      cardEnabledFlagOptions:[],
-      discountSettingOptions:[],
-      isNoOilOptions:[],
-      integralPrintFlagOptions:[],
+      wsPrintFlagOptions: [],
+      printSettingOptions: [],
+      cardEnabledFlagOptions: [],
+      discountSettingOptions: [],
+      isNoOilOptions: [],
+      integralPrintFlagOptions: [],
       deleteImgFileList: [], //存已被删除了的图片的id
-      dialogImageUrl: '',
+      dialogImageUrl: "",
       dialogVisible: false,
-      ruleForm:{
-        imgFileList:[]
-      },
-      queryParams: {
-        stationId: null
-      },
-      query:{
-        deptId: null
+      ruleForm: {
+        imgFileList: [],
       },
       // 表单校验
-      rules: {
-      },
+      rules: {},
       headers: { Authorization: "Bearer " + getToken() },
-      addressUrl: location.protocol+"//"+location.host+ process.env.VUE_APP_BASE_API+"/common/upload"
+      addressUrl: process.env.VUE_APP_BASE_API + "/common/upload",
     };
   },
   created() {
-    this.look();
-    this.query.deptId =this.$store.selectDeptId;
-    this.getDicts("ws_print_flag").then(response => {
+    this.getInfo();
+    this.getDicts("ws_print_flag").then((response) => {
       this.wsPrintFlagOptions = response.data;
     });
-    this.getDicts("print_setting_flag").then(response => {
+    this.getDicts("print_setting_flag").then((response) => {
       this.printSettingOptions = response.data;
     });
-    this.getDicts("card_enabled_flag").then(response => {
+    this.getDicts("card_enabled_flag").then((response) => {
       this.cardEnabledFlagOptions = response.data;
     });
-    this.getDicts("discount_setting").then(response => {
+    this.getDicts("discount_setting").then((response) => {
       this.discountSettingOptions = response.data;
     });
-    this.getDicts("is_flag").then(response => {
+    this.getDicts("is_flag").then((response) => {
       this.isNoOilOptions = response.data;
     });
-    this.getDicts("is_flag").then(response => {
+    this.getDicts("is_flag").then((response) => {
       this.integralPrintFlagOptions = response.data;
     });
-
-  },
-  mounted(){
-    
   },
   methods: {
     handleRemove(file, fileList) {
       this.ruleForm.imgFileList = fileList;
     },
     beforeAvatarUpload(file) {
-      const isType = file.type === 'image/jpeg' || 'image/png';
+      // const isType = file.type === "image/jpeg" || "image/png";
       const isLt5M = file.size / 1024 / 1024 < 5;
-      if (!isType) {
-        this.$message.error('上传头像图片只能是 JPG 或 PNG格式!');
-      }
+      // if (!isType) {
+      //   this.$message.error("上传头像图片只能是 JPG 或 PNG格式!");
+      // }
       if (!isLt5M) {
-        this.$message.error('上传头像图片大小不能超过 1MB!');
+        this.$message.error("上传头像图片大小不能超过 5MB!");
       }
       return isLt5M;
     },
-     //上传成功
-    handlepaymentSuccess(response,file, fileList){
-      console.log(response);
-      console.log(file)
-      console.log(fileList)
-        let imgurl=location.protocol+"//"+location.host+process.env.VUE_APP_BASE_API+response.fileName;
-        this.ruleForm.imgFileList.push({name:file.name,url:imgurl});
+    //上传成功
+    handlepaymentSuccess(response, file, fileList) {
+      this.ruleForm.imgFileList = [
+        ...this.ruleForm.imgFileList,
+        {
+          name: file.name,
+          url: process.env.VUE_APP_BASE_API + response.fileName,
+        },
+      ];
     },
     /** 进入信息 */
-    look() {
-      getStationPay(this.queryParams).then(response => {
-        console.log("response",response);
-         this.ruleForm = response.data;
-          if(response.data.imgFileList==null){
-            this.ruleForm.imgFileList=[];
-          }
-          if(response.data.stationId==null){
-            this.ruleForm.stationId=this.$store.state.user.deptId;
-          }
-        
+    getInfo() {
+      getStationPay().then((response) => {
+        const imgFileList = response.data.imgFileList
+        response.data.imgFileList = [];
+        this.ruleForm = response.data;
+        setTimeout(() =>{
+          this.ruleForm = {...response.data, imgFileList}
+        }, 1000)
       });
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["ruleForm"].validate(valid => {
+      this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
           if (this.ruleForm.payId != null) {
-            updatePay(this.ruleForm).then(response => {
-              this.msgSuccess("修改成功");
-              this.look();
+            updatePay(this.ruleForm).then((response) => {
+              this.msgSuccess("修改配置成功");
+              this.getInfo();
             });
           } else {
-            addPay(this.ruleForm).then(response => {
-              this.msgSuccess("添加成功");
-              this.look();
+            addPay(this.ruleForm).then((response) => {
+              this.msgSuccess("添加配置成功");
+              this.getInfo();
             });
           }
         }
-      });  
-    }
-  }
+      });
+    },
+  },
 };
 </script>
 <style lang="scss">
-.uploader-hidden{
-  .el-upload--picture-card{
-    display:none;
+.uploader-hidden {
+  .el-upload--picture-card {
+    display: none;
   }
 }
-
 </style>

+ 1 - 1
src/views/station/configuration/info.vue

@@ -100,7 +100,7 @@ export default {
   name: "Info",
   components: { Treeselect },
   data() {
-    var validatorPhone = (rule, value, callback) => {
+    const validatorPhone = (rule, value, callback) => {
       if (!value) {
         return callback(new Error("手机号不能为空"));
       } else {