소스 검색

调整修改

DESKTOP-B78GIPM\admin 2 년 전
부모
커밋
4be40c6865
4개의 변경된 파일666개의 추가작업 그리고 42개의 파일을 삭제
  1. 277 9
      src/views/room/leasegoods.vue
  2. 266 28
      src/views/room/membermessage.vue
  3. 121 3
      src/views/room/modules/checkIn/BillRoomInfo.vue
  4. 2 2
      src/views/settings/roomSettings.vue

+ 277 - 9
src/views/room/leasegoods.vue

@@ -49,7 +49,7 @@
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
     </div>
     <!-- table区域-begin -->
-    <div>
+    <div class="table-remake">
       <a-table
         ref="table"
         size="middle"
@@ -67,7 +67,7 @@
         class="j-table-force-nowrap"
         @change="handleTableChange"
       >
-        <template slot="htmlSlot" slot-scope="text">
+        <!-- <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
         <template slot="imgSlot" slot-scope="text, record">
@@ -97,9 +97,59 @@
           >
             下载
           </a-button>
-        </template>
+        </template> -->
 
-        <span slot="action" slot-scope="text, record">
+        
+        <template v-for="col in columns.map(item=> item.dataIndex )" :slot="col" slot-scope="text, record, index">
+          <div :key="col">
+            <a-input
+              v-if="record.editable && col == 'userName' "
+              style="margin: -5px 0;width:100px;"
+              :value="text"
+              @change="e => handleChange(e.target.value, record.id, col)"
+            />
+            <!-- <template v-if="!record.editable && col != 'relay' ">
+              {{ text }}
+            </template>
+            <template v-if="record.editable && col == 'createDate' ">
+              {{ text }}
+            </template>
+            <template v-if="!record.editable && col == 'relay' ">
+              {{ text==1? '是':'否' }}
+            </template> -->
+            <template v-if=" record.editable && col != 'userName' && col != 'roomNo' && col != 'num' && col != 'deposit' && col != 'goodName' ">
+              {{ text }}
+            </template>
+            <template v-if=" !record.editable ">
+              {{ text }}
+            </template>
+            <a-select v-if=" record.editable && col == 'roomNo' " v-model="record.livingOrderId" placeholder="请选择房号">
+              <a-select-option
+                :value="item.livingOrderId"
+                v-for="(item, index) in roomsList"
+                :key="item.id"
+              >
+                {{ item.roomName }}/{{ item.customerName }}
+              </a-select-option>
+            </a-select>
+            <a-input-number
+              v-if="record.editable && (col == 'num' || col == 'deposit') "
+              style="margin: -5px 0;width:100px;"
+              :value="text"
+              @change="e => handleChange(e, record.id, col)"
+            />
+              <a-select v-if=" record.editable && col == 'goodName' " v-model="record.goodsId" placeholder="请选择物品">
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in busDictItemList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+          </div>
+        </template>
+        <!-- <span slot="action" slot-scope="text, record">
           <template v-if="!record.revertDate">
             <a @click="handleEdit(record)">编辑</a>
 
@@ -110,7 +160,47 @@
             <a-divider type="vertical" />
             <a @click="handleRevert(record.id)">归还</a></template
           >
