|
@@ -116,8 +116,8 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<!-- 代金劵详情 -->
|
|
<!-- 代金劵详情 -->
|
|
|
- <el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogVoucherVisible" :close-on-click-modal="false"
|
|
|
|
|
- :close-on-press-escape="false" @close="dialogVoucherVisible = false">
|
|
|
|
|
|
|
+ <el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogVoucherVisible" :close-on-click-modal="true"
|
|
|
|
|
+ :close-on-press-escape="true" @close="dialogVoucherVisible = false">
|
|
|
<p><label class="lbl-cls">代金券名称:</label>{{ coupon.name }}</p>
|
|
<p><label class="lbl-cls">代金券名称:</label>{{ coupon.name }}</p>
|
|
|
<p><label class="lbl-cls">减免金额:</label> {{ coupon.deductionPrice }}</p>
|
|
<p><label class="lbl-cls">减免金额:</label> {{ coupon.deductionPrice }}</p>
|
|
|
<p><label class="lbl-cls">发放数量:</label> {{ coupon.grantNumber }}张</p>
|
|
<p><label class="lbl-cls">发放数量:</label> {{ coupon.grantNumber }}张</p>
|
|
@@ -129,12 +129,13 @@
|
|
|
<p v-if="coupon.effectiveType == 1"><label class="lbl-cls">有效期:</label> {{ coupon.effectiveStartDate }} ~ {{ coupon.effectiveEndDate}}</p>
|
|
<p v-if="coupon.effectiveType == 1"><label class="lbl-cls">有效期:</label> {{ coupon.effectiveStartDate }} ~ {{ coupon.effectiveEndDate}}</p>
|
|
|
<p v-else-if="coupon.effectiveType == 2"><label class="lbl-cls">有效期:</label> 领取后{{ coupon.effectiveDay }}天开始,{{ coupon.effectiveLoseDay }}天内有效
|
|
<p v-else-if="coupon.effectiveType == 2"><label class="lbl-cls">有效期:</label> 领取后{{ coupon.effectiveDay }}天开始,{{ coupon.effectiveLoseDay }}天内有效
|
|
|
</p>
|
|
</p>
|
|
|
- <p><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
|
|
|
|
|
|
|
+ <p v-if="coupon.hotelIds == -1"><label class="lbl-cls">选用民宿:</label> 全部民宿</p>
|
|
|
|
|
+ <p v-else><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 折扣劵详情 -->
|
|
<!-- 折扣劵详情 -->
|
|
|
- <el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogCouponVisible" :close-on-click-modal="false"
|
|
|
|
|
- :close-on-press-escape="false" @close="dialogCouponVisible = false">
|
|
|
|
|
|
|
+ <el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogCouponVisible" :close-on-click-modal="true" :close-on-press-escape="true"
|
|
|
|
|
+ @close="dialogCouponVisible = false">
|
|
|
<p><label class="lbl-cls">折扣券名称:</label>{{ coupon.name }}</p>
|
|
<p><label class="lbl-cls">折扣券名称:</label>{{ coupon.name }}</p>
|
|
|
<p><label class="lbl-cls">折扣:</label> {{ coupon.rebatePrice }}折</p>
|
|
<p><label class="lbl-cls">折扣:</label> {{ coupon.rebatePrice }}折</p>
|
|
|
<p><label class="lbl-cls">最大折扣金额:</label> {{ coupon.maxDeduction }}元</p>
|
|
<p><label class="lbl-cls">最大折扣金额:</label> {{ coupon.maxDeduction }}元</p>
|
|
@@ -147,7 +148,8 @@
|
|
|
<p v-if="coupon.effectiveType == 1"><label class="lbl-cls">有效期:</label> {{ coupon.effectiveStartDate }} ~ {{ coupon.effectiveEndDate}}</p>
|
|
<p v-if="coupon.effectiveType == 1"><label class="lbl-cls">有效期:</label> {{ coupon.effectiveStartDate }} ~ {{ coupon.effectiveEndDate}}</p>
|
|
|
<p v-else-if="coupon.effectiveType == 2"><label class="lbl-cls">有效期:</label> 领取后{{ coupon.effectiveDay }}天开始,{{ coupon.effectiveLoseDay }}天内有效
|
|
<p v-else-if="coupon.effectiveType == 2"><label class="lbl-cls">有效期:</label> 领取后{{ coupon.effectiveDay }}天开始,{{ coupon.effectiveLoseDay }}天内有效
|
|
|
</p>
|
|
</p>
|
|
|
- <p><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
|
|
|
|
|
|
|
+ <p v-if="coupon.hotelIds == -1"><label class="lbl-cls">选用民宿:</label> 全部民宿</p>
|
|
|
|
|
+ <p v-else><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 新增优惠券界面 -->
|
|
<!-- 新增优惠券界面 -->
|
|
@@ -355,7 +357,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 修改代金券对话框 -->
|
|
<!-- 修改代金券对话框 -->
|
|
|
- <el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyVoucherFormVisible" :close-on-click-modal="false"
|
|
|
|
|
|
|
+ <!-- <el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyVoucherFormVisible" :close-on-click-modal="false"
|
|
|
:close-on-press-escape="false" @close="dialogModifyVoucherFormVisible = false">
|
|
:close-on-press-escape="false" @close="dialogModifyVoucherFormVisible = false">
|
|
|
<el-form :model="formModifyVoucher" ref="addHostelForm">
|
|
<el-form :model="formModifyVoucher" ref="addHostelForm">
|
|
|
<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
|
|
<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
|
|
@@ -443,9 +445,9 @@
|
|
|
<el-button class="add-info-cancel-btn" @click="dialogModifyVoucherFormVisible = false">取 消</el-button>
|
|
<el-button class="add-info-cancel-btn" @click="dialogModifyVoucherFormVisible = false">取 消</el-button>
|
|
|
<el-button class="add-info-confirm-btn" @click="modify_voucher_dialog_handler">确 认</el-button>
|
|
<el-button class="add-info-confirm-btn" @click="modify_voucher_dialog_handler">确 认</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
|
|
|
|
+ </el-dialog> -->
|
|
|
<!-- 修改折扣券对话框 -->
|
|
<!-- 修改折扣券对话框 -->
|
|
|
- <el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyCouponFormVisible" :close-on-click-modal="false"
|
|
|
|
|
|
|
+ <!-- <el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyCouponFormVisible" :close-on-click-modal="false"
|
|
|
:close-on-press-escape="false" @close="dialogModifyCouponFormVisible = false">
|
|
:close-on-press-escape="false" @close="dialogModifyCouponFormVisible = false">
|
|
|
<el-form :model="formModifyCoupon" ref="addHostelForm" :rules="addCouponFormRules">
|
|
<el-form :model="formModifyCoupon" ref="addHostelForm" :rules="addCouponFormRules">
|
|
|
<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
|
|
<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
|
|
@@ -541,7 +543,7 @@
|
|
|
<el-button class="add-info-cancel-btn" @click="dialogModifyCouponFormVisible = false">取 消</el-button>
|
|
<el-button class="add-info-cancel-btn" @click="dialogModifyCouponFormVisible = false">取 消</el-button>
|
|
|
<el-button class="add-info-confirm-btn" @click="modify_coupon_dialog_handler">确 认</el-button>
|
|
<el-button class="add-info-confirm-btn" @click="modify_coupon_dialog_handler">确 认</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
|
|
|
|
+ </el-dialog> -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -550,8 +552,8 @@
|
|
|
getTableData,
|
|
getTableData,
|
|
|
coupomsaveBatchLapse,
|
|
coupomsaveBatchLapse,
|
|
|
coupominsterVoucher,
|
|
coupominsterVoucher,
|
|
|
- coupominsterModifyVoucher,
|
|
|
|
|
- coupominsterModifyCoupon,
|
|
|
|
|
|
|
+ // coupominsterModifyVoucher,
|
|
|
|
|
+ // coupominsterModifyCoupon,
|
|
|
coupominsterCoupon,
|
|
coupominsterCoupon,
|
|
|
hotelqueryAllHotel
|
|
hotelqueryAllHotel
|
|
|
} from '@/api/discountCouponMgr'
|
|
} from '@/api/discountCouponMgr'
|
|
@@ -648,8 +650,10 @@
|
|
|
couponModifyCheckedTowns: [], // 修改折扣券适用民宿
|
|
couponModifyCheckedTowns: [], // 修改折扣券适用民宿
|
|
|
voucherMinSuIds: [], // 增加代金券适用民宿的ids
|
|
voucherMinSuIds: [], // 增加代金券适用民宿的ids
|
|
|
couponMinSuIds: [], // 增加折扣券适用民宿的ids
|
|
couponMinSuIds: [], // 增加折扣券适用民宿的ids
|
|
|
- voucherModifyMinSuIds: [], // 增加代金券适用民宿的ids
|
|
|
|
|
- couponModifyMinSuIds: [] // 增加折扣券适用民宿的ids
|
|
|
|
|
|
|
+ voucherModifyMinSuIds: [], // 修改代金券适用民宿的ids
|
|
|
|
|
+ couponModifyMinSuIds: [], // 修改折扣券适用民宿的ids
|
|
|
|
|
+ voucherMinSuIds_bool: false, // 增加代金券适用民宿:全选则为true,否则false
|
|
|
|
|
+ couponMinSuIds_bool: false // 增加折扣券适用民宿:全选则为true,否则false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -706,7 +710,7 @@
|
|
|
handleModifyCouponCheckAllChange(val) {
|
|
handleModifyCouponCheckAllChange(val) {
|
|
|
this.couponModifyCheckedTowns = val ? townOptions : [];
|
|
this.couponModifyCheckedTowns = val ? townOptions : [];
|
|
|
this.isModifyCouponIndeterminate = false;
|
|
this.isModifyCouponIndeterminate = false;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 获取代金券ids
|
|
// 获取代金券ids
|
|
|
this.get_modify_zhekouquan_ids()
|
|
this.get_modify_zhekouquan_ids()
|
|
|
},
|
|
},
|
|
@@ -714,50 +718,55 @@
|
|
|
* 获取增加代金券,适用民宿ids
|
|
* 获取增加代金券,适用民宿ids
|
|
|
*/
|
|
*/
|
|
|
get_daijinquan_ids() {
|
|
get_daijinquan_ids() {
|
|
|
- var that = this;
|
|
|
|
|
- this.voucherMinSuIds.length = 0;
|
|
|
|
|
-
|
|
|
|
|
- this.voucherCheckedTowns.forEach((item) => {
|
|
|
|
|
- townOptions_obj.forEach((obj) => {
|
|
|
|
|
- if (obj.hname === item) {
|
|
|
|
|
- that.voucherMinSuIds.push(obj.hid);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.voucherCheckedTowns.length == townOptions_obj.length) {
|
|
|
|
|
+ this.voucherMinSuIds_bool = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ this.voucherMinSuIds.length = 0;
|
|
|
|
|
+
|
|
|
|
|
+ this.voucherCheckedTowns.forEach((item) => {
|
|
|
|
|
+ townOptions_obj.forEach((obj) => {
|
|
|
|
|
+ if (obj.hname === item) {
|
|
|
|
|
+ that.voucherMinSuIds.push(obj.hid);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
- // console.log(this.voucherMinSuIds);
|
|
|
|
|
|
|
+ // console.log(this.voucherMinSuIds);
|
|
|
|
|
+ this.voucherMinSuIds_bool = false
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取修改代金券,适用民宿ids
|
|
* 获取修改代金券,适用民宿ids
|
|
|
*/
|
|
*/
|
|
|
- get_modify_daijinquan_ids() {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- this.voucherModifyMinSuIds.length = 0;
|
|
|
|
|
-
|
|
|
|
|
- this.voucherModifyCheckedTowns.forEach((item) => {
|
|
|
|
|
- townOptions_obj.forEach((obj) => {
|
|
|
|
|
- if (obj.hname === item) {
|
|
|
|
|
- that.voucherModifyMinSuIds.push(obj.hid);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- console.log(this.voucherModifyMinSuIds);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // get_modify_daijinquan_ids() {
|
|
|
|
|
+ // var that = this;
|
|
|
|
|
+ // this.voucherModifyMinSuIds.length = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // this.voucherModifyCheckedTowns.forEach((item) => {
|
|
|
|
|
+ // townOptions_obj.forEach((obj) => {
|
|
|
|
|
+ // if (obj.hname === item) {
|
|
|
|
|
+ // that.voucherModifyMinSuIds.push(obj.hid);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ // console.log(this.voucherModifyMinSuIds);
|
|
|
|
|
+ // },
|
|
|
/**
|
|
/**
|
|
|
* 获取修改折扣券,适用民宿ids
|
|
* 获取修改折扣券,适用民宿ids
|
|
|
*/
|
|
*/
|
|
|
- get_modify_zhekouquan_ids() {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- this.couponModifyMinSuIds.length = 0;
|
|
|
|
|
-
|
|
|
|
|
- this.couponModifyCheckedTowns.forEach((item) => {
|
|
|
|
|
- townOptions_obj.forEach((obj) => {
|
|
|
|
|
- if (obj.hname === item) {
|
|
|
|
|
- that.couponModifyMinSuIds.push(obj.hid);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- console.log(this.couponModifyMinSuIds);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // get_modify_zhekouquan_ids() {
|
|
|
|
|
+ // var that = this;
|
|
|
|
|
+ // this.couponModifyMinSuIds.length = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // this.couponModifyCheckedTowns.forEach((item) => {
|
|
|
|
|
+ // townOptions_obj.forEach((obj) => {
|
|
|
|
|
+ // if (obj.hname === item) {
|
|
|
|
|
+ // that.couponModifyMinSuIds.push(obj.hid);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ // console.log(this.couponModifyMinSuIds);
|
|
|
|
|
+ // },
|
|
|
/**
|
|
/**
|
|
|
* 折扣券适用民宿全选
|
|
* 折扣券适用民宿全选
|
|
|
* @param {Object} val
|
|
* @param {Object} val
|
|
@@ -773,17 +782,22 @@
|
|
|
* 获取折扣券ids
|
|
* 获取折扣券ids
|
|
|
*/
|
|
*/
|
|
|
get_zhekouquan_ids() {
|
|
get_zhekouquan_ids() {
|
|
|
- var that = this;
|
|
|
|
|
- this.couponMinSuIds.length = 0;
|
|
|
|
|
-
|
|
|
|
|
- this.couponCheckedTowns.forEach((item) => {
|
|
|
|
|
- townOptions_obj.forEach((obj) => {
|
|
|
|
|
- if (obj.hname === item) {
|
|
|
|
|
- that.couponMinSuIds.push(obj.hid);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.couponCheckedTowns.length == townOptions_obj.length) {
|
|
|
|
|
+ this.couponMinSuIds_bool = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ this.couponMinSuIds.length = 0;
|
|
|
|
|
+
|
|
|
|
|
+ this.couponCheckedTowns.forEach((item) => {
|
|
|
|
|
+ townOptions_obj.forEach((obj) => {
|
|
|
|
|
+ if (obj.hname === item) {
|
|
|
|
|
+ that.couponMinSuIds.push(obj.hid);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
- // console.log(this.couponMinSuIds);
|
|
|
|
|
|
|
+ // console.log(this.couponMinSuIds);
|
|
|
|
|
+ this.couponMinSuIds_bool = false;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 代金券适用民宿,勾选某一项
|
|
* 代金券适用民宿,勾选某一项
|
|
@@ -820,7 +834,7 @@
|
|
|
let checkedCount = value.length;
|
|
let checkedCount = value.length;
|
|
|
this.couponModifyCheckAll = checkedCount === this.towns.length;
|
|
this.couponModifyCheckAll = checkedCount === this.towns.length;
|
|
|
this.isModifyCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
|
|
this.isModifyCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 获取代金券ids
|
|
// 获取代金券ids
|
|
|
this.get_modify_zhekouquan_ids()
|
|
this.get_modify_zhekouquan_ids()
|
|
|
},
|
|
},
|
|
@@ -884,163 +898,163 @@
|
|
|
/**
|
|
/**
|
|
|
* 修改折扣券
|
|
* 修改折扣券
|
|
|
*/
|
|
*/
|
|
|
- modify_coupon_dialog_handler() {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- var d = this.formModifyCoupon;
|
|
|
|
|
- if (isEmpty(d.name)) {
|
|
|
|
|
- this.$message.error('请输入【优惠券名称】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.rebatePrice)) {
|
|
|
|
|
- this.$message.error('请输入【折扣】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.maxDeduction)) {
|
|
|
|
|
- this.$message.error('请输入【最大抵扣金额】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.grantNumber)) {
|
|
|
|
|
- this.$message.error('请输入【发放数量】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.limitNumber)) {
|
|
|
|
|
- this.$message.error('请输入【每人限领】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.grantTimes)) {
|
|
|
|
|
- this.$message.error('请选择【发放时间】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.meetPrice)) {
|
|
|
|
|
- this.$message.error('请输入【订单满多少可使用】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (d.radio == 1) {
|
|
|
|
|
- if (isEmpty(d.effectiveDateTime)) {
|
|
|
|
|
- this.$message.error('请选择【有效期时间段】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- } else if (d.radio == 2) {
|
|
|
|
|
- if (isEmpty(d.effectiveDay)) {
|
|
|
|
|
- this.$message.error('请选择【多少天开始】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.effectiveLoseDay)) {
|
|
|
|
|
- this.$message.error('请输入【多少天有效】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isEmpty(this.couponModifyMinSuIds)) {
|
|
|
|
|
- this.$message.error('请选择【适用民宿】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.formModifyCoupon.hotelIds = this.couponModifyMinSuIds // 适用民宿ids
|
|
|
|
|
- this.formModifyCoupon.createId = this.currentUserId // 创建人
|
|
|
|
|
- this.formModifyCoupon.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
|
|
- this.formModifyCoupon.type = 2 // // 类型(1.代金券 2.折扣券)
|
|
|
|
|
- this.formModifyCoupon.status = 1 // 状态(0删除 1正常)
|
|
|
|
|
-
|
|
|
|
|
- coupominsterModifyCoupon(this.formModifyCoupon).then((res) => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- that.$message.success(res.message)
|
|
|
|
|
-
|
|
|
|
|
- this.get_table_data('list')
|
|
|
|
|
-
|
|
|
|
|
- that.dialogModifyCouponFormVisible = false
|
|
|
|
|
-
|
|
|
|
|
- that.formModifyCoupon = {}
|
|
|
|
|
- that.couponModifyMinSuIds = []
|
|
|
|
|
- that.couponModifyCheckedTowns = []
|
|
|
|
|
- } else {
|
|
|
|
|
- that.$message.warning(res.message)
|
|
|
|
|
- }
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- // console.log(err);
|
|
|
|
|
- that.$message.error(err.message)
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // modify_coupon_dialog_handler() {
|
|
|
|
|
+ // var that = this;
|
|
|
|
|
+ // var d = this.formModifyCoupon;
|
|
|
|
|
+ // if (isEmpty(d.name)) {
|
|
|
|
|
+ // this.$message.error('请输入【优惠券名称】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.rebatePrice)) {
|
|
|
|
|
+ // this.$message.error('请输入【折扣】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.maxDeduction)) {
|
|
|
|
|
+ // this.$message.error('请输入【最大抵扣金额】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.grantNumber)) {
|
|
|
|
|
+ // this.$message.error('请输入【发放数量】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.limitNumber)) {
|
|
|
|
|
+ // this.$message.error('请输入【每人限领】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.grantTimes)) {
|
|
|
|
|
+ // this.$message.error('请选择【发放时间】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.meetPrice)) {
|
|
|
|
|
+ // this.$message.error('请输入【订单满多少可使用】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (d.radio == 1) {
|
|
|
|
|
+ // if (isEmpty(d.effectiveDateTime)) {
|
|
|
|
|
+ // this.$message.error('请选择【有效期时间段】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else if (d.radio == 2) {
|
|
|
|
|
+ // if (isEmpty(d.effectiveDay)) {
|
|
|
|
|
+ // this.$message.error('请选择【多少天开始】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.effectiveLoseDay)) {
|
|
|
|
|
+ // this.$message.error('请输入【多少天有效】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (isEmpty(this.couponModifyMinSuIds)) {
|
|
|
|
|
+ // this.$message.error('请选择【适用民宿】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // this.formModifyCoupon.hotelIds = this.couponModifyMinSuIds // 适用民宿ids
|
|
|
|
|
+ // this.formModifyCoupon.createId = this.currentUserId // 创建人
|
|
|
|
|
+ // this.formModifyCoupon.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
|
|
+ // this.formModifyCoupon.type = 2 // // 类型(1.代金券 2.折扣券)
|
|
|
|
|
+ // this.formModifyCoupon.status = 1 // 状态(0删除 1正常)
|
|
|
|
|
+
|
|
|
|
|
+ // coupominsterModifyCoupon(this.formModifyCoupon).then((res) => {
|
|
|
|
|
+ // // console.log(res);
|
|
|
|
|
+ // if (res.code === 200) {
|
|
|
|
|
+ // that.$message.success(res.message)
|
|
|
|
|
+
|
|
|
|
|
+ // this.get_table_data('list')
|
|
|
|
|
+
|
|
|
|
|
+ // that.dialogModifyCouponFormVisible = false
|
|
|
|
|
+
|
|
|
|
|
+ // that.formModifyCoupon = {}
|
|
|
|
|
+ // that.couponModifyMinSuIds = []
|
|
|
|
|
+ // that.couponModifyCheckedTowns = []
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // that.$message.warning(res.message)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }).catch((err) => {
|
|
|
|
|
+ // // console.log(err);
|
|
|
|
|
+ // that.$message.error(err.message)
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
/**
|
|
/**
|
|
|
* 修改代金券
|
|
* 修改代金券
|
|
|
*/
|
|
*/
|
|
|
- modify_voucher_dialog_handler() {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- var d = this.formModifyVoucher;
|
|
|
|
|
- if (isEmpty(d.name)) {
|
|
|
|
|
- this.$message.error('请输入【优惠券名称】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.deductionPrice)) {
|
|
|
|
|
- this.$message.error('请输入【减免金额】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.grantNumber)) {
|
|
|
|
|
- this.$message.error('请输入【发放数量】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.limitNumber)) {
|
|
|
|
|
- this.$message.error('请输入【每人限领】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.grantTimes)) {
|
|
|
|
|
- this.$message.error('请选择【发放时间】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.meetPrice)) {
|
|
|
|
|
- this.$message.error('请输入【订单满多少可使用】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (d.radio == 1) {
|
|
|
|
|
- if (isEmpty(d.effectiveDateTime)) {
|
|
|
|
|
- this.$message.error('请选择【有效期时间段】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- } else if (d.radio == 2) {
|
|
|
|
|
- if (isEmpty(d.effectiveDay)) {
|
|
|
|
|
- this.$message.error('请选择【多少天开始】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (isEmpty(d.effectiveLoseDay)) {
|
|
|
|
|
- this.$message.error('请输入【多少天有效】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isEmpty(this.voucherModifyMinSuIds)) {
|
|
|
|
|
- this.$message.error('请选择【适用民宿】')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.formModifyVoucher.hotelIds = this.voucherModifyMinSuIds // 适用民宿ids
|
|
|
|
|
- this.formModifyVoucher.createId = this.currentUserId // 创建人
|
|
|
|
|
- this.formModifyVoucher.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
|
|
- this.formModifyVoucher.type = 1 // 类型(1.代金券 2.折扣券)
|
|
|
|
|
- this.formModifyVoucher.status = 1 // 状态(0删除 1正常)
|
|
|
|
|
-
|
|
|
|
|
- coupominsterModifyVoucher(this.formModifyVoucher).then((res) => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- that.$message.success(res.message)
|
|
|
|
|
-
|
|
|
|
|
- this.get_table_data('list')
|
|
|
|
|
-
|
|
|
|
|
- that.dialogModifyVoucherFormVisible = false
|
|
|
|
|
-
|
|
|
|
|
- that.formModifyVoucher = {}
|
|
|
|
|
- that.voucherModifyMinSuIds = []
|
|
|
|
|
- that.voucherModifyCheckedTowns = []
|
|
|
|
|
- } else {
|
|
|
|
|
- that.$message.warning(res.message)
|
|
|
|
|
- }
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- // console.log(err);
|
|
|
|
|
- that.$message.error(err.message)
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // modify_voucher_dialog_handler() {
|
|
|
|
|
+ // var that = this;
|
|
|
|
|
+ // var d = this.formModifyVoucher;
|
|
|
|
|
+ // if (isEmpty(d.name)) {
|
|
|
|
|
+ // this.$message.error('请输入【优惠券名称】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.deductionPrice)) {
|
|
|
|
|
+ // this.$message.error('请输入【减免金额】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.grantNumber)) {
|
|
|
|
|
+ // this.$message.error('请输入【发放数量】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.limitNumber)) {
|
|
|
|
|
+ // this.$message.error('请输入【每人限领】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.grantTimes)) {
|
|
|
|
|
+ // this.$message.error('请选择【发放时间】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.meetPrice)) {
|
|
|
|
|
+ // this.$message.error('请输入【订单满多少可使用】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (d.radio == 1) {
|
|
|
|
|
+ // if (isEmpty(d.effectiveDateTime)) {
|
|
|
|
|
+ // this.$message.error('请选择【有效期时间段】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else if (d.radio == 2) {
|
|
|
|
|
+ // if (isEmpty(d.effectiveDay)) {
|
|
|
|
|
+ // this.$message.error('请选择【多少天开始】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (isEmpty(d.effectiveLoseDay)) {
|
|
|
|
|
+ // this.$message.error('请输入【多少天有效】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (isEmpty(this.voucherModifyMinSuIds)) {
|
|
|
|
|
+ // this.$message.error('请选择【适用民宿】')
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // this.formModifyVoucher.hotelIds = this.voucherModifyMinSuIds // 适用民宿ids
|
|
|
|
|
+ // this.formModifyVoucher.createId = this.currentUserId // 创建人
|
|
|
|
|
+ // this.formModifyVoucher.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
|
|
+ // this.formModifyVoucher.type = 1 // 类型(1.代金券 2.折扣券)
|
|
|
|
|
+ // this.formModifyVoucher.status = 1 // 状态(0删除 1正常)
|
|
|
|
|
+
|
|
|
|
|
+ // coupominsterModifyVoucher(this.formModifyVoucher).then((res) => {
|
|
|
|
|
+ // // console.log(res);
|
|
|
|
|
+ // if (res.code === 200) {
|
|
|
|
|
+ // that.$message.success(res.message)
|
|
|
|
|
+
|
|
|
|
|
+ // this.get_table_data('list')
|
|
|
|
|
+
|
|
|
|
|
+ // that.dialogModifyVoucherFormVisible = false
|
|
|
|
|
+
|
|
|
|
|
+ // that.formModifyVoucher = {}
|
|
|
|
|
+ // that.voucherModifyMinSuIds = []
|
|
|
|
|
+ // that.voucherModifyCheckedTowns = []
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // that.$message.warning(res.message)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }).catch((err) => {
|
|
|
|
|
+ // // console.log(err);
|
|
|
|
|
+ // that.$message.error(err.message)
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
/**
|
|
/**
|
|
|
* 添加代金券
|
|
* 添加代金券
|
|
|
*/
|
|
*/
|
|
@@ -1088,12 +1102,16 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (isEmpty(this.voucherMinSuIds)) {
|
|
|
|
|
- this.$message.error('请选择【适用民宿】')
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ if (this.voucherMinSuIds_bool) {
|
|
|
|
|
+ this.formAddVoucher.hotelIds = -1 // 适用民宿ids
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (isEmpty(this.voucherMinSuIds)) {
|
|
|
|
|
+ this.$message.error('请选择【适用民宿】')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.formAddVoucher.hotelIds = this.voucherMinSuIds // 适用民宿ids
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.formAddVoucher.hotelIds = this.voucherMinSuIds // 适用民宿ids
|
|
|
|
|
this.formAddVoucher.createId = this.currentUserId // 创建人
|
|
this.formAddVoucher.createId = this.currentUserId // 创建人
|
|
|
this.formAddVoucher.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
this.formAddVoucher.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
this.formAddVoucher.type = 1 // 类型(1.代金券 2.折扣券)
|
|
this.formAddVoucher.type = 1 // 类型(1.代金券 2.折扣券)
|
|
@@ -1139,6 +1157,20 @@
|
|
|
if (isEmpty(d.rebatePrice)) {
|
|
if (isEmpty(d.rebatePrice)) {
|
|
|
this.$message.error('请输入【折扣】')
|
|
this.$message.error('请输入【折扣】')
|
|
|
return
|
|
return
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const reg = /^(?:[1-9](?:\.[0-9])?|9(?:\.[0-9])?)$/;
|
|
|
|
|
+ const msg = '【折扣】只能输入1.0-9.9,仅可带有一位小数。';
|
|
|
|
|
+ if (!regex.test(d.rebatePrice)) {
|
|
|
|
|
+ this.$message.error(msg);
|
|
|
|
|
+ const h = this.$createElement;
|
|
|
|
|
+
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ title: '提示信息',
|
|
|
|
|
+ message: h('i', {
|
|
|
|
|
+ style: 'color: red'
|
|
|
|
|
+ }, msg)
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (isEmpty(d.maxDeduction)) {
|
|
if (isEmpty(d.maxDeduction)) {
|
|
|
this.$message.error('请输入【最大抵扣金额】')
|
|
this.$message.error('请输入【最大抵扣金额】')
|
|
@@ -1177,12 +1209,16 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (isEmpty(this.couponMinSuIds)) {
|
|
|
|
|
- this.$message.error('请选择【适用民宿】')
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ if (this.couponMinSuIds_bool) {
|
|
|
|
|
+ this.formAddCoupon.hotelIds = -1 // 适用民宿ids
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (isEmpty(this.couponMinSuIds)) {
|
|
|
|
|
+ this.$message.error('请选择【适用民宿】')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.formAddCoupon.hotelIds = this.couponMinSuIds // 适用民宿ids
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.formAddCoupon.hotelIds = this.couponMinSuIds // 适用民宿ids
|
|
|
|
|
this.formAddCoupon.createId = this.currentUserId // 创建人
|
|
this.formAddCoupon.createId = this.currentUserId // 创建人
|
|
|
this.formAddCoupon.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
this.formAddCoupon.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
|
|
|
this.formAddCoupon.type = 2 // // 类型(1.代金券 2.折扣券)
|
|
this.formAddCoupon.type = 2 // // 类型(1.代金券 2.折扣券)
|
|
@@ -1353,7 +1389,7 @@
|
|
|
this.coupon.effectiveLoseDay = row.effectiveLoseDay
|
|
this.coupon.effectiveLoseDay = row.effectiveLoseDay
|
|
|
|
|
|
|
|
this.coupon.hotelNames = row.hotelNames
|
|
this.coupon.hotelNames = row.hotelNames
|
|
|
- // this.coupon.hotelIds = row.hotelIds
|
|
|
|
|
|
|
+ this.coupon.hotelIds = row.hotelIds
|
|
|
} else { // 折扣券
|
|
} else { // 折扣券
|
|
|
this.dialogCouponVisible = true
|
|
this.dialogCouponVisible = true
|
|
|
|
|
|
|
@@ -1373,7 +1409,7 @@
|
|
|
this.coupon.effectiveLoseDay = row.effectiveLoseDay
|
|
this.coupon.effectiveLoseDay = row.effectiveLoseDay
|
|
|
|
|
|
|
|
this.coupon.hotelNames = row.hotelNames
|
|
this.coupon.hotelNames = row.hotelNames
|
|
|
- // this.coupon.hotelIds = row.hotelIds
|
|
|
|
|
|
|
+ this.coupon.hotelIds = row.hotelIds
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|