|
@@ -5,23 +5,6 @@
|
|
|
<j-form-container :disabled="formDisabled">
|
|
<j-form-container :disabled="formDisabled">
|
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
<a-row>
|
|
<a-row>
|
|
|
- <!-- <a-col :span="24">
|
|
|
|
|
- <a-form-model-item label="续住总价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
|
|
- {{PriceData.reduce((pre,cur)=> pre+cur.price*1,0 ) || 0}}
|
|
|
|
|
- <a-popover placement="right" v-if="dayNum>0">
|
|
|
|
|
- <template slot="content">
|
|
|
|
|
-
|
|
|
|
|
- </template>
|
|
|
|
|
- <template slot="title">
|
|
|
|
|
- <a-input-number :min="0" @change="batchPrice" placeholder="批量改价"></a-input-number>
|
|
|
|
|
- </template>
|
|
|
|
|
- <a-icon type="edit" />
|
|
|
|
|
- </a-popover>
|
|
|
|
|
- <template v-else>
|
|
|
|
|
- <a-icon type="edit" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-form-model-item>
|
|
|
|
|
- </a-col> -->
|
|
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="原房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="原房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.arrivalTime || ''}} -->
|
|
<!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.arrivalTime || ''}} -->
|
|
@@ -31,33 +14,52 @@
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.dueOutTime || ''}} -->
|
|
<!-- {{ model.livingData && model.livingData.livingOrder && model.livingData.livingOrder.dueOutTime || ''}} -->
|
|
|
- {{ model.roomInfo && model.layout.marketPrice}}
|
|
|
|
|
|
|
+ {{ model.roomInfo && model.livingData.price.reduce((pre,cur)=> pre+cur.price*1,0) || 0}} / {{ model.roomInfo && model.layout.marketPrice || 0}}
|
|
|
|
|
+ <a-popover placement="right">
|
|
|
|
|
+ <template slot="content" v-if="model.livingData">
|
|
|
|
|
+ <div style="max-height:400px;overflow:auto;width:100%;">
|
|
|
|
|
+ <div v-for="(item, index) in model.livingData.price" :key="index">
|
|
|
|
|
+ {{item.dayTime}}
|
|
|
|
|
+ <a-input-number disabled :min="0" v-model="item.price"></a-input-number>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot="title">
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <a-icon type="eye" />
|
|
|
|
|
+ </a-popover>
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<template v-if="selectData.length>0">
|
|
<template v-if="selectData.length>0">
|
|
|
- {{newRoom.roomInfo && newRoom.roomInfo.name}}
|
|
|
|
|
|
|
+ {{newRoom && newRoom.roomInfo.name}}
|
|
|
</template> <a href="#" @click="selectVisible = true">选择</a>
|
|
</template> <a href="#" @click="selectVisible = true">选择</a>
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
|
<!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
|
|
<!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
|
|
|
- {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
|
|
|
|
|
- <a-popover placement="right" v-if="newRoom.roomInfo">
|
|
|
|
|
- <template slot="content">
|
|
|
|
|
- <div style="max-height:400px;overflow:auto;width:100%;">
|
|
|
|
|
- <div v-for="(item, index) in timeData" :key="index">
|
|
|
|
|
- {{item.day}}
|
|
|
|
|
- <a-input-number :min="0" v-model="item.price"></a-input-number>
|
|
|
|
|
|
|
+ <template v-if="newRoom && newRoom.roomInfo">
|
|
|
|
|
+ {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
|
|
|
|
|
+ <a-popover placement="right">
|
|
|
|
|
+ <template slot="content">
|
|
|
|
|
+ <div style="max-height:400px;overflow:auto;width:100%;">
|
|
|
|
|
+ <div v-for="(item, index) in timeData" :key="index">
|
|
|
|
|
+ {{item.day}}
|
|
|
|
|
+ <a-input-number :disabled="daysBetweenCopy(item.day)" :min="0" v-model="item.price"></a-input-number>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template slot="title">
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot="title">
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <a-icon type="edit" />
|
|
|
|
|
+ </a-popover>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ 0
|
|
|
<a-icon type="edit" />
|
|
<a-icon type="edit" />
|
|
|
- </a-popover>
|
|
|
|
|
|
|
+ </template>
|
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
@@ -73,7 +75,7 @@
|
|
|
<!-- <a-tab-pane key="2" tab="换房记录"></a-tab-pane> -->
|
|
<!-- <a-tab-pane key="2" tab="换房记录"></a-tab-pane> -->
|
|
|
</a-tabs>
|
|
</a-tabs>
|
|
|
|
|
|
|
|
- <a-modal :title="'选择房间'" :visible="selectVisible" @cancel="selectVisible = false" @ok="changeSelct">
|
|
|
|
|
|
|
+ <a-modal :title="'选择房间'" :width="800" :visible="selectVisible" @cancel="selectVisible = false" @ok="changeSelct">
|
|
|
<a-row>
|
|
<a-row>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="房型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
<a-form-model-item label="房型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
|
|
@@ -97,7 +99,7 @@
|
|
|
|
|
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24" v-if="dataList.length>0">
|
|
<a-col :span="24" v-if="dataList.length>0">
|
|
|
- <div style="display:flex;flex-wrap:wrap;">
|
|
|
|
|
|
|
+ <div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
|
|
|
<div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
|
|
<div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
|
|
|
{{ item.roomInfo && item.roomInfo.name}}
|
|
{{ item.roomInfo && item.roomInfo.name}}
|
|
|
</div>
|
|
</div>
|
|
@@ -210,7 +212,7 @@ export default {
|
|
|
oldRoomList: [],
|
|
oldRoomList: [],
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
selectData: [],
|
|
selectData: [],
|
|
|
- newRoom: {},
|
|
|
|
|
|
|
+ newRoom: null,
|
|
|
timeData: [],
|
|
timeData: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -272,6 +274,9 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.newRoom = this.selectData[0]
|
|
this.newRoom = this.selectData[0]
|
|
|
|
|
+ this.timeData.forEach(ele=>{
|
|
|
|
|
+ ele.price = this.newRoom.layout.marketPrice
|
|
|
|
|
+ })
|
|
|
this.selectVisible = false;
|
|
this.selectVisible = false;
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -306,11 +311,36 @@ export default {
|
|
|
// return
|
|
// return
|
|
|
// }
|
|
// }
|
|
|
const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
|
|
const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
|
|
|
- if (diffDays<0) {
|
|
|
|
|
|
|
+ if (diffDays < 0) {
|
|
|
diffDays = 1
|
|
diffDays = 1
|
|
|
}
|
|
}
|
|
|
return diffDays;
|
|
return diffDays;
|
|
|
},
|
|
},
|
|
|
|
|
+ //比较两个日期大小
|
|
|
|
|
+ daysBetweenCopy(date1) {
|
|
|
|
|
+ const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
|
|
|
|
|
+ const firstDate = new Date(date1);
|
|
|
|
|
+ const secondDate = new Date();
|
|
|
|
|
+ // const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
|
|
|
|
|
+ if (firstDate.getFullYear() >= secondDate.getFullYear()) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if (firstDate.getFullYear() < secondDate.getFullYear()) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (firstDate.getMonth() >= secondDate.getMonth()) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if (firstDate.getMonth() < secondDate.getMonth()) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (firstDate.getDate() >= secondDate.getDate()) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ } else if (firstDate.getDate() < secondDate.getDate()) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // return diffDays < 0 ? true : false;
|
|
|
|
|
+ },
|
|
|
selectRoom(e, idx) {
|
|
selectRoom(e, idx) {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
this.link = idx
|
|
this.link = idx
|
|
@@ -394,10 +424,12 @@ export default {
|
|
|
arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
|
|
arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
arr[i] = {
|
|
arr[i] = {
|
|
|
- day: this.addDate(this.model.livingData.livingOrder.dueOutTime, i),
|
|
|
|
|
- price: 0,
|
|
|
|
|
|
|
+ day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
|
|
|
|
|
+ // price: this.model.layout.marketPrice,
|
|
|
|
|
+ price:0
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(arr);
|
|
|
this.timeData = arr
|
|
this.timeData = arr
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
},
|
|
},
|
|
@@ -416,6 +448,10 @@ export default {
|
|
|
// httpurl += this.url.edit;
|
|
// httpurl += this.url.edit;
|
|
|
// method = "put";
|
|
// method = "put";
|
|
|
// }
|
|
// }
|
|
|
|
|
+ if (!this.newRoom || !this.newRoom.roomInfo) {
|
|
|
|
|
+ this.$message.warning("请选择新房间");
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
let prices = this.timeData.map(item => {
|
|
let prices = this.timeData.map(item => {
|
|
|
return {
|
|
return {
|
|
|
dayTime: item.day,
|
|
dayTime: item.day,
|