|
|
@@ -35,7 +35,7 @@
|
|
|
>
|
|
|
宾客信息
|
|
|
</h4>
|
|
|
- <div><a-switch v-model="otherRoomSync" />附属房间录入信息</div>
|
|
|
+ <div v-if="model.roomIds&&model.roomIds.length>1"><a-switch v-model="otherRoomSync" />附属房间录入信息</div>
|
|
|
</div>
|
|
|
<a-divider />
|
|
|
<!-- <a-col :span="8">
|
|
|
@@ -345,6 +345,9 @@
|
|
|
>
|
|
|
<a-select-option :value="1"> 全天 </a-select-option>
|
|
|
<a-select-option :value="2"> 钟点 </a-select-option>
|
|
|
+ <a-select-option :value="3"> 自用 </a-select-option>
|
|
|
+ <a-select-option :value="4"> 免费 </a-select-option>
|
|
|
+ <a-select-option :value="5"> 长租 </a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
@@ -718,6 +721,13 @@
|
|
|
/> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template slot="deposit" slot-scope="text, record, index">
|
|
|
+ <!-- <editable-cell
|
|
|
+ :text="text"
|
|
|
+ @change="onCellChangeCopy('deposit', index, $event)"
|
|
|
+ /> -->
|
|
|
+ <a-input-number v-model="record.deposit" @change="onCellChangeCopy('deposit', index, $event)"></a-input-number>
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
<div
|
|
|
style="
|
|
|
@@ -918,8 +928,12 @@
|
|
|
|
|
|
<!-- 修改每日单价弹窗 -->
|
|
|
<a-modal :visible="editPriceModal" title="调价" @cancel="editPriceModal = false" :width="800" @ok="editPriceOk">
|
|
|
- <table>
|
|
|
- <tr>
|
|
|
+ <template v-if="editPriceData.length>0">
|
|
|
+ <table v-for="(item, index) in editPriceData" :key="index">
|
|
|
+ <tr v-if="index==0">
|
|
|
+ <td style="text-align:center;background:#722ed1;color:#fff;">
|
|
|
+ <!-- 房号 -->
|
|
|
+ </td>
|
|
|
<td style="text-align:center;background:#722ed1;color:#fff;">
|
|
|
批量调价
|
|
|
</td>
|
|
|
@@ -928,24 +942,37 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<th>
|
|
|
- <td style="text-align:center;color:#722ed1;">
|
|
|
- <div>每日房价</div>
|
|
|
- <div v-if="model.roomPrices.length>0 && model.roomPrices[editPriceIndex]">
|
|
|
- <a-input-number v-model="model.roomPrices[editPriceIndex].prefPrice" @change="batchPrice"></a-input-number>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align:center;color:#722ed1;height:60px;width:100px;">
|
|
|
+ <div>房号</div>
|
|
|
+ <div style="line-height:30px">
|
|
|
+ {{item.roomNo}}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align:center;color:#722ed1;height:60px">
|
|
|
+ <div>每日房价</div>
|
|
|
+ <div>
|
|
|
+ <a-input-number :placeholder="item.marketPrice.toString()" @change="batchPrice($event, index)"></a-input-number>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
</th>
|
|
|
- <th style="display:flex;flex-wrap:wrap;">
|
|
|
- <td v-for="(item, index) in editPriceData" :key="index">
|
|
|
+ <th style="display:flex;flex-wrap:wrap;height:60px;overflow: auto;">
|
|
|
+ <td v-for="(sItem, sIndex) in item.edit" :key="sIndex">
|
|
|
<div style="text-align:center;">
|
|
|
- {{item.day}}
|
|
|
+ {{sItem.day}}
|
|
|
</div>
|
|
|
<div>
|
|
|
- <a-input-number v-model="item.price"></a-input-number>
|
|
|
+ <a-input-number v-model="sItem.price" />
|
|
|
</div>
|
|
|
</td>
|
|
|
</th>
|
|
|
</table>
|
|
|
+ </template>
|
|
|
</a-modal>
|
|
|
<member-card-modal ref="modalMemberCardInfo"></member-card-modal>
|
|
|
<agreement-unit-modal ref="modalAgreementUnitInfo"></agreement-unit-modal>
|
|
|
@@ -964,6 +991,7 @@ import MemberCardModal from "./MemberCardModal";
|
|
|
import AgreementUnitModal from "./AgreementUnitModal";
|
|
|
import AgreementUnitModalTable from "./AgreementUnitModalTable";
|
|
|
import HistoryModal from "./HistoryModal";
|
|
|
+import { set } from 'vue';
|
|
|
const columns = [
|
|
|
// {
|
|
|
// title: "",
|
|
|
@@ -988,23 +1016,24 @@ const columns = [
|
|
|
{
|
|
|
title: "优惠价",
|
|
|
dataIndex: "prefPrice",
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
scopedSlots: { customRender: "prefPrice" },
|
|
|
},
|
|
|
{
|
|
|
title: "天数",
|
|
|
dataIndex: "day",
|
|
|
- width: 60,
|
|
|
+ width: 50,
|
|
|
},
|
|
|
{
|
|
|
title: "房费",
|
|
|
dataIndex: "roomFee",
|
|
|
- width: 80,
|
|
|
+ width: 60,
|
|
|
},
|
|
|
{
|
|
|
title: "押金",
|
|
|
dataIndex: "deposit",
|
|
|
- // width: 60,
|
|
|
+ scopedSlots: { customRender: "deposit" },
|
|
|
+ width: 100,
|
|
|
},
|
|
|
];
|
|
|
|
|
|
@@ -1025,6 +1054,7 @@ const columns2 = [
|
|
|
title: "应缴",
|
|
|
dataIndex: "receivable",
|
|
|
width: "25%",
|
|
|
+ scopedSlots: { customRender: "prefPrice" },
|
|
|
},
|
|
|
{
|
|
|
title: "实收",
|
|
|
@@ -1055,11 +1085,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ editDepositModal: false,
|
|
|
//会员选中数据
|
|
|
vipCustomerData: {},
|
|
|
agreementUnitData: { customerName: "" },
|
|
|
busMarketAgreementCustomer: {},
|
|
|
- otherRoomSync: false,
|
|
|
+ otherRoomSync: true,
|
|
|
payPalModel: { list: [{ key1: "", key2: "", key3: "" }] },
|
|
|
depositSplit: true,
|
|
|
paymentSplit: true,
|
|
|
@@ -1160,34 +1191,74 @@ export default {
|
|
|
oldBusMarketAgreementUnitList: [],
|
|
|
busMarketAgreementUnitList: [],
|
|
|
ruZhuHistoryList: [],
|
|
|
+ remenmberPayState: null,
|
|
|
+ loadRemenmberPayState: false,
|
|
|
+ roomListCopy:[]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
editPriceData() {
|
|
|
- let arr = [];
|
|
|
- arr.length = this.model.orderInfo.dayCount;
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- arr[i] = {
|
|
|
- day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
- price:
|
|
|
- (this.model.roomPrices[this.editPriceIndex] &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].prefPrice) ||
|
|
|
- 0,
|
|
|
- };
|
|
|
- let idx =
|
|
|
- this.model.roomPrices[this.editPriceIndex] &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex(
|
|
|
- (item) => item == arr[i].day
|
|
|
- );
|
|
|
- if (idx > -1) {
|
|
|
- console.log(idx);
|
|
|
- arr[i].price =
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice[idx];
|
|
|
+ // let arr = [];
|
|
|
+ // arr.length = this.model.orderInfo.dayCount;
|
|
|
+ // for (let i = 0; i < arr.length; i++) {
|
|
|
+ // arr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:
|
|
|
+ // (this.model.roomPrices[this.editPriceIndex] &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].prefPrice) ||
|
|
|
+ // 0,
|
|
|
+ // };
|
|
|
+ // let idx =
|
|
|
+ // this.model.roomPrices[this.editPriceIndex] &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex(
|
|
|
+ // (item) => item == arr[i].day
|
|
|
+ // );
|
|
|
+ // if (idx > -1) {
|
|
|
+ // console.log(idx);
|
|
|
+ // arr[i].price = this.model.roomPrices[this.editPriceIndex].editPrice[idx];
|
|
|
+ // }
|
|
|
+ // arr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:0
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ console.log('99999999999999999999999',this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTimeSpan));
|
|
|
+ let copy = JSON.parse(JSON.stringify(this.model.roomPrices));
|
|
|
+ for (let i = 0; i < copy.length; i++) {
|
|
|
+ let money = copy[i].prefPrice;
|
|
|
+ let brr = [];
|
|
|
+ // brr.length = this.model.orderInfo.dayCount;
|
|
|
+ brr.length = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
|
|
|
+ for (let j = 0; j < brr.length; j++) {
|
|
|
+ brr[j] = {
|
|
|
+ day: this.addDate(this.model.orderInfo.arrivalTime2, j),
|
|
|
+ price: money,
|
|
|
+ };
|
|
|
+ if (
|
|
|
+ this.model.roomPrices[i].editPriceTime &&
|
|
|
+ this.model.roomPrices[i].editPriceTime.length > 0
|
|
|
+ ) {
|
|
|
+ let idx = this.model.roomPrices[i].editPriceTime.findIndex(
|
|
|
+ (item) => item == brr[j].day
|
|
|
+ );
|
|
|
+ if (idx > -1) {
|
|
|
+ brr[j].price = this.model.roomPrices[i].editPrice[idx];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ // brr.fill({day: this.addDate(this.model.orderInfo.arrivalTime2, i),price:money})
|
|
|
+ // brr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:money
|
|
|
+ // };
|
|
|
+ copy[i].edit = brr;
|
|
|
+ // copy[i].day = this.model.orderInfo.dayCount;
|
|
|
+ copy[i].day = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
|
|
|
}
|
|
|
- this.PriceData = arr;
|
|
|
- return arr;
|
|
|
+ console.log(copy);
|
|
|
+ this.PriceData = copy;
|
|
|
+ return copy;
|
|
|
},
|
|
|
|
|
|
formDisabled() {
|
|
|
@@ -1219,6 +1290,83 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
+ 'model.orderInfo.bookingType'(val,old){
|
|
|
+ debugger
|
|
|
+ if (val) {
|
|
|
+ this.model.orderInfo.dayCount = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
|
|
|
+ }
|
|
|
+ if(old == 2 && val == 3 || val == 4){
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ let arr = {}
|
|
|
+ arr = this.roomListCopy.filter(t=>t.roomId == item.roomId)[0]
|
|
|
+ item.marketPrice = arr.marketPrice
|
|
|
+ item.prefPrice = 0
|
|
|
+ item.roomFee = 0
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
+ if (val == 3 || val == 4) {
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ item.edit.forEach((ele) => {
|
|
|
+ ele.price = 0;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
+ if (val == 1 || val == 5) {
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ let arr = {}
|
|
|
+ arr = this.roomListCopy.filter(t=>t.roomId == item.roomId)[0]
|
|
|
+ console.log(arr);
|
|
|
+ item.marketPrice = arr.marketPrice
|
|
|
+ item.prefPrice = item.marketPrice
|
|
|
+ item.roomFee = item.marketPrice
|
|
|
+ item.edit.forEach((ele) => {
|
|
|
+ ele.price = item.prefPrice;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
+ if (val == 2) {
|
|
|
+ console.log(this.hourRoomRuleList);
|
|
|
+ let obj = this.hourRoomRuleList.filter(item=>item.id == this.model.orderInfo.hourRoomId)[0]
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ item.marketPrice = obj.afterOpenRoomPay
|
|
|
+ item.prefPrice = obj.afterOpenRoomPay
|
|
|
+ item.roomFee = obj.afterOpenRoomPay
|
|
|
+ if (item.edit) {
|
|
|
+ item.edit.forEach((ele) => {
|
|
|
+ ele.price = item.prefPrice;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ otherRoomSync(value) {
|
|
|
+ if (!value) {
|
|
|
+ if (this.modelDefault.roomIds && this.modelDefault.roomIds.length > 0) {
|
|
|
+ if (this.modelDefault.roomIds[0].key1) {
|
|
|
+ for (var i = 1; i < this.modelDefault.roomIds.length; i++) {
|
|
|
+ var room = this.modelDefault.roomIds[i];
|
|
|
+ if (!room.key1) {
|
|
|
+ this.$set(room, "key1", this.modelDefault.roomIds[0].key1);
|
|
|
+ this.$set(room, "key2", this.modelDefault.roomIds[0].key2);
|
|
|
+ this.$set(room, "key3", this.modelDefault.roomIds[0].key3);
|
|
|
+ this.$set(room, "key4", this.modelDefault.roomIds[0].key4);
|
|
|
+ this.$set(room, "key5", this.modelDefault.roomIds[0].key5);
|
|
|
+ this.$set(room, "key6", this.modelDefault.roomIds[0].key6);
|
|
|
+ this.$set(
|
|
|
+ room,
|
|
|
+ "customerId",
|
|
|
+ this.modelDefault.roomIds[0].customerId
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
depositSplit(value) {
|
|
|
if (!value) {
|
|
|
var yajin = this.model.roomPrices.reduce((sum, val) => {
|
|
|
@@ -1236,51 +1384,55 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
paymentSplit(value) {
|
|
|
- if (!value) {
|
|
|
- var list2 = this.model.orderFees.filter(
|
|
|
- (t) => t.subjectType == 2 && (!t.add || t.add != 1)
|
|
|
- );
|
|
|
- var list1 = this.model.orderFees.filter((t) => t.subjectType == 1);
|
|
|
- var list = this.model.orderFees.filter(
|
|
|
- (t) =>
|
|
|
- (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
|
|
|
- );
|
|
|
- list2.forEach((t) => {
|
|
|
- var yjList = list1.filter((b) => b.roomId == t.roomId);
|
|
|
- var yajin = yjList.reduce((sum, val) => {
|
|
|
- let total = sum + val.money;
|
|
|
- return isNaN(total) ? 0 : total;
|
|
|
- }, 0);
|
|
|
- t.yajing = yajin;
|
|
|
- t.money += yajin;
|
|
|
- t.receivable = t.money;
|
|
|
- });
|
|
|
- this.model.orderFees = [...list, ...list2];
|
|
|
- } else {
|
|
|
- // var list2 = this.model.orderFees.filter(
|
|
|
- // (t) => t.subjectType == 2 && (!t.add || t.add != 1)
|
|
|
- // );
|
|
|
- // var list1 = [];
|
|
|
+ if (this.loadRemenmberPayState) {
|
|
|
+ console.log(1111111, this.loadRemenmberPayState);
|
|
|
+ if (!value) {
|
|
|
+ var list2 = this.model.orderFees.filter(
|
|
|
+ (t) => t.subjectType == 2 && (!t.add || t.add != 1)
|
|
|
+ );
|
|
|
+ var list1 = this.model.orderFees.filter((t) => t.subjectType == 1);
|
|
|
+ var list = this.model.orderFees.filter(
|
|
|
+ (t) =>
|
|
|
+ (t.subjectType != 1 && t.subjectType != 2) ||
|
|
|
+ (t.add && t.add == 1)
|
|
|
+ );
|
|
|
+ list2.forEach((t) => {
|
|
|
+ var yjList = list1.filter((b) => b.roomId == t.roomId);
|
|
|
+ var yajin = yjList.reduce((sum, val) => {
|
|
|
+ let total = sum + val.money;
|
|
|
+ return isNaN(total) ? 0 : total;
|
|
|
+ }, 0);
|
|
|
+ t.yajing = yajin;
|
|
|
+ t.money += yajin;
|
|
|
+ t.receivable = t.money;
|
|
|
+ });
|
|
|
+ this.model.orderFees = [...list, ...list2];
|
|
|
+ } else {
|
|
|
+ // var list2 = this.model.orderFees.filter(
|
|
|
+ // (t) => t.subjectType == 2 && (!t.add || t.add != 1)
|
|
|
+ // );
|
|
|
+ // var list1 = [];
|
|
|
|
|
|
- // var list = this.model.orderFees.filter(
|
|
|
- // (t) =>
|
|
|
- // (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
|
|
|
- // );
|
|
|
- // list2.forEach((t) => {
|
|
|
- // if (t.yajing && t.yajing > 0) {
|
|
|
- // t.money -= t.yajing;
|
|
|
- // t.receivable = t.money;
|
|
|
- // var item = JSON.parse(JSON.stringify(t));
|
|
|
- // item.subjectType = 1;
|
|
|
- // item.money = t.yajing;
|
|
|
- // item.yajing = 0;
|
|
|
- // item.receivable = item.money;
|
|
|
- // list1.push(item);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // list = [...list, ...list1];
|
|
|
- // this.model.orderFees = [...list, ...list2];
|
|
|
- this.loadOrderFees();
|
|
|
+ // var list = this.model.orderFees.filter(
|
|
|
+ // (t) =>
|
|
|
+ // (t.subjectType != 1 && t.subjectType != 2) || (t.add && t.add == 1)
|
|
|
+ // );
|
|
|
+ // list2.forEach((t) => {
|
|
|
+ // if (t.yajing && t.yajing > 0) {
|
|
|
+ // t.money -= t.yajing;
|
|
|
+ // t.receivable = t.money;
|
|
|
+ // var item = JSON.parse(JSON.stringify(t));
|
|
|
+ // item.subjectType = 1;
|
|
|
+ // item.money = t.yajing;
|
|
|
+ // item.yajing = 0;
|
|
|
+ // item.receivable = item.money;
|
|
|
+ // list1.push(item);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // list = [...list, ...list1];
|
|
|
+ // this.model.orderFees = [...list, ...list2];
|
|
|
+ this.loadOrderFees();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// "model.roomIds": {
|
|
|
@@ -1439,6 +1591,25 @@ export default {
|
|
|
// this.getcesRoomLayout();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //计算两个日期之间相隔多少天
|
|
|
+ daysBetween(date1, date2) {
|
|
|
+ const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
|
|
|
+ const firstDate = new Date(date1);
|
|
|
+ const secondDate = new Date(date2);
|
|
|
+ if (secondDate<firstDate) {
|
|
|
+ this.$message.warning("离开时间不能小于预离时间");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
|
|
|
+ if (diffDays == 0) {
|
|
|
+ return 1
|
|
|
+ }
|
|
|
+ return diffDays;
|
|
|
+ },
|
|
|
+ priceInput(e, idx, sidx) {
|
|
|
+ console.log(e, idx, sidx);
|
|
|
+ this.editPriceData[idx].edit[sidx].price = e;
|
|
|
+ },
|
|
|
handleSearchAgreementUnit(value) {
|
|
|
let result;
|
|
|
if (!value) {
|
|
|
@@ -1481,18 +1652,15 @@ export default {
|
|
|
},
|
|
|
|
|
|
loadOrderFees() {
|
|
|
+ var arr = [];
|
|
|
+ if (!this.loadRemenmberPayState) {
|
|
|
+ arr = this.remenmberPayState.split("-");
|
|
|
+ this.paymentSplit = arr[0] == "1";
|
|
|
+ }
|
|
|
var orderFees = [];
|
|
|
var roomIndex = 0;
|
|
|
var payType = this.payTypeList[0];
|
|
|
- // roomNo: item.name,
|
|
|
- // roomId: item.id,
|
|
|
- // marketPrice: item.marketPrice,
|
|
|
- // prefPrice: item.marketPrice,
|
|
|
- // day: this.model.orderInfo.dayCount,
|
|
|
- // roomFee: item.marketPrice * this.model.orderInfo.dayCount,
|
|
|
- // deposit: this.compuleDeposit(item.marketPrice),
|
|
|
- // layoutName: roomLayout ? roomLayout.name : "",
|
|
|
- // layoutId: item.layoutId,
|
|
|
+
|
|
|
this.model.roomPrices.forEach((item) => {
|
|
|
var money = item.roomFee;
|
|
|
var deposit = item.deposit;
|
|
|
@@ -1500,15 +1668,52 @@ export default {
|
|
|
if (!this.paymentSplit) {
|
|
|
money = item.roomFee + deposit;
|
|
|
}
|
|
|
- orderFees.push({
|
|
|
- subjectType: 2,
|
|
|
- subjectTypeLabel: "预收房费",
|
|
|
- payType: payType ? payType.id : "",
|
|
|
- payTypeLabel: payType ? payType.name : "",
|
|
|
- receivable: money,
|
|
|
- money: money,
|
|
|
- roomId: this.model.roomIds[0].id,
|
|
|
- });
|
|
|
+ if (!this.paymentSplit) {
|
|
|
+ if (arr.length === 3) {
|
|
|
+ if (arr[1] == "1") {
|
|
|
+ orderFees.push({
|
|
|
+ subjectType: 2,
|
|
|
+ subjectTypeLabel: "预收房费",
|
|
|
+ payType: payType ? payType.id : "",
|
|
|
+ payTypeLabel: payType ? payType.name : "",
|
|
|
+ receivable: money,
|
|
|
+ money: money,
|
|
|
+ roomId: this.model.roomIds[0].id,
|
|
|
+ });
|
|
|
+ } else if (arr[1] == "2") {
|
|
|
+ orderFees.push({
|
|
|
+ subjectType: 1,
|
|
|
+ subjectTypeLabel: "押金",
|
|
|
+ payType: payType ? payType.id : "",
|
|
|
+ payTypeLabel: payType ? payType.name : "",
|
|
|
+ receivable: deposit,
|
|
|
+ money: deposit,
|
|
|
+ roomId: this.model.roomIds[0].id,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderFees.push({
|
|
|
+ subjectType: 2,
|
|
|
+ subjectTypeLabel: "预收房费",
|
|
|
+ payType: payType ? payType.id : "",
|
|
|
+ payTypeLabel: payType ? payType.name : "",
|
|
|
+ receivable: money,
|
|
|
+ money: money,
|
|
|
+ roomId: this.model.roomIds[0].id,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderFees.push({
|
|
|
+ subjectType: 2,
|
|
|
+ subjectTypeLabel: "预收房费",
|
|
|
+ payType: payType ? payType.id : "",
|
|
|
+ payTypeLabel: payType ? payType.name : "",
|
|
|
+ receivable: money,
|
|
|
+ money: money,
|
|
|
+ roomId: this.model.roomIds[0].id,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (this.paymentSplit) {
|
|
|
if (deposit > 0) {
|
|
|
orderFees.push({
|
|
|
@@ -1558,7 +1763,11 @@ export default {
|
|
|
}
|
|
|
roomIndex++;
|
|
|
});
|
|
|
+
|
|
|
this.model.orderFees = orderFees;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loadRemenmberPayState = true;
|
|
|
+ }, 100);
|
|
|
},
|
|
|
readCardNo() {
|
|
|
this.$message.error("接口程序未打开,请打开接口程序");
|
|
|
@@ -1680,9 +1889,12 @@ export default {
|
|
|
this.$refs.modalAgreementUnitTable.disableSubmit = true;
|
|
|
},
|
|
|
//批量调价
|
|
|
- batchPrice(e) {
|
|
|
+ batchPrice(e, index) {
|
|
|
console.log(e);
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // ele.price = e;
|
|
|
+ // });
|
|
|
+ this.editPriceData[index].edit.forEach((ele) => {
|
|
|
ele.price = e;
|
|
|
});
|
|
|
},
|
|
|
@@ -1708,10 +1920,7 @@ export default {
|
|
|
onCellExpand(idx) {
|
|
|
console.log(idx);
|
|
|
this.editPriceIndex = idx;
|
|
|
- console.log(
|
|
|
- "11111111111111111111111",
|
|
|
- this.model.roomPrices[this.editPriceIndex]
|
|
|
- );
|
|
|
+ console.log("11111111111111111111111", this.model.roomPrices);
|
|
|
this.editPriceModal = true;
|
|
|
},
|
|
|
|
|
|
@@ -1719,25 +1928,50 @@ export default {
|
|
|
* 修改完成
|
|
|
*/
|
|
|
editPriceOk() {
|
|
|
- console.log(this.editPriceData);
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice = [];
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day);
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price);
|
|
|
- });
|
|
|
console.log(this.model.roomPrices);
|
|
|
- this.model.roomPrices[this.editPriceIndex].prefPrice =
|
|
|
- this.editPriceData[0].price;
|
|
|
- this.onCellChange(
|
|
|
- "prefPrice",
|
|
|
- this.editPriceIndex,
|
|
|
- this.editPriceData[0].price
|
|
|
- );
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
- ele.prcie = 0;
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPrice = [];
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day);
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price);
|
|
|
+ // });
|
|
|
+ // console.log(this.model.roomPrices);
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].prefPrice =
|
|
|
+ // this.editPriceData[0].price;
|
|
|
+ // this.onCellChange(
|
|
|
+ // "prefPrice",
|
|
|
+ // this.editPriceIndex,
|
|
|
+ // this.editPriceData[0].price
|
|
|
+ // );
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // ele.price = 0;
|
|
|
+ // });
|
|
|
+ this.model.roomPrices = JSON.parse(JSON.stringify(this.editPriceData));
|
|
|
+ this.model.roomPrices.forEach((ele, index) => {
|
|
|
+ ele.editPriceTime = [];
|
|
|
+ ele.editPrice = [];
|
|
|
+ ele.edit.forEach((t, tdx) => {
|
|
|
+ ele.editPriceTime.push(t.day), ele.editPrice.push(t.price);
|
|
|
+ });
|
|
|
+ ele.prefPrice = ele.edit[0].price;
|
|
|
});
|
|
|
- console.log(this.editPriceData);
|
|
|
+ // this.editPriceData.forEach((ele, index) => {
|
|
|
+ // if (this.model.roomPrices[index].roomId==ele.roomId) {
|
|
|
+ // this.model.roomPrices[index].editPriceTime = [];
|
|
|
+ // this.model.roomPrices[index].editPrice = [];
|
|
|
+ // ele.edit.forEach(t=>{
|
|
|
+ // this.model.roomPrices[index].editPriceTime.push(t.day);
|
|
|
+ // this.model.roomPrices[index].editPrice.push(t.price);
|
|
|
+ // this.model.roomPrices[index].prefPrice = ele.edit[0].price;
|
|
|
+ // })
|
|
|
+ // this.onCellChange(
|
|
|
+ // "prefPrice",
|
|
|
+ // index,
|
|
|
+ // ele.edit[0].price
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ console.log(this.model.roomPrices);
|
|
|
this.editPriceModal = false;
|
|
|
|
|
|
var sum = 0;
|
|
|
@@ -1871,6 +2105,18 @@ export default {
|
|
|
"HH:mm"
|
|
|
);
|
|
|
}
|
|
|
+ let obj = this.hourRoomRuleList.filter(item=>item.id == this.model.orderInfo.hourRoomId)[0]
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ item.marketPrice = obj.afterOpenRoomPay
|
|
|
+ item.prefPrice = obj.afterOpenRoomPay
|
|
|
+ item.roomFee = obj.afterOpenRoomPay
|
|
|
+ if (item.edit) {
|
|
|
+ item.edit.forEach((ele) => {
|
|
|
+ ele.price = item.prefPrice;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
}
|
|
|
this.loadRooms();
|
|
|
},
|
|
|
@@ -1900,6 +2146,11 @@ export default {
|
|
|
"HH:mm"
|
|
|
);
|
|
|
}
|
|
|
+ this.model.orderInfo.dayCount = this.daysBetween(
|
|
|
+ this.model.orderInfo.arrivalTime2,
|
|
|
+ this.model.orderInfo.dueOutTime2
|
|
|
+ );
|
|
|
+ this.dayCountChange()
|
|
|
} else if (this.model.orderInfo.bookingType === 1) {
|
|
|
var mDate = moment(this.model.orderInfo.arrivalTime2).add(1, "days");
|
|
|
this.model.orderInfo.dueOutTime2 = mDate.format("YYYY-MM-DD");
|
|
|
@@ -1924,6 +2175,7 @@ export default {
|
|
|
this.editPriceOk();
|
|
|
i++;
|
|
|
});
|
|
|
+ console.log(this.model.roomPrices);
|
|
|
},
|
|
|
disabledDate(current) {
|
|
|
return current && current < moment().add(-1, "days").endOf("day");
|
|
|
@@ -2014,6 +2266,7 @@ export default {
|
|
|
this.$set(room, "customerId", find.id);
|
|
|
},
|
|
|
pulsRoom() {
|
|
|
+ console.log(this.canUserRooms);
|
|
|
this.$refs.modalSelectRoomForm.add(this.canUserRooms);
|
|
|
this.$refs.modalSelectRoomForm.title = "选择房间";
|
|
|
this.$refs.modalSelectRoomForm.disableSubmit = false;
|
|
|
@@ -2052,6 +2305,73 @@ export default {
|
|
|
// this.amount = sum;
|
|
|
// console.log("this.model.roomPrices", this.model.roomPrices);
|
|
|
},
|
|
|
+ onCellChangeCopy(key, dataIndex, value) {
|
|
|
+ console.log(key, value);
|
|
|
+ console.log(this.depositRule);
|
|
|
+ console.log(this.model.roomPrices[dataIndex]);
|
|
|
+ const dataSource = [...this.model.roomPrices];
|
|
|
+ const target = dataSource[dataIndex];
|
|
|
+ console.log("target", target);
|
|
|
+ if (target) {
|
|
|
+ target[key] = value;
|
|
|
+ // target.roomFee = value * target.day;
|
|
|
+ // target.deposit = this.compuleDeposit(value);
|
|
|
+ this.model.roomPrices = dataSource;
|
|
|
+ }
|
|
|
+ // this.editPriceData.forEach(ele=>{
|
|
|
+ // if (target.roomId==ele.roomId) {
|
|
|
+ // ele.deposit = target.deposit
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ var sum = 0;
|
|
|
+ var money2 = 0;
|
|
|
+ var deposit2 = 0;
|
|
|
+ for (var i = 0; i < this.model.roomPrices.length; i++) {
|
|
|
+ var money = 0;
|
|
|
+ var item = this.model.roomPrices[i];
|
|
|
+ if (item.editPrice && item.editPrice.length > 0) {
|
|
|
+ item.editPrice.forEach((p) => {
|
|
|
+ money += p;
|
|
|
+ });
|
|
|
+ item.roomFee = money;
|
|
|
+ sum += money + item.deposit;
|
|
|
+ } else {
|
|
|
+ sum += item.roomFee + item.deposit;
|
|
|
+ }
|
|
|
+
|
|
|
+ money2 += item.roomFee;
|
|
|
+ deposit2 += item.deposit;
|
|
|
+ // var find = this.model.orderFees.find(
|
|
|
+ // (t) =>
|
|
|
+ // t.subjectType == 2 &&
|
|
|
+ // t.roomId == this.model.roomPrices[this.editPriceIndex].roomId
|
|
|
+ // );
|
|
|
+ // if (find && find.roomId == item.roomId) {
|
|
|
+ // find.money = money;
|
|
|
+ // find.receivable = money;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ var find = this.model.orderFees.find(
|
|
|
+ (t) => t.subjectType == 2 && t.roomId == this.model.roomIds[0].id
|
|
|
+ );
|
|
|
+ if (find) {
|
|
|
+ find.money = money2;
|
|
|
+ find.receivable = money2;
|
|
|
+ if (!this.paymentSplit) {
|
|
|
+ find.money += deposit2;
|
|
|
+ find.receivable += deposit2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var find2 = this.model.orderFees.find(
|
|
|
+ (t) => t.subjectType == 1 && t.roomId == this.model.roomIds[0].id
|
|
|
+ );
|
|
|
+ if (find2) {
|
|
|
+ find2.money = deposit2;
|
|
|
+ find2.receivable = deposit2;
|
|
|
+ }
|
|
|
+ this.amount = sum;
|
|
|
+ },
|
|
|
// handleChange(value, index, column) {
|
|
|
// const newData = [...this.data2];
|
|
|
// const target = newData[index];
|
|
|
@@ -2168,7 +2488,7 @@ export default {
|
|
|
console.log("e", e);
|
|
|
this.model.roomPrices = this.model.roomPrices.filter((t) =>
|
|
|
e.some((r) => r.id == t.roomId)
|
|
|
- );
|
|
|
+ );
|
|
|
this.model.orderFees = this.model.orderFees.filter((t) =>
|
|
|
e.some((r) => r.id == t.roomId)
|
|
|
);
|
|
|
@@ -2215,7 +2535,20 @@ export default {
|
|
|
});
|
|
|
this.modelDefault.roomIds = [...[mainRoom], ...sortRooms];
|
|
|
}
|
|
|
+ console.log(this.modelDefault);
|
|
|
console.log(" this.modelDefault.roomIds", this.modelDefault.roomIds);
|
|
|
+ this.canUserRooms[0].buildingRooms.forEach((ele) => {
|
|
|
+ ele.floorRooms.forEach((b) => {
|
|
|
+ b.check = 0;
|
|
|
+ });
|
|
|
+ this.modelDefault.roomIds.forEach((t) => {
|
|
|
+ ele.floorRooms.forEach((b) => {
|
|
|
+ if (b.id == t.id) {
|
|
|
+ b.check = 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
this.edit(this.modelDefault);
|
|
|
},
|
|
|
compuleDeposit(prefPrice) {
|
|
|
@@ -2247,10 +2580,12 @@ export default {
|
|
|
roomIds: JSON.parse(JSON.stringify(roomLiveList)),
|
|
|
});
|
|
|
this.modelDefault.orderInfo.bookingOrdersType = key;
|
|
|
+ this.model.orderInfo.bookingOrdersType = key;
|
|
|
this.edit(this.modelDefault);
|
|
|
},
|
|
|
async edit(record) {
|
|
|
console.log("edit", record);
|
|
|
+ this.activeKey = record.roomIds[0].id;
|
|
|
this.visible = true;
|
|
|
this.model = Object.assign({}, record);
|
|
|
console.log("this.model", this.model);
|
|
|
@@ -2260,6 +2595,9 @@ export default {
|
|
|
if (this.payTypeList == 0) {
|
|
|
await this.getbusRoomPayType();
|
|
|
}
|
|
|
+ if (!this.remenmberPayState) {
|
|
|
+ await this.getHotelInfo();
|
|
|
+ }
|
|
|
if (this.customerSourceList) {
|
|
|
if (!this.model.orderInfo.customerSource) {
|
|
|
this.model.orderInfo.customerSource = this.customerSourceList[0].id;
|
|
|
@@ -2396,6 +2734,37 @@ export default {
|
|
|
// roomIndex++;
|
|
|
});
|
|
|
this.model.roomPrices = [...this.model.roomPrices, ...roomPrices];
|
|
|
+ if (this.roomListCopy.length==0) {
|
|
|
+ this.roomListCopy = JSON.parse(JSON.stringify(this.model.roomPrices));
|
|
|
+ }else{
|
|
|
+ this.roomListCopy = [...this.roomListCopy,...roomPrices]
|
|
|
+ }
|
|
|
+ // let type = JSON.parse(JSON.stringify(this.model.orderInfo.bookingType))
|
|
|
+ // this.model.orderInfo.bookingType = 9999
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.model.orderInfo.bookingType = type
|
|
|
+ // }, 100);
|
|
|
+ if(this.model.orderInfo.bookingType==3 || this.model.orderInfo.bookingType==4){
|
|
|
+ this.model.roomPrices.forEach(ele=>{
|
|
|
+ ele.prefPrice = 0
|
|
|
+ ele.roomFee = 0
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
+ if (this.model.orderInfo.bookingType == 2) {
|
|
|
+ let obj = this.hourRoomRuleList.filter(item=>item.id == this.model.orderInfo.hourRoomId)[0]
|
|
|
+ this.editPriceData.forEach(item=>{
|
|
|
+ item.marketPrice = obj.afterOpenRoomPay
|
|
|
+ item.prefPrice = obj.afterOpenRoomPay
|
|
|
+ item.roomFee = obj.afterOpenRoomPay
|
|
|
+ if (item.edit) {
|
|
|
+ item.edit.forEach((ele) => {
|
|
|
+ ele.price = item.prefPrice;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.editPriceOk()
|
|
|
+ }
|
|
|
if (this.model.roomPrices && this.model.roomPrices.length > 2) {
|
|
|
var mainRoom = this.model.roomPrices[0];
|
|
|
var sortRooms = this.model.roomPrices
|
|
|
@@ -2416,6 +2785,16 @@ export default {
|
|
|
// this.model.orderFees = [...this.model.orderFees, ...orderFees];
|
|
|
}
|
|
|
},
|
|
|
+ async getHotelInfo() {
|
|
|
+ var _info = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
+ await getAction("/business/busHotel/queryById", { id: _info.id }).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.remenmberPayState = res.result.remenmberPayState || "1-1-2";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
const that = this;
|
|
|
that.model.livingRoomDayPrices = [];
|
|
|
@@ -2485,6 +2864,9 @@ export default {
|
|
|
httpurl += this.url.edit;
|
|
|
method = "put";
|
|
|
}
|
|
|
+ console.log(this.model);
|
|
|
+ // return
|
|
|
+ // this.model.orderInfo.bookingOrdersType = this.modelDefault.orderInfo.bookingOrdersType;
|
|
|
// if (this.model.orderInfo.bookingOrdersId) {
|
|
|
// httpurl = "/business/busRoomBookingOrders/add-batch";
|
|
|
// method = "post";
|
|
|
@@ -2495,7 +2877,16 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
|
- that.$emit("ok", {order:res.result, model:that.model});
|
|
|
+ that.$emit("ok", { order: res.result, model: that.model });
|
|
|
+ var arr = [
|
|
|
+ that.paymentSplit ? 1 : 2,
|
|
|
+ this.model.orderFees[0].subjectType == 1 ? 2 : 1,
|
|
|
+ this.model.orderFees[0].subjectType == 1 ? 2 : 1,
|
|
|
+ ];
|
|
|
+ getAction("/business/busHotel/set-pay-state", {
|
|
|
+ hotelId: this.model.hotelId,
|
|
|
+ type: arr.join("-"),
|
|
|
+ }).then((res) => {});
|
|
|
} else {
|
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
|
that.$confirm({
|
|
|
@@ -2507,7 +2898,10 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
|
- that.$emit("ok", {order:res.result, model:that.model});
|
|
|
+ that.$emit("ok", {
|
|
|
+ order: res.result,
|
|
|
+ model: that.model,
|
|
|
+ });
|
|
|
} else {
|
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
|
} else {
|