|
|
@@ -11,9 +11,9 @@
|
|
|
<span slot="startDate" slot-scope="text, record, index">
|
|
|
{{ record.startDate }} ~ {{ record.endDate }}
|
|
|
</span>
|
|
|
-
|
|
|
+
|
|
|
<span slot="sellerId" slot-scope="text, record, index">
|
|
|
- {{ record.sellerId ? getSellerName(record.sellerId): '' }}
|
|
|
+ {{ record.sellerId ? getSellerName(record.sellerId) : '' }}
|
|
|
</span>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
@@ -25,94 +25,70 @@
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<a-form-model layout="inline" ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
- <a-row>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="价格名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
|
|
|
- <a-input v-model="model.name" placeholder="请输入房价名称"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oprice">
|
|
|
- <a-input-number style="width:100%;" v-model="model.oprice" :min="1" placeholder="请填写原价"
|
|
|
- @change="formVipOpriceChange" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="现价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
|
|
|
- <a-input-number style="width:100%;" v-model="model.price" :min="1" placeholder="请填写现价" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="预付" prop="prepay">
|
|
|
- <a-radio-group v-model="model.prepay">
|
|
|
- <a-radio-button :value="1">
|
|
|
- 是
|
|
|
- </a-radio-button>
|
|
|
- <a-radio-button :value="0">
|
|
|
- 否
|
|
|
- </a-radio-button>
|
|
|
- </a-radio-group>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="积分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="integral">
|
|
|
- <a-input-number style="width:100%;" v-model="model.integral" placeholder="请填写积分" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
|
|
|
- <a-input-number style="width:100%;" v-model="model.num" placeholder="请填写数量" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="会员折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isVip">
|
|
|
- <a-radio-group v-model="model.isVip" @change="onVipChange">
|
|
|
- <a-radio-button :value="1">
|
|
|
- 是
|
|
|
- </a-radio-button>
|
|
|
- <a-radio-button :value="0">
|
|
|
- 否
|
|
|
- </a-radio-button>
|
|
|
- </a-radio-group>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- </a-row>
|
|
|
- <a-row>
|
|
|
- <a-col :span="4">
|
|
|
- <a-form-model-item label="适用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startDate">
|
|
|
- <a-time-picker :open.sync="open2" v-model="model.startDate" format="HH:mm" @change="onStartTimeChange">
|
|
|
- <a-button slot="addon" size="small" type="primary" @click="open2 = false">
|
|
|
- 确定
|
|
|
- </a-button>
|
|
|
- </a-time-picker>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="3">
|
|
|
- <a-form-model-item label="" :labelCol="labelCol1" :wrapperCol="wrapperCol" prop="endDate">
|
|
|
- <a-time-picker :open.sync="open" v-model="model.endDate" format="HH:mm">
|
|
|
- <a-button slot="addon" size="small" type="primary" @click="open = false">
|
|
|
- 确定
|
|
|
- </a-button>
|
|
|
- </a-time-picker>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="4">
|
|
|
- <a-form-model-item label="钟点房方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sellerId">
|
|
|
- <a-select style="width: 120px" v-model="model.sellerId" placeholder="请选择">
|
|
|
- <a-select-option :value="item.id" v-for="item in hourRules">
|
|
|
- {{ item.hourRoomName }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="2">
|
|
|
- <a-button :disabled="submitLoading" :loading="submitLoading" @click="submitForm" type="primary">保存</a-button>
|
|
|
- </a-col>
|
|
|
- <a-col :span="1">
|
|
|
- <a-button :disabled="submitLoading" :loading="submitLoading" @click="clearForm" type="primary">清空</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
+ <a-form-model-item label="价格名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
|
|
|
+ <a-input v-model="model.name" placeholder="请输入房价名称"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oprice">
|
|
|
+ <a-input-number style="width:100%;" v-model="model.oprice" :min="1" placeholder="请填写原价"
|
|
|
+ @change="formVipOpriceChange" />
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="现价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
|
|
|
+ <a-input-number style="width:100%;" v-model="model.price" :min="1" placeholder="请填写现价" />
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="预付" prop="prepay">
|
|
|
+ <a-radio-group v-model="model.prepay">
|
|
|
+ <a-radio-button :value="1">
|
|
|
+ 是
|
|
|
+ </a-radio-button>
|
|
|
+ <a-radio-button :value="0">
|
|
|
+ 否
|
|
|
+ </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="积分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="integral">
|
|
|
+ <a-input-number style="width:100%;" v-model="model.integral" placeholder="请填写积分" />
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
|
|
|
+ <a-input-number style="width:100%;" v-model="model.num" placeholder="请填写数量" />
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="会员折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isVip">
|
|
|
+ <a-radio-group v-model="model.isVip" @change="onVipChange">
|
|
|
+ <a-radio-button :value="1">
|
|
|
+ 是
|
|
|
+ </a-radio-button>
|
|
|
+ <a-radio-button :value="0">
|
|
|
+ 否
|
|
|
+ </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="适用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startDate">
|
|
|
+ <a-time-picker :open.sync="open2" v-model="model.startDate" format="HH:mm" @change="onStartTimeChange">
|
|
|
+ <a-button slot="addon" size="small" type="primary" @click="open2 = false">
|
|
|
+ 确定
|
|
|
+ </a-button>
|
|
|
+ </a-time-picker>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="" :labelCol="labelCol1" :wrapperCol="wrapperCol" prop="endDate">
|
|
|
+ <a-time-picker :open.sync="open" v-model="model.endDate" format="HH:mm">
|
|
|
+ <a-button slot="addon" size="small" type="primary" @click="open = false">
|
|
|
+ 确定
|
|
|
+ </a-button>
|
|
|
+ </a-time-picker>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="钟点房方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sellerId">
|
|
|
+ <a-select style="width: 120px" v-model="model.sellerId" placeholder="请选择">
|
|
|
+ <a-select-option :value="item.id" v-for="item in hourRules" :key="item.id">
|
|
|
+ {{ item.hourRoomName }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-button :disabled="submitLoading" :loading="submitLoading" @click="submitForm"
|
|
|
+ type="primary">保存</a-button>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-button :disabled="submitLoading" :loading="submitLoading" @click="clearForm" type="primary">清空</a-button>
|
|
|
+ </a-form-model-item>
|
|
|
</a-form-model>
|
|
|
|
|
|
<div class="vip-config" v-if="model.isVip">
|
|
|
@@ -143,7 +119,7 @@
|
|
|
|
|
|
<script>
|
|
|
Date.prototype.Format = function (fmt) {
|
|
|
- var o = {
|
|
|
+ var o = {
|
|
|
"M+": this.getMonth() + 1, //月份
|
|
|
"d+": this.getDate(), //日
|
|
|
"H+": this.getHours(), //小时
|
|
|
@@ -151,12 +127,12 @@ Date.prototype.Format = function (fmt) {
|
|
|
"s+": this.getSeconds(), //秒
|
|
|
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
|
"S": this.getMilliseconds() //毫秒
|
|
|
- };
|
|
|
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
- for (var k in o)
|
|
|
+ };
|
|
|
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
+ for (var k in o)
|
|
|
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
|
- return fmt;
|
|
|
- }
|
|
|
+ return fmt;
|
|
|
+}
|
|
|
import { list, modify, create, getLayoutpriceLevels, getHourRoomRule } from '@/api/roomLayoutPrice'
|
|
|
import { httpAction, getAction } from "@/api/manage";
|
|
|
import * as api from '@/api/api'
|
|
|
@@ -281,14 +257,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onStartTimeChange(e, timeStr) {
|
|
|
- console.log(e,timeStr,this.model.startDate)
|
|
|
+ console.log(e, timeStr, this.model.startDate)
|
|
|
},
|
|
|
onEndTimeChange(e, timeStr) {
|
|
|
this.model.endDate = timeStr
|
|
|
},
|
|
|
getSellerName(id) {
|
|
|
- let index = this.hourRules.findIndex(s=>s.id == id)
|
|
|
- if(index > -1) {
|
|
|
+ let index = this.hourRules.findIndex(s => s.id == id)
|
|
|
+ if (index > -1) {
|
|
|
return this.hourRules[index].hourRoomName
|
|
|
}
|
|
|
return id
|
|
|
@@ -340,7 +316,7 @@ export default {
|
|
|
pageNo: 1,
|
|
|
pageSize: 999
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.hourRules = res.result.records
|
|
|
} else {
|
|
|
this.$message.warning('⚠️没有找到钟点房方案')
|
|
|
@@ -385,8 +361,8 @@ export default {
|
|
|
cpData.isVip = record.isVip ? 1 : 0
|
|
|
cpData.prepay = record.prepay ? 1 : 0
|
|
|
this.model = cpData
|
|
|
- this.model.startDate = moment(this.model.startDate,"HH:mm")
|
|
|
- this.model.endDate = moment(this.model.endDate,"HH:mm")
|
|
|
+ this.model.startDate = moment(this.model.startDate, "HH:mm")
|
|
|
+ this.model.endDate = moment(this.model.endDate, "HH:mm")
|
|
|
let nowLvs = JSON.parse(JSON.stringify(this.origiVipLevels))
|
|
|
if (this.model.oprice) {
|
|
|
nowLvs.forEach(s => {
|
|
|
@@ -459,7 +435,7 @@ export default {
|
|
|
model['type'] = 2
|
|
|
model.startDate = this.model.startDate
|
|
|
model.endDate = this.model.endDate
|
|
|
- model.startDate =model.startDate.utcOffset(8).format("HH:mm")
|
|
|
+ model.startDate = model.startDate.utcOffset(8).format("HH:mm")
|
|
|
model.endDate = model.endDate.utcOffset(8).format("HH:mm")
|
|
|
let memberPriceEntities = [];
|
|
|
if (model.isVip) {
|
|
|
@@ -490,7 +466,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
doCreate() {
|
|
|
-
|
|
|
+
|
|
|
let model = JSON.parse(JSON.stringify(this.model))
|
|
|
model['hotelId'] = hotelItem.id
|
|
|
model['layoutId'] = this.layoutId
|
|
|
@@ -498,10 +474,10 @@ export default {
|
|
|
// 经过序列化的moment要重新赋值成moment对象
|
|
|
model.startDate = this.model.startDate
|
|
|
model.endDate = this.model.endDate
|
|
|
- model.startDate =model.startDate.utcOffset(8).format("HH:mm")
|
|
|
+ model.startDate = model.startDate.utcOffset(8).format("HH:mm")
|
|
|
model.endDate = model.endDate.utcOffset(8).format("HH:mm")
|
|
|
let memberPriceEntities = [];
|
|
|
-
|
|
|
+
|
|
|
if (model.isVip) {
|
|
|
(this.vipLevels || []).forEach(s => {
|
|
|
let item = {
|
|
|
@@ -525,7 +501,7 @@ export default {
|
|
|
}).catch(err => {
|
|
|
this.$message.error("保存失败")
|
|
|
}).finally(_ => {
|
|
|
-
|
|
|
+
|
|
|
this.submitLoading = false
|
|
|
})
|
|
|
}
|
|
|
@@ -536,7 +512,7 @@ export default {
|
|
|
|
|
|
<style lang="css" scoped>
|
|
|
.vip-config {
|
|
|
- width: 30%;
|
|
|
+ width: 50%;
|
|
|
height: 200px;
|
|
|
overflow-y: auto;
|
|
|
margin-top: 20px;
|
|
|
@@ -554,8 +530,9 @@ export default {
|
|
|
.h-title {
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
-/deep/
|
|
|
-.ant-select-selection__placeholder, .ant-select-search__field__placeholder{
|
|
|
+
|
|
|
+/deep/ .ant-select-selection__placeholder,
|
|
|
+.ant-select-search__field__placeholder {
|
|
|
display: inline-block !important;
|
|
|
}
|
|
|
</style>
|