浏览代码

优惠方案完成

Joe 4 年之前
父节点
当前提交
408e2626fe
共有 2 个文件被更改,包括 496 次插入897 次删除
  1. 3 2
      src/utils/request.js
  2. 493 895
      src/views/market/discount.vue

+ 3 - 2
src/utils/request.js

@@ -8,8 +8,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
-  // baseURL: process.env.VUE_APP_BASE_API,
-  baseURL: 'http://www.huiyj.com:9002/prod-api',
+  baseURL: process.env.VUE_APP_BASE_API,
+  // baseURL: '/prod-api',
+  // baseURL: 'http://www.huiyj.com:9002/prod-api',
   // 超时
   timeout: 10000
 })

+ 493 - 895
src/views/market/discount.vue

@@ -1,10 +1,15 @@
 <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
+      ref="ruleForm"
+      :model="ruleForm"
+      :rules="rules"
+      label-width="130px"
+    >
+      <el-form-item label="当前执行优惠方案">
+        {{ currentDiscountName }}
       </el-form-item>
-      <el-form-item label="优惠方案" >
+      <el-form-item label="优惠方案">
         <el-select
           v-model="ruleForm.discountSetting"
           placeholder="请选择优惠方案"
@@ -12,976 +17,569 @@
           size="small"
           @change="discountSettingChang"
         >
-          <!-- <el-option
-            v-for="item in discountSettingOptions"
-            :key="item.dictValue"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option> -->
-          <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-option label="无" value="0"></el-option>
+          <el-option label="满减" value="1"></el-option>
+          <el-option label="立减" value="2"></el-option>
+          <el-option label="直降" value="3"></el-option>
         </el-select>
-        <el-button  size="mini" @click="save"  type="primary">确定执行该优惠方案</el-button>
+        <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">
+    <hr />
+    <el-dialog
+      :title="title"
+      :visible.sync="openDialog"
+      width="550px"
+      append-to-body
+    >
+      <el-form
+        ref="updateForm"
+        :model="updateForm"
+        :rules="rules"
+        label-width="140px"
+      >
         <el-form-item label="方案名称" prop="grade">
-          <el-input v-model="zjform.grade" placeholder="请输入方案名称" />
+          <el-input v-model="updateForm.grade" placeholder="请输入方案名称" />
         </el-form-item>
         <el-form-item label="油品名称" prop="oilName">
-          <el-select v-model="zjform.oilName" placeholder="油品名称" clearable size="small">
+          <el-select
+            v-model="updateForm.oilName"
+            placeholder="油品名称"
+            clearable
+            size="small"
+          >
             <el-option
-              v-for="dict in oilNameOptionsZJ"
+              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-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-form-item label="优惠条件" prop="gasoilDiscountAmt" required>
+          <el-radio-group v-model="updateForm.discountTerm">
+            <el-radio :label="0">按加油金额优惠</el-radio>
+            <el-radio :label="1">按加油升数优惠</el-radio>
           </el-radio-group>
-          <div>
+          <div
+            v-show="
+              updateForm.discountTerm == 0 || updateForm.discountTerm == 1
+            "
+          >
-            <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" />元
+            <el-input-number
+              v-model="updateForm.discountAmt"
+              size="mini"
+              :min="0"
+            />
+            <span>{{ updateForm.discountTerm == 0 ? "元" : "L" }}</span>
+            每升优惠
+            <el-input-number
+              v-model="updateForm.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-form-item label="叠加等级优惠" prop="vipDiscountyPlus">
+          <el-radio-group v-model="updateForm.vipDiscountyPlus">
+            <el-radio label="1">是</el-radio>
+            <el-radio label="0">否</el-radio>
           </el-radio-group>
-           <span style="margin-left:20px;color:red;">注:"否" 客户只享受直降优惠</span>
+          <div style="margin-left: 20px; color: red">
+            注:"否" 客户只享受 {{ discountName }} 优惠
+          </div>
         </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 v-model="updateForm.couponPlus">
+            <el-radio label="1">是</el-radio>
+            <el-radio label="0">否</el-radio>
           </el-radio-group>
-           <span style="margin-left:20px;color:red;">注:"否" 客户只享受直降优惠</span>
+          <div style="margin-left: 20px; color: red">
+            注:"否" 客户只享受 {{ discountName }} 优惠
+          </div>
         </el-form-item>
