|
@@ -21,7 +21,7 @@
|
|
|
</el-select>
|
|
|
<el-button size="mini" @click="save" type="primary">确定执行该优惠方案</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </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>
|
|
@@ -64,8 +64,8 @@
|
|
|
<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-form-item label="油品名称" prop="oilName" >
|
|
|
+ <el-select v-model="zjform.oilName" placeholder="油品名称" clearable size="small" :disabled="zjStatus">
|
|
|
<el-option
|
|
|
v-for="dict in oilNameOptionsZJ"
|
|
|
:key="dict.oilName"
|
|
@@ -170,7 +170,7 @@
|
|
|
<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-select v-model="form.oilName" placeholder="油品名称" clearable size="small" :disabled="mjStatus" >
|
|
|
<el-option
|
|
|
v-for="dict in oilNameOptions"
|
|
|
:key="dict.oilName"
|
|
@@ -231,7 +231,7 @@
|
|
|
</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="优惠金额" 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" />
|
|
@@ -261,7 +261,7 @@
|
|
|
<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-select v-model="dtform.oilName" placeholder="油品名称" clearable size="small" :disabled="ljStatus">
|
|
|
<el-option
|
|
|
v-for="dict in oilNameOptionsDT"
|
|
|
:key="dict.oilName"
|
|
@@ -350,6 +350,9 @@
|
|
|
fangan:"",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ zjStatus:false,
|
|
|
+ mjStatus:false,
|
|
|
+ ljStatus:false,
|
|
|
yuan: true,
|
|
|
laters: false,
|
|
|
opendt: false,
|
|
@@ -427,6 +430,9 @@
|
|
|
zjrules: {
|
|
|
discountTerm: [
|
|
|
{ required: true, message: "选择优惠执行规则", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ oilName:[
|
|
|
+ { required: true, message: "请选择油品名称", trigger: "blur" }
|
|
|
]
|
|
|
},
|
|
|
queryInfo:{
|
|
@@ -528,6 +534,7 @@
|
|
|
});
|
|
|
},
|
|
|
discountSettingChang(e){
|
|
|
+ console.log("打印是选择的优惠方案:",e);
|
|
|
if(e=="1"){
|
|
|
this.showZJ=false;
|
|
|
this.showMJ=false;
|
|
@@ -704,13 +711,14 @@
|
|
|
this.resetForm("zjform");
|
|
|
},
|
|
|
|
|
|
- /** 新增按钮操作 */
|
|
|
+ /** 新增满减操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
this.deptId=this.$store.selectDeptId;
|
|
|
if(this.deptId==null || this.deptId==""){
|
|
|
this.deptId =this.$store.state.user.deptId;
|
|
|
}
|
|
|
+ this.mjStatus=false;
|
|
|
getDept(this.deptId).then(response => {
|
|
|
this.deptInfo = response.data;
|
|
|
if(this.deptInfo.jiBie==2){
|
|
@@ -725,21 +733,23 @@
|
|
|
}else{
|
|
|
this.msgSuccess("请选择油站");
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
+ /** 修改满减操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
+ this.mjStatus=true;
|
|
|
getPlan(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改满减优惠";
|
|
|
});
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
+ /** 新增立减操作 */
|
|
|
handleAddDT() {
|
|
|
this.resetDT();
|
|
|
+ this.ljStatus=false;
|
|
|
this.deptId=this.$store.selectDeptId;
|
|
|
if(this.deptId==null || this.deptId==""){
|
|
|
this.deptId =this.$store.state.user.deptId;
|
|
@@ -758,11 +768,12 @@
|
|
|
}else{
|
|
|
this.msgSuccess("请选择油站");
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
+ /** 修改立减操作 */
|
|
|
handleUpdateDT(row) {
|
|
|
this.resetDT();
|
|
|
+ this.ljStatus=true;
|
|
|
const id = row.id || this.ids
|
|
|
getPlan(id).then(response => {
|
|
|
this.dtform = response.data;
|
|
@@ -770,9 +781,10 @@
|
|
|
this.title = "修改立减优惠";
|
|
|
});
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
+ /** 新增直降操作 */
|
|
|
handleAddZJ() {
|
|
|
this.resetZJ();
|
|
|
+ this.zjStatus=false;
|
|
|
this.deptId=this.$store.selectDeptId;
|
|
|
if(this.deptId==null || this.deptId==""){
|
|
|
this.deptId =this.$store.state.user.deptId;
|
|
@@ -792,9 +804,9 @@
|
|
|
}else{
|
|
|
this.msgSuccess("请选择油站");
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
+ /** 修改直降操作 */
|
|
|
handleUpdateZJ(row) {
|
|
|
this.resetZJ();
|
|
|
const id = row.id || this.ids
|
|
@@ -802,6 +814,7 @@
|
|
|
this.zjform = response.data;
|
|
|
this.openzj = true;
|
|
|
this.titlezj = "修改直降优惠";
|
|
|
+ this.zjStatus=true;
|
|
|
if(this.zjform.discountTerm=="2"){
|
|
|
this.yuan=true;
|
|
|
this.laters=false;
|
|
@@ -811,11 +824,22 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
+ /** 提交满减方案 */
|
|
|
submitForm() {
|
|
|
this.form.discountPlanType="1";
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ let flag = true;
|
|
|
+ //判断满减方案是否有该油品的满减方案
|
|
|
+ let planList =this.planList;
|
|
|
+ if(planList.length>0){
|
|
|
+ for(let i=0;i<planList.length;i++){
|
|
|
+ if(this.form.oilName ===planList[i].oilName){
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.form.id != null) {
|
|
|
updatePlan(this.form).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -823,21 +847,36 @@
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addPlan(this.form).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ if(flag){
|
|
|
+ addPlan(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.msgSuccess("该油品已有满减方案,请重新创建");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
+ /** 提交立减方案*/
|
|
|
submitFormDT() {
|
|
|
this.dtform.discountPlanType="2";
|
|
|
this.$refs["dtform"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ let flag = true;
|
|
|
+ //判断立减方案是否有该油品的立减方案
|
|
|
+ let dtplanList =this.DTplanList;
|
|
|
+ if(dtplanList.length>0){
|
|
|
+ for(let i=0;i<dtplanList.length;i++){
|
|
|
+ if(this.dtform.oilName ===dtplanList[i].oilName){
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.dtform.id != null) {
|
|
|
updatePlan(this.dtform).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -845,20 +884,35 @@
|
|
|
this.getList2();
|
|
|
});
|
|
|
} else {
|
|
|
- addPlan(this.dtform).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.opendt= false;
|
|
|
- this.getList2();
|
|
|
- });
|
|
|
+ if(flag){
|
|
|
+ addPlan(this.dtform).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.opendt= false;
|
|
|
+ this.getList2();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.msgSuccess("该油品已有立减方案,请重新创建");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
+ /** 提交直降方案 */
|
|
|
submitFormZJ() {
|
|
|
this.zjform.discountPlanType="3";
|
|
|
this.$refs["zjform"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ let flag = true;
|
|
|
+ //判断直降方案是否有该油品的直降方案
|
|
|
+ let zjlist =this.ZJplanList;
|
|
|
+ if(zjlist.length>0){
|
|
|
+ for(let i=0;i<zjlist.length;i++){
|
|
|
+ if(this.zjform.oilName ===zjlist[i].oilName){
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.zjform.id != null) {
|
|
|
updatePlan(this.zjform).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -866,16 +920,20 @@
|
|
|
this.getList3();
|
|
|
});
|
|
|
} else {
|
|
|
- addPlan(this.zjform).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.openzj= false;
|
|
|
- this.getList3();
|
|
|
- });
|
|
|
+ if(flag){
|
|
|
+ addPlan(this.zjform).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.openzj= false;
|
|
|
+ this.getList3();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.msgSuccess("该油品已有直降方案,请重新创建");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
+ /** 删除满减操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$confirm('是否确认删除满减优惠方案?', "警告", {
|
|
@@ -889,7 +947,7 @@
|
|
|
this.msgSuccess("删除成功");
|
|
|
})
|
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
+ /** 删除立减操作 */
|
|
|
handleDeleteDT(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$confirm('是否确认删除立减优惠方案?', "警告", {
|
|
@@ -903,7 +961,7 @@
|
|
|
this.msgSuccess("删除成功");
|
|
|
})
|
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
+ /** 删除直降操作 */
|
|
|
handleDeleteZJ(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$confirm('是否确认删除直降优惠方案?', "警告", {
|
|
@@ -917,22 +975,6 @@
|
|
|
this.msgSuccess("删除成功");
|
|
|
})
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- if(queryParams.stationId==null || queryParams.stationId==""){
|
|
|
- queryParams.stationId =this.$store.state.user.deptId;
|
|
|
- }
|
|
|
- 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 '按加油升数优惠'
|