-        </span>
+        </span> -->
+        <template slot="action" slot-scope="text, record, index">
+          <!-- <div>
+            <a @click="handleEdit(record)">编辑</a>
+            <a-divider type="vertical" />
+            <a-popconfirm
+              title="确定删除吗?"
+              @confirm="() => handleDelete(record.id)"
+            >
+              <a>删除</a>
+            </a-popconfirm>
+          </div> -->
+          <span v-if="record.editable">
+            <a @click="() => save(record.id, record)">保存</a>
+            <a-divider :disabled="editingKey !== ''" type="vertical" />
+            <!-- <a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record.id)"> -->
+              <a @click="() => cancel(record.id)">取消</a>
+            <!-- </a-popconfirm> -->
+          </span>
+          <span v-else>
+            <template v-if="!record.revertDate">
+              <a :disabled="editingKey !== ''" @click="edit(record.id)">编辑</a>
+
+              <a-divider :disabled="editingKey !== ''" type="vertical"
+            /></template>
+            <a :disabled="editingKey !== ''" @click="handleDelete(record.id)">删除</a>
+            <template v-if="!record.revertDate">
+              <a-divider :disabled="editingKey !== ''" type="vertical" />
+              <a :disabled="editingKey !== ''" @click="handleRevert(record.id)">归还</a></template
+            >
+            <!-- <a :disabled="editingKey !== ''" @click="edit(record.id)">编辑</a>
+            <a-divider :disabled="editingKey !== ''" type="vertical" />
+            <a-popconfirm :disabled="editingKey !== ''"
+              title="确定删除吗?"
+              @confirm="() => handleDelete(record.id)"
+            >
+              <a :disabled="editingKey !== ''">删除</a>
+            </a-popconfirm> -->
+          </span>
+
+        </template>
       </a-table>
     </div>
 
@@ -148,31 +238,37 @@ export default {
           title: "单号",
           align: "center",
           dataIndex: "orderNo",
+          scopedSlots: { customRender: "orderNo" },
         },
         {
           title: "房号",
           align: "center",
           dataIndex: "roomNo",
+          scopedSlots: { customRender: "roomNo" },
         },
         {
           title: "姓名",
           align: "center",
           dataIndex: "userName",
+          scopedSlots: { customRender: "userName" },
         },
         {
           title: "物品",
           align: "center",
           dataIndex: "goodName",
+          scopedSlots: { customRender: "goodName" },
         },
         {
           title: "数量",
           align: "center",
           dataIndex: "num",
+          scopedSlots: { customRender: "num" },
         },
         {
           title: "押金",
           align: "center",
           dataIndex: "deposit",
+          scopedSlots: { customRender: "deposit" },
         },
         {
           title: "租借时间",
@@ -205,24 +301,154 @@ export default {
       superFieldList: [],
       hotelList: [],
       datetime: [],
+      dataSourceCopy:[],
+      roomsList: [],
+      isAddOk: true,
+      editingKey: "",
+      busDictItemList: [],
     };
   },