-        <el-form-item v-show="false" label="优惠方案类型" prop="discountPlanType">
-          <el-select v-model="zjform.discountPlanType" placeholder="请选择优惠方案类型">
+        <el-form-item
+          v-show="false"
+          label="优惠方案类型"
+          prop="discountPlanType"
+        >
+          <el-select
+            v-model="updateForm.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>
+        <el-button type="primary" @click="handleSubmit">确 定</el-button>
+        <el-button @click="cancelSubmit">取 消</el-button>
       </div>
     </el-dialog>
 
-    <!--满减方案-->
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showMJ" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      label-width="68px"
+      v-show="discountSetting!=0"
+    >
       <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>
+        <span style="color: #ff9955; font-size: 25px">|</span
+        ><span style="font-size: 25px">
+          {{
+            this.discountSetting == 1
+              ? "满减方案"
+              : this.discountSetting == 2
+              ? "立减方案"
+              : this.discountSetting == 3
+              ? "直降方案"
+              : "无"
+          }}
+        </span>
+        <el-button
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleUpdateClick"
+          style="float: right"
+          type="warning"
+        >
+          {{
+            this.discountSetting == 1
+              ? "添加满减方案条目"
+              : this.discountSetting == 2
+              ? "添加立减方案条目"
+              : this.discountSetting == 3
+              ? "添加直降方案条目"
+              : "无"
+          }}
+        </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"  >
+    <el-table :data="discountList"  v-show="discountSetting!=0">
+      <af-table-column label="id" align="center" prop="id" v-if="false" />
+      <af-table-column label="方案名称" align="center" prop="grade" />
+      <af-table-column label="油品名称" align="center" prop="oilName" />
+      <af-table-column
+        label="优惠条件"
+        align="center"
+        v-show="discountSetting == 3"
+      >
         <template slot-scope="scope">
