|
|
@@ -1,6 +1,31 @@
|
|
|
<template>
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
- <j-form-container :disabled="formDisabled">
|
|
|
+ <div style="gap: 10px; display: flex; margin: 10px">
|
|
|
+ <a-button
|
|
|
+ v-if="disabled && model.orderInfo.bookingStatus == 1"
|
|
|
+ @click="disabled = false"
|
|
|
+ >修改预定</a-button
|
|
|
+ >
|
|
|
+ <a-button v-if="!disabled" @click="editOrder">确认修改</a-button>
|
|
|
+ <a-button v-if="!disabled" @click="cancelOrder">取消修改</a-button>
|
|
|
+ <a-button
|
|
|
+ v-if="disabled && model.orderInfo.bookingStatus == 1"
|
|
|
+ @click="setOrderStatus(2)"
|
|
|
+ >取消预定</a-button
|
|
|
+ >
|
|
|
+ <a-button
|
|
|
+ v-if="model.orderInfo.bookingStatus == 2"
|
|
|
+ @click="setOrderStatus(1)"
|
|
|
+ >恢复预定</a-button
|
|
|
+ >
|
|
|
+ <a-button v-if="model.orderInfo.bookingStatus == 2" @click="deleteOrder"
|
|
|
+ >删除预定</a-button
|
|
|
+ >
|
|
|
+ <a-button v-if="disabled && model.orderInfo.bookingStatus == 1"
|
|
|
+ >合并联房</a-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <j-form-container>
|
|
|
<a-form-model
|
|
|
ref="form"
|
|
|
:model="model"
|
|
|
@@ -14,6 +39,15 @@
|
|
|
订价信息
|
|
|
</h4>
|
|
|
<a-divider />
|
|
|
+ <a-col :span="24" v-if="disabled">
|
|
|
+ <a-form-model-item
|
|
|
+ label="预定单号"
|
|
|
+ :labelCol="labelCol"
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
+ >
|
|
|
+ {{ model.orderInfo.bookingOrdersNo }}
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-model-item
|
|
|
label="入住类型"
|
|
|
@@ -22,6 +56,7 @@
|
|
|
prop="orderInfo.bookingType"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="入住类型"
|
|
|
v-model="model.orderInfo.bookingType"
|
|
|
@change="bookingTypeChange"
|
|
|
@@ -40,6 +75,7 @@
|
|
|
prop="orderInfo.arrivalTime2"
|
|
|
>
|
|
|
<j-date
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="预抵时间"
|
|
|
v-model="model.orderInfo.arrivalTime2"
|
|
|
style="width: 180px"
|
|
|
@@ -48,6 +84,7 @@
|
|
|
@change="arrivalTimeChange"
|
|
|
/>
|
|
|
<a-time-picker
|
|
|
+ :disabled="disabled"
|
|
|
style="width: 80px; margin-left: 2px"
|
|
|
v-model="model.orderInfo.arrivalTimeSpan"
|
|
|
:default-value="moment('12:00', 'HH:mm')"
|
|
|
@@ -64,6 +101,7 @@
|
|
|
prop="orderInfo.dueOutTime2"
|
|
|
>
|
|
|
<j-date
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="预离时间"
|
|
|
v-model="model.orderInfo.dueOutTime2"
|
|
|
style="width: 180px"
|
|
|
@@ -72,6 +110,7 @@
|
|
|
@change="arrivalTimeChange"
|
|
|
/>
|
|
|
<a-time-picker
|
|
|
+ :disabled="disabled"
|
|
|
style="width: 80px; margin-left: 2px"
|
|
|
v-model="model.orderInfo.dueOutTimeSpan"
|
|
|
format="HH:mm"
|
|
|
@@ -87,6 +126,7 @@
|
|
|
prop="orderInfo.customerSource"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="客人来源"
|
|
|
v-model="model.orderInfo.customerSource"
|
|
|
>
|
|
|
@@ -108,6 +148,7 @@
|
|
|
prop="orderInfo.hourRoomId"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="时长"
|
|
|
v-model="model.orderInfo.hourRoomId"
|
|
|
>
|
|
|
@@ -129,6 +170,7 @@
|
|
|
prop="orderInfo.dayCount"
|
|
|
>
|
|
|
<a-input-number
|
|
|
+ :disabled="disabled"
|
|
|
v-model="model.orderInfo.dayCount"
|
|
|
placeholder="天数"
|
|
|
:min="1"
|
|
|
@@ -145,6 +187,7 @@
|
|
|
prop="orderInfo.breakfastNum"
|
|
|
>
|
|
|
<a-input-number
|
|
|
+ :disabled="disabled"
|
|
|
v-model="model.orderInfo.breakfastNum"
|
|
|
placeholder="早餐"
|
|
|
:min="0"
|
|
|
@@ -159,6 +202,7 @@
|
|
|
prop="orderInfo.bookingDicWay"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="预定方式"
|
|
|
v-model="model.orderInfo.bookingDicWay"
|
|
|
>
|
|
|
@@ -180,6 +224,7 @@
|
|
|
prop="orderInfo.customerType"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="客人类型"
|
|
|
v-model="model.orderInfo.customerType"
|
|
|
>
|
|
|
@@ -198,6 +243,7 @@
|
|
|
prop="orderInfo.roomPriceSlnId"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="房价方案"
|
|
|
v-model="model.orderInfo.roomPriceSlnId"
|
|
|
>
|
|
|
@@ -218,15 +264,18 @@
|
|
|
prop="contactName"
|
|
|
>
|
|
|
<a-auto-complete
|
|
|
+ :disabled="disabled"
|
|
|
v-model="model.contactName"
|
|
|
placeholder="联系人"
|
|
|
@search="handleSearch"
|
|
|
@select="(e) => handleSelectMember(e)"
|
|
|
>
|
|
|
<template slot="dataSource">
|
|
|
- <a-select-option v-for="item in result" :key="item">{{
|
|
|
- item
|
|
|
- }}</a-select-option>
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in customerList"
|
|
|
+ :key="item.id"
|
|
|
+ >{{ item }}</a-select-option
|
|
|
+ >
|
|
|
</template>
|
|
|
</a-auto-complete>
|
|
|
</a-form-model-item>
|
|
|
@@ -238,7 +287,11 @@
|
|
|
:wrapperCol="wrapperCol"
|
|
|
prop="phone"
|
|
|
>
|
|
|
- <a-input v-model="model.phone" placeholder="电话"></a-input>
|
|
|
+ <a-input
|
|
|
+ :disabled="disabled"
|
|
|
+ v-model="model.phone"
|
|
|
+ placeholder="电话"
|
|
|
+ ></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
@@ -249,6 +302,7 @@
|
|
|
prop="orderInfo.warrantType"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="担保方式"
|
|
|
v-model="model.orderInfo.warrantType"
|
|
|
>
|
|
|
@@ -266,6 +320,7 @@
|
|
|
prop="orderInfo.warranter"
|
|
|
>
|
|
|
<a-select
|
|
|
+ :disabled="disabled"
|
|
|
placeholder="销售员"
|
|
|
v-model="model.orderInfo.warranter"
|
|
|
>
|
|
|
@@ -287,6 +342,7 @@
|
|
|
prop="orderInfo.outerOrdersNo"
|
|
|
>
|
|
|
<a-input
|
|
|
+ :disabled="disabled"
|
|
|
v-model="model.orderInfo.outerOrdersNo"
|
|
|
placeholder="外部单号"
|
|
|
></a-input>
|
|
|
@@ -300,6 +356,7 @@
|
|
|
prop="orderInfo.remark"
|
|
|
>
|
|
|
<a-textarea
|
|
|
+ :disabled="disabled"
|
|
|
v-model="model.orderInfo.remark"
|
|
|
rows="4"
|
|
|
placeholder="备注"
|
|
|
@@ -307,17 +364,92 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
</div>
|
|
|
- <div style="width: 61%">
|
|
|
+ <div style="width: 61%" v-if="disabled">
|
|
|
<h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
|
|
|
选择房间
|
|
|
</h4>
|
|
|
<a-divider />
|
|
|
- <p>
|
|
|
- <span>占房天数:{{ model.orderInfo.dayCount }}晚</span>
|
|
|
- <span style="padding-left: 10px">总价:{{ amount }}</span>
|
|
|
- </p>
|
|
|
+ <div style="display: flex; justify-content: space-between">
|
|
|
+ <div>
|
|
|
+ <span>房间数:{{ model.roomIds.length }}间</span>
|
|
|
+ <span style="padding-left: 10px"
|
|
|
+ >占房天数:{{ model.orderInfo.dayCount }}晚</span
|
|
|
+ >
|
|
|
+ <span style="padding-left: 10px">总价:{{ amount2 }}</span>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; gap: 10px">
|
|
|
+ <a-button>制房卡</a-button>
|
|
|
+ <a-button>批量排房</a-button>
|
|
|
+ <a-button>批量入住</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<a-table
|
|
|
:columns="columns"
|
|
|
+ :data-source="model.roomIds"
|
|
|
+ :pagination="false"
|
|
|
+ rowKey="id"
|
|
|
+ >
|
|
|
+ <template slot="favPrice" slot-scope="text, record, index">
|
|
|
+ {{ record.layout.favPrice }}
|
|
|
+ </template>
|
|
|
+ <template slot="presetNum" slot-scope="text, record, index">
|
|
|
+ <div>
|
|
|
+ <a-input-number
|
|
|
+ v-model="record.layout.presetNum"
|
|
|
+ :min="(record.rooms || []).length"
|
|
|
+ :max="record.layout.oldTags"
|
|
|
+ @change="presetNumChange($event, record)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <span slot="selectRoom" slot-scope="text, record, index">
|
|
|
+ <a-button type="link" @click="pulsRoom2(record, index)">{{
|
|
|
+ text ? text : "排房"
|
|
|
+ }}</a-button>
|
|
|
+ </span>
|
|
|
+ <span slot="action" slot-scope="text, record, index">
|
|
|
+ <div style="gap: 10px; display: flex">
|
|
|
+ <a-button
|
|
|
+ v-if="record.roomStatus != 3 && record.roomStatus != 4"
|
|
|
+ size="small"
|
|
|
+ >入住</a-button
|
|
|
+ >
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ v-if="!record.isMain"
|
|
|
+ @click="setMain(record.id)"
|
|
|
+ >设主房</a-button
|
|
|
+ >
|
|
|
+ <a-button v-if="record.roomStatus == 3" size="small"
|
|
|
+ >查看详单</a-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <template slot="zhu" slot-scope="text, record, index">
|
|
|
+ <span
|
|
|
+ v-if="text == true"
|
|
|
+ class="booking_circle_span orange_color"
|
|
|
+ >主</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ <div style="width: 61%" v-else>
|
|
|
+ <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">
|
|
|
+ 选择房间
|
|
|
+ </h4>
|
|
|
+ <a-divider />
|
|
|
+ <div style="display: flex; justify-content: space-between">
|
|
|
+ <div>
|
|
|
+ <span style="padding-left: 10px"
|
|
|
+ >占房天数:{{ model.orderInfo.dayCount }}晚</span
|
|
|
+ >
|
|
|
+ <span style="padding-left: 10px">总价:{{ amount }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <a-table
|
|
|
+ :columns="columns2"
|
|
|
:data-source="canUserRooms"
|
|
|
:pagination="false"
|
|
|
:rowKey="rowKey"
|
|
|
@@ -393,11 +525,15 @@
|
|
|
ref="modalSelectRoomForm"
|
|
|
@ok="modalFormOk"
|
|
|
></select-room-form-modal>
|
|
|
+ <select-room-form-modal
|
|
|
+ ref="modalSelectRoomForm2"
|
|
|
+ @ok="modalFormOk2"
|
|
|
+ ></select-room-form-modal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { httpAction, getAction, postAction } from "@/api/manage";
|
|
|
+import { httpAction, getAction, postAction, deleteAction } from "@/api/manage";
|
|
|
import { validateDuplicateValue } from "@/utils/util";
|
|
|
import moment from "moment";
|
|
|
import EditableCell from "@views/room/modules/checkIn/EditableCell.vue";
|
|
|
@@ -405,48 +541,33 @@ import SelectRoomFormModal from "./SelectRoomFormModal.vue";
|
|
|
const date = new Date();
|
|
|
const endDate = new Date(date.setDate(date.getDate() + 1));
|
|
|
const columns = [
|
|
|
- // {
|
|
|
- // title: "",
|
|
|
- // dataIndex: "key",
|
|
|
- // width: 20,
|
|
|
- // },
|
|
|
{
|
|
|
- title: "房型",
|
|
|
- dataIndex: "name",
|
|
|
- width: 150,
|
|
|
- customRender: function (text, record) {
|
|
|
- return record.layout.name;
|
|
|
- },
|
|
|
+ title: "",
|
|
|
+ dataIndex: "isMain",
|
|
|
+ width: 50,
|
|
|
+ scopedSlots: { customRender: "zhu" },
|
|
|
},
|
|
|
{
|
|
|
- title: "门市价",
|
|
|
- dataIndex: "marketPrice",
|
|
|
- width: 100,
|
|
|
- customRender: function (text, record) {
|
|
|
- return record.layout.marketPrice;
|
|
|
- },
|
|
|
+ title: "排房",
|
|
|
+ dataIndex: "roomName",
|
|
|
+ scopedSlots: { customRender: "selectRoom" },
|
|
|
},
|
|
|
{
|
|
|
- title: "优惠价",
|
|
|
- dataIndex: "favPrice",
|
|
|
- width: 120,
|
|
|
- scopedSlots: { customRender: "favPrice" },
|
|
|
+ title: "房型",
|
|
|
+ dataIndex: "layoutName",
|
|
|
},
|
|
|
{
|
|
|
- title: "可订数/可超数",
|
|
|
- dataIndex: "canUseCount",
|
|
|
- width: 170,
|
|
|
+ title: "房价",
|
|
|
+ dataIndex: "marketPrice",
|
|
|
customRender: function (text, record) {
|
|
|
- return record.layout.canUseCount + "/0";
|
|
|
+ var price = 0;
|
|
|
+ if (record.layoutDayPrices && record.layoutDayPrices.length > 0) {
|
|
|
+ price = record.layoutDayPrices[0].price;
|
|
|
+ }
|
|
|
+ return price;
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: "预定间数",
|
|
|
- dataIndex: "presetNum",
|
|
|
- width: 100,
|
|
|
- scopedSlots: { customRender: "presetNum" },
|
|
|
- },
|
|
|
- {
|
|
|
title: "操作",
|
|
|
dataIndex: "action",
|
|
|
align: "center",
|
|
|
@@ -472,20 +593,71 @@ export default {
|
|
|
components: { EditableCell, SelectRoomFormModal },
|
|
|
props: {
|
|
|
//表单禁用
|
|
|
- disabled: {
|
|
|
+ disabled2: {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
- required: false,
|
|
|
},
|
|
|
id: {
|
|
|
- type: Boolean,
|
|
|
+ type: String,
|
|
|
default: "",
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ disabled: false,
|
|
|
visible: true,
|
|
|
columns,
|
|
|
+ columns2: [
|
|
|
+ // {
|
|
|
+ // title: "",
|
|
|
+ // dataIndex: "key",
|
|
|
+ // width: 20,
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: "房型",
|
|
|
+ dataIndex: "name",
|
|
|
+ width: 150,
|
|
|
+ customRender: function (text, record) {
|
|
|
+ return record.layout.name;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "门市价",
|
|
|
+ dataIndex: "marketPrice",
|
|
|
+ width: 100,
|
|
|
+ customRender: function (text, record) {
|
|
|
+ return record.layout.marketPrice;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "优惠价",
|
|
|
+ dataIndex: "favPrice",
|
|
|
+ width: 120,
|
|
|
+ scopedSlots: { customRender: "favPrice" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "可订数/可超数",
|
|
|
+ dataIndex: "canUseCount",
|
|
|
+ width: 170,
|
|
|
+ customRender: function (text, record) {
|
|
|
+ return record.layout.canUseCount + "/0";
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "预定间数",
|
|
|
+ dataIndex: "presetNum",
|
|
|
+ width: 100,
|
|
|
+ scopedSlots: { customRender: "presetNum" },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "action",
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
+ width: 70,
|
|
|
+ scopedSlots: { customRender: "action" },
|
|
|
+ },
|
|
|
+ ],
|
|
|
model: {
|
|
|
// data: data,
|
|
|
orderInfo: {
|
|
|
@@ -536,7 +708,7 @@ export default {
|
|
|
},
|
|
|
url: {
|
|
|
add: "/business/busRoomBookingOrders/add",
|
|
|
- edit: "/business/busMeetingRoom/edit",
|
|
|
+ edit: "/business/busRoomBookingOrders/edit",
|
|
|
getBookingOrderInfo:
|
|
|
"/business/busRoomBookingOrders/getBookingOrderInfo",
|
|
|
},
|
|
|
@@ -547,6 +719,9 @@ export default {
|
|
|
warranterList: [],
|
|
|
hourRoomRuleList: [],
|
|
|
canUserRooms: [],
|
|
|
+ canUserRooms2: [],
|
|
|
+ customerList: [],
|
|
|
+ oldcustomerList: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -560,8 +735,18 @@ export default {
|
|
|
});
|
|
|
return sum.toFixed(2);
|
|
|
},
|
|
|
+ amount2() {
|
|
|
+ var sum = 0;
|
|
|
+ this.model.roomIds.forEach((t) => {
|
|
|
+ t.layoutDayPrices.forEach((p) => {
|
|
|
+ sum += p.price;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return sum.toFixed(2);
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
+ this.disabled = this.disabled2;
|
|
|
var _info = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
if (_info) {
|
|
|
this.model.hotelId = _info.id;
|
|
|
@@ -603,35 +788,95 @@ export default {
|
|
|
this.hourRoomRuleList = res.result.records;
|
|
|
}
|
|
|
});
|
|
|
+ // postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
|
|
|
+ // (res) => {
|
|
|
+ // if (res.success) {
|
|
|
+ // if (
|
|
|
+ // res.result &&
|
|
|
+ // res.result.cesAllDayPriceRule &&
|
|
|
+ // res.result.cesAllDayPriceRule.leaveTime
|
|
|
+ // ) {
|
|
|
+ // this.model.orderInfo.dueOutTimeSpan = moment(
|
|
|
+ // res.result.cesAllDayPriceRule.leaveTime,
|
|
|
+ // "HH:mm"
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- postAction("/rooms/cesAllDayPriceRule/fetch", { hotelId: _info.id }).then(
|
|
|
- (res) => {
|
|
|
+ // this.loadRooms();
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ this.getBookingOrderInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getBookingOrderInfo() {
|
|
|
+ getAction(this.url.getBookingOrderInfo, {
|
|
|
+ bookingNo: this.id,
|
|
|
+ }).then((res) => {
|
|
|
if (res.success) {
|
|
|
- if (
|
|
|
- res.result &&
|
|
|
- res.result.cesAllDayPriceRule &&
|
|
|
- res.result.cesAllDayPriceRule.leaveTime
|
|
|
- ) {
|
|
|
- this.model.orderInfo.dueOutTimeSpan = moment(
|
|
|
- res.result.cesAllDayPriceRule.leaveTime,
|
|
|
- "HH:mm"
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
+ this.model = res.result;
|
|
|
+ this.model.orderInfo.arrivalTime2 = moment(
|
|
|
+ this.model.orderInfo.arrivalTime
|
|
|
+ ).format("YYYY-MM-DD");
|
|
|
+ this.model.orderInfo.dueOutTime2 = moment(
|
|
|
+ this.model.orderInfo.dueOutTime
|
|
|
+ ).format("YYYY-MM-DD");
|
|
|
+ this.model.orderInfo.arrivalTimeSpan = moment(
|
|
|
+ this.model.orderInfo.arrivalTime.substr(11, 15),
|
|
|
+ "HH:mm"
|
|
|
+ );
|
|
|
+ this.model.orderInfo.dueOutTimeSpan = moment(
|
|
|
+ this.model.orderInfo.dueOutTime.substr(11, 15),
|
|
|
+ "HH:mm"
|
|
|
+ );
|
|
|
|
|
|
- this.loadRooms();
|
|
|
- }
|
|
|
- );
|
|
|
+ this.getbusCustomer();
|
|
|
+ this.loadRooms();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteOrder() {
|
|
|
+ deleteAction("/business/busRoomBookingOrders/delete", {
|
|
|
+ id: this.model.orderInfo.id,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success(res.message);
|
|
|
+ this.$router.go(-1);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setOrderStatus(status) {
|
|
|
+ postAction("/business/busRoomBookingOrders/set-booking-status", {
|
|
|
+ id: this.model.orderInfo.id,
|
|
|
+ bookingStatus: status,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success(res.message);
|
|
|
+ this.getBookingOrderInfo();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getbusCustomer() {
|
|
|
+ getAction("/bus/busCustomer/list", {}).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.customerList = res.result.records;
|
|
|
+ this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
|
|
|
+ var find = this.oldcustomerList.find(
|
|
|
+ (t) => t.id == this.model.orderInfo.contactId
|
|
|
+ );
|
|
|
+ if (find) {
|
|
|
+ this.model.contactName = find.name;
|
|
|
+ this.model.phone = find.phone;
|
|
|
|
|
|
- getAction(this.url.getBookingOrderInfo, {
|
|
|
- bookingNo: this.id,
|
|
|
- }).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- this.hourRoomRuleList = res.result.records;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ this.$emit("ok", this.model);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
presetNumChange(e, record) {
|
|
|
console.log(e);
|
|
|
record.layout.canUseCount = record.layout.oldTags - e;
|
|
|
@@ -661,20 +906,32 @@ export default {
|
|
|
moment(this.model.orderInfo.dueOutTimeSpan).format("HH:mm"),
|
|
|
bookingType: this.model.orderInfo.bookingType,
|
|
|
hourRoomRuleId: this.model.orderInfo.hourRoomId,
|
|
|
+ orderId: this.model.orderInfo.id,
|
|
|
}).then((res) => {
|
|
|
if (res.success) {
|
|
|
res.result.forEach((t) => {
|
|
|
+ var rooms = [];
|
|
|
+ var layouts = this.model.roomIds.filter(
|
|
|
+ (r) => r.roomLayoutId === t.layout.id
|
|
|
+ );
|
|
|
t.layout = Object.assign({}, t.layout, {
|
|
|
- presetNum: 0,
|
|
|
- oldTags: t.layout.canUseCount,
|
|
|
+ presetNum: layouts.length,
|
|
|
+ oldTags: t.layout.canUseCount + layouts.length,
|
|
|
});
|
|
|
t.buildingRooms.forEach((b) => {
|
|
|
b.floorRooms.forEach((f) => {
|
|
|
- this.$set(f, "check", 0);
|
|
|
+ var exRoom = this.model.roomIds.some((r) => r.roomId === f.id);
|
|
|
+ if (exRoom) {
|
|
|
+ rooms.push(f);
|
|
|
+ }
|
|
|
+ this.$set(f, "check", exRoom === true ? 1 : 0);
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ this.$set(t, "rooms", rooms);
|
|
|
});
|
|
|
this.canUserRooms = res.result;
|
|
|
+ console.log("this.canUserRooms", this.canUserRooms);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -715,9 +972,14 @@ export default {
|
|
|
console.log(moment(m).format("HH:mm"));
|
|
|
},
|
|
|
tagClose2(rindex, bindex, index) {
|
|
|
- // console.log(rindex, index);
|
|
|
- // console.log(this.canUserRooms[index]);
|
|
|
- this.canUserRooms[index].rooms.splice(rindex, 1);
|
|
|
+ console.log(rindex, index);
|
|
|
+ console.log(this.canUserRooms[index]);
|
|
|
+ var id =
|
|
|
+ this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex].id;
|
|
|
+ var findIndex = this.canUserRooms[index].rooms.findIndex(
|
|
|
+ (t) => t.id === id
|
|
|
+ );
|
|
|
+ this.canUserRooms[index].rooms.splice(findIndex, 1);
|
|
|
|
|
|
this.$set(
|
|
|
this.canUserRooms[index].buildingRooms[bindex].floorRooms[rindex],
|
|
|
@@ -734,25 +996,90 @@ export default {
|
|
|
this.$set(this.canUserRooms[this.selectIndex], "rooms", e);
|
|
|
console.log(this.canUserRooms[this.selectIndex]);
|
|
|
},
|
|
|
+ modalFormOk2(e) {
|
|
|
+ this.$set(this.canUserRooms2[0], "rooms", e);
|
|
|
+ console.log("modalFormOk2", this.canUserRooms2[0]);
|
|
|
+ this.model.roomIds[this.selectIndex].roomId = e[0].id;
|
|
|
+ this.model.roomIds[this.selectIndex].roomName = e[0].name;
|
|
|
+ postAction(
|
|
|
+ "/business/busBookingRooms/edit",
|
|
|
+ this.model.roomIds[this.selectIndex]
|
|
|
+ ).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success(res.message);
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ setMain(id) {
|
|
|
+ postAction("/business/busBookingRooms/set-main", { id: id }).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success(res.message);
|
|
|
+ this.getBookingOrderInfo();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
pulsRoom(index) {
|
|
|
this.selectIndex = index;
|
|
|
this.$refs.modalSelectRoomForm.add(this.canUserRooms[this.selectIndex]);
|
|
|
this.$refs.modalSelectRoomForm.title = "排房";
|
|
|
this.$refs.modalSelectRoomForm.disableSubmit = false;
|
|
|
},
|
|
|
+ pulsRoom2(record, index) {
|
|
|
+ this.selectIndex = index;
|
|
|
+ getAction("/rooms/cesRooms/can-user-rooms", {
|
|
|
+ startOf:
|
|
|
+ this.model.orderInfo.arrivalTime2 +
|
|
|
+ " " +
|
|
|
+ moment(this.model.orderInfo.arrivalTimeSpan).format("HH:mm"),
|
|
|
+ endOf:
|
|
|
+ this.model.orderInfo.dueOutTime2 +
|
|
|
+ " " +
|
|
|
+ moment(this.model.orderInfo.dueOutTimeSpan).format("HH:mm"),
|
|
|
+ bookingType: this.model.orderInfo.bookingType,
|
|
|
+ hourRoomRuleId: this.model.orderInfo.hourRoomId,
|
|
|
+ layoutId: record.roomLayoutId,
|
|
|
+ // orderId: this.model.orderInfo.id,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ res.result.forEach((t) => {
|
|
|
+ t.layout = Object.assign({}, t.layout, {
|
|
|
+ presetNum: 0,
|
|
|
+ oldTags: t.layout.canUseCount,
|
|
|
+ });
|
|
|
+ t.buildingRooms.forEach((b) => {
|
|
|
+ b.floorRooms.forEach((f) => {
|
|
|
+ this.$set(f, "check", 0);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.canUserRooms2 = res.result;
|
|
|
+ this.canUserRooms2[0].layout.presetNum = 1;
|
|
|
+ this.$refs.modalSelectRoomForm2.add(this.canUserRooms2[0]);
|
|
|
+ this.$refs.modalSelectRoomForm2.title = "排房";
|
|
|
+ this.$refs.modalSelectRoomForm2.disableSubmit = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
handleSearch(value) {
|
|
|
let result;
|
|
|
if (!value) {
|
|
|
- result = [];
|
|
|
+ result = this.oldcustomerList;
|
|
|
} else {
|
|
|
- result = ["a", "b", "c"].map(
|
|
|
- (domain) => `${value}${domain}(15888888888)`
|
|
|
- );
|
|
|
+ result = this.oldcustomerList.filter((t) => t.name.includes(value));
|
|
|
}
|
|
|
- this.result = result;
|
|
|
+ this.customerList = result;
|
|
|
},
|
|
|
handleSelectMember(e) {
|
|
|
- this.model.mobile = "158888888888";
|
|
|
+ var find = this.customerList.find((t) => t.id === e);
|
|
|
+ this.model.phone = find.phone;
|
|
|
+ this.model.contactName = find.name;
|
|
|
+ this.model.orderInfo.contactId = find.id;
|
|
|
},
|
|
|
moment,
|
|
|
onChange(date, dateString) {
|
|
|
@@ -771,15 +1098,28 @@ export default {
|
|
|
this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
},
|
|
|
+ cancelOrder() {
|
|
|
+ this.disabled = true;
|
|
|
+ this.getBookingOrderInfo();
|
|
|
+ },
|
|
|
+ editOrder() {
|
|
|
+ this.submitForm();
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
const that = this;
|
|
|
that.model.roomIds = [];
|
|
|
+ that.model.layoutDayPrices = [];
|
|
|
that.canUserRooms.forEach((t) => {
|
|
|
+ console.log("foreach");
|
|
|
var lastlayoutId = t.layout.id;
|
|
|
t.buildingRooms.forEach((b) => {
|
|
|
b.floorRooms.forEach((f) => {
|
|
|
if (f.check && f.check === 1) {
|
|
|
- that.model.roomIds.push({ layoutId: t.layout.id, roomId: f.id });
|
|
|
+ that.model.roomIds.push({
|
|
|
+ layoutId: t.layout.id,
|
|
|
+ roomId: f.id,
|
|
|
+ roomLayoutId: t.layout.id,
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -788,7 +1128,11 @@ export default {
|
|
|
);
|
|
|
var len = roomIds.length;
|
|
|
for (var i = len; i < t.layout.presetNum; i++) {
|
|
|
- that.model.roomIds.push({ layoutId: t.layout.id, roomId: null });
|
|
|
+ that.model.roomIds.push({
|
|
|
+ layoutId: t.layout.id,
|
|
|
+ roomId: null,
|
|
|
+ roomLayoutId: t.layout.id,
|
|
|
+ });
|
|
|
}
|
|
|
for (var b = 0; b < that.model.orderInfo.dayCount; b++) {
|
|
|
var dayTime = moment(this.model.orderInfo.arrivalTime2)
|
|
|
@@ -802,6 +1146,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ console.log(" that.canUserRooms", that.canUserRooms);
|
|
|
console.log("this.model", this.model);
|
|
|
if (that.model.roomIds.length <= 0) {
|
|
|
that.$message.warning("请先添加房间");
|
|
|
@@ -821,7 +1166,7 @@ export default {
|
|
|
that.confirmLoading = true;
|
|
|
let httpurl = "";
|
|
|
let method = "";
|
|
|
- if (!this.model.id) {
|
|
|
+ if (!this.model.orderInfo.id) {
|
|
|
httpurl += this.url.add;
|
|
|
method = "post";
|
|
|
} else {
|
|
|
@@ -832,7 +1177,12 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
|
- that.$emit("ok");
|
|
|
+ if (that.model.orderInfo.id) {
|
|
|
+ that.getBookingOrderInfo();
|
|
|
+ that.disabled = true;
|
|
|
+ } else {
|
|
|
+ that.$emit("ok");
|
|
|
+ }
|
|
|
} else {
|
|
|
that.$message.warning(res.message);
|
|
|
}
|
|
|
@@ -853,4 +1203,20 @@ export default {
|
|
|
/deep/ .ant-form-item {
|
|
|
margin-bottom: 5px !important;
|
|
|
}
|
|
|
+.orange_color {
|
|
|
+ border-color: #ff9e35 !important;
|
|
|
+ color: #ff9e35 !important;
|
|
|
+ vertical-align: initial;
|
|
|
+}
|
|
|
+.booking_circle_span {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ border-radius: 50%;
|
|
|
+ color: #f24e4c;
|
|
|
+ border: 1px solid #f24e4c;
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 16px;
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
</style>
|