gqx пре 2 година
родитељ
комит
26b7a41262
1 измењених фајлова са 116 додато и 44 уклоњено
  1. 116 44
      src/views/room/guestorders.vue

+ 116 - 44
src/views/room/guestorders.vue

@@ -6,28 +6,48 @@
         <a-row :gutter="24">
           <a-col :span="3">
             <a-form-item label="">
-              <a-input placeholder="房号" v-model="queryParam.roomNo"></a-input>
+              <a-input
+                placeholder="房号/姓名/手机号/单号"
+                v-model="queryParam.keyw"
+              ></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="3">
             <a-form-item label="">
-              <a-input placeholder="姓名" v-model="queryParam.userName"></a-input>
+              <a-select
+                v-model="queryParam.type"
+                style="width: 100%"
+                placeholder="类型"
+              >
+                <a-select-option :value="1">入住</a-select-option>
+                <a-select-option :value="2">预定</a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
-          <a-col :span="3">
+          <a-col :span="3" v-if="queryParam.type == 1">
             <a-form-item label="">
-              <a-input placeholder="手机号" v-model="queryParam.userMobile"></a-input>
+              <a-select
+                v-model="queryParam.livingStatus"
+                style="width: 100%"
+                placeholder="类型"
+              >
+                <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>
             </a-form-item>
           </a-col>
-          <a-col :span="3">
+          <a-col :span="3" v-else-if="queryParam.type == 2">
             <a-form-item label="">
               <a-select
-                v-model="queryParam.commentType"
+                v-model="queryParam.bookingStatus"
                 style="width: 100%"
                 placeholder="类型"
               >
-                <a-select-option value="1">正常入住</a-select-option>
-                <a-select-option value="2">未结离点</a-select-option>
+                <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>
             </a-form-item>
           </a-col>
@@ -104,10 +124,14 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-          <!-- <a @click="handleEdit(record)">编辑</a>
+          <a @click="handleInfo(record)">查看</a>
+          <a-divider v-if="queryParam.type == 2" type="vertical" />
+          <a v-if="queryParam.type == 2" @click="setOrderStatus(record)"
+            >取消订单</a
+          >
 
-          <a-divider type="vertical" /> -->
-          <a @click="handleDelete(record.id)">删除</a>
+          <a-divider type="vertical" v-if="queryParam.type == 2" />
+          <a v-if="queryParam.type == 2" @click="handleInfo(record)">入住</a>
         </span>
       </a-table>
     </div>
@@ -139,55 +163,98 @@ export default {
         {
           title: "单号",
           align: "center",
-          dataIndex: "hotelName",
+          dataIndex: "orderNo",
         },
         {
           title: "客人/电话",
           align: "center",
-          dataIndex: "messageType",
-          customRender: function (text) {
-            return text == 1 ? "投诉" : "建议";
+          dataIndex: "customerName",
+          customRender: function (text, record) {
+            return record.customerName + "/" + record.customerPhone;
           },
         },
         {
           title: "客人类型",
           align: "center",
-          dataIndex: "contentBody",
+          dataIndex: "customerType",
           customRender: function (text) {
-            return text == 1 ? "投诉" : "建议";
+            if (text == 1) {
+              return "散客";
+            } else if (text == 2) {
+              return "会员";
+            } else if (text == 3) {
+              return "协议单位";
+            } else if (text == 4) {
+              return "中介";
+            }
           },
         },
         {
           title: "入住类型",
           align: "center",
-          dataIndex: "userName",
+          dataIndex: "isLiving",
+          customRender: function (text, record) {
+            if (record.livingDayPrices && record.livingDayPrices.length > 0) {
+              return record.livingDayPrices[0].livingType == 1
+                ? "全天"
+                : "钟点";
+            }
+            if (record.bookingDayPrices && record.bookingDayPrices.length > 0) {
+              return record.bookingDayPrices[0].livingType == 1
+                ? "全天"
+                : "钟点";
+            }
+            return "--";
+          },
         },
         {
           title: "房型",
           align: "center",
-          dataIndex: "userMobile",
+          dataIndex: "layoutName",
         },
         {
           title: "房号",
           align: "center",
-          dataIndex: "roomNo",
+          dataIndex: "roomName",
+          customRender: function (text, record) {
+            return !text ? "排房" : text;
+          },
         },
         {
           title: "房价",
           align: "center",
           dataIndex: "createDate",
+          customRender: function (text, record) {
+            if (record.livingDayPrices && record.livingDayPrices.length > 0) {
+              return record.livingDayPrices[0].price
+            }
+            if (record.bookingDayPrices && record.bookingDayPrices.length > 0) {
+              return record.bookingDayPrices[0].price;
+            }
+            return "--";
+          },
         },
+        // {
+        //   title: "状态",
+        //   align: "center",
+        //   dataIndex: "createDate",
+        // },
         {
-          title: "状态",
+          title: "预抵时间",
           align: "center",
-          dataIndex: "createDate",
+          dataIndex: "arrivalTime",
         },
         {
-          title: "创建时间",
+          title: "预离时间",
           align: "center",
-          dataIndex: "createDate",
-          customRender: function (text) {
-            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          dataIndex: "dueOutTime",
+        },
+        {
+          title: "金额",
+          align: "center",
+          dataIndex: "yuE",
+          customRender: function (text, record) {
+            return record.yuE + "(余)/" + record.yushou + "(预)";
           },
         },
         {
@@ -200,7 +267,7 @@ export default {
         },
       ],
       url: {
-        list: "/order/cesOrderMessage/list",
+        list: "/business/busRoomBookingOrders/kedan-orders",
         delete: "/order/cesOrderMessage/delete",
         deleteBatch: "/order/cesOrderMessage/deleteBatch",
         exportXlsUrl: "/order/cesOrderMessage/exportXls",
@@ -209,6 +276,7 @@ export default {
       dictOptions: {},
       superFieldList: [],
       hotelList: [],
+      queryParam: { type: 1, livingStatus: 1, bookingStatus: 1 },
     };
   },
   created() {
@@ -226,24 +294,28 @@ export default {
     },
   },
   methods: {
-    initDictConfig() {},
-    getSuperFieldList() {
-      let fieldList = [];
-      fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
-      fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
-      fieldList.push({ type: "int", value: "userId", text: "用户ID" });
-      fieldList.push({
-        type: "int",
-        value: "messageType",
-        text: "留言类型 1 投诉 2建议",
+    setOrderStatus(record) {
+      postAction("/business/busRoomBookingOrders/set-booking-status", {
+        id: record.id,
+        bookingStatus: 2,
+      }).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message);
+          this.loadData();
+        } else {
+          this.$message.warning(res.message);
+        }
       });
-      fieldList.push({ type: "string", value: "images", text: "图片逗号分隔" });
-      fieldList.push({ type: "string", value: "contentBody", text: "内容" });
-      fieldList.push({ type: "string", value: "userName", text: "姓名" });
-      fieldList.push({ type: "string", value: "userMobile", text: "手机号" });
-      fieldList.push({ type: "string", value: "roomNo", text: "房号" });
-      fieldList.push({ type: "date", value: "createDate", text: "创建时间" });
-      this.superFieldList = fieldList;
+    },
+    handleInfo(record) {
+      if (this.queryParam.type == 2) {
+        this.$router.push({
+          name: "room-scheduledetail",
+          params: {
+            id: record.orderNo,
+          },
+        });
+      }
     },
   },
 };