|
@@ -35,42 +35,42 @@
|
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
|
<a-time-picker :open.sync="open1" v-model="beforeTime1" format="HH:mm">
|
|
<a-time-picker :open.sync="open1" v-model="beforeTime1" format="HH:mm">
|
|
|
<a-button slot="addon" size="small" type="primary" @click="open1 = false">
|
|
<a-button slot="addon" size="small" type="primary" @click="open1 = false">
|
|
|
- 确定
|
|
|
|
|
|
|
+ 确定
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- </a-time-picker>
|
|
|
|
|
- <span>前可取消</span>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ </a-time-picker>
|
|
|
|
|
+ <span>前可取消</span>
|
|
|
|
|
+ </span>
|
|
|
</a-radio>
|
|
</a-radio>
|
|
|
<a-radio :style="radioStyle" :value="2">
|
|
<a-radio :style="radioStyle" :value="2">
|
|
|
<span style="display: inline-block;">
|
|
<span style="display: inline-block;">
|
|
|
<span style="width: 76px;display:inline-block;">入住前</span>
|
|
<span style="width: 76px;display:inline-block;">入住前</span>
|
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
|
- <a-input-number id="inputNumber" v-model="cancelDay1" :min="1" />
|
|
|
|
|
|
|
+ <a-input-number v-model="cancelDay1" :min="0" />
|
|
|
<span>天</span>
|
|
<span>天</span>
|
|
|
<a-time-picker :open.sync="open2" v-model="beforeTime2" format="HH:mm">
|
|
<a-time-picker :open.sync="open2" v-model="beforeTime2" format="HH:mm">
|
|
|
<a-button slot="addon" size="small" type="primary" @click="open2 = false">
|
|
<a-button slot="addon" size="small" type="primary" @click="open2 = false">
|
|
|
- 确定
|
|
|
|
|
|
|
+ 确定
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- </a-time-picker>
|
|
|
|
|
- <span>前可取消</span>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ </a-time-picker>
|
|
|
|
|
+ <span>前可取消</span>
|
|
|
|
|
+ </span>
|
|
|
</a-radio>
|
|
</a-radio>
|
|
|
<a-radio :style="radioStyle" :value="3">
|
|
<a-radio :style="radioStyle" :value="3">
|
|
|
<span style="display: inline-block;">
|
|
<span style="display: inline-block;">
|
|
|
<span style="width: 76px;display:inline-block;">入住前</span>
|
|
<span style="width: 76px;display:inline-block;">入住前</span>
|
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
<span style="display: inline-block;width: 20px;height:1px;"></span>
|
|
|
- <a-input-number id="inputNumber" v-model="cancelDay1" :min="1" />
|
|
|
|
|
|
|
+ <a-input-number v-model="cancelDay2" :min="0" />
|
|
|
<span>天</span>
|
|
<span>天</span>
|
|
|
- <a-time-picker :open.sync="open2" v-model="beforeTime2" format="HH:mm">
|
|
|
|
|
- <a-button slot="addon" size="small" type="primary" @click="open2 = false">
|
|
|
|
|
- 确定
|
|
|
|
|
|
|
+ <a-time-picker :open.sync="open3" v-model="beforeTime3" format="HH:mm">
|
|
|
|
|
+ <a-button slot="addon" size="small" type="primary" @click="open3 = false">
|
|
|
|
|
+ 确定
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- </a-time-picker>
|
|
|
|
|
- <span>前可取消,</span>
|
|
|
|
|
- <span>收取</span>
|
|
|
|
|
- <a-input-number id="inputNumber" v-model="model.cancelMoney" :min="0" />
|
|
|
|
|
- %罚金
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ </a-time-picker>
|
|
|
|
|
+ <span>前可取消,</span>
|
|
|
|
|
+ <span>收取</span>
|
|
|
|
|
+ <a-input-number v-model="model.cancelMoney" :min="0" />
|
|
|
|
|
+ %罚金
|
|
|
|
|
+ </span>
|
|
|
</a-radio>
|
|
</a-radio>
|
|
|
<a-radio :style="radioStyle" :value="4">
|
|
<a-radio :style="radioStyle" :value="4">
|
|
|
不可取消
|
|
不可取消
|
|
@@ -87,13 +87,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+var splitChar = '⛔'
|
|
|
|
|
+import { modify } from '@/api/roomLayout'
|
|
|
|
|
+import moment from 'moment';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'HotelSaasTenantFrontendRoomLayoutDetail',
|
|
name: 'HotelSaasTenantFrontendRoomLayoutDetail',
|
|
|
|
|
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- cancelDay1: 1,
|
|
|
|
|
- cancelDay2: 1,
|
|
|
|
|
|
|
+ cancelDay1: null,
|
|
|
|
|
+ cancelDay2: null,
|
|
|
beforeTime1: null,
|
|
beforeTime1: null,
|
|
|
beforeTime2: null,
|
|
beforeTime2: null,
|
|
|
beforeTime3: null,
|
|
beforeTime3: null,
|
|
@@ -142,14 +145,11 @@ export default {
|
|
|
model: {
|
|
model: {
|
|
|
id: null,
|
|
id: null,
|
|
|
tags: [],
|
|
tags: [],
|
|
|
- facilities: null,
|
|
|
|
|
- cancelRule: null,
|
|
|
|
|
|
|
+ facilities: null, // 房间设施
|
|
|
|
|
+ cancelRule: null, // 取消规则
|
|
|
windows: null,
|
|
windows: null,
|
|
|
cancelBeforeTime: null,
|
|
cancelBeforeTime: null,
|
|
|
cancelMoney: 0,
|
|
cancelMoney: 0,
|
|
|
- area: 0,
|
|
|
|
|
- bedSize: 0,
|
|
|
|
|
- remark: ''
|
|
|
|
|
},
|
|
},
|
|
|
validatorRules: {
|
|
validatorRules: {
|
|
|
windows: [{ required: true, message: "请选择是否有窗" }],
|
|
windows: [{ required: true, message: "请选择是否有窗" }],
|
|
@@ -164,6 +164,50 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ setData(data) {
|
|
|
|
|
+ this.model = JSON.parse(JSON.stringify(data))
|
|
|
|
|
+ // 房间标签
|
|
|
|
|
+ if (this.model.tags) {
|
|
|
|
|
+ this.model.tags = this.model.tags.split(splitChar)
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.model.tags = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 房间设施
|
|
|
|
|
+ if (this.model.facilities) {
|
|
|
|
|
+ this.model.facilities = this.model.facilities.split(',')
|
|
|
|
|
+ this.defvals = this.model.facilities
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.model.facilities = null
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 取消规则渲染
|
|
|
|
|
+ if (this.model.cancelRule) {
|
|
|
|
|
+ if (this.model.cancelRule == 1) { //入住当天 补充当天时间赋值
|
|
|
|
|
+ if (this.model.cancelBeforeTime) {
|
|
|
|
|
+ this.beforeTime1 = moment(this.model.cancelBeforeTime, "HH:mm").utcOffset(8)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.model.cancelRule == 2) { // 入住前N天可取消
|
|
|
|
|
+ if (this.model.cancelDayNum || this.model.cancelDayNum == 0) {
|
|
|
|
|
+ this.cancelDay1 = this.model.cancelDayNum
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.model.cancelBeforeTime) {
|
|
|
|
|
+ this.beforeTime2 = moment(this.model.cancelBeforeTime, "HH:mm").utcOffset(8)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.model.cancelRule == 3) { // 入住前N天包含罚金比率
|
|
|
|
|
+ if (this.model.cancelDayNum || this.model.cancelDayNum == 0) {
|
|
|
|
|
+ this.cancelDay2 = this.model.cancelDayNum
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.model.cancelBeforeTime) {
|
|
|
|
|
+ this.beforeTime3 = moment(this.model.cancelBeforeTime, "HH:mm").utcOffset(8)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.model.cancelMoney = this.model.cancelMoney ? this.model.cancelMoney : 0
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
onTagClose(item) {
|
|
onTagClose(item) {
|
|
|
delete this.model.tags[item]
|
|
delete this.model.tags[item]
|
|
|
},
|
|
},
|
|
@@ -189,12 +233,76 @@ export default {
|
|
|
// 触发表单验证
|
|
// 触发表单验证
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- that.confirmLoading = true;
|
|
|
|
|
- if (this.model.id && this.model.id != '') {
|
|
|
|
|
- this.doModify()
|
|
|
|
|
- } else {
|
|
|
|
|
- this.doCreate()
|
|
|
|
|
|
|
+ let data = JSON.parse(JSON.stringify(this.model))
|
|
|
|
|
+ data.checkType = (data.checkType || []).toString()
|
|
|
|
|
+ data.facilities = (data.facilities || []).toString()
|
|
|
|
|
+ data.tags = data.tags.join(splitChar)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (this.model.cancelRule) {
|
|
|
|
|
+ if (this.model.cancelRule == 1) { //入住当天 补充当天时间赋值
|
|
|
|
|
+ if (this.beforeTime1) {
|
|
|
|
|
+ data.cancelBeforeTime = this.beforeTime1.format("HH:mm")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请选择最后取消时间')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.model.cancelRule == 2) { // 入住前N天可取消
|
|
|
|
|
+ if (this.cancelDay1 || this.cancelDay1 == 0) {
|
|
|
|
|
+ data.cancelDayNum = this.cancelDay1
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请输入取消前天数')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.beforeTime2) {
|
|
|
|
|
+ data.cancelBeforeTime = this.beforeTime2.format("HH:mm")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请选择最后取消时间')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (this.model.cancelRule == 3) { // 入住前N天包含罚金比率
|
|
|
|
|
+ if (this.cancelDay2 || this.cancelDay2 == 0) {
|
|
|
|
|
+ data.cancelDayNum = this.cancelDay2
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请输入取消前天数')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.beforeTime3) {
|
|
|
|
|
+ data.cancelBeforeTime = this.beforeTime3.format("HH:mm")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请选择最后取消时间')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!this.model.cancelMoney || this.model.cancelMoney < 0) {
|
|
|
|
|
+ this.$message.error('罚金比率必须大于1')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ that.confirmLoading = true;
|
|
|
|
|
+ modify({
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ hotelId: data.hotelId,
|
|
|
|
|
+ name: data.name,
|
|
|
|
|
+ marketPrice: data.marketPrice,
|
|
|
|
|
+ canLivePersonNum: data.canLivePersonNum,
|
|
|
|
|
+ breakfastNum: data.breakfastNum,
|
|
|
|
|
+ lunchNum: data.lunchNum,
|
|
|
|
|
+ dinnerNum: data.dinnerNum,
|
|
|
|
|
+ tags: data.tags,
|
|
|
|
|
+ facilities: data.facilities,
|
|
|
|
|
+ cancelRule: data.cancelRule,
|
|
|
|
|
+ cancelDayNum: data.cancelDayNum,
|
|
|
|
|
+ cancelBeforeTime: data.cancelBeforeTime,
|
|
|
|
|
+ cancelMoney: data.cancelMoney
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$emit('saveOk')
|
|
|
|
|
+ this.$message.success("保存成功")
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(_=>{
|
|
|
|
|
+ that.confirmLoading = false;
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|