soft5566 2 lat temu
rodzic
commit
d67c49b5e7
3 zmienionych plików z 744 dodań i 78 usunięć
  1. 4 2
      .env.production
  2. 88 17
      src/api/discountCouponMgr.js
  3. 652 59
      src/views/discountCouponMgr/index.vue

+ 4 - 2
.env.production

@@ -2,6 +2,8 @@
 ENV = 'production'
 ENV = 'production'
 
 
 # base api
 # base api
-VUE_APP_BASE_API = 'https://chtech.ncjti.edu.cn/hotelReservation/mhotel'
+# VUE_APP_BASE_API = 'https://chtech.ncjti.edu.cn/hotelReservation/mhotel'
+VUE_APP_BASE_API = 'http://101.42.162.31/hotelReservation/mhotel'
 
 
-# VUE_APP_BASE_FILE = 'https://chtech.ncjti.edu.cn/hotelReservation/fileload'
+# VUE_APP_BASE_FILE = 'https://chtech.ncjti.edu.cn/hotelReservation/fileload'
+VUE_APP_BASE_FILE = 'http://101.42.162.31/hotelReservation/fileload'

+ 88 - 17
src/api/discountCouponMgr.js

@@ -44,26 +44,25 @@ export function coupomsaveBatchLapse(forData) {
 // 新增代金券
 // 新增代金券
 export function coupominsterVoucher(forData) {
 export function coupominsterVoucher(forData) {
 	let data = new FormData()
 	let data = new FormData()
-	if (typeof forData.name !== 'undefined') {
-		data.append('name', forData.name)
-	}
+
+	data.append('name', forData.name)
 	data.append('deductionPrice', forData.deductionPrice)
 	data.append('deductionPrice', forData.deductionPrice)
 	data.append('grantNumber', forData.grantNumber)
 	data.append('grantNumber', forData.grantNumber)
 	data.append('limitNumber', forData.limitNumber)
 	data.append('limitNumber', forData.limitNumber)
 
 
 	data.append('grantStartDate', forData.grantTimes[0])
 	data.append('grantStartDate', forData.grantTimes[0])
 	data.append('grantEndDate', forData.grantTimes[1])
 	data.append('grantEndDate', forData.grantTimes[1])
-	
+
 	data.append('meetPrice', forData.meetPrice)
 	data.append('meetPrice', forData.meetPrice)
 
 
-	if (forData.radio == 1) {
+	if (forData.effectiveType == 1) {
 		data.append('effectiveStartDate', forData.effectiveDateTime[0])
 		data.append('effectiveStartDate', forData.effectiveDateTime[0])
 		data.append('effectiveEndDate', forData.effectiveDateTime[1])
 		data.append('effectiveEndDate', forData.effectiveDateTime[1])
-	} else if (forData.radio == 2) {
+	} else if (forData.effectiveType == 2) {
 		data.append('effectiveDay', forData.effectiveDay)
 		data.append('effectiveDay', forData.effectiveDay)
 		data.append('effectiveLoseDay', forData.effectiveLoseDay)
 		data.append('effectiveLoseDay', forData.effectiveLoseDay)
 	}
 	}
-	
+
 	data.append('hotelIds', forData.hotelIds)
 	data.append('hotelIds', forData.hotelIds)
 	data.append('createId', forData.createId)
 	data.append('createId', forData.createId)
 	data.append('effectiveType', forData.effectiveType)
 	data.append('effectiveType', forData.effectiveType)
@@ -80,23 +79,22 @@ export function coupominsterVoucher(forData) {
 // 新增折扣券
 // 新增折扣券
 export function coupominsterCoupon(forData) {
 export function coupominsterCoupon(forData) {
 	let data = new FormData()
 	let data = new FormData()
-	if (typeof forData.name !== 'undefined') {
-		data.append('name', forData.name)
-	}
+
+	data.append('name', forData.name)
 	data.append('rebatePrice', forData.rebatePrice)
 	data.append('rebatePrice', forData.rebatePrice)
 	data.append('maxDeduction', forData.maxDeduction)
 	data.append('maxDeduction', forData.maxDeduction)
 	data.append('grantNumber', forData.grantNumber)
 	data.append('grantNumber', forData.grantNumber)
 	data.append('limitNumber', forData.limitNumber)
 	data.append('limitNumber', forData.limitNumber)
-	
+
 	data.append('grantStartDate', forData.grantTimes[0])
 	data.append('grantStartDate', forData.grantTimes[0])
 	data.append('grantEndDate', forData.grantTimes[1])
 	data.append('grantEndDate', forData.grantTimes[1])
-	
-	data.append('meetPrice', forData.meetPrice)	
-	
-	if (forData.radio == 1) {
+
+	data.append('meetPrice', forData.meetPrice)
+
+	if (forData.effectiveType == 1) {
 		data.append('effectiveStartDate', forData.effectiveDateTime[0])
 		data.append('effectiveStartDate', forData.effectiveDateTime[0])
 		data.append('effectiveEndDate', forData.effectiveDateTime[1])
 		data.append('effectiveEndDate', forData.effectiveDateTime[1])
-	} else if (forData.radio == 2) {
+	} else if (forData.effectiveType == 2) {
 		data.append('effectiveDay', forData.effectiveDay)
 		data.append('effectiveDay', forData.effectiveDay)
 		data.append('effectiveLoseDay', forData.effectiveLoseDay)
 		data.append('effectiveLoseDay', forData.effectiveLoseDay)
 	}
 	}
@@ -106,7 +104,7 @@ export function coupominsterCoupon(forData) {
 	data.append('effectiveType', forData.effectiveType)
 	data.append('effectiveType', forData.effectiveType)
 	data.append('type', forData.type)
 	data.append('type', forData.type)
 	data.append('status', forData.status)
 	data.append('status', forData.status)
-	
+
 	return request({
 	return request({
 		url: '/Coupominster.action',
 		url: '/Coupominster.action',
 		method: 'post',
 		method: 'post',
@@ -114,6 +112,79 @@ export function coupominsterCoupon(forData) {
 	})
 	})
 }
 }
 
 
+// 修改代金券
+export function coupominsterModifyVoucher(forData) {
+	let data = new FormData()
+
+	data.append('name', forData.name)
+	data.append('deductionPrice', forData.deductionPrice)
+	data.append('grantNumber', forData.grantNumber)
+	data.append('limitNumber', forData.limitNumber)
+
+	data.append('grantStartDate', forData.grantTimes[0])
+	data.append('grantEndDate', forData.grantTimes[1])
+
+	data.append('meetPrice', forData.meetPrice)
+
+	if (forData.effectiveType == 1) {
+		data.append('effectiveStartDate', forData.effectiveDateTime[0])
+		data.append('effectiveEndDate', forData.effectiveDateTime[1])
+	} else if (forData.effectiveType == 2) {
+		data.append('effectiveDay', forData.effectiveDay)
+		data.append('effectiveLoseDay', forData.effectiveLoseDay)
+	}
+
+	data.append('hotelIds', forData.hotelIds)
+	data.append('createId', forData.createId)
+	data.append('effectiveType', forData.effectiveType)
+	data.append('type', forData.type)
+	data.append('status', forData.status)
+	data.append('id', forData.id)
+
+	return request({
+		url: '/Coupomupdate.action',
+		method: 'post',
+		data
+	})
+}
+
+// 修改折扣券
+export function coupominsterModifyCoupon(forData) {
+	let data = new FormData()
+
+	data.append('name', forData.name)
+	data.append('rebatePrice', forData.rebatePrice)
+	data.append('maxDeduction', forData.maxDeduction)
+	data.append('grantNumber', forData.grantNumber)
+	data.append('limitNumber', forData.limitNumber)
+
+	data.append('grantStartDate', forData.grantTimes[0])
+	data.append('grantEndDate', forData.grantTimes[1])
+
+	data.append('meetPrice', forData.meetPrice)
+
+	if (forData.effectiveType == 1) {
+		data.append('effectiveStartDate', forData.effectiveDateTime[0])
+		data.append('effectiveEndDate', forData.effectiveDateTime[1])
+	} else if (forData.effectiveType == 2) {
+		data.append('effectiveDay', forData.effectiveDay)
+		data.append('effectiveLoseDay', forData.effectiveLoseDay)
+	}
+
+	data.append('hotelIds', forData.hotelIds)
+	data.append('createId', forData.createId)
+	data.append('effectiveType', forData.effectiveType)
+	data.append('type', forData.type)
+	data.append('status', forData.status)
+	data.append('id', forData.id)
+
+	return request({
+		url: '/Coupomupdate.action',
+		method: 'post',
+		data
+	})
+}
+
 // 获取民宿列表
 // 获取民宿列表
 export function hotelqueryAllHotel() {
 export function hotelqueryAllHotel() {
 
 

+ 652 - 59
src/views/discountCouponMgr/index.vue

@@ -41,33 +41,35 @@
 								<el-button type="primary" class="export" @click="add_discount_coupons">增加</el-button>
 								<el-button type="primary" class="export" @click="add_discount_coupons">增加</el-button>
 							</div>
 							</div>
 						</div>
 						</div>
-						<el-table ref="multipleTable" :data="tableData" height="510" style="width: 100%" :cell-style="cell_style" v-loading="loading"
+						<el-table ref="multipleTable" :data="tableData" height="562" style="width: 100%" :cell-style="cell_style" v-loading="loading"
 							:header-cell-style="header_cell_style" @selection-change="handleSelectionChange">
 							:header-cell-style="header_cell_style" @selection-change="handleSelectionChange">
 							<el-table-column type="selection" width="50">
 							<el-table-column type="selection" width="50">
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="名称" align="center">
+							<el-table-column label="名称" align="center" fixed>
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span>{{ scope.row.name }}</span>
 									<span>{{ scope.row.name }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="类型" align="center">
+							<el-table-column label="类型" align="center" fixed>
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span v-if="scope.row.type == 1">代金券</span>
 									<span v-if="scope.row.type == 1">代金券</span>
 									<span v-else-if="scope.row.type == 2">折扣券</span>
 									<span v-else-if="scope.row.type == 2">折扣券</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="额度" align="center">
+							<el-table-column label="额度" align="center" width="100">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<span>{{ scope.row.maxDeduction }}</span>
+									<span v-if="scope.row.type == 1">{{ scope.row.deductionPrice }}</span>
+									<span v-else-if="scope.row.type == 2">{{ scope.row.maxDeduction }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-
-							<el-table-column label="有效期" align="center" width="200">
+							<el-table-column label="有效期 / 有效时间" align="center" width="308">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<span>领取后{{ scope.row.effectiveDay }}天开始,{{ scope.row.effectiveLoseDay }}天内有效</span>
+									<span v-if="scope.row.effectiveType == 1">{{ scope.row.effectiveStartDate }} ~ {{ scope.row.effectiveEndDate }}</span>
+									<span
+										v-else-if="scope.row.effectiveType == 2">领取后{{ scope.row.effectiveDay }}天开始,{{ scope.row.effectiveLoseDay }}天内有效</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="状态" align="center">
+							<el-table-column label="状态" align="center" width="90">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span v-if="scope.row.status == 0">已删除</span>
 									<span v-if="scope.row.status == 0">已删除</span>
 									<span v-else-if="scope.row.status == 1">正常</span>
 									<span v-else-if="scope.row.status == 1">正常</span>
@@ -81,24 +83,26 @@
 									<span>{{ scope.row.grantStartDate }} ~ {{ scope.row.grantEndDate }}</span>
 									<span>{{ scope.row.grantStartDate }} ~ {{ scope.row.grantEndDate }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="发放数量" align="center">
+							<el-table-column label="发放数量" align="center" width="90">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span>{{ scope.row.grantNumber }}</span>
 									<span>{{ scope.row.grantNumber }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="剩余" align="center">
+							<el-table-column label="剩余" align="center" width="90">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span>{{ scope.row.remainderNumber }}</span>
 									<span>{{ scope.row.remainderNumber }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
-							<el-table-column label="已核销" align="center">
+							<el-table-column label="已核销" align="center" width="90">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span>{{ scope.row.reversedNumber }}</span>
 									<span>{{ scope.row.reversedNumber }}</span>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
 							<el-table-column fixed="right" label="操作" width="100">
 							<el-table-column fixed="right" label="操作" width="100">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
-									<el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>
+									<!-- <el-button @click="handleModifyClick(scope.row)" type="text" size="small">修改</el-button> -->
+									<el-button v-if="scope.row.type == 1" @click="handleDetailClick(scope.row)" type="text" size="small">查看详情</el-button>
+									<el-button v-else-if="scope.row.type == 2" @click="handleDetailClick(scope.row)" type="text" size="small">查看详情</el-button>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
 						</el-table>
 						</el-table>
@@ -111,10 +115,27 @@
 				</div>
 				</div>
 			</el-col>
 			</el-col>
 		</el-row>
 		</el-row>
-		<!-- 优惠劵详情 -->
-		<el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogComplaintVisible" :close-on-click-modal="false"
-			:close-on-press-escape="false" @close="dialogComplaintVisible = false">
-			<p><label class="lbl-cls">优惠券名称:</label>{{ coupon.name }}</p>
+		<!-- 代金劵详情 -->
+		<el-dialog title="优惠券详情" custom-class="add-account-class" :visible.sync="dialogVoucherVisible" :close-on-click-modal="false"
+			:close-on-press-escape="false" @close="dialogVoucherVisible = false">
+			<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.grantNumber }}张</p>
+			<p><label class="lbl-cls">每人限领:</label> {{ coupon.limitNumber }}张</p>
+			<p><label class="lbl-cls">发放时间:</label> {{ coupon.grantStartDate }} ~ {{ coupon.grantEndDate}}</p>
+			<div>
+				<h3 style="padding-top: 20px;">限制条件</h3>
+				<p><label class="lbl-cls">使用条件:</label> 订单满{{ coupon.meetPrice }}元可使用</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>
+				<p><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
+			</div>
+		</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">
+			<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>
 			<p><label class="lbl-cls">发放数量:</label> {{ coupon.grantNumber }}张</p>
 			<p><label class="lbl-cls">发放数量:</label> {{ coupon.grantNumber }}张</p>
@@ -123,7 +144,9 @@
 			<div>
 			<div>
 				<h3 style="padding-top: 20px;">限制条件</h3>
 				<h3 style="padding-top: 20px;">限制条件</h3>
 				<p><label class="lbl-cls">使用条件:</label> 订单满{{ coupon.meetPrice }}元可使用</p>
 				<p><label class="lbl-cls">使用条件:</label> 订单满{{ coupon.meetPrice }}元可使用</p>
-				<p><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>
 				<p><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
 				<p><label class="lbl-cls">选用民宿:</label> {{ coupon.hotelNames }}</p>
 			</div>
 			</div>
 		</el-dialog>
 		</el-dialog>
@@ -217,7 +240,8 @@
 								</div>
 								</div>
 							</el-form-item>
 							</el-form-item>
 							<el-form-item label="适用民宿:" :label-width="formLabelWidth">
 							<el-form-item label="适用民宿:" :label-width="formLabelWidth">
-								<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleVoucherCheckAllChange">全选</el-checkbox>
+								<el-checkbox :indeterminate="isAddVoucherIndeterminate" v-model="voucherCheckAll"
+									@change="handleVoucherCheckAllChange">全选</el-checkbox>
 								<div style="margin: 0;"></div>
 								<div style="margin: 0;"></div>
 								<el-checkbox-group v-model="voucherCheckedTowns" @change="handleVoucherCheckedTownsChange">
 								<el-checkbox-group v-model="voucherCheckedTowns" @change="handleVoucherCheckedTownsChange">
 									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
 									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
@@ -276,8 +300,8 @@
 								</div>
 								</div>
 							</el-form-item>
 							</el-form-item>
 							<el-form-item label="发放时间:" :label-width="formLabelWidth">
 							<el-form-item label="发放时间:" :label-width="formLabelWidth">
-								<el-date-picker v-model="formAddCoupon.grantTimes" style="width: 390px;"
-									type="datetimerange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
+								<el-date-picker v-model="formAddCoupon.grantTimes" style="width: 390px;" type="datetimerange" range-separator="~"
+									start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
 								</el-date-picker>
 								</el-date-picker>
 							</el-form-item>
 							</el-form-item>
 						</el-col>
 						</el-col>
@@ -314,7 +338,8 @@
 								</div>
 								</div>
 							</el-form-item>
 							</el-form-item>
 							<el-form-item label="适用民宿:" :label-width="formLabelWidth" style="margin-bottom: 0;">
 							<el-form-item label="适用民宿:" :label-width="formLabelWidth" style="margin-bottom: 0;">
-								<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCouponCheckAllChange">全选</el-checkbox>
+								<el-checkbox :indeterminate="isAddCouponIndeterminate" v-model="couponCheckAll"
+									@change="handleCouponCheckAllChange">全选</el-checkbox>
 								<div style="margin: 0;"></div>
 								<div style="margin: 0;"></div>
 								<el-checkbox-group v-model="couponCheckedTowns" @change="handleCouponCheckedTownsChange">
 								<el-checkbox-group v-model="couponCheckedTowns" @change="handleCouponCheckedTownsChange">
 									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
 									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
@@ -329,6 +354,194 @@
 				<el-button class="add-info-confirm-btn" @click="add_coupon_dialog_handler">确 认</el-button>
 				<el-button class="add-info-confirm-btn" @click="add_coupon_dialog_handler">确 认</el-button>
 			</div>
 			</div>
 		</el-dialog>
 		</el-dialog>
+		<!-- 修改代金券对话框 -->
+		<el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyVoucherFormVisible" :close-on-click-modal="false"
+			:close-on-press-escape="false" @close="dialogModifyVoucherFormVisible = false">
+			<el-form :model="formModifyVoucher" ref="addHostelForm">
+				<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
+					<el-row>
+						<el-col :span="24">
+							<div style="font-size: 18px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">代金券<span
+									style="color: red; font-size: 14px;">(同一代金券,每笔订单最多仅可使用一张)</span></div>
+							<el-form-item label="优惠券名称:" :label-width="formLabelWidth">
+								<el-input v-model="formModifyVoucher.name" autocomplete="off" placeholder="请输入优惠券名称" maxlength="20">
+								</el-input>
+							</el-form-item>
+							<el-form-item label="减免金额:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyVoucher.deductionPrice" autocomplete="off" placeholder="请输入金额" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">元</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="发放数量:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyVoucher.grantNumber" autocomplete="off" placeholder="请输入数量" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">张</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="每人限领:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyVoucher.limitNumber" autocomplete="off" placeholder="请输入数量" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">张</div>
+									<div style="color: #ccc;">(每个用户可领卷上限)</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="发放时间:" :label-width="formLabelWidth">
+								<el-date-picker v-model="formModifyVoucher.grantTimes" style="width: 390px;" type="datetimerange" range-separator="~"
+									start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
+								</el-date-picker>
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row>
+						<el-col :span="24">
+							<div style="font-size: 18px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">限制条件</div>
+							<el-form-item label="使用条件:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<div style="margin-right: 10px;">订单满</div>
+									<el-input v-model="formModifyVoucher.meetPrice" autocomplete="off" placeholder="请输入金额" maxlength="6">
+									</el-input>
+									<div style="margin-left: 10px;">元,可使用</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="有效期:" :label-width="formLabelWidth">
+								<div style="display: flex; align-items: center; margin-bottom: 15px;">
+									<el-radio v-model="formModifyVoucher.radio" label="1">时间段</el-radio>
+									<el-date-picker v-model="formModifyVoucher.effectiveDateTime" :disabled="formModifyVoucher.radio != 1" style="width: 390px;"
+										type="datetimerange" range-separator="~" start-placeholder="有效开始日期" end-placeholder="有效结束日期"
+										value-format="yyyy-MM-dd HH:mm:ss">
+									</el-date-picker>
+								</div>
+								<div style="display: flex; align-items: center;">
+									<el-radio v-model="formModifyVoucher.radio" label="2">领取后</el-radio>
+									<el-input v-model="formModifyVoucher.effectiveDay" :disabled="formModifyVoucher.radio != 2" autocomplete="off"
+										placeholder="请输入天数" class="custom-input" maxlength="3">
+									</el-input>
+									<div style="margin: 0 10px;">天开始</div>
+									<el-input v-model="formModifyVoucher.effectiveLoseDay" :disabled="formModifyVoucher.radio != 2" autocomplete="off"
+										placeholder="请输入天数" class="custom-input" maxlength="3">
+									</el-input>
+									<div style="margin-left: 10px;">天内有效</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="适用民宿:" :label-width="formLabelWidth">
+								<el-checkbox :indeterminate="isModifyVoucherIndeterminate" v-model="voucherModifyCheckAll"
+									@change="handleModifyVoucherCheckAllChange">全选</el-checkbox>
+								<div style="margin: 0;"></div>
+								<el-checkbox-group v-model="voucherModifyCheckedTowns" @change="handleModifyVoucherCheckedTownsChange">
+									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
+								</el-checkbox-group>
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</div>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<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>
+			</div>
+		</el-dialog>
+		<!-- 修改折扣券对话框 -->
+		<el-dialog title="修改优惠券" custom-class="add-voucher-class" :visible.sync="dialogModifyCouponFormVisible" :close-on-click-modal="false"
+			:close-on-press-escape="false" @close="dialogModifyCouponFormVisible = false">
+			<el-form :model="formModifyCoupon" ref="addHostelForm" :rules="addCouponFormRules">
+				<div style="height: 700px; padding: 0; margin: 0; overflow:auto;">
+					<el-row>
+						<el-col :span="24">
+							<div style="font-size: 18px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">折扣券<span
+									style="color: red; font-size: 14px;">(同一优惠券,每笔订单最多仅可使用一张)</span></div>
+							<el-form-item label="优惠券名称:" :label-width="formLabelWidth">
+								<el-input v-model="formModifyCoupon.name" autocomplete="off" placeholder="请输入优惠券名称" maxlength="20">
+								</el-input>
+							</el-form-item>
+							<el-form-item label="折扣:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyCoupon.rebatePrice" autocomplete="off" placeholder="请输入折扣" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">折</div>
+									<div style="color: #ccc;">(填写1.0-9.9,仅可带有一位小数)</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="最大抵扣金额:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyCoupon.maxDeduction" autocomplete="off" placeholder="请输入金额" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">元</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="发放数量:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyCoupon.grantNumber" autocomplete="off" placeholder="请输入数量" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">张</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="每人限领:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<el-input v-model="formModifyCoupon.limitNumber" autocomplete="off" placeholder="请输入数量" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">张</div>
+									<div style="color: #ccc;">(每个用户可领卷上限)</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="发放时间:" :label-width="formLabelWidth">
+								<el-date-picker v-model="formModifyCoupon.grantTimes" style="width: 390px;" type="datetimerange" range-separator="~"
+									start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
+								</el-date-picker>
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row>
+						<el-col :span="24">
+							<div style="font-size: 18px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: -10px 0 20px 20px;">限制条件</div>
+							<el-form-item label="使用条件:" :label-width="formLabelWidth">
+								<div style="display: flex; justify-content: flex-start; align-items: center;">
+									<div style="margin-right: 10px;">订单满</div>
+									<el-input v-model="formModifyCoupon.meetPrice" autocomplete="off" placeholder="请输入金额" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">元,可使用</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="有效期:" :label-width="formLabelWidth">
+								<div style="display: flex; align-items: center; margin-bottom: 15px;">
+									<el-radio v-model="formModifyCoupon.radio" label="1">时间段</el-radio>
+									<el-date-picker v-model="formModifyCoupon.effectiveDateTime" :disabled="formModifyCoupon.radio != 1" style="width: 390px;"
+										type="datetimerange" range-separator="~" start-placeholder="有效开始日期" end-placeholder="有效结束日期"
+										value-format="yyyy-MM-dd HH:mm:ss">
+									</el-date-picker>
+								</div>
+								<div style="display: flex; align-items: center;">
+									<el-radio v-model="formModifyCoupon.radio" label="2">领取后</el-radio>
+									<el-input v-model="formModifyCoupon.effectiveDay" :disabled="formModifyCoupon.radio != 2" autocomplete="off"
+										placeholder="请输入金额" class="custom-input" maxlength="8">
+									</el-input>
+									<div style="margin: 0 10px;">天开始</div>
+									<el-input v-model="formModifyCoupon.effectiveLoseDay" :disabled="formModifyCoupon.radio != 2" autocomplete="off"
+										placeholder="请输入金额" class="custom-input" maxlength="8">
+									</el-input>
+									<div style="margin-left: 10px;">天内有效</div>
+								</div>
+							</el-form-item>
+							<el-form-item label="适用民宿:" :label-width="formLabelWidth" style="margin-bottom: 0;">
+								<el-checkbox :indeterminate="isModifyCouponIndeterminate" v-model="couponModifyCheckAll"
+									@change="handleModifyCouponCheckAllChange">全选</el-checkbox>
+								<div style="margin: 0;"></div>
+								<el-checkbox-group v-model="couponModifyCheckedTowns" @change="handleModifyCouponCheckedTownsChange">
+									<el-checkbox v-for="town in towns" :label="town" :key="town">{{town}}</el-checkbox>
+								</el-checkbox-group>
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</div>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<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>
+			</div>
+		</el-dialog>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -337,6 +550,8 @@
 		getTableData,
 		getTableData,
 		coupomsaveBatchLapse,
 		coupomsaveBatchLapse,
 		coupominsterVoucher,
 		coupominsterVoucher,
+		coupominsterModifyVoucher,
+		coupominsterModifyCoupon,
 		coupominsterCoupon,
 		coupominsterCoupon,
 		hotelqueryAllHotel
 		hotelqueryAllHotel
 	} from '@/api/discountCouponMgr'
 	} from '@/api/discountCouponMgr'
@@ -376,10 +591,7 @@
 						label: '折扣券'
 						label: '折扣券'
 					}],
 					}],
 					type: '',
 					type: '',
-					statusOptions: [{ // 0删除 1正常 2失效 3过期
-						status: 0,
-						label: '删除'
-					}, {
+					statusOptions: [{ // 1正常 2失效 3过期
 						status: 1,
 						status: 1,
 						label: '正常'
 						label: '正常'
 					}, {
 					}, {
@@ -403,26 +615,41 @@
 				},
 				},
 				loading: true,
 				loading: true,
 				coupon: {},
 				coupon: {},
-				dialogComplaintVisible: false, // 优惠券详情界面
+				dialogVoucherVisible: false, // 代金券详情界面
+				dialogCouponVisible: false, // 折扣券详情界面
 				dialogAddVisible: false, // 新增优惠券界面
 				dialogAddVisible: false, // 新增优惠券界面
 				dialogAddVoucherFormVisible: false, // 新增代金券对话框
 				dialogAddVoucherFormVisible: false, // 新增代金券对话框
-				formAddVoucher: {},
+				dialogModifyVoucherFormVisible: false, // 修改代金券对话框
+				formAddVoucher: {}, // 增加代金券数据模型
+				formModifyVoucher: {}, // 修改代金券数据模型
 				addVoucherFormRules: {
 				addVoucherFormRules: {
 
 
 				},
 				},
 				dialogAddCouponFormVisible: false, // 新增折扣券对话框
 				dialogAddCouponFormVisible: false, // 新增折扣券对话框
-				formAddCoupon: {},
+				dialogModifyCouponFormVisible: false, // 修改折扣券对话框
+				formAddCoupon: {}, // 增加折扣券数据模型
+				formModifyCoupon: {}, // 修改折扣券数据模型
 				addCouponFormRules: {
 				addCouponFormRules: {
 
 
 				},
 				},
-				checkAll: false,
+				voucherCheckAll: false,
+				couponCheckAll: false,
+				voucherModifyCheckAll: false,
+				couponModifyCheckAll: false,
 				towns: townOptions,
 				towns: townOptions,
-				isIndeterminate: true,
+				isAddCouponIndeterminate: true,
+				isAddVoucherIndeterminate: true,
+				isModifyVoucherIndeterminate: true,
+				isModifyCouponIndeterminate: true,
 				multipleSelection: [], // 数据表的多选
 				multipleSelection: [], // 数据表的多选
 				couponCheckedTowns: [], // 折扣券适用民宿
 				couponCheckedTowns: [], // 折扣券适用民宿
 				voucherCheckedTowns: [], // 代金券适用民宿
 				voucherCheckedTowns: [], // 代金券适用民宿
-				voucherMinSuIds: [], // 代金券适用民宿的ids
-				couponMinSuIds: [] // 折扣券适用民宿的ids
+				voucherModifyCheckedTowns: [], // 修改代金券适用民宿
+				couponModifyCheckedTowns: [], // 修改折扣券适用民宿
+				voucherMinSuIds: [], // 增加代金券适用民宿的ids
+				couponMinSuIds: [], // 增加折扣券适用民宿的ids
+				voucherModifyMinSuIds: [], // 增加代金券适用民宿的ids
+				couponModifyMinSuIds: [] // 增加折扣券适用民宿的ids
 			}
 			}
 		},
 		},
 		created() {
 		created() {
@@ -456,13 +683,35 @@
 			 */
 			 */
 			handleVoucherCheckAllChange(val) {
 			handleVoucherCheckAllChange(val) {
 				this.voucherCheckedTowns = val ? townOptions : [];
 				this.voucherCheckedTowns = val ? townOptions : [];
-				this.isIndeterminate = false;
+				this.isAddVoucherIndeterminate = false;
 
 
 				// 获取代金券ids
 				// 获取代金券ids
 				this.get_daijinquan_ids()
 				this.get_daijinquan_ids()
 			},
 			},
 			/**
 			/**
-			 * 获取代金券ids
+			 * 修改代金券适用民宿全选
+			 * @param {Object} val
+			 */
+			handleModifyVoucherCheckAllChange(val) {
+				this.voucherModifyCheckedTowns = val ? townOptions : [];
+				this.isModifyVoucherIndeterminate = false;
+
+				// 获取代金券ids
+				this.get_modify_daijinquan_ids()
+			},
+			/**
+			 * 修改折扣券适用民宿全选
+			 * @param {Object} val
+			 */
+			handleModifyCouponCheckAllChange(val) {
+				this.couponModifyCheckedTowns = val ? townOptions : [];
+				this.isModifyCouponIndeterminate = false;
+				
+				// 获取代金券ids
+				this.get_modify_zhekouquan_ids()
+			},
+			/**
+			 * 获取增加代金券,适用民宿ids
 			 */
 			 */
 			get_daijinquan_ids() {
 			get_daijinquan_ids() {
 				var that = this;
 				var that = this;
@@ -478,12 +727,44 @@
 				// console.log(this.voucherMinSuIds);
 				// console.log(this.voucherMinSuIds);
 			},
 			},
 			/**
 			/**
+			 * 获取修改代金券,适用民宿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);
+			},
+			/**
+			 * 获取修改折扣券,适用民宿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);
+			},
+			/**
 			 * 折扣券适用民宿全选
 			 * 折扣券适用民宿全选
 			 * @param {Object} val
 			 * @param {Object} val
 			 */
 			 */
 			handleCouponCheckAllChange(val) {
 			handleCouponCheckAllChange(val) {
 				this.couponCheckedTowns = val ? townOptions : [];
 				this.couponCheckedTowns = val ? townOptions : [];
-				this.isIndeterminate = false;
+				this.isAddCouponIndeterminate = false;
 
 
 				// 获取折扣券ids
 				// 获取折扣券ids
 				this.get_zhekouquan_ids()
 				this.get_zhekouquan_ids()
@@ -511,20 +792,46 @@
 			handleVoucherCheckedTownsChange(value) {
 			handleVoucherCheckedTownsChange(value) {
 				var that = this;
 				var that = this;
 				let checkedCount = value.length;
 				let checkedCount = value.length;
-				this.checkAll = checkedCount === this.towns.length;
-				this.isIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
+				this.voucherCheckAll = checkedCount === this.towns.length;
+				this.isAddVoucherIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
 
 
 				// 获取代金券ids
 				// 获取代金券ids
 				this.get_daijinquan_ids()
 				this.get_daijinquan_ids()
 			},
 			},
 			/**
 			/**
+			 * 修改代金券适用民宿,勾选某一项
+			 * @param {Object} value
+			 */
+			handleModifyVoucherCheckedTownsChange(value) {
+				var that = this;
+				let checkedCount = value.length;
+				this.voucherModifyCheckAll = checkedCount === this.towns.length;
+				this.isModifyVoucherIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
+
+				// 获取代金券ids
+				this.get_modify_daijinquan_ids()
+			},
+			/**
+			 * 修改折扣券适用民宿,勾选某一项
+			 * @param {Object} value
+			 */
+			handleModifyCouponCheckedTownsChange(value) {
+				var that = this;
+				let checkedCount = value.length;
+				this.couponModifyCheckAll = checkedCount === this.towns.length;
+				this.isModifyCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
+				
+				// 获取代金券ids
+				this.get_modify_zhekouquan_ids()
+			},
+			/**
 			 * 折扣券适用民宿,勾选某一项
 			 * 折扣券适用民宿,勾选某一项
 			 * @param {Object} value
 			 * @param {Object} value
 			 */
 			 */
 			handleCouponCheckedTownsChange(value) {
 			handleCouponCheckedTownsChange(value) {
 				let checkedCount = value.length;
 				let checkedCount = value.length;
-				this.checkAll = checkedCount === this.towns.length;
-				this.isIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
+				this.couponCheckAll = checkedCount === this.towns.length;
+				this.isAddCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
 
 
 				// 获取折扣券ids
 				// 获取折扣券ids
 				this.get_zhekouquan_ids()
 				this.get_zhekouquan_ids()
@@ -575,6 +882,166 @@
 				});
 				});
 			},
 			},
 			/**
 			/**
+			 * 修改折扣券
+			 */
+			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)
+				});
+			},
+			/**
 			 * 添加代金券
 			 * 添加代金券
 			 */
 			 */
 			add_voucher_dialog_handler() {
 			add_voucher_dialog_handler() {
@@ -632,7 +1099,6 @@
 				this.formAddVoucher.type = 1 // 类型(1.代金券 2.折扣券)
 				this.formAddVoucher.type = 1 // 类型(1.代金券 2.折扣券)
 				this.formAddVoucher.status = 1 // 状态(0删除 1正常)
 				this.formAddVoucher.status = 1 // 状态(0删除 1正常)
 
 
-
 				coupominsterVoucher(this.formAddVoucher).then((res) => {
 				coupominsterVoucher(this.formAddVoucher).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (res.code === 200) {
 					if (res.code === 200) {
@@ -660,7 +1126,9 @@
 				// 获取适用民宿列表
 				// 获取适用民宿列表
 				this.getMinSuList()
 				this.getMinSuList()
 			},
 			},
-			// 添加折扣券
+			/**
+			 * 添加折扣券
+			 */
 			add_coupon_dialog_handler() {
 			add_coupon_dialog_handler() {
 				var that = this;
 				var that = this;
 				var d = this.formAddCoupon;
 				var d = this.formAddCoupon;
@@ -721,7 +1189,7 @@
 				this.formAddCoupon.status = 1 // 状态(0删除 1正常)
 				this.formAddCoupon.status = 1 // 状态(0删除 1正常)
 
 
 				coupominsterCoupon(this.formAddCoupon).then((res) => {
 				coupominsterCoupon(this.formAddCoupon).then((res) => {
-					console.log(res);
+					// console.log(res);
 					if (res.code === 200) {
 					if (res.code === 200) {
 						that.$message.success(res.message)
 						that.$message.success(res.message)
 
 
@@ -740,6 +1208,9 @@
 					that.$message.error(err.message)
 					that.$message.error(err.message)
 				});
 				});
 			},
 			},
+			/**
+			 * 批量失效
+			 */
 			invalidate_batch() {
 			invalidate_batch() {
 				if (this.multipleSelection.length == 0) {
 				if (this.multipleSelection.length == 0) {
 					this.$message.error('请勾选优惠券!')
 					this.$message.error('请勾选优惠券!')
@@ -767,22 +1238,143 @@
 			add_discount_coupons() {
 			add_discount_coupons() {
 				this.dialogAddVisible = true;
 				this.dialogAddVisible = true;
 			},
 			},
-			// 点击查看投诉详情,弹出投诉详情对话框
-			handleClick(row) {
+			/**
+			 * 打开修改优惠券对话框
+			 * @param {Object} row
+			 */
+			handleModifyClick(row) {
+				// 获取适用民宿列表
+				this.getMinSuList()
+
+				if (row.type == 1) { // 代金券
+					this.dialogModifyVoucherFormVisible = true
+
+					this.formModifyVoucher = {}
+
+					this.$set(this.formModifyVoucher, 'name', row.name);
+					this.$set(this.formModifyVoucher, 'deductionPrice', row.deductionPrice);
+					this.$set(this.formModifyVoucher, 'grantNumber', row.grantNumber);
+					this.$set(this.formModifyVoucher, 'limitNumber', row.limitNumber);
+					this.$set(this.formModifyVoucher, 'grantTimes', [row.grantStartDate, row.grantEndDate]);
+					this.$set(this.formModifyVoucher, 'meetPrice', row.meetPrice);
+					if (row.effectiveType == 1) {
+						this.$set(this.formModifyVoucher, 'radio', '1');
+						this.$set(this.formModifyVoucher, 'effectiveDateTime', [row.effectiveStartDate, row.effectiveEndDate]);
+					} else {
+						this.$set(this.formModifyVoucher, 'radio', '2');
+						this.$set(this.formModifyVoucher, 'effectiveDay', row.effectiveDay);
+						this.$set(this.formModifyVoucher, 'effectiveLoseDay', row.effectiveLoseDay);
+					}
+
+					this.voucherModifyMinSuIds = row.hotelIds.split(',')
+					this.voucherModifyCheckedTowns.length = 0
+					setTimeout(() => {
+						var tmp = []
+						row.hotelIds.split(',').forEach((item) => {
+							townOptions_obj.forEach((obj) => {
+								if (obj.hid == item) {
+									tmp.push(obj.hname);
+								}
+							});
+						});
+						this.voucherModifyCheckedTowns = tmp
+						this.$set(this.formModifyVoucher, 'voucherModifyCheckedTowns', tmp);
+					}, 1000);
+
+					this.$set(this.formModifyVoucher, 'createId', this.currentUserId); // 创建人
+					this.$set(this.formModifyVoucher, 'effectiveType', row.effectiveType); // 有效期类型(1.时间段 2.生效失效天数)
+					this.$set(this.formModifyVoucher, 'type', 1); // 类型(1.代金券 2.折扣券)
+					this.$set(this.formModifyVoucher, 'status', 1); // 状态(0删除 1正常)
+					this.$set(this.formModifyVoucher, 'id', row.id);
+				} else { // 折扣券
+					this.dialogModifyCouponFormVisible = true
+
+					this.formModifyCoupon = {}
+
+					this.$set(this.formModifyCoupon, 'name', row.name);
+					this.$set(this.formModifyCoupon, 'rebatePrice', row.rebatePrice);
+					this.$set(this.formModifyCoupon, 'maxDeduction', row.maxDeduction);
+					this.$set(this.formModifyCoupon, 'grantNumber', row.grantNumber);
+					this.$set(this.formModifyCoupon, 'limitNumber', row.limitNumber);
+					this.$set(this.formModifyCoupon, 'grantTimes', [row.grantStartDate, row.grantEndDate]);
+					this.$set(this.formModifyCoupon, 'meetPrice', row.meetPrice);
+					if (row.effectiveType == 1) {
+						this.$set(this.formModifyCoupon, 'radio', '1');
+						this.$set(this.formModifyCoupon, 'effectiveDateTime', [row.effectiveStartDate, row.effectiveEndDate]);
+					} else {
+						this.$set(this.formModifyCoupon, 'radio', '2');
+						this.$set(this.formModifyCoupon, 'effectiveDay', row.effectiveDay);
+						this.$set(this.formModifyCoupon, 'effectiveLoseDay', row.effectiveLoseDay);
+					}
+
+					this.couponModifyMinSuIds = row.hotelIds.split(',')
+					this.couponModifyCheckedTowns.length = 0
+					setTimeout(() => {
+						var tmp = []
+						row.hotelIds.split(',').forEach((item) => {
+							townOptions_obj.forEach((obj) => {
+								if (obj.hid == item) {
+									tmp.push(obj.hname);
+								}
+							});
+						});
+						this.couponModifyCheckedTowns = tmp
+						this.$set(this.formModifyCoupon, 'couponModifyCheckedTowns', tmp);
+					}, 1000);
+
+					this.$set(this.formModifyCoupon, 'createId', this.currentUserId); // 创建人
+					this.$set(this.formModifyCoupon, 'effectiveType', row.effectiveType); // 有效期类型(1.时间段 2.生效失效天数)
+					this.$set(this.formModifyCoupon, 'type', 1); // 类型(1.代金券 2.折扣券)
+					this.$set(this.formModifyCoupon, 'status', 1); // 状态(0删除 1正常)
+					this.$set(this.formModifyCoupon, 'id', row.id);
+				}
+			},
+			/**
+			 * 点击查看优惠券详情,弹出优惠券详情对话框
+			 * @param {Object} row
+			 */
+			handleDetailClick(row) {
 				// console.log(row);
 				// console.log(row);
-				this.dialogComplaintVisible = true
-				this.coupon.name = row.name
-				this.coupon.rebatePrice = row.rebatePrice
-				this.coupon.maxDeduction = row.maxDeduction
-				this.coupon.grantNumber = row.grantNumber
-				this.coupon.limitNumber = row.limitNumber
-				this.coupon.grantStartDate = row.grantStartDate
-				this.coupon.grantEndDate = row.grantEndDate
-				this.coupon.meetPrice = row.meetPrice
-				this.coupon.effectiveStartDate = row.effectiveStartDate
-				this.coupon.effectiveEndDate = row.effectiveEndDate
-				this.coupon.hotelNames = row.hotelNames
-				// this.coupon.hotelIds = row.hotelIds
+				if (row.type == 1) { // 代金券
+					this.dialogVoucherVisible = true
+
+					this.coupon.name = row.name
+					this.coupon.deductionPrice = row.deductionPrice
+					this.coupon.grantNumber = row.grantNumber
+					this.coupon.limitNumber = row.limitNumber
+					this.coupon.grantStartDate = row.grantStartDate
+					this.coupon.grantEndDate = row.grantEndDate
+					this.coupon.meetPrice = row.meetPrice
+
+					this.coupon.effectiveType = row.effectiveType
+					this.coupon.effectiveStartDate = row.effectiveStartDate
+					this.coupon.effectiveEndDate = row.effectiveEndDate
+					this.coupon.effectiveDay = row.effectiveDay
+					this.coupon.effectiveLoseDay = row.effectiveLoseDay
+
+					this.coupon.hotelNames = row.hotelNames
+					// this.coupon.hotelIds = row.hotelIds
+				} else { // 折扣券
+					this.dialogCouponVisible = true
+
+					this.coupon.name = row.name
+					this.coupon.rebatePrice = row.rebatePrice
+					this.coupon.maxDeduction = row.maxDeduction
+					this.coupon.grantNumber = row.grantNumber
+					this.coupon.limitNumber = row.limitNumber
+					this.coupon.grantStartDate = row.grantStartDate
+					this.coupon.grantEndDate = row.grantEndDate
+					this.coupon.meetPrice = row.meetPrice
+
+					this.coupon.effectiveType = row.effectiveType
+					this.coupon.effectiveStartDate = row.effectiveStartDate
+					this.coupon.effectiveEndDate = row.effectiveEndDate
+					this.coupon.effectiveDay = row.effectiveDay
+					this.coupon.effectiveLoseDay = row.effectiveLoseDay
+
+					this.coupon.hotelNames = row.hotelNames
+					// this.coupon.hotelIds = row.hotelIds
+				}
 			},
 			},
 			/**
 			/**
 			 * 获取消费记录,表格数据
 			 * 获取消费记录,表格数据
@@ -800,7 +1392,7 @@
 				var that = this
 				var that = this
 				// console.log(data);
 				// console.log(data);
 				getTableData(data).then((res) => {
 				getTableData(data).then((res) => {
-					// console.log(res);
+					// console.log(res.data);
 					if (res.code === 200) {
 					if (res.code === 200) {
 						var d = res.data
 						var d = res.data
 						that.pagination.total = d.total
 						that.pagination.total = d.total
@@ -808,6 +1400,7 @@
 						for (var i = 0; i < d.pageList.length; i++) {
 						for (var i = 0; i < d.pageList.length; i++) {
 							that.tableData.push(d.pageList[i])
 							that.tableData.push(d.pageList[i])
 						}
 						}
+						// that.tableData.sort((a,b) => b.createDate.localeCompare(a.createDate))
 					} else {
 					} else {
 						that.tableData = []
 						that.tableData = []
 						that.$message.warning('没有符合条件的数据!')
 						that.$message.warning('没有符合条件的数据!')