-  created() {},
+  created() {
+    getAction("/business/busRoomBookingOrders/living-orders?status=-1", {
+      pageNo: 1,
+      pageSize: 99999,
+    }).then((res) => {
+      if (res.success) {
+        this.roomsList = res.result.records;
+      }
+    });
+    getAction("/business/busDictItem/list", {
+      dictId: "1659108818476990465",
+    }).then((res) => {
+      if (res.success) {
+        this.busDictItemList = res.result.records;
+      }
+    });
+  },
   computed: {
     importExcelUrl: function () {
       return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
     },
   },
   methods: {
+
+    handleChange(value, key, column) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      if (target) {
+        target[column] = value;
+        this.dataSource = newData;
+      }
+    },
+
+    edit(key) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      this.editingKey = key;
+      if (target) {
+        target.editable = true;
+        this.dataSource = newData;
+      }
+    },
+    save(key) {
+      const that = this;
+      const newData = [...this.dataSource];
+      const newCacheData = [...this.dataSourceCopy];
+      const target = newData.find(item => key === item.id);
+      const targetCache = newCacheData.find(item => key === item.id);
+      if (!target.goodsId) {
+        that.$message.warning("请选择物品");
+        return
+      }
+      if (!target.num) {
+        that.$message.warning("请输入数量");
+        return
+      }
+      if (!target.deposit) {
+        that.$message.warning("请输入押金");
+        return
+      }
+      if (target && targetCache) {
+        delete target.editable;
+        this.dataSource = newData;
+        Object.assign(targetCache, target);
+        this.dataSourceCopy = newCacheData;
+      }
+      that.loading = true;
+      let httpurl = "";
+      let method = "";
+      if (!target.id || target.id == 9999) {
+        httpurl += '/order/cesOrderLeaseGoods/add';
+        method = "post";
+      } else {
+        httpurl += '/order/cesOrderLeaseGoods/edit';
+        method = "put";
+      }
+      if (target.id==9999) {
+        delete target.id
+      }
+      httpAction(httpurl, target, method)
+      .then((res) => {
+        if (res.success) {
+          that.$message.success(res.message);
+          // that.$emit("ok");
+          // 新增/修改 成功时,重载列表
+          this.loadData();
+          //清空列表选中
+          this.onClearSelected()
+        } else {
+          that.$message.warning(res.message);
+        }
+      })
+      .finally(() => {
+        that.loading = false;
+        this.isAddOk = true
+      });
+      console.log("target", target);
+      this.editingKey = '';
+    },
+    cancel(key) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      this.editingKey = '';
+      if (target) {
+        Object.assign(target, this.dataSourceCopy.find(item => key === item.id));
+        delete target.editable;
+        this.dataSource = newData;
+      }
+      if (target.id == 9999) {
+        this.dataSource.pop()
+        this.isAddOk = true;
+      }
+      this.loadData()
+    },
+
+
     handleAdd() {
       var id = null;
+      console.log("this.livingOrderId", this.livingOrderId);
       if (this.livingOrderId) {
         var ids = this.livingOrderId.split(",");
         id = ids[0];
       }
-      this.$refs.modalForm.add(id);
-      this.$refs.modalForm.title = "新增";
-      this.$refs.modalForm.disableSubmit = false;
+      // this.$refs.modalForm.add(id);
+      // this.$refs.modalForm.title = "新增";
+      // this.$refs.modalForm.disableSubmit = false;
+      // return
+      let find = this.roomsList.find(
+        (t) => t.livingOrderId === id
+      );
+      let roomId = find.roomId
+      this.dataSource.push({
+        id:9999,
+        livingOrderId: id,
+        relay: 1,
+        editable: true,
+        hotelId:JSON.parse(localStorage.getItem("storeInfo")).id,
+        roomId:roomId,
+      })
+      this.isAddOk = false;
+      this.editingKey = 9999;
     },
     onChange(e, dateString) {
       this.queryParam.startTime = dateString[0];
@@ -258,9 +484,51 @@ export default {
       fieldList.push({ type: "date", value: "createDate", text: "创建时间" });
       this.superFieldList = fieldList;
     },
+    loadData(arg) {
+      if (this.url.list==2) {
+        return
+      }
+      if(!this.url.list){
+        this.$message.error("请设置url.list属性!")
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//查询条件
+      this.loading = true;
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          this.dataSource = res.result.records||res.result;
+          this.dataSourceCopy = res.result.records||res.result
+          if(res.result.total)
+          {
+            this.ipagination.total = res.result.total;
+          }else{
+            this.ipagination.total = 0;
+          }
+          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+        }else{
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
   },
 };
 </script>
 <style scoped>
 @import "~@assets/less/common.less";
+.table-remake /deep/.ant-table-body {
+  min-height: 352px !important;
+  }
+.table-remake /deep/ .ant-empty-normal {
+  margin: 140px 0 !important;
+}
+.table-remake /deep/.ant-table-placeholder{
+  margin-top: -320px;
+}
 </style>

+ 266 - 28
src/views/room/membermessage.vue

@@ -47,11 +47,11 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button @click="handleAdd" :disabled="!isAddOk" type="primary" icon="plus">新增</a-button>
     </div>
 
     <!-- table区域-begin -->
-    <div>
+    <div class="table-remake">
       <a-table
         ref="table"
         size="middle"
@@ -69,7 +69,7 @@
         class="j-table-force-nowrap"
         @change="handleTableChange"
       >
-        <template slot="htmlSlot" slot-scope="text">
+        <!-- <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
         <template slot="imgSlot" slot-scope="text, record">
@@ -99,19 +99,92 @@
           >
             下载
           </a-button>
+        </template> -->
+
+
+        <template v-for="col in columns.map(item=> item.dataIndex )" :slot="col" slot-scope="text, record, index">
+          <div :key="col">
+            <a-input
+              v-if="record.editable && (col == 'userName' || col == 'contentBody') "
+              style="margin: -5px 0;width:100px;"
+              :value="text"
+              @change="e => handleChange(e.target.value, record.id, col)"
+            />
+            <template v-if="!record.editable && col != 'relay' ">
+              {{ text }}
+            </template>
+            <template v-if="record.editable && col == 'createDate' ">
+              {{ text }}
+            </template>
+            <template v-if="!record.editable && col == 'relay' ">
+              {{ text==1? '是':'否' }}
+            </template>
+            <a-select v-if=" record.editable && col == 'roomNo' " v-model="record.livingOrderId" placeholder="请选择房号">
+              <a-select-option
+                :value="item.livingOrderId"
+                v-for="(item, index) in roomsList"
+                :key="item.id"
+              >
+                {{ item.roomName }}/{{ item.customerName }}
+              </a-select-option>
+            </a-select>
+            <j-date
+                v-if=" record.editable && col == 'remindDate' "
+                placeholder="请选择自动提醒时间"
+                v-model="record.remindDate"
+                style="width: 100%"
+              />
+            <j-date
+                v-if=" record.editable && col == 'validDate' "
+                placeholder="请选择有效时间"
+                v-model="record.validDate"
+                style="width: 100%"
+              />
+              <a-select v-if=" record.editable && col == 'relay' " placeholder="请选择" v-model="record.relay">
+                <a-select-option :value="1"> 是 </a-select-option>
+                <a-select-option :value="2"> 否 </a-select-option>
+              </a-select>
+          </div>
         </template>
 
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
 
-          <a-divider type="vertical" />
-          <a-popconfirm
-            title="确定删除吗?"
-            @confirm="() => handleDelete(record.id)"
-          >
-            <a>删除</a>
-          </a-popconfirm>
-        </span>
+
+        <template slot="action" slot-scope="text, record, index">
+          <!-- <div>
+            <a @click="handleEdit(record)">编辑</a>
+            <a-divider type="vertical" />
+            <a-popconfirm
+              title="确定删除吗?"
+              @confirm="() => handleDelete(record.id)"
+            >
+              <a>删除</a>
+            </a-popconfirm>
+          </div> -->
+          <span v-if="record.editable">
+            <a @click="() => save(record.id, record)">保存</a>
+            <a-divider :disabled="editingKey !== ''" type="vertical" />
+            <!-- <a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record.id)"> -->
+              <a @click="() => cancel(record.id)">取消</a>
+            <!-- </a-popconfirm> -->
+          </span>
+          <span v-else>
+            <!-- <a :disabled="editingKey !== ''" @click="() => edit(record.id)">Edit</a> -->
+            <a :disabled="editingKey !== ''" @click="edit(record.id)">编辑</a>
+            <a-divider :disabled="editingKey !== ''" type="vertical" />
+            <a-popconfirm :disabled="editingKey !== ''"
+              title="确定删除吗?"
+              @confirm="() => handleDelete(record.id)"
+            >
+              <a :disabled="editingKey !== ''">删除</a>
+            </a-popconfirm>
+          </span>
+
+        </template>
+
+        <!-- <span slot="action" slot-scope="text, record">
+          
+        </span> -->
+        
       </a-table>
     </div>
 