-         每满 {{scope.row.discountAmt}} 减 {{scope.row.gasoilDiscountAmt}}
+          满 {{ 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">
+      </af-table-column>
+      <af-table-column
+        label="优惠条件"
+        align="center"
+        v-show="discountSetting == 3"
+      >
         <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>
+          满 {{ scope.row.discountAmt }}升,每升优惠
+          {{ scope.row.gasoilDiscountAmt }} 元
         </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>
+      </af-table-column>
+      <af-table-column
+        label="优惠条件"
+        align="center"
+        v-show="discountSetting == 1"
+      >
+        <template slot-scope="scope">
+          每满 {{ scope.row.discountAmt }} 元,减
+          {{ scope.row.gasoilDiscountAmt }} 元
         </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>
-    <hr>
-    <el-table :data="discountList">
-      <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="discountAmt" />
-      <el-table-column label="结束" align="center" prop="gasoilDiscountAmt" />
-      <el-table-column label="优惠条件" align="center"  >
+      </af-table-column>
+      <af-table-column
+        label="优惠条件"
+        align="center"
+        v-show="discountSetting == 2"
+      >
         <template slot-scope="scope">
-         每满 {{scope.row.discountAmt}} 减 {{scope.row.gasoilDiscountAmt}}
+          满 {{ 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"
+      </af-table-column>
+      <af-table-column
+        label="优惠条件金额"
+        v-if="false"
+        align="center"
+        prop="discountAmt"
+      />
+      <af-table-column
+        label="优惠金额"
+        v-if="false"
+        align="center"
+        prop="gasoilDiscountAmt"
+      />
+      <af-table-column
+        label="是否叠加等级优惠"
+        align="center"
+        prop="vipDiscountyPlus"
+        :formatter="vipDiscountyPlusFotmat"
+      />
+      <af-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">
+      <af-table-column
+        label="优惠方案类型"
+        v-if="false"
+        align="center"
+        prop="discountPlanType"
+      />
+      <af-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
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['market:plan:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
-      </el-table-column>
+      </af-table-column>
     </el-table>
   </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 {
-        discountList:[],
-        // 总条数
-        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
-        },
-        // 表单校验
-        rules: {
-        },
-        dtrules: {
-        },
-        zjrules: {
-          discountTerm: [
-            { required: true, message: "选择优惠执行规则", trigger: "blur" }
-          ]
-        },
-        queryInfo:{
-          stationId: null
-        },
-        deptInfo:{},
-        discountSetting:1
-      };
+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() {
+    const validatorGasoilDiscountAmt = (rule, value, callback) => {
+      console.log(this.updateForm.discountTerm);
+      if (
+        this.updateForm.discountTerm === undefined ||
+        this.updateForm.discountTerm === ""
+      ) {
+        callback(new Error("请选择优惠方式"));
+        return;
+      }
+      const start = +this.updateForm.discountAmt;
+      const end = +this.updateForm.gasoilDiscountAmt;
+      if (isNaN(start) || isNaN(end)) {
+        callback(new Error("检查优惠方式完整性"));
+        return;
+      }
+      callback();
+    };
+
+    return {
+      discountList: [],
+      // 总条数
+      total: 0,
+      couponPlusOptions: [],
+      vipDiscountyPlusOptions: [],
+      discountSettingOptions: [],
+      stationOptions: [],
+      oilNameOptions: [],
+      oilNameOptionsDT: [],
+      oilNameOptionsZJ: [],
+      discountTermOptions: [],
+      // 弹出层标题
+      title: "",
+      fangan: "",
+      // 是否显示弹出层
+      open: false,
+      openDialog: false,
+      yuan: true,
+      laters: 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,
+      },
+      // 表单参数
+      form: {},
+      ruleForm: {
+        imgFileList: [],
+      },
+      // 表单校验
+      rules: {
+        grade: [{ required: true, message: "请输入方案名称", trigger: "blur" }],
+        oilName: [
+          { required: true, message: "请选择油品名称", trigger: "change" },
+        ],
+        discountTerm: [
+          { required: true, message: "选择油品名称", trigger: "change" },
+        ],
+        gasoilDiscountAmt: [
+          { validator: validatorGasoilDiscountAmt, trigger: "change" },
+        ],
+        discountAmt: [
+          { required: true, message: "请填写优惠金额", trigger: "blur" },
+        ],
+        vipDiscountyPlus: [
+          {
+            required: true,
+            message: "选择等级优惠是否叠加",
+            trigger: "change",
+          },
+        ],
+        couponPlus: [
+          { required: true, message: "选择可否叠加券", trigger: "change" },
+        ],
+      },
+      dtrules: {},
+      discountSetting: 0,
+      updateForm: {},
+      currentDiscountName:'',
+    };
+  },
+  computed: {
+    discountName() {
+      return this.discountSetting == 1
+        ? "满减"
+        : this.discountSetting == 2
+        ? "立减"
+        : this.discountSetting == 3
+        ? "直降"
+        : "无";
     },
-    created() {
+  },
+  created() {
+    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;
+    });
+    //查看当前优惠设置
+    listPrice().then((response) => {
+      this.oilNameOptions = response.rows;
+    });
+    this.getPay().then(()=>{
+      this.getList()
+    })
+    getStationPay().then((response) => {
+      this.ruleForm = response.data;
+      this.discountSetting = response.data.discountSetting;
       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;
-      });
-      //查看当前优惠设置
+    });
 
-
-      getStationPay().then(response => {
+    this.getDicts("discount_setting").then((response) => {
+      this.discountSettingOptions = response.data;
+    });
+  },
+  methods: {
+    getPay() {
+      return getStationPay().then((response) => {
         this.ruleForm = response.data;
-        let e = this.ruleForm.discountSetting;
-        this.discountSetting = 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;
+        this.discountSetting = response.data.discountSetting;
+        this.currentDiscountName = this.discountName;
       });
     },
-    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="不执行优惠";
+    save() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          if (this.ruleForm.payId != null) {
+            let e = this.ruleForm.discountSetting;
+            if (e == "0") {
+              updatePay(this.ruleForm).then((response) => {
+                this.fangan = "不执行优惠";
+                this.msgSuccess("优惠方案设置成功");
+              });
+            } else if (e == "1") {
+              if (this.discountList.length > 0) {
+                updatePay(this.ruleForm).then((response) => {
+                  this.fangan = "满减";
+                  this.msgSuccess("优惠方案设置成功");
+                });
+              } else {
+                this.msgError("满减规则下无方案");
+              }
+            } else if (e == "2") {
+              if (this.discountList.length > 0) {
+                updatePay(this.ruleForm).then((response) => {
+                  this.fangan = "立减";
+                  this.msgSuccess("优惠方案设置成功");
+                });
+              } else {
+                this.msgError("立减规则下无方案");
+              }
+            } else if (e == "3") {
+              if (this.discountList.length > 0) {
+                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("直降规则下无方案");
-                }
+              } else {
+                this.msgError("直降规则下无方案");
               }
             }
           }
-        });
-      },
-      discountSettingChang(e){
-        this.discountSetting = 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;
-      },
-      getDiscount(){
-        const query = {
-          pageNum: 1,
-          pageSize: 10,
-          discountPlanType:this.discountSetting
-        }
-        listPlan(query).then(response => {
-          console.log('list1',response);
-          this.planList = response.rows;
-          this.discountList = response.rows;
-          this.total = response.total;
-        });
-      },
-      /** 查询客户优惠等级设置列表 */
-      getList() {
-        this.queryParams.discountPlanType="1";
-        this.queryParams.stationId= this.deptId;
-      
-        listPlan(this.queryParams).then(response => {
-          console.log('list1',response);
-          this.planList = response.rows;
-          this.discountList = response.rows;
-          this.total = response.total;
-        });
-      },
-
-  
-      getList2() {
-
-        this.selectParams.discountPlanType="2";
-        this.selectParams.stationId= this.deptId;
-      
-        listPlan(this.selectParams).then(response => {
-          console.log('list2',response);
-          this.DTplanList = response.rows;
-          this.total = response.total;
-        });
-      },
-      getList3() {
-        this.zjParams.discountPlanType="3";
-        this.zjParams.stationId= this.deptId;
-        listPlan(this.zjParams).then(response => {
-          console.log('list3',response);
-          if(response.hasOwnProperty('rows')){
-            this.ZJplanList = response.rows;
-          }
-        });
-      },
-      vipDiscountyPlusFotmat(row, column){
-        if(row.vipDiscountyPlus === '1'){
-          return '是'
-        }else if(row.vipDiscountyPlus === '2'){
-          return '否'
+          this.getPay()
         }
-      },
-      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;
+      });
+    },
+    discountSettingChang(e) {
+      this.discountSetting = e;
+      this.getList();
+    },
+    getList() {
+      const query = {
+        pageNum: 1,
+        pageSize: 10,
+        discountPlanType: this.discountSetting,
+      };
+      listPlan(query).then((response) => {
+        this.discountList = response.rows;
+        this.total = response.total;
+      });
+    },
+    vipDiscountyPlusFotmat(row, column) {
+      if (row.vipDiscountyPlus === "1") {
+        return "是";
+      } else if (row.vipDiscountyPlus === "0") {
+        return "否";
+      }
+    },
+    couponPlusFotmat(row, column) {
+      if (row.couponPlus === "1") {
+        return "是";
+      } else if (row.couponPlus === "0") {
+        return "否";
+      }
+    },
+    handleUpdateClick() {
+      this.openDialog = true;
+      this.updateForm = {
+        discountPlanType: this.discountSetting,
+      };
+    },
+    handleSubmit() {
+      this.$refs["updateForm"].validate((valid) => {
+        if (valid) {
+          if (this.updateForm.id != null) {
+            updatePlan(this.updateForm).then((response) => {
+              this.msgSuccess("修改成功");
+              this.openDialog = false;
+              this.getList();
             });
-          }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 {
+            addPlan(this.updateForm).then((response) => {
+              this.msgSuccess("新增成功");
+              this.openDialog = false;
+              this.getList();
             });
-          }else{
-              this.msgSuccess("请选择油站");
-          }
-        }); 
-      },
-      /** 修改按钮操作 */
-      handleUpdateZJ(row) {
-        this.resetZJ();
-        const id = row.id 
-        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();
-              });
-            }
           }
-        });
+        }
+      });
+    },
+    cancelSubmit() {
+      this.openDialog = false;
+    },
 
-      },
-      /** 提交按钮 */
-      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.$confirm('是否确认删除满减优惠方案?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPlan(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        })
-      },
-      /** 删除按钮操作 */
-      handleDeleteDT(row) {
-        const ids = row.id 
-        this.$confirm('是否确认删除立减优惠方案?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      const id = row.id;
+      this.title = "修改满减优惠";
+      this.openDialog = true;
+      this.updateForm = row;
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id;
+      this.$confirm("是否确认删除满减优惠方案?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
           return delPlan(ids);
-        }).then(() => {
-          this.getList2();
-          this.msgSuccess("删除成功");
         })
-      },
-      /** 删除按钮操作 */
-      handleDeleteZJ(row) {
-        const ids = row.id 
-        this.$confirm('是否确认删除直降优惠方案?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPlan(ids);
-        }).then(() => {
-          this.getList3();
+        .then(() => {
+          this.getList();
           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
-        }
+        });
+    },
+    // /** 导出按钮操作 */
+    // 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>