@@ -127,6 +200,7 @@ import "@/assets/less/TableExpand.less";
 import { mixinDevice } from "@/utils/mixin";
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import BusMemberMessageModal from "./modules/membermessage/BusMemberMessageModal";
+import { deleteAction, getAction,downFile,getFileAccessHttpUrl, httpAction } from '@/api/manage'
 
 export default {
   name: "BusMemberMessageList",
@@ -142,6 +216,7 @@ export default {
   },
   data() {
     return {
+      editingKey: "",
       description: "bus_member_message管理页面",
       // 表头
       columns: [
@@ -149,48 +224,55 @@ export default {
           title: "房号",
           align: "center",
           dataIndex: "roomNo",
+          scopedSlots: { customRender: "roomNo" },
         },
         {
           title: "留言人",
           align: "center",
           dataIndex: "userName",
+          scopedSlots: { customRender: "userName" },
         },
         {
           title: "自动提醒时间",
           align: "center",
           dataIndex: "remindDate",
-          customRender: function (text) {
-            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
-          },
+          // customRender: function (text) {
+          //   return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          // },
+          scopedSlots: { customRender: "remindDate" },
         },
         {
           title: "有效时间",
           align: "center",
           dataIndex: "validDate",
-          customRender: function (text) {
-            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
-          },
+          scopedSlots: { customRender: "validDate" },
+          // customRender: function (text) {
+          //   return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          // },
         },
         {
           title: "是否传达",
           align: "center",
           dataIndex: "relay",
-          customRender: function (text) {
-            return !text ? "否" : "是";
-          },
+          scopedSlots: { customRender: "relay" },
+          // customRender: function (text) {
+          //   return !text ? "否" : "是";
+          // },
         },
         {
           title: "留言内容",
           align: "center",
+          scopedSlots: { customRender: "contentBody" },
           dataIndex: "contentBody",
         },
         {
           title: "创建时间",
           align: "center",
           dataIndex: "createDate",
-          customRender: function (text) {
-            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
-          },
+          scopedSlots: { customRender: "createDate" },
+          // customRender: function (text) {
+          //   return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          // },
         },
         {
           title: "操作",
@@ -212,10 +294,21 @@ export default {
       dictOptions: {},
       superFieldList: [],
       datetime: [],
+      dataSourceCopy:[],
+      roomsList: [],
+      isAddOk: true,
     };
   },
   created() {
     this.getSuperFieldList();
+    getAction("/business/busRoomBookingOrders/living-orders?status=-1", {
+      pageNo: 1,
+      pageSize: 99999,
+    }).then((res) => {
+      if (res.success) {
+        this.roomsList = res.result.records;
+      }
+    });
   },
   computed: {
     importExcelUrl: function () {
@@ -223,10 +316,113 @@ export default {
     },
   },
   methods: {
+
+    handleChange(value, key, column) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      if (target) {
+        target[column] = value;
+        this.dataSource = newData;
+      }
+    },
+
+    edit(key) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      this.editingKey = key;
+      if (target) {
+        target.editable = true;
+        this.dataSource = newData;
+      }
+    },
+    save(key) {
+      const that = this;
+      const newData = [...this.dataSource];
+      const newCacheData = [...this.dataSourceCopy];
+      const target = newData.find(item => key === item.id);
+      const targetCache = newCacheData.find(item => key === item.id);
+      if (!target.remindDate) {
+        that.$message.warning("自动提醒时间不能为空");
+        return
+      }
+      if (!target.validDate) {
+        that.$message.warning("有效时间不能为空");
+        return
+      }
+      if (target && targetCache) {
+        delete target.editable;
+        this.dataSource = newData;
+        Object.assign(targetCache, target);
+        this.dataSourceCopy = newCacheData;
+      }
+      that.loading = true;
+      let httpurl = "";
+      let method = "";
+      if (!target.id || target.id == 9999) {
+        httpurl += '/business/busMemberMessage/add';
+        method = "post";
+      } else {
+        httpurl += '/business/busMemberMessage/edit';
+        method = "put";
+      }
+      if (target.id==9999) {
+        delete target.id
+      }
+      httpAction(httpurl, target, method)
+      .then((res) => {
+        if (res.success) {
+          that.$message.success(res.message);
+          // that.$emit("ok");
+          // 新增/修改 成功时,重载列表
+          this.loadData();
+          //清空列表选中
+          this.onClearSelected()
+        } else {
+          that.$message.warning(res.message);
+        }
+      })
+      .finally(() => {
+        that.loading = false;
+        this.isAddOk = true
+      });
+      console.log("target", target);
+      this.editingKey = '';
+    },
+    cancel(key) {
+      const newData = [...this.dataSource];
+      const target = newData.find(item => key === item.id);
+      this.editingKey = '';
+      if (target) {
+        Object.assign(target, this.dataSourceCopy.find(item => key === item.id));
+        delete target.editable;
+        this.dataSource = newData;
+      }
+      if (target.id == 9999) {
+        this.dataSource.pop()
+        this.isAddOk = true;
+      }
+      this.loadData()
+    },
+
+
     handleAdd() {
-      this.$refs.modalForm.add(this.livingOrderId);
-      this.$refs.modalForm.title = "新增";
-      this.$refs.modalForm.disableSubmit = false;
+      // this.$refs.modalForm.add(this.livingOrderId);
+      // this.$refs.modalForm.title = "新增";
+      // this.$refs.modalForm.disableSubmit = false;
+      let find = this.roomsList.find(
+        (t) => t.livingOrderId === this.livingOrderId
+      );
+      let roomId = find.roomId
+      this.dataSource.push({
+        id:9999,
+        livingOrderId: this.livingOrderId,
+        relay: 1,
+        editable: true,
+        hotelId:JSON.parse(localStorage.getItem("storeInfo")).id,
+        roomId:roomId,
+      })
+      this.isAddOk = false;
+      this.editingKey = 9999;
     },
     onChange(e, dateString) {
       this.queryParam.startTime = dateString[0];
@@ -259,9 +455,51 @@ export default {
       fieldList.push({ type: "date", value: "createDate", text: "创建时间" });
       this.superFieldList = fieldList;
     },
+    loadData(arg) {
+      if (this.url.list==2) {
+        return
+      }
+      if(!this.url.list){
+        this.$message.error("请设置url.list属性!")
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//查询条件
+      this.loading = true;
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          this.dataSource = res.result.records||res.result;
+          this.dataSourceCopy = res.result.records||res.result
+          if(res.result.total)
+          {
+            this.ipagination.total = res.result.total;
+          }else{
+            this.ipagination.total = 0;
+          }
+          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+        }else{
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
   },
 };
 </script>
 <style scoped>
 @import "~@assets/less/common.less";
+.table-remake /deep/.ant-table-body {
+  min-height: 352px !important;
+  }
+.table-remake /deep/ .ant-empty-normal {
+  margin: 140px 0 !important;
+}
+.table-remake /deep/.ant-table-placeholder{
+  margin-top: -320px;
+}
 </style>

+ 121 - 3
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -235,6 +235,44 @@
                 </div>
               </div>
             </div>
+            <a-row v-for="(fItem, index) in addPeopleList" :key="index" style="margin-bottom:10px;">
+              <a-col :span="5">
+                <a-auto-complete
+                  v-model="fItem.customerName"
+                  placeholder="姓名"
+                  @search="handleSearch"
+                  @select="(e) => handleSelectMember(e,index)"
+                >
+                  <template slot="dataSource">
+                    <a-select-option v-for="item in customerList" :key="item.id"
+                      >{{ item.name }}-{{ item.phone }}</a-select-option
+                    >
+                  </template>
+                </a-auto-complete>
+              </a-col>
+              <a-col :span="5">
+                <a-radio-group v-model="fItem.gender">
+                  <a-radio :value="1">男</a-radio>
+                  <a-radio :value="2">女</a-radio>
+                </a-radio-group>
+              </a-col>
+              <a-col :span="6">
+                <a-input
+                  v-model="fItem.certNo"
+                  placeholder="请输入证件号"
+                ></a-input>
+              </a-col>
+              <a-col :span="5">
+                <a-input
+                  v-model="fItem.phone"
+                  placeholder="请输入手机号"
+                ></a-input>
+              </a-col>
+              <a-col :span="3">
+                <a-icon @click="savePeople(fItem)" style="color:bule;" class="dynamic-delete-button" type="check-circle" />
+                <a-icon @click="cancelPeople(index)" style="color: #f56c6c" class="dynamic-delete-button" type="close-circle" />
+              </a-col>
+            </a-row>
             <div id="livingCustomers-grid">
               <a-row
                 v-for="(customer, index) in item.livingCustomers"
@@ -755,6 +793,11 @@ export default {
       vipCustomer: {},
       selectRoomId: "1",
       selectedRowKeys1: [],
+      /**
+       * 同住人
+       */
+      addPeopleList:[],
+      customerList:[]
     };
   },
   computed: {
@@ -834,8 +877,73 @@ export default {
         this.warranterList = res.result.records;
       }
     });
+    this.getbusCustomer()
   },
   methods: {
+    /**
+     * 添加同住人姓名
+     */
+    handleSelectMember(e,idx) {
+      var find = this.customerList.find((t) => t.id === e);
+      console.log(idx);
+      console.log(this.addPeopleList);
+      this.addPeopleList[idx].phone = find.phone;
+      this.addPeopleList[idx].customerName = find.name;
+      this.addPeopleList[idx].customerId = find.id;
+      // this.model.phone = find.phone;
+      // this.model.customerName = find.name;
+      // this.model.customerId = find.id;
+    },
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    /**
+     * 添加同住人保存
+     */
+    savePeople(item){
+      console.log(item);
+      const that = this;
+      if (!item.customerName) {
+        this.$message.warning("姓名不能为空");
+        return
+      }
+      httpAction("/business/busLivingCustomer/add", item, "post")
+      .then((res) => {
+        if (res.success) {
+          that.$message.success("入住成功");
+          // that.$emit("ok");
+          this.modalFormOk();
+          this.addPeopleList.length = 0;
+        } else {
+          that.$message.warning(res.message);
+        }
+      })
+      .finally(() => {
+        // that.confirmLoading = false;
+      });
+    },
+    /**
+     * 添加同住人取消
+     */
+    cancelPeople(idx){
+      this.addPeopleList.splice(idx,1)
+    },
+
+
     // 叫醒服务
     wakeServiceOk() {
       console.log(this.wakeTime);
@@ -1211,9 +1319,19 @@ export default {
     },
     addlivingCustomer(id, roomId) {
       console.log(id, roomId);
-      this.$refs.modalCustomerForm.add(id, roomId);
-      this.$refs.modalCustomerForm.title = "添加同住人";
-      this.$refs.modalCustomerForm.disableSubmit = false;
+      // this.$refs.modalCustomerForm.add(id, roomId);
+      // this.$refs.modalCustomerForm.title = "添加同住人";
+      // this.$refs.modalCustomerForm.disableSubmit = false;
+      this.addPeopleList.push({
+        livingOrderId: id,
+        roomId: roomId,
+        certType: 1,
+        gender: 1,
+        phone: "",
+        customerName: "",
+        customerId: "",
+        hotelId:JSON.parse(localStorage.getItem("storeInfo")).id
+      })
     },
     modalFormOk(e) {
       this.getBookingOrderInfo();

+ 2 - 2
src/views/settings/roomSettings.vue

@@ -16,13 +16,13 @@
                 <!-- <room-gen></room-gen> -->
                 <room-num-list></room-num-list>
             </a-tab-pane>
-            <a-tab-pane key="3">
+            <!-- <a-tab-pane key="3">
                 <span slot="tab">
                     <a-icon type="shop" />
                     商品库存
                 </span>
                <goodList></goodList>
-            </a-tab-pane>
+            </a-tab-pane> -->
             <a-tab-pane key="4">
                 <span slot="tab">
                     <a-icon type="clock-circle" />