瀏覽代碼

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

# Conflicts:
#	src/views/room/modules/schedule/ScheduleRoomForm.vue
覃浩 2 年之前
父節點
當前提交
9e99e543ec
共有 83 個文件被更改,包括 49755 次插入1039 次删除
  1. 41718 0
      package-lock.json
  2. 4 0
      src/api/api.js
  3. 3 3
      src/api/manage.js
  4. 3 2
      src/utils/excloudHotelIdParamPath/CesRoomLayoutPriceController.js
  5. 3 2
      src/views/hotel/newHotelForm.vue
  6. 3 1
      src/views/markets/agreementunit.vue
  7. 57 5
      src/views/markets/modules/agreementUnit/account/accountEnterForm.vue
  8. 53 5
      src/views/markets/modules/agreementUnit/account/accountReverseEntryForm.vue
  9. 24 6
      src/views/markets/modules/agreementUnit/account/accountTransferForm.vue
  10. 2 6
      src/views/markets/modules/agreementUnit/account/accountTransferModal.vue
  11. 104 0
      src/views/markets/modules/agreementUnit/account/commodityRecord.vue
  12. 53 0
      src/views/markets/modules/agreementUnit/account/commodityRecordModal.vue
  13. 187 0
      src/views/markets/modules/agreementUnit/account/commodityReturn.vue
  14. 55 0
      src/views/markets/modules/agreementUnit/account/commodityReturnModal.vue
  15. 180 157
      src/views/markets/modules/agreementUnit/account/goodsConsumeForm.vue
  16. 50 4
      src/views/markets/modules/agreementUnit/account/settlementForm.vue
  17. 13 6
      src/views/markets/modules/agreementUnit/account/settlementModal.vue
  18. 350 31
      src/views/markets/modules/agreementUnit/agreementAccount.vue
  19. 253 54
      src/views/room/fangtailive.vue
  20. 7 2
      src/views/room/leasegoods.vue
  21. 522 128
      src/views/room/modules/checkIn/BillRoomForm.vue
  22. 485 112
      src/views/room/modules/checkIn/BillRoomInfo.vue
  23. 6 8
      src/views/room/modules/checkIn/BillRoomInfoModal.vue
  24. 99 0
      src/views/room/modules/checkIn/EditBatchRoomPriceForm.vue
  25. 64 0
      src/views/room/modules/checkIn/EditBatchRoomPriceModal.vue
  26. 271 0
      src/views/room/modules/checkIn/EditBookingTypeForm.vue
  27. 60 0
      src/views/room/modules/checkIn/EditBookingTypeModal.vue
  28. 182 0
      src/views/room/modules/checkIn/EditBreakfastNumForm.vue
  29. 60 0
      src/views/room/modules/checkIn/EditBreakfastNumModal.vue
  30. 210 0
      src/views/room/modules/checkIn/EditCustomerForm.vue
  31. 60 0
      src/views/room/modules/checkIn/EditCustomerModal.vue
  32. 183 0
      src/views/room/modules/checkIn/EditCustomerSourceForm.vue
  33. 60 0
      src/views/room/modules/checkIn/EditCustomerSourceModal.vue
  34. 378 0
      src/views/room/modules/checkIn/EditCustomerTypeForm.vue
  35. 60 0
      src/views/room/modules/checkIn/EditCustomerTypeModal.vue
  36. 181 0
      src/views/room/modules/checkIn/EditRemarkForm.vue
  37. 60 0
      src/views/room/modules/checkIn/EditRemarkModal.vue
  38. 185 0
      src/views/room/modules/checkIn/EditWarranterForm.vue
  39. 60 0
      src/views/room/modules/checkIn/EditWarranterModal.vue
  40. 300 159
      src/views/room/modules/checkIn/FeeForm.vue
  41. 1 1
      src/views/room/modules/checkIn/FeeModal.vue
  42. 96 11
      src/views/room/modules/checkIn/Payment.vue
  43. 51 45
      src/views/room/modules/checkIn/PaymentModal.vue
  44. 26 2
      src/views/room/modules/checkIn/Refund.vue
  45. 6 2
      src/views/room/modules/checkIn/SelectCheckInRoomOrder.vue
  46. 3 1
      src/views/room/modules/checkIn/SelectCheckInRoomOrderModal.vue
  47. 15 2
      src/views/room/modules/checkIn/SelectRoomForm.vue
  48. 2 2
      src/views/room/modules/checkIn/batchCardDetail.vue
  49. 186 0
      src/views/room/modules/checkIn/batchCardDetailCopy.vue
  50. 1 1
      src/views/room/modules/checkIn/batchCardModal.vue
  51. 59 0
      src/views/room/modules/checkIn/batchCardModalCopy.vue
  52. 500 0
      src/views/room/modules/checkIn/liveBatchCardForm.vue
  53. 65 0
      src/views/room/modules/checkIn/liveBatchCardModal.vue
  54. 42 29
      src/views/room/modules/fangtaiModal/exchangeHouses/exchangeHousesForm.vue
  55. 2 2
      src/views/room/modules/leasegoods/CesOrderLeaseGoodsForm.vue
  56. 120 2
      src/views/room/modules/schedule/ScheduleRoomForm.vue
  57. 1 0
      src/views/settings/components/modules/payInterfaceConfigForm.vue
  58. 13 2
      src/views/settings/components/modules/printComponents/breakFastCouponPrint.vue
  59. 10 0
      src/views/settings/components/modules/printComponents/changeRoomPrint.vue
  60. 690 0
      src/views/settings/components/modules/printComponents/checkInPrint.vue
  61. 47 4
      src/views/settings/components/modules/printComponents/extractPrint.vue
  62. 10 0
      src/views/settings/components/modules/printComponents/handoverDetailPrint.vue
  63. 10 0
      src/views/settings/components/modules/printComponents/handoverPrint.vue
  64. 13 3
      src/views/settings/components/modules/printComponents/hotelEntryPrint.vue
  65. 12 2
      src/views/settings/components/modules/printComponents/hotelOutPrint.vue
  66. 12 2
      src/views/settings/components/modules/printComponents/incomePrint.vue
  67. 13 3
      src/views/settings/components/modules/printComponents/memberChargePrint.vue
  68. 10 0
      src/views/settings/components/modules/printComponents/paymentPrint.vue
  69. 10 0
      src/views/settings/components/modules/printComponents/posCheckOutPrint.vue
  70. 12 2
      src/views/settings/components/modules/printComponents/refundPrint.vue
  71. 10 0
      src/views/settings/components/modules/printComponents/renewalOrderPrint.vue
  72. 12 2
      src/views/settings/components/modules/printComponents/settlePrint.vue
  73. 697 0
      src/views/settings/components/modules/printComponents/teamCheckInPrint.vue
  74. 12 1
      src/views/settings/components/modules/printComponents/teamCheckOut.vue
  75. 128 112
      src/views/settings/components/modules/printTemplateForm.vue
  76. 17 1
      src/views/settings/components/paySettings.vue
  77. 100 69
      src/views/settings/components/roomModules/roomNumSettings/roomNumTable.vue
  78. 4 4
      src/views/settings/systemInfo.vue
  79. 34 27
      src/views/system/RoleList.vue
  80. 4 4
      src/views/system/RoleUserList.vue
  81. 7 1
      src/views/system/UserList.vue
  82. 81 6
      src/views/system/modules/RoleModal.vue
  83. 3 3
      src/views/system/modules/UserModal.vue

文件差異過大導致無法顯示
+ 41718 - 0
package-lock.json


+ 4 - 0
src/api/api.js

@@ -7,6 +7,8 @@ const addRole = (params)=>postAction("/sys/role/add",params);
 const editRole = (params)=>putAction("/sys/role/edit",params);
 const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
 const queryall = (params)=>getAction("/sys/role/queryall",params);
+const saveRoleAndPermission = (params)=>postAction("/sys/role/saveRoleAndPermission",params);
+const editRoleAndPermission = (params)=>postAction("/sys/role/editRoleAndPermission",params);
 
 //用户管理
 const addUser = (params)=>postAction("/sys/user/add",params);
@@ -126,6 +128,8 @@ export const transitRESTful = {
 
 export {
   addRole,
+  saveRoleAndPermission,
+  editRoleAndPermission,
   editRole,
   checkRoleCode,
   addUser,

+ 3 - 3
src/api/manage.js

@@ -14,17 +14,17 @@ export default api
 
 //post
 export function postAction(url,parameter) {
-  let sign = signMd5Utils.getSign(url, parameter);
+  // let sign = signMd5Utils.getSign(url, parameter);
   //将签名和时间戳,添加在请求接口 Header
   // update-begin--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
-  let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getTimestamp()};
+  // let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getTimestamp()};
   // update-end--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
 
   return axios({
     url: url,
     method:'post' ,
     data: parameter,
-    headers: signHeader
+    // headers: signHeader
   })
 }
 

+ 3 - 2
src/utils/excloudHotelIdParamPath/CesRoomLayoutPriceController.js

@@ -2,6 +2,7 @@ export default {
     name: '房价管理模块',
     excloudUrls: [
         '/sys/randomImage',
-        '/rooms/cesRoomBuildingFloor/delete'
+        '/rooms/cesRoomBuildingFloor/delete',
+        '/sys/role/list',
     ]
-}
+}

+ 3 - 2
src/views/hotel/newHotelForm.vue

@@ -60,7 +60,7 @@
             <a-input-number placeholder="1~9999" style="width: 180px;" :min="1" :max="9999"  v-decorator="['roomCount', { rules: [{ required: true, message: '1~9999' }], }]"/>
         </a-form-item>
 
-        
+
 
 
         <a-form-item label="集团品牌">
@@ -103,6 +103,7 @@ export default {
     },
     methods: {
         handleSubmit(e) {
+            this.$router.go(0);
             // e.preventDefault();
             this.form.validateFields((err, values) => {
                 if (!err) {
@@ -130,4 +131,4 @@ export default {
 .short-anl{
     width: 70%;
 }
-</style>
+</style>

+ 3 - 1
src/views/markets/agreementunit.vue

@@ -340,9 +340,11 @@
                 var url = '/tenant/marketinfo/agreementaccount';//'markets/agreementunit/agreementAccount';
                 //缓存选择的协议id
                 console.log(record)
+                localStorage.removeItem("agreementUnitInfo")
                 localStorage.setItem("agreementUnitInfo", JSON.stringify(record))
                 this.$router.push({
-                    path:url
+                    path:url,
+                    query: { agreementUnitInfo: record },
                 });
                 // this.$router.push({
                 //     // path: "/room/scheduledetail",

+ 57 - 5
src/views/markets/modules/agreementUnit/account/accountEnterForm.vue

@@ -3,7 +3,7 @@
     <!--        -->
     <!--    </a-card>-->
     <div>
-        <a-tabs default-active-key="1">
+        <a-tabs default-active-key="1" @change="callback">
             <a-tab-pane key="1">
                 <span slot="tab">
                     <a-icon type="template" />
@@ -19,7 +19,7 @@
         </a-tabs>
         <a-spin :spinning="confirmLoading">
             <j-form-container >
-                <a-form-model ref="form" :model="model" slot="detail">
+                <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
                     <a-row>
                         <a-col :span="24">
                             <a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentMethod">
@@ -79,12 +79,20 @@
                 type: Boolean,
                 default: false,
                 required: false
+            },
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
             }
         },
         data () {
             return {
                 confirmLoading: false,
-                model: {},
+                model: {
+                    price:0,
+                },
                 labelCol: {
                     xs: { span: 24 },
                     sm: { span: 3 },
@@ -93,7 +101,18 @@
                     xs: { span: 24 },
                     sm: { span: 18 },
                 },
+                url: {
+                    addEntry: "/business/busAgreementOrderFee/addEntry",
+                    edit: "/business/busAgreementOrderFee/edit",
+                    queryById: "/business/busAgreementOrderFee/queryById"
+                },
+                type:1,
                 paymentMethodList: [],
+                validatorRules: {
+                    // price: [
+                    //     { required: true, message: '请输入金额!'},
+                    // ],
+                },
             }
         },
         created() {
@@ -118,10 +137,43 @@
             handleCancel(){
                 this.close();
             },
+            callback(key) {
+                console.log(key);
+                this.type = key
+            },
             submitForm(){
-                console.log(888)
                 const that = this;
-                that.$emit('ok');
+                if (that.model.price <= 0){
+                    that.$message.warning("金额需大于0");
+                    return;
+                }
+                // 触发表单验证
+                this.$refs.form.validate(valid => {
+                    if (valid) {
+                        that.confirmLoading = true;
+                        let httpurl = this.url.addEntry;
+                        let method = 'post';
+                        var data = {
+                            agreementUnitId:that.agreementModel.id,
+                            projectName:that.type == 1?"预收账款":"预收退款",
+                            type:that.type,
+                            payPrice:that.type == 1?that.model.price:that.model.price*(-1),
+                            payType:that.model.paymentMethod,
+                            remarks:that.model.remarks,
+                        }
+                        console.log(data);
+                        httpAction(httpurl,data,method).then((res)=>{
+                            if(res.success){
+                                that.$message.success(res.message);
+                                that.$emit('ok');
+                            }else{
+                                that.$message.warning(res.message);
+                            }
+                        }).finally(() => {
+                            that.confirmLoading = false;
+                        })
+                    }
+                })
             },
         }
     }

+ 53 - 5
src/views/markets/modules/agreementUnit/account/accountReverseEntryForm.vue

@@ -1,7 +1,7 @@
 <template>
     <a-spin :spinning="confirmLoading">
         <j-form-container >
-            <a-form-model ref="form" :model="model" slot="detail">
+            <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
                 <a-row>
                     <a-col :span="24">
                         <a-form-model-item label="可冲账金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
@@ -16,6 +16,8 @@
                             <a-input-number
                                     v-model="model.price"
                                     placeholder="请输入金额"
+                                    :min="0"
+                                    :max="maxMoney"
                                     style="width: 30%"
                             />
                         </a-form-model-item>
@@ -43,6 +45,8 @@
 </template>
 
 <script>
+    import { httpAction, getAction } from "@/api/manage";
+
     export default {
         name: 'accountReverseEntryForm',
         props: {
@@ -56,12 +60,20 @@
                 type: Number,
                 default: 200,
                 required: false
-            }
+            },
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
+            },
         },
         data () {
             return {
                 confirmLoading: false,
-                model: {},
+                model: {
+                    price:0,
+                },
                 labelCol: {
                     xs: { span: 24 },
                     sm: { span: 3 },
@@ -71,6 +83,14 @@
                     sm: { span: 18 },
                 },
                 paymentMethodList: [],
+                url: {
+                    reverseEntry: "/business/busAgreementOrderFee/reverseEntry",
+                },
+                validatorRules: {
+                    // price: [
+                    //     { required: true, message: '请输入金额!'},
+                    // ],
+                },
             }
         },
         created() {
@@ -83,9 +103,37 @@
                 // this.visible = true;
             },
             submitForm(){
-                console.log(888)
                 const that = this;
-                that.$emit('ok');
+                if (that.model.price <=0){
+                    that.$message.warning("金额需大于0");
+                    return;
+                }
+                // 触发表单验证
+                this.$refs.form.validate(valid => {
+                    if (valid) {
+                        that.confirmLoading = true;
+                        let httpurl = this.url.reverseEntry;
+                        let method = 'post';
+                        var data = {
+                            agreementUnitId:that.agreementModel.id,
+                            projectName:"冲账",
+                            type:6,
+                            payPrice:that.model.price*(-1),
+                            remarks:that.model.remarks,
+                        }
+                        console.log(data);
+                        httpAction(httpurl,data,method).then((res)=>{
+                            if(res.success){
+                                that.$message.success(res.message);
+                                that.$emit('ok');
+                            }else{
+                                that.$message.warning(res.message);
+                            }
+                        }).finally(() => {
+                            that.confirmLoading = false;
+                        })
+                    }
+                })
             },
         }
     }

+ 24 - 6
src/views/markets/modules/agreementUnit/account/accountTransferForm.vue

@@ -62,8 +62,8 @@
                 default: false,
                 required: false
             },
-            maxMoney: {
-                type: Number,
+            orderIds: {
+                type: String,
                 default: 200,
                 required: false
             }
@@ -108,6 +108,7 @@
                 ],
                 url: {
                     list: "/business/busMarketAgreementUnit/list",
+                    transferBatch: "/business/busAgreementOrderFee/transferBatch",
                 },
             }
         },
@@ -129,11 +130,28 @@
                 // this.changeColumns(this.model.roomType, this.model.fixedDiscount)
                 // this.visible = true;
             },
-            handleTransfer(){
-                console.log('确认转账');
-                this.$message.success("转账成功");
+            handleTransfer(record){
+                console.log(record);
+                console.log(this.orderIds);
                 const that = this;
-                that.$emit('ok');
+                var data = {
+                    agreementUnitId:record.id,
+                    orderIds:that.orderIds
+                }
+                console.log(data);
+                that.confirmLoading = true;
+                let httpurl = this.url.transferBatch;
+                let method = 'post';
+                httpAction(httpurl,data,method).then((res)=>{
+                    if(res.success){
+                        that.$message.success(res.message);
+                        that.$emit('ok');
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
             }
         }
     }

+ 2 - 6
src/views/markets/modules/agreementUnit/account/accountTransferModal.vue

@@ -8,7 +8,7 @@
             @ok="handleOk"
             @cancel="handleCancel"
             cancelText="关闭">
-        <account-transfer-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :maxMoney="maxMoney" :agreementModel="agreementModel"></account-transfer-form>
+        <account-transfer-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :orderIds="orderIds" :agreementModel="agreementModel"></account-transfer-form>
     </j-modal>
 </template>
 
@@ -26,16 +26,12 @@
                 required: false,
                 default: () => {
                 }
-            },
-            maxMoney: {
-                type: Number,
-                default: 200,
-                required: false
             }
         },
         data () {
             return {
                 title:'',
+                orderIds:'',
                 width:1000,
                 visible: false,
                 disableSubmit: false

+ 104 - 0
src/views/markets/modules/agreementUnit/account/commodityRecord.vue

@@ -0,0 +1,104 @@
+<template>
+    <div>
+        <a-table
+                ref="table"
+                size="middle"
+                :scroll="{x:true}"
+                rowKey="id"
+                :columns="columns"
+                :dataSource="dataSource"
+                :pagination="ipagination"
+                :loading="loading"
+                class="j-table-force-nowrap"
+                @change="handleTableChange">
+        </a-table>
+    </div>
+</template>
+
+<script>
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+    export default {
+        name: 'commodityRecord',
+        mixins:[JeecgListMixin, mixinDevice],
+        props: {
+            agreementOrderFeeId:{
+                type: String,
+                required: false,
+                default: () => {
+                }
+            }
+        },
+        data(){
+          return {
+              // 表头
+              columns: [
+                  {
+                      title:'科目',
+                      align:"center",
+                      dataIndex: 'categoryId_dictText',
+                  },
+                  {
+                      title:'分类',
+                      align:"center",
+                      dataIndex: 'categoryTwoId_dictText',
+                  },
+                  {
+                      title:'名称',
+                      align:"center",
+                      dataIndex: 'goodsId_dictText',
+                  },
+                  {
+                      title:'单价',
+                      align:"center",
+                      dataIndex: 'shopPrice',
+                      sorter: (a, b) => a.shopPrice - b.shopPrice,
+                  },
+                  {
+                      title:'数量',
+                      align:"center",
+                      dataIndex: 'buyNumber',
+                      sorter: (a, b) => a.buyNumber - b.buyNumber,
+                  },
+                  {
+                      title:'购买人',
+                      align:"center",
+                      dataIndex: 'purchaserName',
+                  },
+                  {
+                      title:'总价格',
+                      align:"center",
+                      dataIndex: 'amount',
+                  },
+                  {
+                      title:'操作员',
+                      align:"center",
+                      dataIndex: 'createBy'
+                  },
+                  {
+                      title:'备注',
+                      align:"center",
+                      dataIndex: 'remarks'
+                  }
+              ],
+              url: {
+                  list: "/business/busCommodityRecord/list?agreementOrderFeeId="+this.agreementOrderFeeId,
+              },
+          }
+        },
+        created() {
+            console.log(this.agreementOrderFeeId)
+        },
+        methods:{
+            show(){
+
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 53 - 0
src/views/markets/modules/agreementUnit/account/commodityRecordModal.vue

@@ -0,0 +1,53 @@
+<template>
+    <j-modal
+            :title="title"
+            :width="width"
+            :visible="visible"
+            switchFullscreen
+            @ok="handleOk"
+            :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+            cancelText="关闭"
+            @cancel="handleCancel">
+        <commodity-record ref="realForm" :disabled="disableSubmit" :agreementOrderFeeId="agreementOrderFeeId"></commodity-record>
+    </j-modal>
+</template>
+
+<script>
+    import CommodityRecord from './commodityRecord'
+    export default {
+        name: 'commodityRecordModal',
+        components: {
+            CommodityRecord
+        },
+        props: {
+        },
+        data () {
+            return {
+                title:'',
+                agreementOrderFeeId:'',
+                width:1200,
+                visible: false,
+                disableSubmit: false,
+            }
+        },
+        methods: {
+            show () {
+                this.visible=true
+                this.$nextTick(()=>{
+                    this.$refs.realForm.show();
+                })
+            },
+            close () {
+                this.$emit('close');
+                this.visible = false;
+            },
+            handleOk () {
+                this.$refs.realForm.submitForm();
+            },
+            handleCancel () {
+                this.close()
+            }
+        }
+    }
+</script>
+

+ 187 - 0
src/views/markets/modules/agreementUnit/account/commodityReturn.vue

@@ -0,0 +1,187 @@
+<template>
+    <div>
+        <a-table
+                ref="table"
+                size="middle"
+                :scroll="{x:true}"
+                rowKey="id"
+                :columns="columns"
+                :dataSource="dataSource"
+                :pagination="false"
+                :loading="loading"
+                class="j-table-force-nowrap"
+                @change="handleTableChange">
+
+            <template slot="returnSlot" slot-scope="text, record">
+                <span>{{(record.returnMaxNumber)}}</span>
+            </template>
+            <template slot="returnNumberSlot" slot-scope="text, record">
+                <a-input-number :class="record.id"
+                                v-model="record.returnNumber"
+                                placeholder="请输入数量"
+                                style="width: 50%"
+                                :min="0"
+                                :max="record.returnMaxNumber"
+                                :disabled="record.sellingPrice == 0"
+                />
+            </template>
+            <template slot="returnMoneySlot" slot-scope="text, record">
+                <span>{{record.shopPrice*record.returnNumber}}</span>
+            </template>
+        </a-table>
+
+        <j-form-container style="margin-top: 10px;" >
+            <a-form-model ref="form" :model="model" slot="detail">
+                <a-row>
+                    <a-col :span="24">
+                        <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">
+                            <a-textarea
+                                    v-model="model.remarks"
+                                    rows="4"
+                                    placeholder="请输入备注"
+                                    style="width: 100%"
+                            />
+                        </a-form-model-item>
+                    </a-col>
+                </a-row>
+            </a-form-model>
+        </j-form-container>
+    </div>
+</template>
+
+<script>
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import { httpAction, getAction } from "@/api/manage";
+
+    export default {
+        name: 'commodityReturn',
+        mixins:[JeecgListMixin, mixinDevice],
+        props: {
+            agreementOrderFeeId:{
+                type: String,
+                required: false,
+                default: () => {
+                }
+            }
+        },
+        data(){
+            return {
+                model:{
+                    remarks:'',
+                },
+                confirmLoading: false,
+                labelCol: {
+                    xs: { span: 24 },
+                    sm: { span: 2 },
+                },
+                wrapperCol: {
+                    xs: { span: 24 },
+                    sm: { span: 22 },
+                },
+                // 表头
+                columns: [
+                    {
+                        title:'名称',
+                        align:"center",
+                        dataIndex: 'goodsId_dictText',
+                    },
+                    {
+                        title:'可退数',
+                        align:"center",
+                        dataIndex: 'buyNumber',
+                        scopedSlots: { customRender: 'returnSlot' }
+                    },
+                    {
+                        title:'单价',
+                        align:"center",
+                        dataIndex: 'shopPrice',
+                        customRender: function (text) {
+                            return !text?"":'¥'+text
+                        },
+                    },
+                    {
+                        title:'退货数量',
+                        align:"center",
+                        dataIndex: 'purchaserName',
+                        scopedSlots: { customRender: 'returnNumberSlot' }
+                    },
+                    {
+                        title:'退款',
+                        align:"center",
+                        dataIndex: 'amount',
+                        scopedSlots: { customRender: 'returnMoneySlot' }
+                    },
+
+                ],
+                url: {
+                    list: "/business/busCommodityRecord/list?agreementOrderFeeId="+this.agreementOrderFeeId,
+                    addReturn: "/business/busAgreementOrderFee/addReturn",
+                },
+            }
+        },
+        created() {
+            console.log(this.agreementOrderFeeId)
+        },
+        methods:{
+            show(){
+
+            },
+            submitForm(){
+                var that = this;
+                var goodsList = [];
+                var goodsDataSource = this.dataSource;
+                if (goodsDataSource && goodsDataSource.length > 0){
+                    var amount = 0
+                    for(let i=0;i<goodsDataSource.length;i++){
+                        var item = goodsDataSource[i];
+                        if (parseFloat(item.returnNumber) > 0 ){
+                            var _money = parseFloat(item.returnNumber) * parseFloat(item.shopPrice);
+                            amount = amount + parseFloat(_money.toFixed(2));
+                            var goodsItem = {
+                                id:item.id,
+                                returnNumber:item.returnNumber,
+                            }
+                            goodsList.push(goodsItem)
+                        }
+                    }
+                    if (amount <= 0 ){
+                        that.$message.warning('退货信息未填写');
+                        return;
+                    }
+
+                    //组装退货信息
+                    var data = {
+                        id:that.agreementOrderFeeId,
+                        type:4,
+                        payPrice:amount*(-1),
+                        remarks:that.model.remarks,
+                        commodityRecords:goodsList
+                    }
+
+                    that.confirmLoading = true;
+                    let httpurl = this.url.addReturn;
+                    let method = 'post';
+
+                    httpAction(httpurl,data,method).then((res)=>{
+                        if(res.success){
+                            that.$message.success(res.message);
+                            that.$emit('ok');
+                        }else{
+                            that.$message.warning(res.message);
+                        }
+                    }).finally(() => {
+                        that.confirmLoading = false;
+                    })
+                }
+
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>
+

+ 55 - 0
src/views/markets/modules/agreementUnit/account/commodityReturnModal.vue

@@ -0,0 +1,55 @@
+<template>
+    <j-modal
+            :title="title"
+            :width="width"
+            :visible="visible"
+            switchFullscreen
+            @ok="handleOk"
+            @cancel="handleCancel">
+        <commodity-return ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :agreementOrderFeeId="agreementOrderFeeId"></commodity-return>
+    </j-modal>
+</template>
+
+<script>
+    import CommodityReturn from './commodityReturn'
+    export default {
+        name: 'commodityReturnModal',
+        components: {
+            CommodityReturn
+        },
+        props: {
+        },
+        data () {
+            return {
+                title:'',
+                agreementOrderFeeId:'',
+                width:800,
+                visible: false,
+                disableSubmit: false,
+            }
+        },
+        methods: {
+            show () {
+                this.visible=true
+                this.$nextTick(()=>{
+                    this.$refs.realForm.show();
+                })
+            },
+            close () {
+                this.$emit('close');
+                this.visible = false;
+            },
+            handleOk () {
+                this.$refs.realForm.submitForm();
+            },
+            submitCallback(){
+                this.$emit('ok');
+                this.visible = false;
+            },
+            handleCancel () {
+                this.close()
+            }
+        }
+    }
+</script>
+

+ 180 - 157
src/views/markets/modules/agreementUnit/account/goodsConsumeForm.vue

@@ -1,111 +1,15 @@
 <template>
     <div>
-<!--        <a-row type="flex">-->
-<!--            <a-col :flex="1">1 / 3</a-col>-->
-<!--            <a-col :flex="2">2 / 3</a-col>-->
-<!--        </a-row>-->
-<!--        <a-row type="flex" style="flex-direction: row">-->
-<!--            <a-col :flex="1">-->
-<!--                <a-spin :spinning="confirmLoading">-->
-<!--                    <j-form-container >-->
-<!--                        <a-form-model ref="form" :model="model" slot="detail">-->
-<!--                            <a-row>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentMethod">-->
-<!--                                        <a-select-->
-<!--                                                v-model="model.paymentMethod"-->
-<!--                                                style="width: 30%"-->
-<!--                                                placeholder="支付方式" >-->
-<!--                                            <a-select-option-->
-<!--                                                    v-for="(item, index) in paymentMethodList"-->
-<!--                                                    :key="index"-->
-<!--                                                    :value="item.id"-->
-<!--                                            >{{ item.name }}</a-select-option>-->
-<!--                                        </a-select>-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">-->
-<!--                                        <a-input-number-->
-<!--                                                v-model="model.price"-->
-<!--                                                placeholder="请输入金额"-->
-<!--                                                style="width: 30%"-->
-<!--                                        />-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">-->
-<!--                                        <a-textarea-->
-<!--                                                v-model="model.remarks"-->
-<!--                                                rows="4"-->
-<!--                                                placeholder="请输入备注"-->
-<!--                                                style="width: 90%"-->
-<!--                                        />-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-
-<!--                            </a-row>-->
-<!--                        </a-form-model>-->
-<!--                    </j-form-container>-->
-<!--                </a-spin>-->
-<!--            </a-col>-->
-<!--            <a-col :flex="2">-->
-<!--                <a-spin :spinning="confirmLoading">-->
-<!--                    <j-form-container >-->
-<!--                        <a-form-model ref="form" :model="model" slot="detail">-->
-<!--                            <a-row>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentMethod">-->
-<!--                                        <a-select-->
-<!--                                                v-model="model.paymentMethod"-->
-<!--                                                style="width: 30%"-->
-<!--                                                placeholder="支付方式" >-->
-<!--                                            <a-select-option-->
-<!--                                                    v-for="(item, index) in paymentMethodList"-->
-<!--                                                    :key="index"-->
-<!--                                                    :value="item.id"-->
-<!--                                            >{{ item.name }}</a-select-option>-->
-<!--                                        </a-select>-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">-->
-<!--                                        <a-input-number-->
-<!--                                                v-model="model.price"-->
-<!--                                                placeholder="请输入金额"-->
-<!--                                                style="width: 30%"-->
-<!--                                        />-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-<!--                                <a-col :span="24">-->
-<!--                                    <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">-->
-<!--                                        <a-textarea-->
-<!--                                                v-model="model.remarks"-->
-<!--                                                rows="4"-->
-<!--                                                placeholder="请输入备注"-->
-<!--                                        />-->
-<!--                                    </a-form-model-item>-->
-<!--                                </a-col>-->
-
-<!--                            </a-row>-->
-<!--                        </a-form-model>-->
-<!--                    </j-form-container>-->
-<!--                </a-spin>-->
-<!--                <div style="height: 200px">-->
-
-<!--                </div>-->
-<!--            </a-col>-->
-<!--        </a-row>-->
         <div class="contentGoods">
             <div class="left">
                 <a-spin :spinning="confirmLoading">
                     <j-form-container >
-                        <a-form-model ref="form" :model="model" slot="detail">
+                        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
                             <a-row>
                                 <a-col :span="24">
-                                    <a-form-model-item label="消费类目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stockType">
+                                    <a-form-model-item label="消费类目" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="categoryId">
                                         <a-select
-                                                v-model="model.stockType"
+                                                v-model="model.categoryId"
                                                 style="width: 90%"
                                                 @change="changeStockType"
                                                 placeholder="消费类目" >
@@ -118,17 +22,17 @@
                                     </a-form-model-item>
                                 </a-col>
                                 <a-col :span="24">
-                                    <a-form-model-item label="消费金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
+                                    <a-form-model-item label="消费金额" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="payPrice">
                                         <a-input-number
-                                                disabled
-                                                v-model="model.amount"
+                                                :disabled="goodsCount > 0"
+                                                v-model="model.payPrice"
                                                 placeholder="请输入金额"
                                                 style="width: 90%"
                                         />
                                     </a-form-model-item>
                                 </a-col>
                                 <a-col :span="24">
-                                    <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">
+                                    <a-form-model-item label="备注" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="remarks">
                                         <a-textarea
                                                 v-model="model.remarks"
                                                 rows="4"
@@ -143,17 +47,17 @@
                     </j-form-container>
                 </a-spin>
             </div>
-            <div class="right">
+            <div class="right"  v-if="goodsCount > 0">
                 <a-spin :spinning="confirmLoading">
                     <j-form-container>
-                        <a-form-model ref="form" :model="model" slot="detail">
+                        <a-form-model ref="formCommodity" :model="modelCommodity" slot="detail">
                             <a-row>
                                 <a-col :span="9" v-if="type == 1">
-                                    <a-form-model-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="childStockType">
+                                    <a-form-model-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryTwoId">
                                         <a-select
-                                                v-model="model.childStockType"
+                                                v-model="modelCommodity.categoryTwoId"
                                                 style="width: 100%"
-                                                @change="changeStockType"
+                                                @change="handleSearch()"
                                                 placeholder="类别" >
                                             <a-select-option
                                                     v-for="(item, index) in childStockTypeList"
@@ -208,17 +112,24 @@
                                     v-model="record.sellingPrice"
                                     placeholder="请输入金额"
                                     style="width: 90%"
+                                    :min="0"
                                     @change="e=>changePrice(e,record)"
                             />
                         </template>
                         <template slot="numberSlot" slot-scope="text,record">
-                            <a-input-number
-                                    v-model="record.number"
-                                    placeholder="请输入数量"
-                                    style="width: 90%"
-                                    @change="e=>changeNumber(e,record)"
+                            <a-input-number :class="record.id"
+                                            v-model="record.number"
+                                            placeholder="请输入数量"
+                                            style="width: 90%"
+                                            :min="0"
+                                            :disabled="record.sellingPrice == 0"
+                                            @change="e=>changeNumber(e,record)"
                             />
                         </template>
+                        <template slot="inventorySlot" slot-scope="text,record">
+                            {{record.inventory - record.number}}
+                        </template>
+
                     </a-table>
                 </div>
             </div>
@@ -240,6 +151,12 @@
                 type: Boolean,
                 default: false,
                 required: false
+            },
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
             }
         },
         mixins:[JeecgListMixin, mixinDevice],
@@ -247,10 +164,26 @@
             return {
                 confirmLoading: false,
                 model: {
-                    stockType:'',
-                    amount:0,
+                    categoryId:'',
+                    payPrice:0,
                     remarks:'',
-                    childStockType:'',
+                },
+                modelCommodity:{
+                    categoryId:'',
+                    categoryTwoId:'',
+                    goodsId:'',
+                    shopPrice:0,
+                    buyNumber:0,
+                    amount:0,
+                    remarks:'',//协议单位名称+备注
+                },
+                labelCol1: {
+                    xs: { span: 24 },
+                    sm: { span: 3 },
+                },
+                wrapperCol1: {
+                    xs: { span: 24 },
+                    sm: { span: 20 },
                 },
                 labelCol: {
                     xs: { span: 24 },
@@ -260,12 +193,18 @@
                     xs: { span: 24 },
                     sm: { span: 18 },
                 },
+                validatorRules: {
+                    categoryId: [
+                        { required: true, message: '请选择消费类目!'},
+                    ],
+                },
                 paymentMethodList: [],
                 stockTypeList:[],
                 childStockTypeList:[],
                 type:1,
                 url: {
                     list: "/rooms/cesGoods/queryList",
+                    addEntry: "/business/busAgreementOrderFee/addEntry",
                 },
                 // 表头
                 columns: [
@@ -289,9 +228,12 @@
                     {
                         title:'剩余库存',
                         align:"center",
-                        dataIndex: 'inventory'
+                        dataIndex: 'inventory',
+                        scopedSlots: { customRender: 'inventorySlot' }
                     },
                 ],
+                projectName:'',
+                goodsCount:0,
                 // loading:true,
                 // dataSource:[]
             }
@@ -315,7 +257,9 @@
                 // this.visible = true;
             },
             changeStockType(e){
+                this.modelCommodity.categoryTwoId = '';
                 var _this = this;
+                _this.childStockTypeList = []
                 httpAction(
                     "/rooms/cesStockType/getChildTypes?parentId="+e,
                     { },
@@ -324,19 +268,65 @@
                     if (res.success) {
                         _this.childStockTypeList = res.result;
                     }
+                }).finally(() => {
+                    _this.handleSearch(1)
                 });
             },
-            handleSearch(){
+            handleSearch(type) {
                 var typeId = "";
                 var search = "";
-                if (this.model.childStockType){
-                    typeId = this.model.childStockType;
-                }
-                if (this.model.goodsName){
+                var _this = this;
+
+                if (this.model.goodsName) {
                     search = this.model.goodsName;
                 }
-                this.url.list = "/rooms/cesGoods/queryList?typeId="+typeId+"&search="+search;
+
+                if (type == 1) {
+                    if (this.model.categoryId) {
+                        typeId = this.model.categoryId;
+                    }
+
+                    httpAction(
+                        "/rooms/cesGoods/queryList?typeId=" + typeId + "&search=" + search,
+                        { },
+                        "get"
+                    ).then((res) => {
+                        console.log(res)
+                        if (res.success) {
+                            _this.goodsCount = res.result.length;
+                            console.log(_this.goodsCount)
+                            if (_this.goodsCount > 0){
+                                _this.labelCol1= {
+                                    xs: { span: 24 },
+                                    sm: { span: 8 },
+                                }
+                                _this.wrapperCol1= {
+                                    xs: { span: 24 },
+                                    sm: { span: 14 },
+                                }
+                            }else{
+                                _this.labelCol1= {
+                                    xs: { span: 24 },
+                                    sm: { span: 3 },
+                                }
+                                _this.wrapperCol1= {
+                                    xs: { span: 24 },
+                                    sm: { span: 20 },
+                                }
+                            }
+                        }
+                    }).finally(() => {
+                    });
+                } else {
+                    if (this.modelCommodity.categoryTwoId) {
+                        typeId = this.modelCommodity.categoryTwoId;
+                    }
+                }
+
+                this.url.list = "/rooms/cesGoods/queryList?typeId=" + typeId + "&search=" + search;
+
                 this.loadData(1);
+
             },
             handleChangeType(){
                 if (this.type == 1){
@@ -348,37 +338,67 @@
                 }
             },
             submitForm () {
-                console.log(9999)
-                const that = this;
-                that.$emit('ok');
+                var that = this;
+                var categoryIndex = this.stockTypeList.findIndex((s) => s.id == this.model.categoryId);
+                var _projectName = '';
+                if (categoryIndex > 0){
+                    _projectName = this.stockTypeList[categoryIndex].name
+                }
+                var goodsList = [];
+                var goodsDataSource = this.dataSource;
+                if (goodsDataSource && goodsDataSource.length > 0){
+                    for(let i=0;i<goodsDataSource.length;i++){
+                        var item = goodsDataSource[i];
+                        if (parseFloat(item.number) > 0 && parseFloat(item.sellingPrice) > 0){
+                            var _amount = parseFloat(item.number) * parseFloat(item.sellingPrice);
+                            var amount = parseFloat(_amount.toFixed(2));
+                            var goodsItem = {
+                                categoryId:that.model.categoryId,
+                                categoryTwoId:that.modelCommodity.categoryTwoId,
+                                goodsId:item.id,
+                                shopPrice:item.sellingPrice,
+                                buyNumber:item.number,
+                                amount:amount,
+                                remarks:that.agreementModel.customerName+','+that.model.remarks,//协议单位名称+备注
+                            }
+                            goodsList.push(goodsItem)
+                        }
+                    }
+                }
+                if (that.model.payPrice <= 0){
+                    that.$message.warning("没有消费");
+                    return;
+                }
+                console.log(goodsList)
                 // 触发表单验证
-                // this.$refs.form.validate(valid => {
-                //     if (valid) {
-                //         that.confirmLoading = true;
-                //         let httpurl = '';
-                //         let method = '';
-                //         if(!this.model.id){
-                //             httpurl+=this.url.add;
-                //             method = 'post';
-                //             this.model.hotelId = hotelInfo.id;
-                //             this.model.agreementId = this.agreementModel.id;
-                //         }else{
-                //             httpurl+=this.url.edit;
-                //             method = 'put';
-                //         }
-                //         httpAction(httpurl,this.model,method).then((res)=>{
-                //             if(res.success){
-                //                 that.$message.success(res.message);
-                //                 that.$emit('ok');
-                //             }else{
-                //                 // that.$message.warning(res.message);
-                //             }
-                //         }).finally(() => {
-                //             that.confirmLoading = false;
-                //         })
-                //     }
-                //
-                // })
+                this.$refs.form.validate(valid => {
+                    if (valid) {
+                        that.confirmLoading = true;
+                        let httpurl = this.url.addEntry;
+                        let method = 'post';
+                        var data = {
+                            agreementUnitId:that.agreementModel.id,
+                            categoryId:that.model.categoryId,
+                            projectName:_projectName,
+                            type:3,
+                            payPrice:that.model.payPrice,
+                            remarks:that.model.remarks,
+                            commodityRecords:goodsList
+                        }
+                        console.log(data);
+                        httpAction(httpurl,data,method).then((res)=>{
+                            if(res.success){
+                                that.$message.success(res.message);
+                                that.$emit('ok');
+                            }else{
+                                that.$message.warning(res.message);
+                            }
+                        }).finally(() => {
+                            that.confirmLoading = false;
+                        })
+                    }
+
+                })
             },
             changePrice(e,record){
                 var _amount = 0;
@@ -387,12 +407,13 @@
                     for (var i = 0; i < goodsList.length; i++) {
                         var goods = goodsList[i];
                         if (parseFloat(goods.number) > 0){
-                            var money = parseFloat( goods.sellingPrice )* parseFloat(goods.number)
+                            var _money = parseFloat( goods.sellingPrice )* parseFloat(goods.number)
+                            var money = parseFloat(_money.toFixed(2))
                             _amount = _amount+ money;
                         }
                     }
                 }
-                this.model.amount = _amount;
+                this.model.payPrice = _amount;
             },
             changeNumber(e,record){
                 var _amount = 0;
@@ -401,12 +422,14 @@
                     for (var i = 0; i < goodsList.length; i++) {
                         var goods = goodsList[i];
                         if (parseFloat(goods.number) > 0){
-                            var money = parseFloat( goods.sellingPrice )* parseFloat(goods.number)
+                            var _money = parseFloat( goods.sellingPrice )* parseFloat(goods.number)
+                            var money = parseFloat(_money.toFixed(2))
                             _amount = _amount+ money;
                         }
                     }
                 }
-                this.model.amount = _amount;
+                console.log(_amount)
+                this.model.payPrice = _amount;
             },
         }
     }

+ 50 - 4
src/views/markets/modules/agreementUnit/account/settlementForm.vue

@@ -4,9 +4,9 @@
             <a-form-model ref="form" :model="model" slot="detail">
                 <a-row>
                     <a-col :span="24">
-                        <a-form-model-item label="应收金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
+                        <a-form-model-item :label="maxMoney > 0 ?'应收金额':'应退金额'" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
                             <a-input-number disabled
-                                            v-model="maxMoney"
+                                            v-model="Math.abs(maxMoney)"
                                             style="width: 30%"
                             />
                         </a-form-model-item>
@@ -30,6 +30,7 @@
                             <a-input-number
                                     v-model="model.price"
                                     placeholder="请输入金额"
+                                    :min="0"
                                     style="width: 30%"
                             />
                         </a-form-model-item>
@@ -68,10 +69,21 @@
                 default: false,
                 required: false
             },
+            agreementModel:{
+                type: Object,
+                required: false,
+                default: () => {
+                }
+            },
             maxMoney: {
                 type: Number,
                 default: 200,
                 required: false
+            },
+            orderIds: {
+                type: String,
+                default: 200,
+                required: false
             }
         },
         data () {
@@ -87,6 +99,10 @@
                     sm: { span: 18 },
                 },
                 paymentMethodList: [],
+                url: {
+                    list: "/rooms/cesGoods/queryList",
+                    updateStatusBatch: "/business/busAgreementOrderFee/updateStatusBatch",
+                },
             }
         },
         created() {
@@ -108,9 +124,39 @@
                 // this.visible = true;
             },
             submitForm(){
-                console.log(888)
+                console.log(this.$parent)
                 const that = this;
-                that.$emit('ok');
+                if(this.model.price != Math.abs(this.maxMoney)){
+                    that.$message.warning("支付金额应等于应收/应退金额");
+                    return;
+                }
+                that.confirmLoading = true;
+                let httpurl = this.url.updateStatusBatch;
+                let method = 'post';
+
+                var order = {
+                    agreementUnitId:that.agreementModel.id,
+                    projectName:that.maxMoney >=0?"结算收款":"结算退款",
+                    type:5,
+                    payPrice:that.maxMoney,
+                    payType:that.model.paymentMethod,
+                    remarks:that.model.remarks,
+                }
+                var data = {
+                    busAgreementOrderFee:order,
+                    orderIds:that.orderIds
+                }
+                console.log(data);
+                httpAction(httpurl,data,method).then((res)=>{
+                    if(res.success){
+                        that.$message.success(res.message);
+                        that.$emit('ok');
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
             },
         }
     }

+ 13 - 6
src/views/markets/modules/agreementUnit/account/settlementModal.vue

@@ -7,7 +7,7 @@
             @ok="handleOk"
             @cancel="handleCancel"
             cancelText="关闭">
-        <settlement-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :maxMoney="maxMoney" :agreementModel="agreementModel"></settlement-form>
+        <settlement-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :maxMoney="maxMoney" :orderIds="orderIds" :agreementModel="agreementModel"></settlement-form>
     </j-modal>
 </template>
 
@@ -26,15 +26,22 @@
                 default: () => {
                 }
             },
-            maxMoney: {
-                type: Number,
-                default: 200,
-                required: false
-            }
+            // maxMoney: {
+            //     type: Number,
+            //     default: 200,
+            //     required: false
+            // },
+            // orderIds: {
+            //     type: String,
+            //     default: 200,
+            //     required: false
+            // }
         },
         data () {
             return {
                 title:'',
+                orderIds:'',
+                maxMoney:0,
                 width:1000,
                 visible: false,
                 disableSubmit: false

+ 350 - 31
src/views/markets/modules/agreementUnit/agreementAccount.vue

@@ -67,31 +67,31 @@
         </div>
         <div class="oper">
             <div class="oper-wrapper">
-                <div class="oper-item">
+                <div class="oper-item" v-if="settleType != 2">
                     <a-button @click="handleClick(1)">
                         <a-icon type="file" />
                         商品消费
                     </a-button>
                 </div>
-                <div class="oper-item">
+                <div class="oper-item" v-if="settleType != 2">
                     <a-button @click="handleClick(2)">
                         <a-icon type="file" />
                         入账
                     </a-button>
                 </div>
-                <div class="oper-item">
+                <div class="oper-item" v-if="settleType == 1">
                     <a-button @click="handleClick(3)">
                         <a-icon type="file" />
                         转账
                     </a-button>
                 </div>
-                <div class="oper-item">
+                <div class="oper-item" v-if="settleType == 1">
                     <a-button @click="handleClick(4)">
                         <a-icon type="file" />
                         结算
                     </a-button>
                 </div>
-                <div class="oper-item">
+                <div class="oper-item" v-if="settleType == 1">
                     <a-button @click="handleClick(5)">
                         <a-icon type="file" />
                         冲账
@@ -114,40 +114,125 @@
                     <a-range-picker v-model="rangeValue" @change="onRangeChange" :format="dateFormat" />
                 </span>
                 <span style="display: inline-block; margin-left: 10px;">
-                    <a-button>
-                        <a-icon type="search" />
+                    <a-button @click="searchQuery" icon="search">
                         查询
                     </a-button>
                 </span>
                 <span style="display: block; margin-left: 10px;">
                     <a-tag color="orange">
-                        <pre style="margin: 0;">消费:¥300    收款:¥0    余额:¥-300</pre>
+                        <pre style="margin: 0;">消费:¥{{ accountModel.consume }}    收款:¥{{ accountModel.payment }}    余额:¥{{ accountModel.consume - accountModel.payment }}</pre>
                     </a-tag>
                 </span>
             </div>
         </div>
-        <div class="cotent">
+        <div class="cotent" style="margin-top: 20px;">
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
 
+                <template slot="projectNameSlot" slot-scope="text, record">
+                    <span v-if="record.type == 3">
+<!--                        <a-tag color="green" @click="handleCommodityRecord(record)">-->
+<!--                            {{record.projectName}}-->
+<!--                        </a-tag>-->
+                        <a-button class="project_name" @click="handleCommodityRecord(record)">
+                          {{record.categoryId_dictText}}
+                        </a-button>
+                    </span>
+                    <span v-else>
+                        <span v-if="record.categoryId != null && record.categoryId.toString().length >0 ">
+                            {{record.categoryId_dictText}}
+                        </span>
+                        <span v-else>
+                            {{record.projectName}}
+                        </span>
+                    </span>
+                </template>
+                <template slot="orderNoSlot" slot-scope="text, record">
+                    <a style="color: #4172db">{{record.orderNo}}</a>
+                </template>
+                <template slot="saleSlot" slot-scope="text, record">
+                    <span v-if="record.type == 1 || record.type == 2">
+                        -
+                    </span>
+                    <span v-else>
+                        <a-tag color="green"  v-if="record.payPrice >= 0">
+                            {{record.payPrice}}
+                        </a-tag>
+                        <a-tag color="red" v-else>
+                            {{record.payPrice}}
+                        </a-tag>
+                    </span>
+                </template>
+                <template slot="paymentSlot" slot-scope="text, record">
+                    <span v-if="record.type == 1 || record.type == 2">
+                        <a-tag color="green" v-if="record.type == 1">
+                            {{record.payPrice}}
+                        </a-tag>
+                        <a-tag color="red" v-else>
+                            {{record.payPrice}}
+                        </a-tag>
+                    </span>
+                    <span v-else>
+                        -
+                    </span>
+                </template>
+                <template slot="statusSlot" slot-scope="text, record">
+                    <a-tag v-if="record.status == 2" color="green">已结算</a-tag>
+                    <a-tag v-else color="red">未结算</a-tag>
+                </template>
+                <template slot="remarksSlot" slot-scope="text,record">
+                    <a-input v-model="record.remarks" placeholder="" @blur="handleAccountRemarks(record)"></a-input>
+                </template>
+                <span slot="action" slot-scope="text, record">
+                    <a-popconfirm v-if="record.status == 2" title="确定撤销结算吗?" @confirm="() => handleRevoke(record)">
+                      <a>撤销</a>
+                    </a-popconfirm>
+                    <span v-else>
+                        <a v-if="record.type == 3" @click="handleGoodsReturn(record)">退货</a>
+                    </span>
+                </span>
+            </a-table>
         </div>
 
         <goods-consume-modal ref="goodsConsumeForm" @ok="modalFormOk" :agreementModel="agreementUnitInfo"></goods-consume-modal>
-        <account-enter-modal ref="accountEnterForm" @ok="modalFormOk"></account-enter-modal>
-        <account-reverse-entry-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountReverseEnterForm" @ok="modalFormOk"></account-reverse-entry-modal>
-        <account-transfer-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountTransferForm" @ok="modalFormOk"></account-transfer-modal>
-        <settlement-modal :maxMoney="parseFloat(accountModel.consume)" ref="settlementForm" @ok="modalFormOk"></settlement-modal>
+        <account-enter-modal ref="accountEnterForm" @ok="modalFormOk" :agreementModel="agreementUnitInfo"></account-enter-modal>
+        <account-reverse-entry-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountReverseEnterForm" :agreementModel="agreementUnitInfo" @ok="modalFormOk"></account-reverse-entry-modal>
+        <account-transfer-modal :maxMoney="parseFloat(accountModel.consume)" ref="accountTransferForm" :agreementModel="agreementUnitInfo" @ok="modalFormOk"></account-transfer-modal>
+        <settlement-modal ref="settlementForm" :agreementModel="agreementUnitInfo" @ok="modalFormOk"></settlement-modal>
+        <commodity-record-modal ref="commodityRecordForm" @ok="modalFormOk"></commodity-record-modal>
+        <commodity-return-modal ref="commodityReturnForm" @ok="modalFormOk"></commodity-return-modal>
     </a-card>
 </template>
 
 <script>
 import moment from 'moment';
+import { httpAction, getAction } from "@/api/manage";
 import GoodsConsumeModal from './account/goodsConsumeModal'
 import AccountEnterModal from './account/accountEnterModal'
 import AccountReverseEntryModal from './account/accountReverseEntryModal'
 import AccountTransferModal from './account/accountTransferModal'
 import SettlementModal from './account/settlementModal'
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import CommodityRecordModal from './account/commodityRecordModal'
+import CommodityReturnModal from './account/commodityReturnModal'
+
 export default {
     name: 'agreementAccount',
-    components: { SettlementModal, AccountTransferModal, AccountReverseEntryModal, AccountEnterModal, GoodsConsumeModal },
+    mixins:[JeecgListMixin, mixinDevice],
+    components: { CommodityReturnModal, CommodityRecordModal, SettlementModal, AccountTransferModal, AccountReverseEntryModal, AccountEnterModal, GoodsConsumeModal },
     data() {
         var my_date = new Date();
         var first_date = new Date(my_date.getFullYear(), my_date.getMonth(), 1);
@@ -156,45 +241,169 @@ export default {
             settleType: 1,
             dateFormat: 'YYYY-MM-DD',
             rangeValue: [moment(first_date), moment(last_date)],
-            defaultRange: [first_date.format('yyyy-MM-dd'), last_date.format('yyyy-MM-dd')],
             agreementUnitInfo: {},
             accountModel: {
                 consume: '0',
                 payment: '0',
-                used: '0',
-                surplus: '0'
-            }
+            },
+            // 表头
+            columns: [
+                {
+                    title:'项目名称',
+                    align:"center",
+                    dataIndex: 'projectName',
+                    scopedSlots: { customRender: 'projectNameSlot' }
+                },
+                {
+                    title:'订单号',
+                    align:"center",
+                    dataIndex: 'orderNo',
+                    scopedSlots: { customRender: 'orderNoSlot' }
+                },
+                {
+                    title:'客人信息',
+                    align:"center",
+                    dataIndex: 'guest'
+                },
+                {
+                    title:'付款方式',
+                    align:"center",
+                    dataIndex: 'payType_dictText',
+                    customRender: function (text) {
+                        return !text?"-":text
+                    },
+                },
+                {
+                    title:'消费',
+                    align:"center",
+                    scopedSlots: { customRender: 'saleSlot' }
+                },
+                {
+                    title:'付款',
+                    align:"center",
+                    scopedSlots: { customRender: 'paymentSlot' }
+                },
+                {
+                    title:'状态',
+                    align:"center",
+                    dataIndex: 'status',
+                    scopedSlots: { customRender: 'statusSlot' }
+                },
+                {
+                    title:'备注',
+                    width: 200,
+                    align:"center",
+                    dataIndex: 'remarks',
+                    scopedSlots: { customRender: 'remarksSlot' }
+                },
+                {
+                    title:'操作员',
+                    align:"center",
+                    dataIndex: 'createBy'
+                },
+                {
+                    title:'操作时间',
+                    align:"center",
+                    dataIndex: 'createdTime',
+                    customRender:function (text) {
+                        return !text?"":(text.length>10?text.substr(0,10):text)
+                    }
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    align:"center",
+                    fixed:"right",
+                    width:147,
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            url: {
+                list: "/business/busAgreementOrderFee/list",
+                baseList: "/business/busAgreementOrderFee/list",
+                delete: "/business/busAgreementOrderFee/delete",
+                deleteBatch: "/business/busAgreementOrderFee/deleteBatch",
+                exportXlsUrl: "/business/busAgreementOrderFee/exportXls",
+                importExcelUrl: "business/busAgreementOrderFee/importExcel",
+                revoke: "/business/busAgreementOrderFee/revoke",
+                editRemarks: "/business/busAgreementOrderFee/editRemarks",
+                queryAgreementAccount: "/business/busAgreementOrderFee/queryAgreementAccount",//获取协议单位消费、收款信息
+            },
+            queryParam: {
+                startTime: first_date.format('yyyy-MM-dd'),
+                endTime: last_date.format('yyyy-MM-dd'),
+            },
         }
     },
     activated() {
-        console.log(99999)
         var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
         this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
+        this.url.list = this.url.list +"?status=1&agreementUnitId="+this.agreementUnitInfo.id;
+        this.loadData(1);
         this.$forceUpdate()
     },
     created() {
         var agreementUnitInfo = JSON.parse(localStorage.getItem("agreementUnitInfo"));
         this.agreementUnitInfo = Object.assign({}, agreementUnitInfo);
 
-        var temp = {
-            consume: '20',
-            payment: '0',
-            used: '0',
-            surplus: '0'
-        }
-        this.accountModel = Object.assign({}, temp);
-        // console.log(agreementUnitInfo.customerName)
+        this.getAccount();
+        // this.accountModel = Object.assign({}, {});
     },
     methods: {
         moment,
-        onRangeChange(e) {
-            console.log(this.rangeValue);
+        onRangeChange(date, dateString) {
+            console.log(date)
+            console.log(dateString)
+            if (dateString[0]=="" || dateString[1]=="") {
+                return
+            }
+            this.queryParam = {
+                startTime: dateString[0],
+                endTime: dateString[1],
+            }
+            if (this.settleType == 1 || this.settleType == 2){
+                this.url.list = this.url.baseList +"?status="+this.settleType+"&agreementUnitId="+this.agreementUnitInfo.id;
+            }else{
+                this.url.list = this.url.baseList+"?status=1&agreementUnitId="+this.agreementUnitInfo.id;
+            }
+            // if (!this.queryParam.startTime=="") {
+            //     this.url.list = this.url.list + "&startDate=" + this.queryParam.startTime
+            // }
+            // if (!this.queryParam.endTime=="") {
+            //     this.url.list = this.url.list + "&endDate=" + this.queryParam.endTime
+            // }
+            this.getAccount();
+            this.loadData(1);
+            this.selectedRowKeys = [];
+            this.selectionRows = [];
+
+        },
+        searchQuery() {
+            this.getAccount();
+            this.loadData(1);
+            // 点击查询清空列表选中行
+            // https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
+            this.selectedRowKeys = []
+            this.selectionRows = []
         },
         onTypeChange(e) {
-            console.log(e);
+            if (this.settleType == 1 || this.settleType == 2){
+                this.url.list = this.url.baseList +"?status="+this.settleType+"&agreementUnitId="+this.agreementUnitInfo.id;
+            }else{
+                this.url.list = this.url.baseList+"?agreementUnitId="+this.agreementUnitInfo.id;
+            }
+            // if (!this.queryParam.startTime=="") {
+            //     this.url.list = this.url.list + "&startDate=" + this.queryParam.startTime
+            // }
+            // if (!this.queryParam.endTime=="") {
+            //     this.url.list = this.url.list + "&endDate=" + this.queryParam.endTime
+            // }
+            this.getAccount();
+            this.loadData(1);
+            this.selectedRowKeys = [];
+            this.selectionRows = [];
         },
         handleClick(type){
-            console.log('当前类型:  '+type);
             if (type == 1){
                 this.$refs.goodsConsumeForm.edit();
                 this.$refs.goodsConsumeForm.title="入账";
@@ -206,13 +415,47 @@ export default {
                 this.$refs.accountEnterForm.disableSubmit = true;
             }
             else if(type == 3){
+                if (this.selectedRowKeys.length <= 0) {
+                    this.$message.warning("请选择一条记录!");
+                    return;
+                }
+                let ids = '';
+                this.selectedRowKeys.forEach(function (val) {
+                    ids += val + ",";
+                });
                 this.$refs.accountTransferForm.edit();
                 this.$refs.accountTransferForm.title="转账";
+                this.$refs.accountTransferForm.orderIds=ids;
                 this.$refs.accountTransferForm.disableSubmit = true;
             }
             else if(type == 4){
+                if (this.selectedRowKeys.length <= 0) {
+                    this.$message.warning("请选择一条记录!");
+                    return;
+                }
+                let ids = '';
+                var idList = []
+                this.selectedRowKeys.forEach(function (val) {
+                    ids += val + ",";
+                    idList.push(val)
+                });
+                var dataSource = this.dataSource;
+                var amount = 0;
+                if(dataSource && dataSource.length > 0){
+                    for(var a=0;a<dataSource.length;a++){
+                        if (idList.indexOf(dataSource[a].id) >= 0){
+                            if (dataSource[a].type == 2){
+                                amount -= parseFloat(dataSource[a].payPrice)
+                            }else{
+                                amount += parseFloat(dataSource[a].payPrice)
+                            }
+                        }
+                    }
+                }
                 this.$refs.settlementForm.edit();
                 this.$refs.settlementForm.title="结算";
+                this.$refs.settlementForm.maxMoney=amount;
+                this.$refs.settlementForm.orderIds=ids;
                 this.$refs.settlementForm.disableSubmit = true;
             }
             else if(type == 5){
@@ -222,7 +465,75 @@ export default {
             }
         },
         modalFormOk() {
+            this.loadData(1);
+            this.getAccount();
         },
+        handleCommodityRecord(record){
+            //打开商品消费明细
+            this.$refs.commodityRecordForm.show();
+            this.$refs.commodityRecordForm.title="详细信息";
+            this.$refs.commodityRecordForm.agreementOrderFeeId = record.id;
+            this.$refs.commodityRecordForm.disableSubmit = true;
+        },
+        handleGoodsReturn(record){
+            //退货
+            this.$refs.commodityReturnForm.show();
+            this.$refs.commodityReturnForm.title="退货";
+            this.$refs.commodityReturnForm.agreementOrderFeeId = record.id;
+            this.$refs.commodityReturnForm.disableSubmit = true;
+        },
+        handleRevoke(record){
+            const that = this;
+            that.confirmLoading = true;
+            let httpurl = this.url.revoke;
+            let method = 'post';
+            var data = {
+                id:record.id
+            }
+            httpAction(httpurl,data,method).then((res)=>{
+                if(res.success){
+                    that.$message.success(res.message);
+                    that.$emit('ok');
+                    that.loadData(1);
+                }else{
+                    that.$message.warning(res.message);
+                }
+            }).finally(() => {
+                that.confirmLoading = false;
+            })
+        },
+        getAccount(){
+            console.log(this.queryParam)
+            var that = this;
+            getAction(this.url.queryAgreementAccount, {
+                agreementUnitId: this.agreementUnitInfo.id,
+                startTime: this.queryParam.startTime,
+                endTime: this.queryParam.endTime,
+            }).then((res) => {
+                console.log(res)
+                if (res.success) {
+                    that.accountModel = res.result;
+                }
+            });
+        },
+        handleAccountRemarks(record){
+            console.log(record)
+            const that = this;
+            that.confirmLoading = true;
+            let httpurl = this.url.editRemarks;
+            let method = 'put';
+            httpAction(httpurl,record,method).then((res)=>{
+                if(res.success){
+                    that.$message.success(res.message);
+                    // that.$emit('ok');
+                    // that.loadData(1);
+                }else{
+                    that.$message.warning(res.message);
+                }
+            }).finally(() => {
+                that.confirmLoading = false;
+            })
+        }
     }
 }
 </script>
@@ -268,5 +579,13 @@ export default {
     display: flex;
     align-items: center;
 }
+.project_name{
+    color: #2e9c69;
+    border-color: #2e9c69;
+}
+.project_name:hover{
+background-color: #2e9c69;
+    color: white;
+}
 </style>
 

+ 253 - 54
src/views/room/fangtailive.vue

@@ -76,15 +76,14 @@
               >锁房</a-button
             >
             <a-button
-              disabled
+              :disabled="joinDisabled"
               style="margin-bottom: 10px"
-              @click="handleAdd"
+              @click="addUnion"
               type="danger"
               >联房</a-button
             ><a-button
-              disabled
               style="margin-bottom: 10px"
-              @click="handleAdd"
+              @click="handleBatchCard"
               type="danger"
               >批量制卡</a-button
             >
@@ -171,7 +170,14 @@
                         style="font-size: 40px"
                       />
                     </div>
-                    <a-popover placement="rightTop">
+                    <div style="position:absolute;top:-8px;padding:6px;border-radius:50%;border:2px solid #ccc;color:#ccc;left:60%;" v-if="roomLive.livingData &&  roomLive.livingData.livingOrder && roomLive.livingData.livingOrder.isTeam">
+                      {{roomLive.livingData.livingOrder.teamTag}}
+                    </div>
+                    <a-popover
+                      placement="rightTop"
+                      :mouseLeaveDelay="0"
+                      overlayClassName="popoverWidth"
+                    >
                       <template
                         slot="content"
                         v-if="
@@ -285,6 +291,25 @@
                         <!-- <p>
                           备注:{{ roomLive.livingData.livingOrder.remark }}
                         </p> -->
+                        <template
+                          v-if="
+                            roomLive.roomInfo.roomStatus === 5 &&
+                            roomLive.repairInfo
+                          "
+                        >
+                          <p>维修时间:{{ roomLive.repairInfo.startDate }}</p>
+                          <p>结束时间:{{ roomLive.repairInfo.endDate }}</p>
+                          <p>维修原因:{{ roomLive.repairInfo.remark }}</p>
+                        </template>
+                        <template
+                          v-if="
+                            roomLive.roomInfo.roomStatus === 6 &&
+                            roomLive.lockInfo
+                          "
+                        >
+                          <p>锁房时间:{{ roomLive.lockInfo.createTime }}</p>
+                          <p>锁房原因:{{ roomLive.lockInfo.remark }}</p>
+                        </template>
                       </template>
                       <template
                         slot="title"
@@ -519,7 +544,8 @@
                             v-if="
                               (!roomLive.livingData ||
                                 !roomLive.livingData.livingOrder) &&
-                              roomLive.roomInfo.roomStatus !== 6
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
                             "
                           >
                             入住
@@ -529,7 +555,8 @@
                             v-if="
                               (!roomLive.livingData ||
                                 !roomLive.livingData.livingOrder) &&
-                              roomLive.roomInfo.roomStatus !== 6
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
                             "
                           >
                             预定</a-menu-item
@@ -542,7 +569,10 @@
                           </a-menu-item>
                           <a-menu-item
                             key="3"
-                            v-else-if="roomLive.roomInfo.roomStatus !== 6"
+                            v-else-if="
+                              roomLive.roomInfo.roomStatus !== 6 &&
+                              roomLive.roomInfo.roomStatus !== 5
+                            "
                           >
                             置脏
                           </a-menu-item>
@@ -570,7 +600,12 @@
                             >
                               解锁
                             </a-menu-item>
-                            <a-menu-item key="5" v-else> 锁房 </a-menu-item>
+                            <a-menu-item
+                              key="5"
+                              v-else-if="roomLive.roomInfo.roomStatus !== 5"
+                            >
+                              锁房
+                            </a-menu-item>
                           </template>
                           <template
                             v-if="
@@ -612,17 +647,18 @@
       </div>
       <div style="width: 1%"></div>
       <div style="width: 19%; overflow: hidden auto">
-        <div>
+        <div style="display:flex;justify-content: space-between;align-items:center;">
           <a-input-search
-            style="width: 100%; margin-bottom: 8px"
+            style="width: 80%;"
             placeholder="房间号/姓名/手机号/身份证号"
             enter-button="搜索"
             v-model="keyWord"
             type="danger"
             @search="checkChange"
           />
+          <a-button @click="readCard = true">读卡</a-button>
         </div>
-        <p style="font-size: 16px; font-weight: 600; color: rgb(0, 186, 173)">
+        <p style="font-size: 16px; font-weight: 600; color: rgb(0, 186, 173);margin-top: 6px;">
           按楼层
         </p>
         <a-tree-select
@@ -687,6 +723,24 @@
           @change="checkChange"
         >
         </a-checkbox-group>
+        <p style="font-size: 16px; font-weight: 600; color: rgb(0, 186, 173);margin-top: 10px;">
+          房间信息
+        </p>
+        <a-checkbox-group
+          v-model="checkedCesRoomLayoutList"
+          :options="['欠费', '无押金', '续住', '换房', '租借', '不足']"
+          @change="checkChange"
+        >
+        </a-checkbox-group>
+        <p style="font-size: 16px; font-weight: 600; color: rgb(0, 186, 173);margin-top: 10px;">
+          对客服务
+        </p>
+        <a-checkbox-group
+          v-model="checkedCesRoomLayoutList"
+          :options="['生日', '叫醒', '免打扰', '免查询']"
+          @change="checkChange"
+        >
+        </a-checkbox-group>
       </div>
     </div>
     <template v-else-if="activeKey === '2'">
@@ -743,6 +797,8 @@
     ></clean-room-modal>
     <posOrderModal ref="posOrderModal" />
     <batchCardModal ref="batchCheckInModal" @ok="modalBatchhFormOk" />
+    <liveBatchCardModal ref="liveBatchCardModal" @ok="liveBatchCardOk" />
+    <batchCardModalCopy ref="batchCardModalCopy" />
 
     <!-- 右键菜单 -->
     <look-room-modalVue ref="lookRoomModalVue" @ok="modalLockRoomFormOk" />
@@ -759,6 +815,33 @@
       ref="exchangeHousesModalVue"
       @ok="modalLockRoomFormOk"
     />
+
+    <!-- 读卡弹窗 -->
+    <a-modal :visible="readCard" :title="'快速查询'" @cancel="readCard = false" @ok="readCard = false">
+      <a-row>
+        <a-col :span="6">
+          <a-button @click="()=>{ this.$message.error('接口程序未打开,请打开接口程序') }">
+            刷卡查询
+          </a-button>
+        </a-col>
+        <a-col :span="6">
+          <a-button disabled>注销房卡</a-button>
+        </a-col>
+      </a-row>
+      <a-row style="margin-top:20px;">
+        <a-col :span="6">
+          <a-input :placeholder="'房间号'"></a-input>
+        </a-col>
+      </a-row>
+      <a-row style="margin-top:20px;">
+        <a-col :span="8">
+          <a-input :placeholder="'入住日期'"></a-input>
+        </a-col>
+        <a-col :span="8" style="margin-left:10px;">
+          <a-input :placeholder="'预离日期'"></a-input>
+        </a-col>
+      </a-row>
+    </a-modal>
   </a-card>
 </template>
 
@@ -783,6 +866,8 @@ import membermessage from "./membermessage";
 import membergoodsmanage from "./membergoodsmanage";
 import fangwuLookRoom from "./fangwuLookRoom.vue";
 import posOrderModal from "./posOrderModal.vue";
+import liveBatchCardModal from "./modules/checkIn/liveBatchCardModal.vue";
+import batchCardModalCopy from './modules/checkIn/batchCardModalCopy.vue'
 
 import batchCardModal from "./modules/checkIn/batchCardModal.vue";
 
@@ -791,7 +876,6 @@ import continuedModalVue from "./modules/fangtaiModal/continuedModal/continuedMo
 import SelectCheckInRoomOrderModal from "./modules/checkIn/SelectCheckInRoomOrderModal.vue";
 import CustomerModal from "./modules/checkIn/CustomerModal.vue";
 import exchangeHousesModalVue from "./modules/fangtaiModal/exchangeHouses/exchangeHousesModal.vue";
-
 import { TreeSelect } from "ant-design-vue";
 import moment from "moment";
 const SHOW_PARENT = TreeSelect.SHOW_PARENT;
@@ -821,11 +905,14 @@ export default {
     CustomerModal,
     exchangeHousesModalVue,
     posOrderModal,
-    batchCardModal
+    batchCardModal,
+    liveBatchCardModal,
+    batchCardModalCopy
   },
   data() {
     return {
-      YDorder:null,
+      readCard:false,
+      YDorder: null,
       currentDate: moment(new Date()).format("YYYY-MM-DD"),
       activeKey: "1",
       timeId: null,
@@ -896,6 +983,8 @@ export default {
       scheduleBtnDis: false,
       checkInBtnDis: false,
       kzfLiving: false,
+      roomCard: false,
+      roomClear: false,
     };
   },
   watch: {
@@ -904,13 +993,27 @@ export default {
     },
   },
   computed: {
+    joinDisabled() {
+      return !this.roomList.some((t) => {
+        return (
+          t.rooms.filter((c) => c.roomInfo.state === 88).length == 1 &&
+          t.rooms.filter(
+            (c) =>
+              c.roomInfo.state === 88 &&
+              (c.roomInfo.roomStatus === 3 || c.roomInfo.roomStatus === 4)
+          ).length == 1
+        );
+      });
+    },
     lockDisabled() {
       return !this.roomList.some((t) =>
         t.rooms.some(
           (c) =>
             c.roomInfo.state === 88 &&
             c.roomInfo.roomStatus !== 6 &&
-            c.roomInfo.roomStatus !== 5
+            c.roomInfo.roomStatus !== 5 &&
+            c.roomInfo.roomStatus !== 3 &&
+            c.roomInfo.roomStatus !== 4
         )
       );
     },
@@ -1009,6 +1112,40 @@ export default {
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
   },
   methods: {
+
+    handleBatchCard() {
+      this.$refs.liveBatchCardModal.visible = true;
+    },
+
+    liveBatchCardOk(e){
+      console.log(e);
+      this.$refs.batchCardModalCopy.edit(e)
+    },
+
+    addUnion() {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push({
+              roomId: c.roomInfo.id,
+              livingOrderId: c.livingData.livingOrder.id,
+            });
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      this.$refs.modalSelectCheckInRoomOrder.add();
+      this.$refs.modalSelectCheckInRoomOrder.title = "请选择需要关联的订单";
+      this.$refs.modalSelectCheckInRoomOrder.disableSubmit = false;
+      this.$refs.modalSelectCheckInRoomOrder.livingOrderId =
+        selectRoom[0].livingOrderId;
+      this.$refs.modalSelectCheckInRoomOrder.livingRoomId =
+        selectRoom[0].roomId;
+    },
     moment,
     posOrderClick() {
       this.$refs.posOrderModal.visible = true;
@@ -1120,7 +1257,11 @@ export default {
         if (roomLive.roomInfo.state !== 88) {
           roomLive.roomInfo.state = 88;
 
-          if (roomLive.livingData && roomLive.livingData.livingOrder) {
+          if (
+            (roomLive.livingData && roomLive.livingData.livingOrder) ||
+            roomLive.roomInfo.roomStatus === 6 ||
+            roomLive.roomInfo.roomStatus === 5
+          ) {
             this.checkInBtnDis = true;
           } else {
             this.checkInBtnDis = false;
@@ -1128,7 +1269,9 @@ export default {
 
           if (
             (roomLive.livingData && roomLive.livingData.livingOrder) ||
-            (roomLive.bookingData && roomLive.bookingData.bookingOrder)
+            (roomLive.bookingData && roomLive.bookingData.bookingOrder) ||
+            roomLive.roomInfo.roomStatus === 6 ||
+            roomLive.roomInfo.roomStatus === 5
           ) {
             this.scheduleBtnDis = true;
           } else {
@@ -1140,29 +1283,26 @@ export default {
         if (this.multipleRoom) {
           this.checkInBtnDis = false;
           this.scheduleBtnDis = false;
-          this.roomList.forEach((item) => {
-            item.rooms.forEach((c) => {
-              if (c.roomInfo.state === 88) {
-                if (!this.checkInBtnDis) {
-                  if (c.livingData && c.livingData.livingOrder) {
-                    this.checkInBtnDis = true;
-                  } else {
-                    this.checkInBtnDis = false;
-                  }
-                }
-                if (!this.scheduleBtnDis) {
-                  if (
-                    (c.livingData && c.livingData.livingOrder) ||
-                    (c.bookingData && c.bookingData.bookingOrder)
-                  ) {
-                    this.scheduleBtnDis = true;
-                  } else {
-                    this.scheduleBtnDis = false;
-                  }
-                }
-              }
-            });
-          });
+
+          this.checkInBtnDis = this.roomList.some((t) =>
+            t.rooms.some(
+              (c) =>
+                c.roomInfo.state === 88 &&
+                ((c.livingData && c.livingData.livingOrder) ||
+                  c.roomInfo.roomStatus === 6 ||
+                  c.roomInfo.roomStatus === 5)
+            )
+          );
+          this.scheduleBtnDis = this.roomList.some((t) =>
+            t.rooms.some(
+              (c) =>
+                c.roomInfo.state === 88 &&
+                ((c.livingData && c.livingData.livingOrder) ||
+                  (c.bookingData && c.bookingData.bookingOrder) ||
+                  c.roomInfo.roomStatus === 6 ||
+                  c.roomInfo.roomStatus === 5)
+            )
+          );
         }
         // 清除定时器
         clearTimeout(this.timeId);
@@ -1200,6 +1340,12 @@ export default {
       if (!this.kzfLiving && roomLive.roomInfo.roomStatus === 2) {
         this.$message.warning("空脏房不允许入住");
         return;
+      } else if (roomLive.roomInfo.roomStatus === 5) {
+        this.$message.warning("维修房不允许入住");
+        return;
+      } else if (roomLive.roomInfo.roomStatus === 6) {
+        this.$message.warning("锁房不允许入住");
+        return;
       }
       roomLive.roomInfo.marketPrice = roomLive.layout.marketPrice;
       this.$refs.ModalBillRoomForm.addList([roomLive.roomInfo], 1);
@@ -1395,9 +1541,23 @@ export default {
         return;
       }
       console.log("selectRoom", selectRoom);
-      this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
-      this.$refs.ModalCleanRoom.title = "清理房间";
-      this.$refs.ModalCleanRoom.disableSubmit = false;
+      if (this.roomClear) {
+        this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
+        this.$refs.ModalCleanRoom.title = "清理房间";
+        this.$refs.ModalCleanRoom.disableSubmit = false;
+      } else {
+        var obj = { roomCleanList: selectRoom };
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+          obj.hotelId = _info.id;
+        }
+        postAction("/fw/fwRoomClean/add", obj).then((res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+            this.loadData();
+          }
+        });
+      }
     },
     handleOffLock() {
       var selectRoom = [];
@@ -1508,9 +1668,23 @@ export default {
           return;
         }
         console.log("selectRoom", selectRoom);
-        this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
-        this.$refs.ModalCleanRoom.title = "清理房间";
-        this.$refs.ModalCleanRoom.disableSubmit = false;
+        if (this.roomClear) {
+          this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
+          this.$refs.ModalCleanRoom.title = "清理房间";
+          this.$refs.ModalCleanRoom.disableSubmit = false;
+        } else {
+          var obj = { roomCleanList: selectRoom };
+          var _info = JSON.parse(localStorage.getItem("storeInfo"));
+          if (_info) {
+            obj.hotelId = _info.id;
+          }
+          postAction("/fw/fwRoomClean/add", obj).then((res) => {
+            if (res.success) {
+              this.$message.success(res.message);
+              this.loadData();
+            }
+          });
+        }
       } else if (e.key == "4") {
         var selectRoom = [
           {
@@ -1604,22 +1778,31 @@ export default {
       } else if (e.key == 16) {
         this.handleBillInfo(row);
         return;
+      }else if(e.key == 17){
+        console.log(row);
+        getAction('/business/busRoomBookingOrders/reverse-living?livingOrderId='+row.livingData.livingOrder.id).then(res=>{
+          console.log(res);
+          if (res.success) {
+            this.$message.success('撤销成功');
+            this.loadData();
+          }
+        })
       }
     },
     modalBillRoomFormOk(e) {
       this.loadData();
       console.log("e", e);
-      this.YDorder = e.order
-      if (this.kzfLiving) {
+      this.YDorder = e.order;
+      if (this.roomCard) {
         this.$refs.batchCheckInModal.visible = true;
-            this.$refs.batchCheckInModal.edit(e.model)
-      }else{
+        this.$refs.batchCheckInModal.edit(e.model);
+      } else {
         this.$refs.ModalBillRoomInfo.add(e.order);
-            this.$refs.ModalBillRoomInfo.title = "账单";
-            this.$refs.ModalBillRoomInfo.disableSubmit = true;
+        this.$refs.ModalBillRoomInfo.title = "账单";
+        this.$refs.ModalBillRoomInfo.disableSubmit = true;
       }
     },
-    modalBatchhFormOk(){
+    modalBatchhFormOk() {
       this.$refs.ModalBillRoomInfo.add(this.YDorder);
       this.$refs.ModalBillRoomInfo.title = "账单";
       this.$refs.ModalBillRoomInfo.disableSubmit = true;
@@ -1664,6 +1847,16 @@ export default {
           }
         }
       );
+      getAction("/business/busOtherRoomCard/queryByHotelId", {}).then((res) => {
+        if (res.success) {
+          this.roomCard = res.result.status === 1;
+        }
+      });
+      getAction("/business/busClear/queryByHotelId", {}).then((res) => {
+        if (res.success) {
+          this.roomClear = res.result.status === 1;
+        }
+      });
     },
   },
 };
@@ -1930,6 +2123,7 @@ export default {
   border-radius: 5px;
   cursor: pointer;
   position: relative;
+  overflow: hidden;
 }
 #components-grid-demo-playground pre {
   background: #f9f9f9;
@@ -1937,4 +2131,9 @@ export default {
   font-size: 13px;
   padding: 8px 16px;
 }
+</style>
+<style>
+.popoverWidth {
+  width: 220px !important;
+}
 </style>

+ 7 - 2
src/views/room/leasegoods.vue

@@ -162,7 +162,7 @@ export default {
         {
           title: "物品",
           align: "center",
-          dataIndex: "goodsId",
+          dataIndex: "goodName",
         },
         {
           title: "数量",
@@ -215,7 +215,12 @@ export default {
   },
   methods: {
     handleAdd() {
-      this.$refs.modalForm.add(this.livingOrderId);
+      var id = null;
+      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;
     },

+ 522 - 128
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -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 {

+ 485 - 112
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -64,6 +64,8 @@
                     : "--"
                 }}
                 <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editCustomer(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /></a-descriptions-item>
@@ -86,92 +88,128 @@
                     : "--"
                 }}
                 <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editCustomer(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /></a-descriptions-item>
 
               <a-descriptions-item label="宾客类型">
-                {{ customerTypeName(model.orderInfo.customerType) }}
+                {{ customerTypeName(item.livingOrder.customerType) }}
                 <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editCustomerType(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /></a-descriptions-item>
               <a-descriptions-item label="入住时间">
-                {{ model.orderInfo.arrivalTime }}
+                {{ item.livingOrder.arrivalTime }}
               </a-descriptions-item>
               <a-descriptions-item label="房价方案"> -- </a-descriptions-item>
               <a-descriptions-item label="预离时间">
-                {{ model.orderInfo.dueOutTime }}
+                {{ item.livingOrder.dueOutTime }}
               </a-descriptions-item>
               <a-descriptions-item label="订单来源">
-                {{ customerSourceName(model.orderInfo.customerSource) }}
+                {{ customerSourceName(item.livingOrder.customerSource) }}
                 <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editCustomerSource(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /></a-descriptions-item>
               <a-descriptions-item label="入住类型">
-                {{ model.orderInfo.bookingType == 1 ? "全天" : "钟点" }}
+                {{  getlivingTypeText(item.livingOrder.livingType) }}
+                <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editBookingType(item)"
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+                />
               </a-descriptions-item>
               <a-descriptions-item label="入住天数">
-                {{ model.orderInfo.dayCount }}
+                {{ item.livingOrder.dayCount }}
               </a-descriptions-item>
               <a-descriptions-item label="早餐券">
-                {{ model.orderInfo.breakfastNum }}
+                {{ item.livingOrder.breakfastNum }}
+                <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editBreakfastNum(item)"
+                  type="edit"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+                />
               </a-descriptions-item>
               <a-descriptions-item label="外部单号">
                 {{ model.orderInfo.outerOrdersNo }}
               </a-descriptions-item>
               <a-descriptions-item label="销售员工">
-                {{ warranterName(model.orderInfo.warranter) }}
+                {{ warranterName(item.livingOrder.warranter) }}
                 <a-icon
+                  v-if="livingIndex > 0"
+                  @click="editWarranter(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /></a-descriptions-item>
               <a-descriptions-item label="订单备注" :span="2">
-                {{ model.orderInfo.remark
+                {{ item.livingOrder.remark
                 }}<a-icon
+                  v-if="livingIndex > 0"
+                  @click="editRemark(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
                 />
               </a-descriptions-item>
-              <a-descriptions-item
-                label="叫醒服务"
-                :span="2"
-                v-for="(item, index) in wakeList"
-                :key="index"
+              <template
+                v-if="
+                  wakeList.filter((item) => {
+                    return tabSelectRoomId == 1
+                      ? item
+                      : tabSelectRoomId == item.roomId;
+                  }).length == 0
+                "
               >
-                <a-select
-                  style="width: 100px"
-                  placeholder="房间号"
-                  @change="onChange"
+                <a-descriptions-item label="叫醒服务" :span="2">
+                  <a-icon
+                    type="plus-circle"
+                    class="dynamic-delete-button"
+                    @click="puls()"
+                  />
+                </a-descriptions-item>
+              </template>
+              <template v-else>
+                <a-descriptions-item
+                  label="叫醒服务"
+                  :span="2"
+                  v-for="(item, index) in wakeList.filter((item) => {
+                    return tabSelectRoomId == 1
+                      ? item
+                      : tabSelectRoomId == item.roomId;
+                  })"
+                  :key="index"
                 >
-                  <a-select-option value="jack"> 1001 </a-select-option>
-                  <a-select-option value="lucy"> 1002 </a-select-option>
-                </a-select>
-                <a-date-picker
-                  style="width: 120px; margin-left: 2px"
-                  placeholder="日期"
-                  @change="onChange"
-                />
-                <a-time-picker
-                  style="width: 100px; margin-left: 2px"
-                  :default-value="moment('12:08', 'HH:mm')"
-                  format="HH:mm"
-                />
-                <a-icon
-                  v-if="wakeList.length - 1 == index"
-                  type="plus-circle"
-                  class="dynamic-delete-button"
-                  @click="puls()"
-                />
-                <a-icon
-                  type="minus-circle"
-                  style="color: #f56c6c"
-                  class="dynamic-delete-button"
-                  v-if="wakeList.length > 1"
-                  @click="() => remove(index)"
-                />
-              </a-descriptions-item>
+                  {{ item.roomName }}
+                  {{ item.jxDate ? item.jxDate + " /" : "" }} {{ item.jxTime }}
+                  <a-icon
+                    v-if="
+                      wakeList.filter((item) => {
+                        return tabSelectRoomId == 1
+                          ? item
+                          : tabSelectRoomId == item.roomId;
+                      }).length -
+                        1 ==
+                      index
+                    "
+                    type="plus-circle"
+                    class="dynamic-delete-button"
+                    @click="puls()"
+                  />
+                  <a-icon
+                    type="minus-circle"
+                    style="color: #f56c6c"
+                    class="dynamic-delete-button"
+                    @click="removeWakeService(item.id)"
+                  />
+                </a-descriptions-item>
+              </template>
             </a-descriptions>
             <div style="display: flex; justify-content: space-between">
               <h4
@@ -203,11 +241,15 @@
                 :key="customer.id"
               >
                 <template v-if="index > 0">
-                  <a-col :span="7"> {{ customer.customerName }} </a-col>
-                  <a-col :span="1"
+                  <a-col :span="6">
+                    ({{ getRoomName(customer.roomId) }}){{
+                      customer.customerName
+                    }}
+                  </a-col>
+                  <a-col :span="2"
                     >{{ customer.gender == 1 ? "男" : "女" }}
                   </a-col>
-                  <a-col :span="8"> {{ customer.certNo }}</a-col>
+                  <a-col :span="8"> {{ customer.certNo || "--" }}</a-col>
                   <a-col :span="6"> {{ customer.phone }}</a-col>
                   <a-col :span="2">
                     <a-icon
@@ -285,7 +327,13 @@
               <a-icon
                 type="import"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
-              /><a-button type="link"> 退单 </a-button>
+              /><a-button
+                type="link"
+                :disabled="selectedRowKeys1.length == 0 || selectRoomId == '1'"
+                @click="tuidan"
+              >
+                退单
+              </a-button>
             </div>
             <div style="display: flex; flex-direction: column">
               <a-icon
@@ -441,11 +489,76 @@
       ref="modalSelectCheckInRoomOrder"
       @ok="modalFormOk"
     ></select-check-in-room-order-modal>
+    <edit-customer-modal
+      ref="modalEditCustomer"
+      @ok="modalFormOk"
+    ></edit-customer-modal>
+    <edit-customer-type-modal
+      ref="modalEditCustomerType"
+      @ok="modalFormOk"
+    ></edit-customer-type-modal>
+    <edit-customer-source-modal
+      ref="modalEditCustomerSource"
+      @ok="modalFormOk"
+    ></edit-customer-source-modal>
+    <edit-warranter-modal
+      ref="modalEditWarranter"
+      @ok="modalFormOk"
+    ></edit-warranter-modal>
+    <edit-remark-modal
+      ref="modalEditRemarkModal"
+      @ok="modalFormOk"
+    ></edit-remark-modal>
+    <edit-breakfast-num-modal
+      ref="modalEditBreakfastNumModal"
+      @ok="modalFormOk"
+    ></edit-breakfast-num-modal>
+    <edit-booking-type-modal
+      ref="modalEditBookingTypeModal"
+      @ok="modalFormOk"
+    ></edit-booking-type-modal>
+
+    <!-- 叫醒服务弹窗 -->
+    <a-modal
+      :title="'叫醒服务'"
+      :visible="wakeService"
+      @cancel="wakeService = false"
+      @ok="wakeServiceOk"
+      destroyOnClose
+    >
+      <a-select
+        style="width: 100px"
+        placeholder="房间号"
+        @change="onChange"
+        v-model="wakeTime.id"
+      >
+        <a-select-option
+          :value="item.livingOrder.id"
+          v-for="(item, index) in (model.livingRoomIds || []).filter(
+            (item) => item.roomName != '全部'
+          )"
+          :key="index"
+        >
+          {{ item.roomName }}
+        </a-select-option>
+        <!-- <a-select-option value="lucy"> 1002 </a-select-option> -->
+      </a-select>
+      <a-date-picker
+        style="width: 120px; margin-left: 2px"
+        placeholder="日期"
+        @change="onChangeWakeService"
+      />
+      <a-time-picker
+        style="width: 100px; margin-left: 2px"
+        format="HH:mm"
+        @change="onChangeWakeServiceTime"
+      />
+    </a-modal>
   </div>
 </template>
 
 <script>
-import { httpAction, getAction, deleteAction } from "@/api/manage";
+import { httpAction, getAction, deleteAction, postAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
 import moment from "moment";
 import CustomerModal from "./CustomerModal.vue";
@@ -455,6 +568,13 @@ import FeeModal from "./FeeModal";
 import MemberMessageModal from "@/views/room/modules/membergoodsmanage/membermessageModal";
 import LeaseGoodsModal from "@/views/room/modules/leasegoods/leasegoodsModal";
 import SelectCheckInRoomOrderModal from "./SelectCheckInRoomOrderModal.vue";
+import EditCustomerModal from "./EditCustomerModal.vue";
+import EditCustomerTypeModal from "./EditCustomerTypeModal.vue";
+import EditCustomerSourceModal from "./EditCustomerSourceModal.vue";
+import EditWarranterModal from "./EditWarranterModal.vue";
+import EditRemarkModal from "./EditRemarkModal.vue";
+import EditBreakfastNumModal from "./EditBreakfastNumModal.vue";
+import EditBookingTypeModal from "./EditBookingTypeModal.vue";
 import { match } from "assert";
 const columns = [
   // {
@@ -564,6 +684,13 @@ export default {
     MemberMessageModal,
     LeaseGoodsModal,
     SelectCheckInRoomOrderModal,
+    EditCustomerModal,
+    EditCustomerTypeModal,
+    EditCustomerSourceModal,
+    EditWarranterModal,
+    EditRemarkModal,
+    EditBreakfastNumModal,
+    EditBookingTypeModal,
   },
   props: {
     //表单禁用
@@ -575,6 +702,12 @@ export default {
   },
   data() {
     return {
+      wakeService: false,
+      wakeTime: {
+        id: "",
+        date: "",
+        time: "",
+      },
       selectedRowKeys: [],
       data,
       columns,
@@ -634,16 +767,19 @@ export default {
       }, 0);
     },
     paymentAmount() {
-      var list = this.paymentList.filter((t) => t.subjectType !== 5);
-      var amount = list.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
+      // var list = this.paymentList.filter((t) => t.subjectType !== 5);
+      // var amount = list.reduce(function (total, item) {
+      //   return total + item.money;
+      // }, 0);
 
-      var list2 = this.paymentList.filter((t) => t.subjectType == 5);
-      var amount2 = list2.reduce(function (total, item) {
+      // var list2 = this.paymentList.filter((t) => t.subjectType == 5);
+      // var amount2 = list2.reduce(function (total, item) {
+      //   return total + item.money;
+      // }, 0);
+      var amount = this.paymentList.reduce(function (total, item) {
         return total + item.money;
       }, 0);
-      return amount - amount2;
+      return amount;
     },
     btnSisabled() {
       var index = this.model.livingRoomIds.findLastIndex(
@@ -700,6 +836,159 @@ export default {
     });
   },
   methods: {
+    // 叫醒服务
+    wakeServiceOk() {
+      console.log(this.wakeTime);
+      if (!this.wakeTime.id) {
+        this.$message.warning("请选择房间号");
+        return;
+      }
+      if (!this.wakeTime.date) {
+        this.$message.warning("请选择日期");
+        return;
+      }
+      if (!this.wakeTime.time) {
+        this.$message.warning("请选择时间");
+        return;
+      }
+      let obj = {
+        livingOrderId: this.wakeTime.id,
+        jxDate: this.wakeTime.date,
+        jxTime: this.wakeTime.time,
+      };
+      postAction("/fw/fwLivingJx/add", obj).then((res) => {
+        if (res.success) {
+          this.$message.success("添加成功");
+          this.wakeTime = {};
+          this.getWakeServiceData();
+          this.wakeService = false;
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
+    //获取叫醒服务数据
+    getWakeServiceData() {
+      let ids = [];
+      this.model.livingRoomIds.forEach((item) => {
+        if (item.roomName != "全部") {
+          ids.push(item.livingOrder.id);
+        }
+      });
+      getAction("/fw/fwLivingJx/list?livingOrderId=" + ids.toString()).then(
+        (res) => {
+          if (res.success) {
+            this.wakeList = res.result.records;
+          }
+        }
+      );
+    },
+    //删除叫醒服务
+    removeWakeService(id) {
+      deleteAction("/fw/fwLivingJx/delete?id=" + id).then((res) => {
+        if (res.success) {
+          this.$message.success("删除成功");
+          this.getWakeServiceData();
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
+    onChangeWakeService(e, e1) {
+      console.log(e, e1);
+      this.wakeTime.date = e1;
+    },
+    onChangeWakeServiceTime(e, e1) {
+      console.log(e, e1);
+      this.wakeTime.time = e1;
+    },
+    editBookingType(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        liveType: item.livingOrder.livingType,
+        fangAnId: item.livingOrder.hourRoomId,
+        livingDayPrices: item.livingDayPrices,
+        roomId: item.roomId,
+      };
+      this.$refs.modalEditBookingTypeModal.edit(obj);
+      this.$refs.modalEditBookingTypeModal.title = "修改";
+      this.$refs.modalEditBookingTypeModal.disableSubmit = false;
+    },
+    editBreakfastNum(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        brkfstNum: item.livingOrder.breakfastNum,
+      };
+      this.$refs.modalEditBreakfastNumModal.edit(obj);
+      this.$refs.modalEditBreakfastNumModal.title = "修改";
+      this.$refs.modalEditBreakfastNumModal.disableSubmit = false;
+    },
+    editRemark(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        remark: item.livingOrder.remark,
+      };
+      this.$refs.modalEditRemarkModal.edit(obj);
+      this.$refs.modalEditRemarkModal.title = "修改";
+      this.$refs.modalEditRemarkModal.disableSubmit = false;
+    },
+    editWarranter(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        warranter: item.livingOrder.warranter,
+      };
+      this.$refs.modalEditWarranter.edit(obj);
+      this.$refs.modalEditWarranter.title = "修改";
+      this.$refs.modalEditWarranter.disableSubmit = false;
+    },
+    getlivingTypeText(livingType) {
+      var text = "";
+      if (livingType === 1) {
+        text = "全天";
+      } else if (livingType === 2) {
+        text = "钟点";
+      } else if (livingType === 3) {
+        text = "自用";
+      } else if (livingType === 4) {
+        text = "免费";
+      } else if (livingType === 4) {
+        text = "长租";
+      }
+      return text;
+    },
+    editCustomerSource(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        customerSource: item.livingOrder.customerSource,
+      };
+      this.$refs.modalEditCustomerSource.edit(obj);
+      this.$refs.modalEditCustomerSource.title = "修改";
+      this.$refs.modalEditCustomerSource.disableSubmit = false;
+    },
+    editCustomerType(item) {
+      var obj = {
+        orderId: item.livingOrder.id,
+        customerType: item.livingOrder.customerType,
+        vipCustomerId: item.livingOrder.vipCustomerId,
+        contractTeamId: item.livingOrder.contractTeamId,
+        contractTeamProtocolId: item.livingOrder.contractTeamProtocolId,
+      };
+      this.$refs.modalEditCustomerType.edit(obj);
+      this.$refs.modalEditCustomerType.title = "修改";
+      this.$refs.modalEditCustomerType.disableSubmit = false;
+    },
+    editCustomer(item) {
+      var customer = item.livingCustomers[0] || {};
+      var obj = {
+        orderId: item.livingOrder.id,
+        cusName: customer.customerName,
+        cusPhone: customer.phone,
+        cusId: customer.id,
+      };
+      this.$refs.modalEditCustomer.edit(obj);
+      this.$refs.modalEditCustomer.title = "修改";
+      this.$refs.modalEditCustomer.disableSubmit = false;
+    },
     splitLiving() {
       var that = this;
       this.$confirm({
@@ -739,27 +1028,45 @@ export default {
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
+      console.log(this.model.livingRoomIds);
       var find = this.model.livingRoomIds[index];
+      let arr = [];
+      this.model.livingRoomIds.forEach((ele) => {
+        if (ele.roomName != "全部") {
+          arr.push(ele.livingOrder.id);
+        }
+      });
       this.$refs.modalSelectCheckInRoomOrder.add();
       this.$refs.modalSelectCheckInRoomOrder.title = "请选择需要关联的订单";
       this.$refs.modalSelectCheckInRoomOrder.disableSubmit = false;
       this.$refs.modalSelectCheckInRoomOrder.livingOrderId =
         find.livingOrder.id;
+      this.$refs.modalSelectCheckInRoomOrder.filterIds = arr;
       this.$refs.modalSelectCheckInRoomOrder.livingRoomId = find.roomId;
     },
     addLeaseGoods() {
-      if (this.selectRoomId === "1") {
-        this.$message.warning("请先选择房间");
-        return;
-      }
+      // if (this.selectRoomId === "1") {
+      //   this.$message.warning("请先选择房间");
+      //   return;
+      // }
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
       var find = this.model.livingRoomIds[index];
+      var livingOrderId = "";
+      if (find.roomId != "1") {
+        livingOrderId = find.livingOrder.id;
+      } else {
+        this.model.livingRoomIds
+          .filter((t) => t.roomId != "1")
+          .forEach((t) => {
+            livingOrderId += t.livingOrder.id + ",";
+          });
+      }
       this.$refs.modalLeaseGoods.add();
       this.$refs.modalLeaseGoods.title = "客人留言";
       this.$refs.modalLeaseGoods.disableSubmit = false;
-      this.$refs.modalLeaseGoods.livingOrderId = find.livingOrder.id;
+      this.$refs.modalLeaseGoods.livingOrderId = livingOrderId; //find.livingOrder.id;
     },
     addMessage() {
       if (this.selectRoomId === "1") {
@@ -785,6 +1092,19 @@ export default {
       this.$refs.modalFeeForm.title = "增加消费项目";
       this.$refs.modalFeeForm.disableSubmit = false;
     },
+    tuidan() {
+      postAction(
+        "/business/busRoomBookingOrders/退你麻痹单狗东西",
+        this.selectedRowKeys1
+      ).then((res) => {
+        if (res.success) {
+          this.$message.success("退单成功");
+          this.getBookingOrderInfo();
+        } else {
+          this.$message.warning(res.message);
+        }
+      });
+    },
     partialSettle() {
       var list2 = this.feesList.filter((t) =>
         this.selectedRowKeys1.includes(t.id)
@@ -814,6 +1134,7 @@ export default {
       });
       this.$refs.modalPaymentForm.title = "部分结账收款";
       this.$refs.modalPaymentForm.disableSubmit = false;
+      this.$refs.modalPaymentForm.showYinshou = false;
     },
     tabChange(e) {
       console.log(e);
@@ -853,6 +1174,16 @@ export default {
         msg = "点餐";
       } else if (text == 8) {
         msg = "夜审房费";
+      } else if (text == 9) {
+        msg = "会议室";
+      } else if (text == 10) {
+        msg = "手工房费";
+      } else if (text == 11) {
+        msg = "水电煤抄表";
+      } else if (text == 12) {
+        msg = "赔偿费";
+      } else if (text == 13) {
+        msg = "退单结账";
       }
       return msg;
     },
@@ -948,7 +1279,9 @@ export default {
           this.tabSelectRoomId = this.roomId
             ? this.roomId
             : res.result.livingRoomIds[1].roomId;
+          this.selectRoomId = this.tabSelectRoomId;
           this.model = res.result;
+          this.getWakeServiceData();
           getAction("/business/busRoomBookingOrders/living-fees", {
             bookingOrderId: this.model.orderInfo.id,
           }).then((res) => {
@@ -973,64 +1306,104 @@ export default {
       this.selectedRowKeys = selectedRowKeys;
       this.selectionRows = selectionRows;
     },
-    handleAdd() {
-      var list = this.paymentList.filter((t) => t.subjectType === 1);
-      var deposit = list.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
-
-      var list2 = this.paymentList.filter((t) => t.subjectType === 2);
-      var sum = list2.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
-
-      var list3 = this.feesList.filter((t) => t.subjectType === 3);
-      var sum2 = list3.reduce(function (total, item) {
-        return total + item.money;
-      }, 0);
+    async handleAdd() {
+      var that = this;
       var index = this.model.livingRoomIds.findLastIndex(
         (t) => t.roomId == this.selectRoomId
       );
       var livingRoom = this.model.livingRoomIds[index];
-      if (this.paymentAmount - this.feesAmount > 0) {
-        this.$refs.modalRefundForm.edit({
-          billRefund: this.paymentAmount - this.feesAmount,
-          deposit: deposit - (sum - sum2),
-          roomFee: sum - sum2,
-          money: this.paymentAmount - this.feesAmount,
-          subjectType: 5,
-          feeType: 2,
-          bookingOrderId: this.model.orderInfo.id,
-          livingOrderId:
-            livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
-        });
-        this.$refs.modalRefundForm.title = "结账退款";
-        this.$refs.modalRefundForm.disableSubmit = false;
+      var livingOrderId = "";
+      if (livingRoom.roomId != "1") {
+        livingOrderId = livingRoom.livingOrder.id;
       } else {
-        this.$refs.modalPaymentForm.edit({
-          billAmount: parseFloat(
-            Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
-          ),
-          deposit: deposit - (sum - sum2),
-          roomFee: parseFloat(
-            Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
-          ),
-          subjectType: 5,
-          feeType: 2,
-          bookingOrderId: this.model.orderInfo.id,
-          livingOrderId:
-            livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
-          preferentialType: 1,
-          couponFirstAmount: 0,
-          discount: 9,
-          vipCustomerId: this.model.orderInfo.vipCustomerId,
-        });
-        this.$refs.modalPaymentForm.title = "结账收款";
-        this.$refs.modalPaymentForm.disableSubmit = false;
+        this.model.livingRoomIds
+          .filter((t) => t.roomId != "1")
+          .forEach((t) => {
+            livingOrderId += t.livingOrder.id + ",";
+          });
+      }
+      /*判断是否有租借物品未归还*/
+      var count = 0;
+      await getAction("/order/cesOrderLeaseGoods/checkReturnGoods", {
+        livingOrderId: livingOrderId,
+      }).then((res) => {
+        if (res.success) {
+          if (res.result && res.result > 0) {
+            count = res.result;
+            that.$confirm({
+              title: "提示",
+              content: "您还有" + count + "件物品未归还,是否跳转物品租借页面?",
+              onOk: function () {
+                that.addLeaseGoods();
+              },
+              onCancel() {},
+            });
+          }
+        }
+      });
+      if (count == 0) {
+        var list = this.paymentList.filter((t) => t.subjectType === 1);
+        var deposit = list.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+
+        var list2 = this.paymentList.filter((t) => t.subjectType === 2);
+        var sum = list2.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+
+        var list3 = this.feesList.filter((t) => t.subjectType === 3);
+        var sum2 = list3.reduce(function (total, item) {
+          return total + item.money;
+        }, 0);
+        if (this.paymentAmount - this.feesAmount > 0) {
+          this.$refs.modalRefundForm.edit({
+            billRefund: this.paymentAmount - this.feesAmount,
+            deposit: deposit - (sum - sum2),
+            roomFee: sum - sum2,
+            money: this.paymentAmount - this.feesAmount,
+            subjectType: 5,
+            feeType: 2,
+            bookingOrderId: this.model.orderInfo.id,
+            livingOrderId:
+              livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
+            vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+            contractTeamId: livingRoom.livingOrder.contractTeamId,
+            contractTeamProtocolId:
+              livingRoom.livingOrder.contractTeamProtocolId,
+          });
+          this.$refs.modalRefundForm.title = "结账退款";
+          this.$refs.modalRefundForm.disableSubmit = false;
+        } else {
+          this.$refs.modalPaymentForm.edit({
+            billAmount: parseFloat(
+              Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
+            ),
+            deposit: deposit - (sum - sum2),
+            roomFee: parseFloat(
+              Math.abs(this.paymentAmount - this.feesAmount).toFixed(2)
+            ),
+            subjectType: 5,
+            feeType: 2,
+            bookingOrderId: this.model.orderInfo.id,
+            livingOrderId:
+              livingRoom.roomId != "1" ? livingRoom.livingOrder.id : "",
+            preferentialType: 1,
+            couponFirstAmount: 0,
+            discount: 9,
+            vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+            contractTeamId: livingRoom.livingOrder.contractTeamId,
+            contractTeamProtocolId:
+              livingRoom.livingOrder.contractTeamProtocolId,
+          });
+          this.$refs.modalPaymentForm.title = "结账收款";
+          this.$refs.modalPaymentForm.disableSubmit = false;
+        }
       }
     },
     puls() {
-      this.wakeList.push({});
+      this.wakeService = true;
+      // this.wakeList.push({});
     },
     remove(index) {
       this.wakeList.splice(index, 1);

+ 6 - 8
src/views/room/modules/checkIn/BillRoomInfoModal.vue

@@ -22,30 +22,28 @@
             style="color: #fff; font-size: 30px"
           /><a-button type="link"> 调价 </a-button>
         </div>
-        <div class="menu">
+        <div class="menu" @click="handleLeaseGoods">
           <a-icon type="block" style="color: #fff; font-size: 30px" /><a-button
             type="link"
-            @click="handleLeaseGoods"
           >
             物品借用
           </a-button>
         </div>
-        <div class="menu">
+        <div class="menu" @click="handleMessage">
           <a-icon
             type="message"
             style="color: #fff; font-size: 30px"
-          /><a-button type="link" @click="handleMessage"> 客户留言 </a-button>
+          /><a-button type="link"> 客户留言 </a-button>
         </div>
-        <div class="menu">
+        <div class="menu" @click="handleUnion">
           <a-icon
             type="retweet"
             style="color: #fff; font-size: 30px"
-          /><a-button type="link" @click="handleUnion"> 联房 </a-button>
+          /><a-button type="link"> 联房 </a-button>
         </div>
-        <div class="menu">
+        <div class="menu" @click="handleLeaveNotSettle">
           <a-icon type="euro" style="color: #fff; font-size: 30px" /><a-button
             type="link"
-            @click="handleLeaveNotSettle"
           >
             先走不结
           </a-button>

+ 99 - 0
src/views/room/modules/checkIn/EditBatchRoomPriceForm.vue

@@ -0,0 +1,99 @@
+<template>
+  <a-card :bordered="false">
+    <div>
+      <a-list
+        :grid="{ gutter: 0, column: 6 }"
+        :data-source="model.livingDayPrices"
+      >
+        <a-list-item slot="renderItem" slot-scope="item, index">
+          <a-card title="价格">
+            <p>{{ item.dayTime }}</p>
+            <p>
+              <a-input-number
+                :disabled="item.dayTime < currentDate"
+                v-model="item.price"
+                placeholder="价格"
+                :min="0"
+              ></a-input-number>
+            </p>
+          </a-card>
+        </a-list-item>
+      </a-list>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import { httpAction, getAction, postAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import moment from "moment";
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      currentDate: moment(new Date()).format("YYYY-MM-DD"),
+      model: { livingDayPrices: [] },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      hourRoomRuleList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    moment,
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      this.$emit("ok", this.model.livingDayPrices);
+    },
+  },
+};
+</script>
+
+<style scoped>
+/deep/ .ant-card-head {
+  text-align: center;
+  background: #f0f0f0;
+  height: 28px !important;
+}
+/deep/ .ant-card-body {
+  padding: 2px !important;
+  text-align: center;
+}
+</style>

+ 64 - 0
src/views/room/modules/checkIn/EditBatchRoomPriceModal.vue

@@ -0,0 +1,64 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <bus-member-card-form
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+    ></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+import BusMemberCardForm from "./EditBatchRoomPriceForm";
+export default {
+  name: "BusMemberCardModal",
+  components: {
+    BusMemberCardForm,
+  },
+  data() {
+    return {
+      title: "",
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+    };
+  },
+  methods: {
+    add(livingOrderId, roomId) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add(livingOrderId, roomId);
+      });
+    },
+    edit(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    submitCallback(e) {
+      this.$emit("ok", e);
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>

+ 271 - 0
src/views/room/modules/checkIn/EditBookingTypeForm.vue

@@ -0,0 +1,271 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="房间总价"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              {{ sumPrice
+              }}<a-icon
+                @click="editBatchRoomPrice()"
+                type="edit"
+                style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="入住类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="liveType"
+            >
+              <a-select
+                placeholder="入住类型"
+                v-model="model.liveType"
+                @change="bookingTypeChange"
+              >
+                <a-select-option :value="1"> 全天 </a-select-option>
+                <a-select-option :value="2"> 钟点 </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-if="model.liveType == 2">
+            <a-form-model-item
+              label="时长"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="fangAnId"
+            >
+              <a-select
+                placeholder="时长"
+                v-model="model.fangAnId"
+                @change="hourRoomIdChange"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in hourRoomRuleList"
+                  :key="item.id"
+                >
+                  {{ item.hourRoomName }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+    <edit-batch-room-price-modal
+      ref="modalEditBatchRoomPriceModal"
+      @ok="modalFormOk"
+    ></edit-batch-room-price-modal>
+  </a-spin>
+</template>
+
+<script>
+import moment from "moment";
+import { httpAction, getAction, postAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import EditBatchRoomPriceModal from "./EditBatchRoomPriceModal.vue";
+export default {
+  name: "BusMemberCardForm",
+  components: { EditBatchRoomPriceModal },
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        liveType: [{ required: true, message: "请输入入住类型!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      hourRoomRuleList: [],
+      currentDate: moment(new Date()).format("YYYY-MM-DD"),
+      roomPrice: 0,
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+    sumPrice() {
+      var sum = 0;
+      // if (this.model.liveType == 1) {
+      (this.model.livingDayPrices || []).forEach((item) => {
+        sum += item.price;
+      });
+      // } else if (this.model.liveType == 2) {
+      //   var find = this.hourRoomRuleList.find(
+      //     (t) => t.id == this.model.fangAnId
+      //   );
+      //   if (find) {
+      //     sum = find.afterOpenRoomPay;
+      //   }
+      // }
+      return sum;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/rooms/cesHourRoomRule/list", {
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.hourRoomRuleList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    moment,
+    modalFormOk(e) {
+      console.log("e", e);
+    },
+    editBatchRoomPrice() {
+      this.$refs.modalEditBatchRoomPriceModal.edit(this.model);
+      this.$refs.modalEditBatchRoomPriceModal.title = "修改";
+      this.$refs.modalEditBatchRoomPriceModal.disableSubmit = false;
+    },
+    bookingTypeChange(e) {
+      if (this.model.liveType == 1) {
+        this.model.fangAnId = "";
+        if (this.model.oldliveType == 1) {
+          this.model.livingDayPrices = this.model.oldlivingDayPrices;
+        } else if (this.model.oldliveType == 2) {
+          //钟点转全天,每日房价要重新赋值
+          this.model.livingDayPrices = this.model.oldlivingDayPrices;
+          var item = JSON.parse(
+            JSON.stringify(this.model.oldlivingDayPrices[0])
+          );
+          item.dayTime = this.currentDate;
+          item.price = this.roomPrice;
+          this.model.livingDayPrices = [item];
+        }
+      } else {
+        var hourRoomRule = this.hourRoomRuleList[0];
+        if (hourRoomRule) {
+          this.model.fangAnId = hourRoomRule.id;
+          this.bindLivingDayPrices();
+        }
+      }
+    },
+    bindLivingDayPrices() {
+      var find = this.hourRoomRuleList.find((t) => t.id == this.model.fangAnId);
+      var item = JSON.parse(JSON.stringify(this.model.oldlivingDayPrices[0]));
+      item.dayTime = this.currentDate;
+      item.price = 0;
+      if (find) {
+        item.price = find.afterOpenRoomPay;
+      }
+      this.model.livingDayPrices = [item];
+    },
+    hourRoomIdChange() {
+      this.bindLivingDayPrices();
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.model.oldlivingDayPrices = JSON.parse(
+        JSON.stringify(this.model.livingDayPrices)
+      );
+      this.model.oldliveType = JSON.parse(JSON.stringify(this.model.liveType));
+      this.visible = true;
+
+      getAction(
+        "/rooms/cesRooms/get-room-mkt-price?roomId=" + this.model.roomId,
+        {}
+      ).then((res) => {
+        if (res.success) {
+          this.roomPrice = res.result;
+        }
+      });
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        console.log(this.model);
+        // return;
+        if (valid) {
+          that.model.prices = {
+            livingOrderId: that.model.orderId,
+            dayPrices: that.model.livingDayPrices,
+          };
+          that.confirmLoading = true;
+          postAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditBookingTypeModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditBookingTypeForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 182 - 0
src/views/room/modules/checkIn/EditBreakfastNumForm.vue

@@ -0,0 +1,182 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="早餐数量"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="brkfstNum"
+            >
+              <a-input-number
+                v-model="model.brkfstNum"
+                placeholder="早餐数量"
+                :min="0"
+              ></a-input-number
+              >份
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+      warranterList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busSalesPerson/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.warranterList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditBreakfastNumModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditBreakfastNumForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 210 - 0
src/views/room/modules/checkIn/EditCustomerForm.vue

@@ -0,0 +1,210 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="姓名"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="cusName"
+            >
+              <a-auto-complete
+                v-model="model.cusName"
+                placeholder="联系人"
+                @search="handleSearch"
+                @select="(e) => handleSelectMember(e)" style="width: 70%;"
+              >
+                <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-button @click="readCardNo" style="margin-left: 10px"
+                >读取身份证</a-button
+              >
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="24">
+            <a-form-model-item
+              label="性别"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="gender"
+            >
+              <a-radio-group v-model="model.gender">
+                <a-radio :value="1">男</a-radio>
+                <a-radio :value="2">女</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col> -->
+          <a-col :span="24">
+            <a-form-model-item
+              label="手机号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="cusPhone"
+            >
+              <a-input
+                v-model="model.cusPhone"
+                placeholder="请输入手机号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    this.getbusCustomer();
+  },
+  methods: {
+    readCardNo() {
+      this.$message.error("接口程序未打开,请打开接口程序");
+    },
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditCustomerModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditCustomerForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 183 - 0
src/views/room/modules/checkIn/EditCustomerSourceForm.vue

@@ -0,0 +1,183 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="订单来源"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerSource"
+            >
+              <a-select placeholder="订单来源" v-model="model.customerSource">
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in customerSourceList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538915239743490",
+    }).then((res) => {
+      if (res.success) {
+        this.customerSourceList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditCustomerSourceModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditCustomerSourceForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 378 - 0
src/views/room/modules/checkIn/EditCustomerTypeForm.vue

@@ -0,0 +1,378 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="宾客类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerType"
+            >
+              <a-select placeholder="宾客类型" v-model="model.customerType">
+                <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-model-item>
+          </a-col>
+          <a-col :span="24" v-if="model.customerType === 2">
+            <a-card :bordered="true" style="width: 100%; padding: 0 !important">
+              <p>
+                <a-form-model-item
+                  label="会员"
+                  :labelCol="{
+                    xs: { span: 24 },
+                    sm: { span: 2 },
+                  }"
+                  :wrapperCol="{
+                    xs: { span: 24 },
+                    sm: { span: 22 },
+                  }"
+                  prop="vipCustomerId"
+                >
+                  <a-auto-complete
+                    v-model="vipCustomerData.name"
+                    @select="(e) => handleSelectVip(e)"
+                    @search="handleSearchVip"
+                  >
+                    <template slot="dataSource">
+                      <a-select-option
+                        :key="item.id"
+                        :value="item.id"
+                        :label="item.name"
+                        v-for="(item, index) in busMemberCardList"
+                      >
+                        {{ item.name }}-{{ item.gradeName }}-{{ item.balance }}
+                      </a-select-option>
+                    </template>
+                  </a-auto-complete>
+                </a-form-model-item>
+              </p>
+              <p>
+                <a-row>
+                  <a-col :span="8">名称:{{ vipCustomerData.name }}</a-col>
+                  <a-col :span="8">电话:{{ vipCustomerData.mobile }}</a-col>
+                  <a-col :span="8">级别:{{ vipCustomerData.gradeName }}</a-col>
+                </a-row>
+                <a-row>
+                  <a-col :span="8">余额:{{ vipCustomerData.balance }}</a-col>
+                  <a-col :span="8">积分:{{ vipCustomerData.integral }}</a-col>
+                  <a-col :span="8">卡号:{{ vipCustomerData.cardNo }}</a-col>
+                </a-row>
+              </p>
+            </a-card>
+          </a-col>
+          <a-col :span="24" v-if="model.customerType === 3">
+            <a-card :bordered="true" style="width: 100%; padding: 0 !important">
+              <a-row>
+                <a-col :span="12">
+                  <a-form-model-item
+                    label="协议单位"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="contractTeamId"
+                  >
+                    <a-auto-complete
+                      v-model="agreementUnitData.customerName"
+                      @select="(e) => handleSelectAgreementUnit(e)"
+                      @search="handleSearchAgreementUnit"
+                    >
+                      <template slot="dataSource">
+                        <a-select-option
+                          :key="item.id"
+                          :value="item.id"
+                          :label="item.customerName"
+                          v-for="(item, index) in busMarketAgreementUnitList"
+                        >
+                          {{ item.customerName }}
+                        </a-select-option>
+                      </template>
+                    </a-auto-complete>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :span="12">
+                  <a-form-model-item
+                    label="协议合同"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="contractTeamProtocolId"
+                  >
+                    <span
+                      style="color: red; cursor: pointer"
+                      @click="showAgreementUnitTable(model.contractTeamId)"
+                      >{{ model.contractTeamProtocolName }}</span
+                    >
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+              <p>
+                <a-row>
+                  <a-col :span="12"
+                    >名称:{{ agreementUnitData.customerName }}</a-col
+                  >
+                  <a-col :span="12"
+                    >签约开始日期:{{
+                      busMarketAgreementCustomer.signTime
+                    }}</a-col
+                  >
+                  <a-col :span="12"
+                    >签约结束日期:{{
+                      busMarketAgreementCustomer.effective
+                    }}</a-col
+                  >
+                  <a-col :span="12"
+                    >可用额度:{{ agreementUnitData.balance || 0 }}</a-col
+                  >
+                </a-row>
+              </p>
+            </a-card>
+          </a-col>
+        </a-row>
+      </a-form-model> </j-form-container
+    ><agreement-unit-modal-table
+      ref="modalAgreementUnitTable"
+      @ok="modalAgreementUnitTableOk"
+    ></agreement-unit-modal-table>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import AgreementUnitModalTable from "./AgreementUnitModalTable";
+export default {
+  name: "BusMemberCardForm",
+  components: { AgreementUnitModalTable },
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        customerType: [{ required: true, message: "请选择宾客类型!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      vipCustomerData: {},
+      agreementUnitData: { customerName: "" },
+      oldBusMemberCardList: [],
+      busMemberCardList: [],
+      oldBusMarketAgreementUnitList: [],
+      busMarketAgreementUnitList: [],
+      busMarketAgreementCustomer: {},
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    // this.getbusCustomer();
+    getAction("/business/busMemberCard/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        this.busMemberCardList = res.result.records;
+        this.oldBusMemberCardList = JSON.parse(
+          JSON.stringify(this.busMemberCardList)
+        );
+        if (this.model.vipCustomerId) {
+          this.handleSelectVip(this.model.vipCustomerId);
+        }
+      }
+    });
+    getAction("/business/busMarketAgreementUnit/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        this.busMarketAgreementUnitList = res.result.records;
+        this.oldBusMarketAgreementUnitList = JSON.parse(
+          JSON.stringify(res.result.records)
+        );
+        if (this.model.contractTeamId && this.model.contractTeamProtocolId) {
+          this.handleSelectAgreementUnit(this.model.contractTeamId);
+        }
+      }
+    });
+  },
+  methods: {
+    modalAgreementUnitTableOk(e) {
+      var info = e;
+      this.model.contractTeamProtocolName = info.name;
+      this.model.contractTeamProtocolId = info.id;
+      this.busMarketAgreementCustomer = info;
+    },
+    showAgreementUnitTable(agreementId) {
+      this.$refs.modalAgreementUnitTable.add(agreementId);
+      this.$refs.modalAgreementUnitTable.title = "选择协议";
+      this.$refs.modalAgreementUnitTable.disableSubmit = true;
+    },
+    handleSearchAgreementUnit(value) {
+      let result;
+      if (!value) {
+        result = this.oldBusMarketAgreementUnitList;
+      } else {
+        result = this.oldBusMarketAgreementUnitList.filter((t) =>
+          t.customerName.includes(value)
+        );
+      }
+      this.busMarketAgreementUnitList = JSON.parse(JSON.stringify(result));
+    },
+    handleSelectAgreementUnit(value) {
+      let result = this.busMarketAgreementUnitList.find((t) => t.id == value);
+      this.model.contractTeamId = value;
+      this.agreementUnitData = JSON.parse(JSON.stringify(result));
+      this.contractTeamIdChange(value);
+    },
+    contractTeamIdChange(e) {
+      this.model.contractTeamId = e;
+      getAction("/business/busMarketAgreementCustomer/list", {
+        agreementId: this.model.contractTeamId,
+      }).then((res) => {
+        if (res.success) {
+          var list = res.result.records;
+          if (list && list.length > 0) {
+            this.model.contractTeamProtocolName = list[0].name;
+            this.model.contractTeamProtocolId = list[0].id;
+            this.busMarketAgreementCustomer = list[0];
+          }
+        }
+      });
+    },
+    handleSearchVip(value) {
+      let result;
+      if (!value) {
+        result = this.oldBusMemberCardList;
+      } else {
+        console.log("this.oldBusMemberCardList", this.oldBusMemberCardList);
+        result = this.oldBusMemberCardList.filter((t) => {
+          return (
+            t.name.includes(value) ||
+            (t.cardNo && t.cardNo.includes(value)) ||
+            (t.mobile && t.mobile.includes(value))
+          );
+        });
+      }
+      this.busMemberCardList = JSON.parse(JSON.stringify(result));
+    },
+    handleSelectVip(value) {
+      console.log(value);
+      let result = this.busMemberCardList.find((t) => t.id == value);
+      this.model.vipCustomerId = value;
+      this.vipCustomerData = JSON.parse(JSON.stringify(result));
+      // this.vipCustomerIdChange(result.id);
+    },
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditCustomerTypeModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditCustomerTypeForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 181 - 0
src/views/room/modules/checkIn/EditRemarkForm.vue

@@ -0,0 +1,181 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="订单备注"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="remark"
+            >
+              <a-textarea
+                v-model="model.remark"
+                rows="4"
+                placeholder="订单备注"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+      warranterList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busSalesPerson/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.warranterList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditRemarkModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditRemarkForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 185 - 0
src/views/room/modules/checkIn/EditWarranterForm.vue

@@ -0,0 +1,185 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="销售员工"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerSource"
+            >
+              <a-select placeholder="销售员工" v-model="model.warranter">
+                <a-select-option
+                  :value="item.id"
+                  v-for="item in warranterList"
+                  :key="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        cusName: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busRoomBookingOrders/booking-to-live",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: [],
+      customerSourceList: [],
+      warranterList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busSalesPerson/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.warranterList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    handleSearch(value) {
+      let result;
+      if (!value) {
+        result = this.oldcustomerList;
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      }
+      this.customerList = result;
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e);
+      this.model.cusPhone = find.phone;
+      this.model.cusName = find.name;
+      this.model.cusId = find.id;
+    },
+    getbusCustomer() {
+      getAction("/bus/busCustomer/list", {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records;
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+        }
+      });
+    },
+    add(livingOrderId, roomId) {
+      this.modelDefault.livingOrderId = livingOrderId;
+      this.modelDefault.roomId = roomId;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          // var customers = [];
+          // customers.push({
+          //   certNo: this.model.certNo,
+          //   certType: this.model.certType,
+          //   customerId: this.model.customerId,
+          //   customerName: this.model.customerName,
+          //   gender: this.model.gender,
+          //   phone: this.model.phone,
+          //   roomId: this.model.roomId,
+          // });
+          httpAction(
+            "/business/busRoomBookingOrders/update-orders?type=2",
+            this.model,
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success("修改成功");
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/checkIn/EditWarranterModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-member-card-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-member-card-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMemberCardForm from './EditWarranterForm'
+  export default {
+    name: 'BusMemberCardModal',
+    components: {
+      BusMemberCardForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (livingOrderId,roomId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(livingOrderId,roomId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 300 - 159
src/views/room/modules/checkIn/FeeForm.vue

@@ -1,175 +1,316 @@
 <template>
-  <a-spin :spinning="confirmLoading">
+<a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
-      <a-form-model
-        ref="form"
-        :model="model"
-        :rules="validatorRules"
-        slot="detail"
-      >
-        <a-row>
-          <a-col :span="24">
-            <a-form-model-item
-              label="消费项目"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-              prop="subjectType"
-            >
-              <a-select
-                v-model="model.subjectType"
-                style="width: 100%"
-                placeholder="消费项目"
-                :allowClear="true"
-              >
-                <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="6">商品</a-select-option>
-                <a-select-option :value="7">点餐</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item
-              label="金额"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-              prop="money"
-            >
-              <a-input-number
-                v-model="model.money"
-                placeholder="请输入金额"
-                :min="0"
-              ></a-input-number>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-      </a-form-model>
+        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+            <a-row style="display:flex;justify-content:center;">
+                <a-col :span="12">
+                    <a-form-model-item label="消费项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subjectType">
+                        <a-select v-model="model.subjectType" style="50%" placeholder="消费项目" :allowClear="true">
+                            <a-select-option :value="6">商品</a-select-option>
+                            <a-select-option :value="10">手工房费</a-select-option>
+                            <a-select-option :value="11">水电煤抄表</a-select-option>
+                            <a-select-option :value="12">赔偿费</a-select-option>
+                        </a-select>
+                    </a-form-model-item>
+                    <a-row>
+                        <a-col :span="24">
+                            <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" v-if="model.subjectType==6">
+                                <a-input-number :disabled="model.subjectType==6" v-model="goodsPrice" placeholder="请输入金额" :min="0"></a-input-number>
+                            </a-form-model-item>
+                            <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money" v-else>
+                                <a-input-number v-model="model.money" placeholder="请输入金额" :min="0"></a-input-number>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-col>
+                <a-col v-if="model.subjectType==6" :span="12">
+                    <a-row>
+                        <a-col :span="24">
+                            <a-space>
+                                <a-input v-model="queryParams.name" placeholder="名称" />
+                                <a-button @click="searchQuery" type="primary">搜索</a-button>
+                            </a-space>
+
+                        </a-col>
+                    </a-row>
+                    <a-table :columns="columns" :loading="loading" :dataSource="dataSource" style="margin-top:10px;">
+                        <template slot="sellingPrice" slot-scope="text, record">
+                            <a-input-number v-model="record.sellingPrice" :min="0"></a-input-number>
+                        </template>
+                        <template slot="number" slot-scope="text, record">
+                            <a-input-number :max="record.inventory" v-model="record.number" @change="changeNumber" :min="0"></a-input-number>
+                        </template>
+                        <template slot="inventorySlot" slot-scope="text,record">
+                            {{record.inventory - record.number}}
+                        </template>
+                    </a-table>
+                </a-col>
+            </a-row>
+            <!-- <a-row>
+                <a-col :span="24">
+                    <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money">
+                        <a-input-number v-model="model.money" placeholder="请输入金额" :min="0"></a-input-number>
+                    </a-form-model-item>
+                </a-col>
+            </a-row> -->
+        </a-form-model>
     </j-form-container>
-  </a-spin>
+</a-spin>
 </template>
 
 <script>
-import { httpAction, getAction } from "@/api/manage";
-import { validateDuplicateValue } from "@/utils/util";
+import {
+    httpAction,
+    getAction
+} from "@/api/manage";
+import {
+    validateDuplicateValue
+} from "@/utils/util";
 
+import {
+    JeecgListMixin
+} from '@/mixins/JeecgListMixin'
 export default {
-  name: "BusMemberCardForm",
-  components: {},
-  props: {
-    //表单禁用
-    disabled: {
-      type: Boolean,
-      default: false,
-      required: false,
-    },
-    livingOrderId: {
-      type: String,
-    },
-  },
-  data() {
-    return {
-      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
-      labelCol: {
-        xs: { span: 24 },
-        sm: { span: 5 },
-      },
-      wrapperCol: {
-        xs: { span: 24 },
-        sm: { span: 16 },
-      },
-      confirmLoading: false,
-      validatorRules: {
-        subjectType: [{ required: true, message: "请输入消费项目!" }],
-        money: [{ required: true, message: "请输入金额!" }],
-      },
-      url: {
-        add: "/business/busRoomBookingOrders/booking-to-live",
-        edit: "/business/busMemberCard/edit",
-        queryById: "/business/busMemberCard/queryById",
-      },
-      gradeList: [],
-      paymentMethodList: [],
-      staffList: [],
-      customerList: [],
-      oldcustomerList: [],
-    };
-  },
-  computed: {
-    formDisabled() {
-      return this.disabled;
+    name: "BusMemberCardForm",
+    components: {},
+    mixins: [JeecgListMixin],
+    props: {
+        //表单禁用
+        disabled: {
+            type: Boolean,
+            default: false,
+            required: false,
+        },
+        livingOrderId: {
+            type: String,
+        },
     },
-  },
-  created() {
-    var _info = JSON.parse(localStorage.getItem("storeInfo"));
-    if (_info) {
-      this.model.hotelId = _info.id;
-    }
-    //备份model原始值
-    this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    this.getbusCustomer();
-  },
-  methods: {
-    handleSearch(value) {
-      let result;
-      if (!value) {
-        result = this.oldcustomerList;
-      } else {
-        result = this.oldcustomerList.filter((t) => t.name.includes(value));
-      }
-      this.customerList = result;
+    data() {
+        return {
+            dataSource: [],
+            columns: [{
+                    title: "名称",
+                    align: "center",
+                    dataIndex: "name",
+                },
+                {
+                    title: "售价",
+                    align: "center",
+                    dataIndex: "sellingPrice",
+                    scopedSlots: {
+                        customRender: 'sellingPrice'
+                    },
+                },
+                {
+                    title: "数量",
+                    align: "center",
+                    dataIndex: "number",
+                    scopedSlots: {
+                        customRender: 'number'
+                    },
+                },
+                {
+                    title: "剩余库存",
+                    align: "center",
+                    dataIndex: "inventory",
+                    scopedSlots: {
+                        customRender: 'inventorySlot'
+                    }
+                },
+            ],
+            model: {
+                payType: 1,
+                livingOrderId: "",
+                certType: 1,
+                gender: 1
+            },
+            queryParams: {},
+            labelCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 5
+                },
+            },
+            wrapperCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 16
+                },
+            },
+            confirmLoading: false,
+            validatorRules: {
+                subjectType: [{
+                    required: true,
+                    message: "请输入消费项目!"
+                }],
+                money: [{
+                    required: true,
+                    message: "请输入金额!"
+                }],
+            },
+            url: {
+                list: "/rooms/cesGoods/kf-goods-list",
+                edit: "/business/busMemberCard/edit",
+                queryById: "/business/busMemberCard/queryById",
+            },
+            gradeList: [],
+            paymentMethodList: [],
+            staffList: [],
+            customerList: [],
+            oldcustomerList: [],
+        };
     },
-    handleSelectMember(e) {
-      var find = this.customerList.find((t) => t.id === e);
-      this.model.phone = find.phone;
-      this.model.customerName = find.name;
-      this.model.customerId = find.id;
-    },
-    getbusCustomer() {
-      getAction("/bus/busCustomer/list", {}).then((res) => {
-        if (res.success) {
-          this.customerList = res.result.records;
-          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+    computed: {
+        formDisabled() {
+            return this.disabled;
+        },
+        goodsPrice() {
+            let money = this.dataSource.reduce((pre, cur) => pre + cur.sellingPrice * (cur.number || 0), 0)
+            return money
         }
-      });
-    },
-    add(livingOrderId, roomId) {
-      this.modelDefault.livingOrderId = livingOrderId;
-      this.modelDefault.roomId = roomId;
-      this.edit(this.modelDefault);
     },
-    edit(record) {
-      this.model = Object.assign({}, record);
-      this.visible = true;
+    created() {
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+            this.model.hotelId = _info.id;
+        }
+        //备份model原始值
+        this.modelDefault = JSON.parse(JSON.stringify(this.model));
+        this.getbusCustomer();
+        // getAction('/kc/kcGoods/list').then(res=>{
+        //   if (res.success) {
+        //     this.dataSource = res.result.records;
+        //   }
+        // })
+        // getAction('/rooms/cesGoods/queryList').then(res=>{
+        //   if (res.success) {
+        //     this.dataSource = res.result.records;
+        //   }
+        // })
     },
-    submitForm() {
-      const that = this;
-      // 触发表单验证
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          that.confirmLoading = true;
-          var orders = [];
-          orders.push({
-            money: this.model.money,
-            subjectType: this.model.subjectType,
-          });
-          this.model.orders = orders;
-          this.model.livingOrderId = this.livingOrderId;
-          httpAction("/business/busRoomBookingOrders/set-living-order-fee?livingOrderId="+this.livingOrderId, orders, "post")
-            .then((res) => {
-              if (res.success) {
-                that.$message.success(res.message);
-                that.$emit("ok");
-              } else {
-                that.$message.warning(res.message);
-              }
-            })
-            .finally(() => {
-              that.confirmLoading = false;
+    methods: {
+        changeNumber() {
+            console.log(this.dataSource);
+        },
+        handleSearch(value) {
+            let result;
+            if (!value) {
+                result = this.oldcustomerList;
+            } else {
+                result = this.oldcustomerList.filter((t) => t.name.includes(value));
+            }
+            this.customerList = result;
+        },
+        handleSelectMember(e) {
+            var find = this.customerList.find((t) => t.id === e);
+            this.model.phone = find.phone;
+            this.model.customerName = find.name;
+            this.model.customerId = find.id;
+        },
+        getbusCustomer() {
+            getAction("/bus/busCustomer/list", {}).then((res) => {
+                if (res.success) {
+                    this.customerList = res.result.records;
+                    this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+                }
             });
-        }
-      });
+        },
+        add(livingOrderId, roomId) {
+            this.modelDefault.livingOrderId = livingOrderId;
+            this.modelDefault.roomId = roomId;
+            this.edit(this.modelDefault);
+        },
+        edit(record) {
+            this.model = Object.assign({}, record);
+            this.visible = true;
+        },
+        submitForm() {
+            const that = this;
+            // 触发表单验证
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    if (this.dataSource.every(ele=>ele.number==0) && this.model.subjectType == 6) {
+                        this.$message.warning("请至少选择一件商品")
+                        return
+                    }
+                    that.confirmLoading = true;
+                    var orders = [];
+                    let feeGoods = []
+                    
+                    if (this.model.subjectType == 6) {
+                        that.dataSource.forEach(ele=>{
+                        if (ele.number>0) {
+                            feeGoods.push({
+                                goodsId: ele.id,
+                                num: ele.number,
+                                price: ele.sellingPrice
+                            })
+                            }
+                        })
+                        that.model.money = that.goodsPrice
+                    }
+                    orders.push({
+                        money: this.model.money,
+                        subjectType: this.model.subjectType,
+                        feeGoods: feeGoods
+                    });
+                    this.model.orders = orders;
+                    this.model.livingOrderId = this.livingOrderId;
+                    httpAction("/business/busRoomBookingOrders/set-living-order-fee?livingOrderId=" + this.livingOrderId, orders, "post")
+                        .then((res) => {
+                            if (res.success) {
+                                that.$message.success(res.message);
+                                that.$emit("ok");
+                            } else {
+                                that.$message.warning(res.message);
+                            }
+                        })
+                        .finally(() => {
+                            that.confirmLoading = false;
+                        });
+                }
+            });
+        },
+        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:适配不分页的数据列表------------
+                    let arr = []
+                    arr = res.result.records || res.result;
+                    arr.forEach(ele=>{
+                        ele.number = 0
+                    })
+                    this.dataSource = JSON.parse(JSON.stringify(arr));
+                    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>
+</script>

+ 1 - 1
src/views/room/modules/checkIn/FeeModal.vue

@@ -23,7 +23,7 @@
     data () {
       return {
         title:'',
-        width:800,
+        width:1200,
         visible: false,
         disableSubmit: false,
         livingOrderId:''

+ 96 - 11
src/views/room/modules/checkIn/Payment.vue

@@ -8,7 +8,7 @@
         slot="detail"
       >
         <a-row>
-          <a-col :span="24">
+          <a-col :span="24" v-show="showYinshou">
             <a-form-model-item
               label="结账应收"
               :labelCol="labelCol"
@@ -127,6 +127,7 @@
                         :value="item2.id"
                         v-for="item2 in payTypeList"
                         :key="item2.id"
+                        :disabled="item2.delFlag == 99"
                       >
                         {{ item2.name }}
                       </a-select-option>
@@ -158,6 +159,20 @@
                   <!-- <a-col :span="12"> 本次扣后剩余: </a-col>
                 <a-col :span="12"> 本次新增积分: </a-col> -->
                 </a-row>
+                <a-row type="flex" v-if="item.isDanwei">
+                  <a-col :span="12">
+                    协议单位:{{ agreementUnitData.customerName }}
+                  </a-col>
+                  <a-col :span="12">
+                    签约开始日期:{{ danwei.signTime }}
+                  </a-col>
+                  <a-col :span="12">
+                    签约结束日期: {{ danwei.effective }}</a-col
+                  >
+                  <a-col :span="12">
+                    可用额度:{{ agreementUnitData.balance || 0 }}
+                  </a-col>
+                </a-row>
               </div>
             </a-form-model-item>
           </a-col>
@@ -170,6 +185,10 @@
               {{ sumAmount.toFixed(2) }}元
             </a-form-model-item>
           </a-col>
+          <a-col :span="24" style="text-align: end">
+            <a-checkbox default-checked>打印结账单</a-checkbox>
+            <a-checkbox default-checked>打印发票二维码</a-checkbox>
+          </a-col>
         </a-row>
       </a-form-model>
     </j-form-container>
@@ -190,6 +209,11 @@ export default {
       default: false,
       required: false,
     },
+    showYinshou: {
+      type: Boolean,
+      default: true,
+      required: false,
+    },
   },
   data() {
     return {
@@ -240,9 +264,12 @@ export default {
       oldcustomerList: [],
       payTypeList: [],
       memberCard: {},
+      danwei: {},
       isVipMemmber: false,
+      isDanwei: false,
       payList: [],
       memeberCouponList: [],
+      agreementUnitData: {},
     };
   },
   computed: {
@@ -291,14 +318,14 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    getAction("/business/busRoomPayType/list", {
-      pageSize: 99999,
-      pageNo: 1,
-    }).then((res) => {
-      if (res.success) {
-        this.payTypeList = res.result.records;
-      }
-    });
+    // getAction("/business/busRoomPayType/list", {
+    //   pageSize: 99999,
+    //   pageNo: 1,
+    // }).then((res) => {
+    //   if (res.success) {
+    //     this.payTypeList = res.result.records;
+    //   }
+    // });
   },
   methods: {
     getbusRoomPayType() {
@@ -309,6 +336,30 @@ export default {
         if (res.success) {
           this.payTypeList = res.result.records;
           if (this.payTypeList && this.payTypeList.length > 0) {
+            if (
+              !this.model.vipCustomerId ||
+              this.model.vipCustomerId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("会员")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
+            if (
+              !this.model.contractTeamId ||
+              this.model.contractTeamId.length == 0 ||
+              !this.model.contractTeamProtocolId ||
+              this.model.contractTeamProtocolId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("单位")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
             this.$set(this.model, "payType", this.payTypeList[0].id);
 
             this.payList = [
@@ -316,6 +367,7 @@ export default {
                 money: this.realityAmount,
                 payType: this.payTypeList[0].id,
                 isVipMemmber: false,
+                isDanwei: false,
               },
             ];
           }
@@ -323,10 +375,18 @@ export default {
       });
     },
     puls() {
+      var sum = this.payList.reduce(function (total, item) {
+        return total + item.money;
+      }, 0);
+      var money = this.realityAmount - sum;
+      if (money < 0) {
+        money = 0;
+      }
       this.payList.push({
-        money: 0,
+        money: money,
         payType: this.payTypeList[0].id,
         isVipMemmber: false,
+        isDanwei: false,
       });
     },
     remove(index) {
@@ -336,7 +396,8 @@ export default {
       console.log("value", value);
       console.log("e", e);
       var find = this.payTypeList.find((t) => t.id == value.payType);
-      value.isVipMemmber = find && find.name == "会员卡";
+      value.isVipMemmber = find && find.name.includes("会员");
+      value.isDanwei = find && find.name.includes("单位");
     },
     handleSearch(value) {
       let result;
@@ -388,6 +449,30 @@ export default {
           }
         });
       }
+      if (this.model.contractTeamId && this.model.contractTeamProtocolId) {
+        getAction("/business/busMarketAgreementUnit/list", {
+          id: this.model.contractTeamId,
+        }).then((res) => {
+          if (res.success) {
+            var list = res.result.records;
+            if (list.length > 0) {
+              this.agreementUnitData = list[0];
+              getAction("/business/busMarketAgreementCustomer/list", {
+                agreementId: this.model.contractTeamId,
+              }).then((res2) => {
+                if (res2.success) {
+                  var list2 = res2.result.records;
+                  if (list2 && list2.length > 0) {
+                    this.danwei = list2.find(
+                      (t) => t.id == this.model.contractTeamProtocolId
+                    );
+                  }
+                }
+              });
+            }
+          }
+        });
+      }
       this.visible = true;
     },
     submitForm() {

+ 51 - 45
src/views/room/modules/checkIn/PaymentModal.vue

@@ -5,56 +5,62 @@
     :visible="visible"
     switchFullscreen
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
-    cancelText="关闭">
-    <payment ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></payment>
+    cancelText="关闭"
+  >
+    <payment
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+      :showYinshou="showYinshou"
+    ></payment>
   </j-modal>
 </template>
 
 <script>
-
-  import payment from './Payment'
-  export default {
-    name: 'PaymentModal',
-    components: {
-      payment
+import payment from "./Payment";
+export default {
+  name: "PaymentModal",
+  components: {
+    payment,
+  },
+  data() {
+    return {
+      title: "",
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+      showYinshou: true,
+    };
+  },
+  methods: {
+    add(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add(record);
+      });
+    },
+    edit(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    submitCallback() {
+      this.$emit("ok");
+      this.visible = false;
     },
-    data () {
-      return {
-        title:'',
-        width:800,
-        visible: false,
-        disableSubmit: false
-      }
+    handleCancel() {
+      this.close();
     },
-    methods: {
-      add (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add(record);
-        })
-      },
-      edit (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.edit(record);
-        })
-      },
-      close () {
-        this.$emit('close');
-        this.visible = false;
-      },
-      handleOk () {
-        this.$refs.realForm.submitForm();
-      },
-      submitCallback(){
-        this.$emit('ok');
-        this.visible = false;
-      },
-      handleCancel () {
-        this.close()
-      }
-    }
-  }
+  },
+};
 </script>

+ 26 - 2
src/views/room/modules/checkIn/Refund.vue

@@ -42,12 +42,12 @@
                 v-model="model.payType"
                 style="width: 200px"
                 placeholder="支付类型"
-                :allowClear="true"
               >
                 <a-select-option
                   :value="item.id"
                   v-for="item in payTypeList"
                   :key="item.id"
+                  :disabled="item.delFlag == 99"
                   >{{ item.name }}</a-select-option
                 >
               </a-select>
@@ -71,12 +71,12 @@
                 v-model="model.payType"
                 style="width: 200px"
                 placeholder="支付类型"
-                :allowClear="true"
               >
                 <a-select-option
                   :value="item.id"
                   v-for="item in payTypeList"
                   :key="item.id"
+                  :disabled="item.delFlag == 99"
                   >{{ item.name }}</a-select-option
                 >
               </a-select>
@@ -190,6 +190,30 @@ export default {
         if (res.success) {
           this.payTypeList = res.result.records;
           if (this.payTypeList && this.payTypeList.length > 0) {
+            if (
+              !this.model.vipCustomerId ||
+              this.model.vipCustomerId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("会员")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
+            if (
+              !this.model.contractTeamId ||
+              this.model.contractTeamId.length == 0 ||
+              !this.model.contractTeamProtocolId ||
+              this.model.contractTeamProtocolId.length == 0
+            ) {
+              var index = this.payTypeList.findIndex((t) =>
+                t.name.includes("单位")
+              );
+              if (index >= 0) {
+                this.payTypeList[index].delFlag = 99;
+              }
+            }
             this.$set(this.model, "payType", this.payTypeList[0].id);
           }
         }

+ 6 - 2
src/views/room/modules/checkIn/SelectCheckInRoomOrder.vue

@@ -94,7 +94,11 @@ export default {
   mixins: [JeecgListMixin, mixinDevice],
   props: {
     livingOrderId: {
-      type: String,
+      type: Array,
+      default: null,
+    },
+    filterIds:{
+      type: Array,
       default: null,
     },
     livingRoomId: {
@@ -168,7 +172,7 @@ export default {
       console.log("val", val);
       if (val && val.length > 0) {
         this.dataSource = val.filter(
-          (t) => t.livingOrderId != this.livingOrderId
+          (t) => !this.filterIds.includes(t.livingOrderId)
         );
       }
       this.end = true;

+ 3 - 1
src/views/room/modules/checkIn/SelectCheckInRoomOrderModal.vue

@@ -15,6 +15,7 @@
       :disabled="disableSubmit"
       :livingOrderId="livingOrderId"
       :livingRoomId="livingRoomId"
+      :filterIds="filterIds"
     ></picking-goods-order>
   </j-modal>
 </template>
@@ -32,8 +33,9 @@ export default {
       width: 1200,
       visible: false,
       disableSubmit: false,
-      livingOrderId: "",
+      livingOrderId: [],
       livingRoomId: "",
+      filterIds:[]
     };
   },
   methods: {

+ 15 - 2
src/views/room/modules/checkIn/SelectRoomForm.vue

@@ -190,8 +190,8 @@ export default {
     return {
       visible: true,
       roomList: [
-        // { key: "1层", child: rooms },
-        // { key: "2层", child: rooms2 },
+        { key: "1层", child: rooms },
+        { key: "2层", child: rooms2 },
       ],
       roomStatusList: [],
       checkedRoomStatusList: [],
@@ -223,6 +223,7 @@ export default {
       checkLayoutList: [],
       roomLayoutList: [],
       oldroomList: [],
+      kzfLiving: false,
     };
   },
   computed: {
@@ -263,6 +264,13 @@ export default {
                 this.checkChange('',[this.roomStatusOptions[0].value,this.roomStatusOptions[1].value])
             }
         });
+    getAction("/business/busOtherEmptyDirtyRoom/queryByHotelId", {}).then(
+        (res) => {
+          if (res.success) {
+            this.kzfLiving = res.result.status === 1;
+          }
+        }
+      );
   },
   methods: {
     filterColor(state){
@@ -348,6 +356,11 @@ export default {
         },
 
     checkRoomClick(row) {
+      console.log(row);
+      if (!this.kzfLiving && row.roomStatus === 2) {
+            this.$message.warning("空脏房不允许入住");
+            return;
+          }
       if (row.check === 1) {
         row.check = 0;
         var index = this.model.rooms.findIndex((t) => t.key1 == row.key1);

+ 2 - 2
src/views/room/modules/checkIn/batchCardDetail.vue

@@ -11,13 +11,13 @@
                         <h3 style="color:rgba(42, 130, 228, 1)">
                             当前房间号
                         </h3>
-                        <div style="color:#fff;background: rgba(42, 130, 228, 1);line-height:60px;width:50%;text-align:center;border-radius:12px;">
+                        <div style="color:#fff;background: rgba(42, 130, 228, 1);line-height:100px;width:40%;text-align:center;border-radius:12px;">
                             {{roomList[roomIndex] && roomList[roomIndex].roomNo}}
                         </div>
                     </div>
                 </a-col>
                 <a-col :span="12">
-                    <div style="display:flex;flex-direction:column;justify-content:flex-end;height:100%;">
+                    <div style="display:flex;flex-direction:column;justify-content:center;height:100%;">
                         <div style="display:flex;align-items:center;justify-content:space-between">
                             <div>
                                 入住时长:{{roomList[roomIndex] && roomList[roomIndex].day}}天

+ 186 - 0
src/views/room/modules/checkIn/batchCardDetailCopy.vue

@@ -0,0 +1,186 @@
+<template>
+<div>
+    <a-card title="批量制卡" style="width: 100%">
+        <div slot="extra" style="display:flex;align-items:center;">
+            <a-switch></a-switch>制卡完毕自动跳转下一张
+        </div>
+        <p>
+            <a-row type="flex" justify="center">
+                <a-col :span="12">
+                    <div style="display:flex;flex-direction:column;justify-content:center;align-items:center;">
+                        <h3 style="color:rgba(42, 130, 228, 1)">
+                            当前房间号
+                        </h3>
+                        <div style="color:#fff;background: rgba(42, 130, 228, 1);line-height:100px;width:40%;text-align:center;border-radius:12px;">
+                            {{roomList[roomIndex] && roomList[roomIndex].name}}
+                        </div>
+                    </div>
+                </a-col>
+                <a-col :span="12">
+                    <div style="display:flex;flex-direction:column;justify-content:center;height:100%;">
+                        <div style="display:flex;align-items:center;justify-content:space-between">
+                            <div>
+                                入住时长:{{'--'}}天
+                            </div>
+                            <div>
+                                已制卡:{{'--'}}张
+                            </div>
+                        </div>
+                        <div>
+                            <!-- 入住时间:{{roomList[roomIndex] && roomList[roomIndex].Info.arrivalTime2}} -->
+                            入住时间:{{'--'}}
+                        </div>
+                        <div>
+                            <!-- 预离时间:{{roomList[roomIndex] && roomList[roomIndex].Info.dueOutTime2}} -->
+                            预离时间:{{'--'}}
+                        </div>
+                    </div>
+                </a-col>
+            </a-row>
+        </p>
+        <p>
+            <a-row :gutter="[6,6]">
+                <a-col :span="5">
+                    <a-button @click="changeErr">制新卡</a-button>
+                </a-col>
+                <a-col :span="5">
+                    <a-button @click="changeErr">复制卡</a-button>
+                </a-col>
+                <a-col :span="4">
+                    <a-button @click="changeErr">读卡</a-button>
+                </a-col>
+                <a-col :span="4">
+                    <a-button @click="changeErr">注销</a-button>
+                </a-col>
+                <a-col :span="5" v-if="roomIndex>0">
+                    <a-button @click="handleCutRoom">上一张</a-button>
+                </a-col>
+                <a-col :span="5" v-if="roomIndex<roomList.length-1">
+                    <a-button @click="handleAddRoom">下一张</a-button>
+                </a-col>
+            </a-row>
+        </p>
+        <p>
+            <a-table ref="table" size="middle" :scroll="{ x: '100%' }" bordered rowKey="id" :columns="columns" :dataSource="roomList" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap">
+                <span slot="state" slot-scope="record">
+                    {{record?'已制卡':''}}
+                    <!-- {{record}} -->
+                </span>
+                <!-- <template slot="num" slot-scope="text, record, index">
+                    {{ (ipagination.current-1)*ipagination.pageSize+index+1}}
+                </template> -->
+                <span slot="action" slot-scope="text, record">
+                    <a @click="ok(record)">选择</a>
+                </span>
+            </a-table>
+        </p>
+    </a-card>
+</div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            // 表头
+            columns: [
+                // {
+                //     title: "序号",
+                //     align: "center",
+                //     loading:false,
+                //     width: 60,
+                //     scopedSlots: {
+                //         customRender: 'num'
+                //     }
+                // },
+                {
+                    title: "房间号",
+                    align: "center",
+                    dataIndex: "name",
+                },
+                {
+                    title: "房型",
+                    align: "center",
+                    dataIndex: "layoutName",
+                },
+                {
+                    title: "住客姓名",
+                    align: "center",
+                    dataIndex: "roomInfo.key1",
+                },
+                {
+                    title: "手机号码",
+                    align: "center",
+                    dataIndex: "roomInfo.key5",
+                },
+                {
+                    title: "",
+                    align: "center",
+                    dataIndex: "iscard",
+                }
+            ],
+            ipagination:{},
+            dataSource:[],
+            loading:false,
+            roomList:[],
+            roomIndex:0,
+        }
+    },
+    methods: {
+        changeErr(){
+            this.$message.error('接口程序未打开,请打开接口程序')
+        },
+        handleAddRoom(){
+            console.log(this.roomIndex);
+            if (this.roomIndex == this.roomList.length-1) {
+                this.$message.error('已经是最后一间了')
+                return                
+            }else{
+                this.roomIndex++;
+            }
+        },
+        handleCutRoom(){
+            console.log(this.roomIndex);
+            if (this.roomIndex == 0) {
+                this.$message.error('已经是第一间了')
+                return                
+            }
+            this.roomIndex--;
+        },
+        edit(record){
+            console.log(record);
+            // let arr = []
+            // arr = record.roomPrices
+            // console.log(arr);
+            // arr.forEach(ele=>{
+            //     ele.roomInfo = record.roomIds.filter(item=> item.roomId==ele.roomId)[0]
+            //     ele.Info = record.orderInfo
+            // })
+            // console.log(arr);
+            this.roomList = record;
+        },
+        submitForm(){
+            this.$emit('ok')
+        }
+    }
+}
+</script>
+
+<style scoped>
+/deep/.ant-table-thead > tr > th {
+  background: rgba(42, 130, 228, 1);
+  color: #ffffff;
+}
+/deep/.ant-divider-horizontal {
+  margin: 12px 0 !important;
+}
+/deep/ .ant-table-tbody .ant-table-row td {
+  padding-top: 5px;
+  padding-bottom: 5px;
+}
+/deep/.ant-table-thead > tr > th,
+.ant-table-tbody > tr > td {
+  padding: 5px 5px !important;
+  overflow-wrap: break-word;
+}
+</style>

+ 1 - 1
src/views/room/modules/checkIn/batchCardModal.vue

@@ -22,7 +22,7 @@
     data () {
       return {
         title:'',
-        width:500,
+        width:800,
         visible: false,
         disableSubmit: false
       }

+ 59 - 0
src/views/room/modules/checkIn/batchCardModalCopy.vue

@@ -0,0 +1,59 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleOk"
+    cancelText="关闭">
+    <pos-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import PosTypeForm from './batchCardDetailCopy.vue'
+  export default {
+    name: 'PosTypeModal',
+    components: {
+      PosTypeForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 500 - 0
src/views/room/modules/checkIn/liveBatchCardForm.vue

@@ -0,0 +1,500 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="房型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-checkbox-group @change="checkChange" v-model="checkLayoutList">
+                <a-row>
+                  <a-col
+                    :span="6"
+                    v-for="(item, index) in roomLayoutList"
+                    :key="item.id"
+                  >
+                    <a-checkbox :value="item.id">
+                      {{ item.name }}
+                    </a-checkbox>
+                  </a-col>
+                </a-row>
+              </a-checkbox-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="房态"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="roomStatus"
+            >
+              <!-- <a-checkbox-group
+                v-model="checkedRoomStatusList"
+                :options="roomStatusOptions"
+                @change="checkChange"
+              /> -->
+              <div style="display:flex;flex-wrap:wrap;">
+                <div v-for="(item, index) in roomStatusOptions" :class="{'check':checkedRoomStatusList.some(ele=> ele==item.value)}" :key="index" class="nocheck room-status" :style="{borderLeft:`2px solid ${item.extend}`}" @click="roomStatusChange(item, index)">
+                  {{item.label}}
+                </div>
+              </div>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="已选"
+              :labelCol="labelCol"
+              :wrapperCol="{
+                xs: { span: 24 },
+                sm: { span: 20 },
+              }"
+              prop="roomStatus"
+            >
+              <a-tag
+                color="blue"
+                closable
+                :visible="visible"
+                @close.stop="tagClose2(index, item.name)"
+                v-for="(item, index) in model.rooms"
+                :key="index"
+                >{{ item.name }}</a-tag
+              >
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="房间"
+              :labelCol="labelCol"
+              :wrapperCol="{
+                xs: { span: 24 },
+                sm: { span: 20 },
+              }"
+            >
+              <!-- <a-tabs
+                default-active-key="room-all"
+                tab-position="left"
+                :style="{ height: '300px' }"
+              >
+              <a-tab-pane
+                  tab="全部"
+                  key="room-all"
+                > -->
+                  <div>
+                    <a-row :gutter="[8, 8]" style="overflow: auto;height:300px;">
+                      <a-col
+                        :span="24"
+                        v-for="(item, index) in (roomList || [])"
+                        :key="index"
+                      >
+                        <div>{{item.name}}</div>
+                        <div style="display:flex;flex-wrap:wrap;">
+                            <div v-for="(r, rIndex) in item.rooms" :style="{'border-left-color':filterColor(r.roomStatus)}" @click="checkRoomClick(r)" :key="'floorRooms' + rIndex" :class="[r.check == 1 ? 'check' : 'nocheck', r.kz == 1 ? 'kz' : '',]" class="nocheck room-status">
+                            <!-- <div 
+                            :class="[
+                              r.check == 1 ? 'check' : 'nocheck',
+                              r.kz == 1 ? 'kz' : '',
+                            ]"
+                            style="display:flex;flex-wrap:wrap;"
+                            @click="checkRoomClick(r)"
+                          >
+                            <div class="nocheck room-status">
+                              {{ r.name }}
+                            </div>
+                          </div> -->
+                          {{ r.name }}
+                          </div>
+                        </div>
+                        </a-col>
+                    </a-row>
+                  </div>
+                <!-- </a-tab-pane>
+                <a-tab-pane
+                  v-for="(room, index) in roomList"
+                  :key="'room' + index"
+                  :tab="room.name"
+                >
+                  <div
+                    id="components-grid-demo-playground"
+                    style="height: 300px; overflow: hidden auto"
+                  >
+                    <a-row :gutter="[8, 8]">
+                      <a-col
+                        :span="3"
+                        v-for="(r, rIndex) in room.rooms"
+                        :key="'floorRooms' + rIndex"
+                      >
+                        <div
+                          :class="[
+                            r.check == 1 ? 'check' : 'nocheck',
+                            r.kz == 1 ? 'kz' : '',
+                          ]"
+                          :style="{'border-left-color':filterColor(r.roomStatus)}"
+                          @click="checkRoomClick(r)"
+                        >
+                          {{ r.name }}
+                        </div></a-col
+                      >
+                    </a-row>
+                  </div>
+                </a-tab-pane>
+              </a-tabs> -->
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+export default {
+  name: "SelectRoomForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    const rooms = [];
+    for (let i = 0; i < 100; i++) {
+      rooms.push({
+        id: "100" + i,
+        roomNo: 1000 + i,
+        check: 0,
+        kz: i == 1 ? 1 : 0,
+      });
+    }
+    const rooms2 = [];
+    for (let i = 0; i < 50; i++) {
+      rooms2.push({
+        id: "200" + i,
+        roomNo: 2000 + i,
+        check: 0,
+        kz: i == 5 ? 1 : 0,
+      });
+    }
+    return {
+      visible: true,
+      roomList: [
+        // { key: "1层", child: rooms },
+        // { key: "2层", child: rooms2 },
+      ],
+      roomStatusList: [],
+      checkedRoomStatusList: [],
+      roomTypeOptions: [],
+      roomStatusOptions: [],
+      model: { roomType: "", rooms: [] },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 2 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        dateRange: [{ required: true, message: "请选择维修时间!" }],
+        remark: [{ required: true, message: "请输入维修原因!" }],
+      },
+      url: {
+        add: "/business/busMeetingRoom/add",
+        edit: "/business/busMeetingRoom/edit",
+        queryById: "/business/busMeetingRoom/queryById",
+      },
+      layoutName: "",
+      presetNum: 0,
+      canUserRooms: [],
+      oldcanUserRooms: [],
+      checkLayoutList: [],
+      roomLayoutList: [],
+      oldroomList: [],
+      kzfLiving: false,
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+
+    getAction("/rooms/cesRoomLayout/list", { pageSize: 99999, pageNo: 1 }).then(
+      (res) => {
+        if (res.success) {
+          this.roomLayoutList = res.result.records;
+          if (this.roomLayoutList && this.roomLayoutList.length > 0) {
+            this.roomLayoutList.forEach((item) => {
+              this.checkLayoutList.push(item.id);
+            });
+          }
+        }
+      }
+    );
+    getAction("/rooms/cesRooms/room-status-color", {}).then((res) => {
+            if (res.success) {
+                // this.roomStatusColorList = res.result;
+                var list = [];
+                res.result.forEach((item) => {
+                    list.push(item);
+                });
+                // list = list.filter(item => item.label == '空净' || item.label == '空脏')
+                console.log(list);
+                this.roomStatusOptions = list;
+                this.checkChange('',[this.roomStatusOptions[0].value,this.roomStatusOptions[1].value])
+            }
+        });
+    getAction("/business/busOtherEmptyDirtyRoom/queryByHotelId", {}).then(
+        (res) => {
+          if (res.success) {
+            this.kzfLiving = res.result.status === 1;
+          }
+        }
+      );
+    this.getData()
+  },
+  methods: {
+    filterColor(state){
+      var color = '';
+      let arr = this.roomStatusOptions.filter(item => item.value == state);
+      color = arr[0] ? arr[0].extend : '';
+      return color;
+    },
+
+    roomStatusChange(item, index){
+      console.log('roomStatusChange');
+      if (this.checkedRoomStatusList.some(ele=> ele==item.value)) {
+        var index = this.checkedRoomStatusList.findIndex((t) => t == item.value);
+        this.checkedRoomStatusList.splice(index, 1);
+      } else {
+        this.checkedRoomStatusList.push(item.value);        
+      }
+      this.checkChange()
+    },
+
+    checkChange(e,stateList) {
+            console.log("e", e);
+            var list = this.oldroomList;
+            console.log(list);
+            console.log(this.checkedRoomStatusList);
+            if (this.checkLayoutList.length > 0) {
+                list = this.oldroomList.reduce((acc, curr) => {
+                    const rooms = curr.rooms.filter((room) =>
+                        this.checkLayoutList.includes(room.layoutId)
+                    );
+                    acc.push({
+                        ...curr,
+                        rooms
+                    });
+                    return acc;
+                }, []);
+            }
+            if (this.checkedRoomStatusList.length > 0) {
+                list = list.reduce((acc, curr) => {
+                    const rooms = curr.rooms.filter((room) =>
+                        this.checkedRoomStatusList.includes(
+                            room.roomStatus.toString()
+                        )
+                    );
+                    acc.push({
+                        ...curr,
+                        rooms
+                    });
+                    return acc;
+                }, []);
+            }
+            if (this.checkedRoomStatusList.length == 0) {
+              let arr = []
+              this.roomStatusOptions.forEach(ele=>{
+                arr.push(ele.value)
+              })
+              list = list.reduce((acc, curr) => {
+                  const rooms = curr.rooms.filter((room) =>
+                      arr.includes(
+                          room.roomStatus.toString()
+                      )
+                  );
+                  acc.push({
+                      ...curr,
+                      rooms
+                  });
+                  return acc;
+              }, []);
+            }
+            if (stateList && stateList.length > 0) {
+                list = list.reduce((acc, curr) => {
+                    const rooms = curr.rooms.filter((room) =>
+                        stateList.includes(room.roomStatus.toString())
+                    );
+                    acc.push({
+                        ...curr,
+                        rooms
+                    });
+                    return acc;
+                }, []);              
+            }
+            console.log("list2", list);
+            this.roomList = list;
+        },
+
+    checkRoomClick(row) {
+      console.log(row);
+      if (!this.kzfLiving && row.roomStatus === 2) {
+            this.$message.warning("空脏房不允许入住");
+            return;
+          }
+      if (row.check === 1) {
+        row.check = 0;
+        var index = this.model.rooms.findIndex((t) => t.key1 == row.key1);
+        this.model.rooms.splice(index, 1);
+      } else {
+        row.check = 1;
+        this.model.rooms.push(row);
+      }
+    },
+    tagClose2(index, key1) {
+      this.model.rooms.splice(index, 1);
+      this.roomList.some((t) => {
+        var r = t.floorRooms.some((c) => {
+          if (c.name === key1) {
+            c.check = 0;
+            return true;
+          }
+          return false;
+        });
+        if (r === true) {
+          return true;
+        }
+      });
+    },
+    onChange(e) {
+      console.log(e);
+      var list = [];
+      this.oldroomList.forEach((item) => {
+        var floorRooms = [];
+        item.floorRooms.forEach((f) => {
+          if (e.includes(f.layoutId)) {
+            floorRooms.push(f);
+          }
+        });
+        var itemd = JSON.parse(JSON.stringify(item));
+        itemd.floorRooms = floorRooms;
+        list.push(itemd);
+      });
+      this.roomList = list;
+      // result = this.oldcustomerList.filter((t) => t.name.includes(value));
+      console.log("this.oldroomList", this.oldroomList);
+      console.log("this.roomList", this.roomList);
+      this.checkChange()
+    },
+    add(row) {
+      console.log("canUserRooms", row);
+      // this.canUserRooms = row;
+      this.oldroomList = JSON.parse(JSON.stringify(row[0].buildingRooms));
+
+      // this.layoutName = row.layout.name;
+      // this.presetNum = row.layout.presetNum;
+      this.roomList = row[0].buildingRooms;
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.roomList.forEach((t) => {
+        t.floorRooms.forEach((f) => {
+          if (f.check && f.check == 1) {
+            this.model.rooms.push(f);
+          }
+        });
+      });
+      this.visible = true;
+    },
+    getData(){
+      getAction("/business/busRoomBookingOrders/rili-fangtai").then((res) => {
+        if (res.success) {
+          this.roomList = res.result.floorRoomVos;
+          this.oldroomList = JSON.parse(JSON.stringify(res.result.floorRoomVos));
+        }
+      });
+    },
+    submitForm() {
+      const that = this;
+      if (that.model.rooms.length === 0) {
+        that.$message.warning("请先选择房间");
+        return;
+      }
+      that.$emit("ok", that.model.rooms);
+    },
+  },
+};
+</script>
+<style scoped>
+#components-grid-demo-playground [class~="ant-col"] {
+  background: transparent;
+  border: 0;
+}
+#components-grid-demo-playground [class~="ant-col"] > div {
+  /* background: #00a0e9; */
+  height: 28px;
+  line-height: 28px;
+  font-size: 13px;
+  text-align: center;
+  cursor: pointer;
+  border-radius: 5px;
+}
+#components-grid-demo-playground .check {
+  border: 1px solid #00a0e9;
+}
+#components-grid-demo-playground .kz {
+  background: rgba(166, 166, 166, 1);
+}
+#components-grid-demo-playground pre {
+  background: #f9f9f9;
+  border-radius: 6px;
+  font-size: 13px;
+  padding: 8px 16px;
+}
+#components-grid-demo-playground .nocheck {
+  border: 1px solid #cccccc;
+  border-left-width: 2px;
+}
+.check {
+  border: 1px solid #00a0e9 !important;
+}
+.nocheck {
+  border: 1px solid #cccccc;
+}
+.room-status{
+  /* height: 100%; */
+  /* line-height: 100%; */
+  font-size: 13px;
+  text-align: center;
+  cursor: pointer;
+  border-radius: 5px;
+  margin-right: 10px;
+  border: 1px solid #cccccc;
+  padding: 0px 16px;
+  margin-top: 5px;
+  border-left-width: 2px;
+  border-left-style: solid;
+}
+</style>

+ 65 - 0
src/views/room/modules/checkIn/liveBatchCardModal.vue

@@ -0,0 +1,65 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <select-room-form
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+    ></select-room-form>
+  </j-modal>
+</template>
+
+<script>
+import SelectRoomForm from "./liveBatchCardForm.vue";
+export default {
+  name: "SelectRoomFormModal",
+  components: {
+    SelectRoomForm,
+  },
+  data() {
+    return {
+      title: "选择制卡房间号",
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+    };
+  },
+  methods: {
+    add(row) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add(row);
+      });
+    },
+    edit(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    submitCallback(e) {
+      console.log("e", e);
+      this.$emit("ok", e);
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>

+ 42 - 29
src/views/room/modules/fangtaiModal/exchangeHouses/exchangeHousesForm.vue

@@ -33,14 +33,14 @@
                         <a-col :span="24">
                             <a-form-model-item label="新房间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <template v-if="selectData.length>0">
-                                    {{newRoom && newRoom.roomInfo.name}}
+                                    {{newRoom && newRoom.name}}
                                 </template> <a href="#" @click="selectVisible = true">选择</a>
                             </a-form-model-item>
                         </a-col>
                         <a-col :span="24">
                             <a-form-model-item label="房价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
                                 <!-- <a-input-number :min="0" v-model="dayNum" placeholder="请输入续住天数" style="width: 40%" @change="dayChange" /> -->
-                                <template v-if="newRoom && newRoom.roomInfo">
+                                <template v-if="newRoom">
                                     {{ timeData.reduce((pre,cur)=> pre+cur.price*1,0) }}
                                     <a-popover placement="right">
                                         <template slot="content">
@@ -100,8 +100,8 @@
             </a-col>
             <a-col :span="24" v-if="dataList.length>0">
                 <div style="display:flex;flex-wrap:wrap;height:400px;overflow: auto;">
-                    <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;">
-                        {{ item.roomInfo && item.roomInfo.name}}
+                    <div v-for="(item,index) in dataList" :key="index" @click="selectRoom(item, index)" :class="{'active':index==link}" style="border:1px solid #ccc;padding: 5px 20px;margin-right:10px;margin-top:10px;border-radius:5px;height:30px">
+                        {{ item && item.name}}
                     </div>
                 </div>
             </a-col>
@@ -265,17 +265,16 @@ export default {
                 this.roomStatusList = list;
             }
         });
-        this.loadData();
     },
     methods: {
         changeSelct() {
-            if (this.selectData[0].roomInfo.id == this.model.roomInfo.id) {
+            if (this.selectData[0].id == this.model.id) {
                 this.$message.warning("不能选择相同的房间");
                 return
             }
             this.newRoom = this.selectData[0]
-            this.timeData.forEach(ele=>{
-                ele.price = this.newRoom.layout.marketPrice
+            this.timeData.forEach(ele => {
+                ele.price = this.newRoom.marketPrice
             })
             this.selectVisible = false;
         },
@@ -361,26 +360,26 @@ export default {
             var list = this.oldRoomList;
             if (this.checkedCesRoomLayoutList.length > 0) {
                 list = this.oldRoomList.reduce((acc, curr) => {
-                    const rooms = curr.rooms.filter((room) =>
-                        this.checkedCesRoomLayoutList.includes(room.layout.id)
+                    const floorRooms = curr.floorRooms.filter((room) =>
+                        this.checkedCesRoomLayoutList.includes(room.layoutId)
                     );
                     acc.push({
                         ...curr,
-                        rooms
+                        floorRooms
                     });
                     return acc;
                 }, []);
             }
             if (this.checkedRoomStatusList.length > 0) {
                 list = list.reduce((acc, curr) => {
-                    const rooms = curr.rooms.filter((room) =>
+                    const floorRooms = curr.floorRooms.filter((room) =>
                         this.checkedRoomStatusList.includes(
-                            room.roomInfo.roomStatus.toString()
+                            room.roomStatus.toString()
                         )
                     );
                     acc.push({
                         ...curr,
-                        rooms
+                        floorRooms
                     });
                     return acc;
                 }, []);
@@ -389,9 +388,9 @@ export default {
             this.roomList = list;
             let arr = [];
             this.roomList.forEach(ele => {
-                ele.rooms.forEach(item => {
+                ele.floorRooms.forEach(item => {
                     if (item) {
-                        if (arr.some(i => i.roomInfo.id == item.roomInfo.id)) {} else {
+                        if (arr.some(i => i.id == item.id)) {} else {
                             arr.push(item)
                         }
                     }
@@ -403,13 +402,26 @@ export default {
         loadData() {
             // this.checkInBtnDis = false;
             // this.scheduleBtnDis = false;
-            getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+            // getAction("/rooms/cesRooms/realtime-rooms", {}).then((res) => {
+            //     if (res.success) {
+            //         res.result.forEach((row) => {
+            //             this.$set(row, "collapse", 1);
+            //         });
+            //         this.roomList = res.result;
+            //         this.oldRoomList = JSON.parse(JSON.stringify(res.result));
+            //         this.checkChange()
+            //     }
+            // });
+            getAction("/rooms/cesRooms/can-user-rooms", {
+                startOf: this.model.livingData.livingOrder.arrivalTime,
+                endOf: this.model.livingData.livingOrder.dueOutTime,
+                bookingType: 1,
+                hourRoomRuleId: '',
+                cancelLayout: true,
+            }).then((res) => {
                 if (res.success) {
-                    res.result.forEach((row) => {
-                        this.$set(row, "collapse", 1);
-                    });
-                    this.roomList = res.result;
-                    this.oldRoomList = JSON.parse(JSON.stringify(res.result));
+                    this.roomList = res.result[0].buildingRooms;
+                    this.oldRoomList = JSON.parse(JSON.stringify(res.result[0].buildingRooms));
                     this.checkChange()
                 }
             });
@@ -419,6 +431,7 @@ export default {
         },
         edit(record) {
             this.model = Object.assign({}, record);
+            this.loadData();
             // this.model.startValue = record.livingData.livingOrder.dueOutTime
             let arr = []
             arr.length = this.daysBetween(record.livingData.livingOrder.dueOutTime, record.livingData.livingOrder.arrivalTime)
@@ -426,7 +439,7 @@ export default {
                 arr[i] = {
                     day: this.addDate(record.livingData.livingOrder.arrivalTime, i),
                     // price: this.model.layout.marketPrice,
-                    price:0
+                    price: 0
                 };
             }
             console.log(arr);
@@ -438,6 +451,10 @@ export default {
             // 触发表单验证
             this.$refs.form.validate((valid) => {
                 if (valid) {
+                    if (!this.newRoom) {
+                        this.$message.warning("请选择新房间");
+                        return
+                    }
                     that.confirmLoading = true;
                     let httpurl = "";
                     let method = "";
@@ -448,19 +465,15 @@ export default {
                     //     httpurl += this.url.edit;
                     //     method = "put";
                     // }
-                    if (!this.newRoom || !this.newRoom.roomInfo) {
-                        this.$message.warning("请选择新房间");
-                        return
-                    }
                     let prices = this.timeData.map(item => {
                         return {
                             dayTime: item.day,
                             price: item.price,
-                            roomId: this.newRoom.roomInfo.id
+                            roomId: this.newRoom.id
                         }
                     })
                     // return
-                    httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.roomInfo.id}`, prices, 'post')
+                    httpAction(`/business/busRoomBookingOrders/change-living-room?livingOrderId=${this.model.roomInfo.livingOrderId}&changeRoomId=${this.newRoom.id}`, prices, 'post')
                         .then((res) => {
                             if (res.success) {
                                 that.$message.success(res.message);

+ 2 - 2
src/views/room/modules/leasegoods/CesOrderLeaseGoodsForm.vue

@@ -46,7 +46,7 @@
               :wrapperCol="wrapperCol"
               prop="goodsId"
             >
-              <a-select v-model="model.goodsId" placeholder="请选择民族">
+              <a-select v-model="model.goodsId" placeholder="请选择物品">
                 <a-select-option
                   :value="item.id"
                   v-for="(item, index) in busDictItemList"
@@ -162,7 +162,7 @@ export default {
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
     getAction("/business/busDictItem/list", {
-      dictId: "1639538235288539138",
+      dictId: "1659108818476990465",
     }).then((res) => {
       if (res.success) {
         this.busDictItemList = res.result.records;

+ 120 - 2
src/views/room/modules/schedule/ScheduleRoomForm.vue

@@ -91,6 +91,59 @@
                   </a-select>
                 </a-form-model-item>
               </a-col>
+              <a-col :span="24" v-if="model.orderInfo.customerType === 3">
+                  <!-- <a-form-model-item
+                    label="协议合同"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="orderInfo.contractTeamProtocolId"
+                  >
+                    <span style="color:red;cursor: pointer;" @click="showAgreementUnitTable(model.orderInfo.contractTeamId)">{{ model.orderInfo.contractTeamProtocolName }}</span>
+                  </a-form-model-item> -->
+                  <a-card :bordered="true" style="width: 130%;padding: 0 !important;">
+                    <a-row>
+                      <a-col :span="12">
+                        <a-form-model-item
+                    label="协议单位"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="orderInfo.contractTeamId"
+                  >
+                        <a-auto-complete v-model="agreementUnitData.customerName" @select="(e)=>handleSelectAgreementUnit(e)" @search="handleSearchAgreementUnit">
+                      <template slot="dataSource">
+                        <a-select-option
+                        :key="item.id"
+                        :value="item.id"
+                        :label="item.customerName"
+                        v-for="(item, index) in busMarketAgreementUnitList"
+                      >
+                      {{ item.customerName }}
+                      </a-select-option>
+                      </template>
+                    </a-auto-complete>
+                    </a-form-model-item>
+                      </a-col>
+                      <a-col :span="12">
+                        <a-form-model-item
+                    label="协议合同"
+                    :labelCol="labelCol"
+                    :wrapperCol="wrapperCol"
+                    prop="orderInfo.contractTeamProtocolId"
+                  >
+                    <span style="color:red;cursor: pointer;" @click="showAgreementUnitTable(model.orderInfo.contractTeamId)">{{ model.orderInfo.contractTeamProtocolName }}</span>
+                  </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                      <p>
+                        <a-row>
+                          <a-col :span="12">名称:{{ agreementUnitData.customerName }}</a-col>
+                          <a-col :span="12">签约开始日期:{{ busMarketAgreementCustomer.signTime }}</a-col>
+                          <a-col :span="12">签约结束日期:{{ busMarketAgreementCustomer.effective }}</a-col>
+                          <a-col :span="12">可用额度:{{ agreementUnitData.balance||0 }}</a-col>
+                        </a-row>
+                      </p>
+                    </a-card>
+                </a-col>
               <a-col :span="24" v-if="model.orderInfo.customerType == 2">
                 <a-card :bordered="true" style="width: 100%;padding: 0 !important;">
                   <p>
@@ -337,6 +390,10 @@ export default {
   },
   data() {
     return {
+      agreementUnitData: { customerName: "" },
+      oldBusMarketAgreementUnitList: [],
+      busMarketAgreementUnitList: [],
+      busMarketAgreementCustomer: {},
       canUserRoomsShow: true,
       visible: true,
       columns,
@@ -510,10 +567,71 @@ export default {
         this.loadRooms();
       }
     );
+    getAction("/business/busMarketAgreementUnit/list", {
+      pageSize: 99999,
+      pageNo: 1,
+    }).then((res) => {
+      if (res.success) {
+        this.busMarketAgreementUnitList = res.result.records;
+        this.oldBusMarketAgreementUnitList = JSON.parse(
+          JSON.stringify(res.result.records)
+        );
+      }
+    });
   },
   methods: {
-    setArrivalTime(dateTime) {
-      this.model.orderInfo.arrivalTime2 = moment(new Date(dateTime)).format("YYYY-MM-DD")
+    handleSelectAgreementUnit(value) {
+      let result = this.busMarketAgreementUnitList.find((t) => t.id == value);
+      this.model.orderInfo.contractTeamId = value;
+      this.agreementUnitData = JSON.parse(JSON.stringify(result));
+      this.contractTeamIdChange(value);
+    },
+    handleSearchAgreementUnit(value) {
+      let result;
+      if (!value) {
+        result = this.oldBusMarketAgreementUnitList;
+      } else {
+        result = this.oldBusMarketAgreementUnitList.filter((t) =>
+          t.customerName.includes(value)
+        );
+      }
+      this.busMarketAgreementUnitList = JSON.parse(JSON.stringify(result));
+    },
+    contractTeamIdChange(e) {
+      this.model.orderInfo.contractTeamId = e;
+      getAction("/business/busMarketAgreementCustomer/list", {
+        agreementId: this.model.orderInfo.contractTeamId,
+      }).then((res) => {
+        if (res.success) {
+          var list = res.result.records;
+          if (list && list.length > 0) {
+            this.model.orderInfo.contractTeamProtocolName = list[0].name;
+            this.model.orderInfo.contractTeamProtocolId = list[0].id;
+            this.busMarketAgreementCustomer = list[0];
+            var info = list[0];
+            if (info.fixedDiscount == 1 && info.discount > 0) {
+              if (this.model.roomPrices && this.model.roomPrices.length > 0) {
+                var i = 0;
+                this.model.roomPrices.forEach((t) => {
+                  t.prefPrice = (t.marketPrice * info.discount) / 100;
+                  t.roomFee = t.prefPrice * t.day;
+                  var editPrice = [];
+                  if (t.editPrice && t.editPrice.length > 0) {
+                    t.editPrice.forEach((p) => {
+                      editPrice.push(t.prefPrice);
+                    });
+                    t.editPrice = editPrice;
+                  }
+                  this.editPriceIndex = i;
+                  this.editPriceOk();
+                  i++;
+                  console.log("t", t);
+                });
+              }
+            }
+          }
+        }
+      });
     },
     presetNumChange(e, record) {
       console.log(e);

+ 1 - 0
src/views/settings/components/modules/payInterfaceConfigForm.vue

@@ -10,6 +10,7 @@
                       v-model="model.payTypeId"
                       placeholder="请选择支付方式"
                       :allowClear="true"
+                      disabled
               >
                 <a-select-option :value="item.id" v-for="(item,index) in payTypeList" :key="index">{{ item.name }}</a-select-option>
               </a-select>

+ 13 - 2
src/views/settings/components/modules/printComponents/breakFastCouponPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}</div>
         <div class="print-title">
             BreakFast Coupon
@@ -76,7 +79,14 @@
             defContent: {
                 type: String,
                 default: ""
-            }
+            },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
         },
         data() {
             let storeInfo = JSON.parse(localStorage.getItem("storeInfo"))
@@ -97,6 +107,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
+        padding: 3mm;
 
         .print-title {
             text-align: center;
@@ -108,7 +119,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 10 - 0
src/views/settings/components/modules/printComponents/changeRoomPrint.vue

@@ -1,6 +1,9 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="content">
+            <div class="print-logo">
+                <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+            </div>
             <div class="print-title">{{ storeInfo.name }}换房确认单</div>
 
             <div class="print-feesinfo">
@@ -60,6 +63,13 @@
                     }
                 }
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             defContent: {
                 type: String,
                 default: ""

文件差異過大導致無法顯示
+ 690 - 0
src/views/settings/components/modules/printComponents/checkInPrint.vue


+ 47 - 4
src/views/settings/components/modules/printComponents/extractPrint.vue

@@ -1,6 +1,12 @@
 <template>
     <div :class="sizeTypeClass">
-        <div class="print-title">{{ storeInfo.name }}取鞋单</div>
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
+        <div class="print-title">
+            <span>{{ storeInfo.name }}</span>
+            <span>取鞋单</span>
+        </div>
 
         <div class="">
             <div style="margin-top: 20px">
@@ -60,7 +66,14 @@
             defContent: {
                 type: String,
                 default: ""
-            }
+            },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
         },
         data() {
             let storeInfo = JSON.parse(localStorage.getItem("storeInfo"))
@@ -81,18 +94,29 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
+        padding: 3mm;
+        .print-logo{
+            display: flex;
+            align-items: center;
+            justify-items: center;
+            justify-content: center;
+        }
 
         .print-title {
+            width: 90%;
+            margin: auto;
             text-align: center;
             font-size: 16px;
             font-weight: 600;
+            word-wrap:break-word;
+            word-break:break-all;
         }
     }
 
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;
@@ -116,11 +140,20 @@
             }
 
         }
-
+        .print-logo{
+            display: flex;
+            align-items: center;
+            justify-items: center;
+            justify-content: center;
+        }
         .print-title {
+            width: 90%;
+            margin: auto;
             text-align: center;
             font-size: 16px;
             font-weight: 600;
+            word-wrap:break-word;
+            word-break:break-all;
         }
     }
 
@@ -148,10 +181,20 @@
         .print-no{
             text-align: center;
         }
+        .print-logo{
+            display: flex;
+            align-items: center;
+            justify-items: center;
+            justify-content: center;
+        }
         .print-title {
+            width: 90%;
+            margin: auto;
             text-align: center;
             font-size: 16px;
             font-weight: 600;
+            word-wrap:break-word;
+            word-break:break-all;
         }
         .a5-partail{
             display: flex;

+ 10 - 0
src/views/settings/components/modules/printComponents/handoverDetailPrint.vue

@@ -1,6 +1,9 @@
 <template>
     <div class="a5">
         <div class="content">
+            <div class="print-logo">
+                <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+            </div>
             <div class="print-title">{{ storeInfo.name }}交班明细表</div>
 
             <div class="print-fee-info">
@@ -274,6 +277,13 @@
                     }
                 }
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             //收款
             data_payment:{
                 type:Array ,

+ 10 - 0
src/views/settings/components/modules/printComponents/handoverPrint.vue

@@ -1,6 +1,9 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="content">
+            <div class="print-logo">
+                <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+            </div>
             <div class="print-title">{{ storeInfo.name }}交班列表</div>
 
             <div class="print-fee-info">
@@ -158,6 +161,13 @@
                     }
                 }
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             //收款
             data_payment:{
                 type:Array ,

+ 13 - 3
src/views/settings/components/modules/printComponents/hotelEntryPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}入库单</div>
         <div v-if="sizeTypeClass == 'a5'">
             <div class="print-fee-info">
@@ -196,7 +199,14 @@
                         },
                     ];
                 }
-            }
+            },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
         },
         data() {
             let storeInfo = JSON.parse(localStorage.getItem("storeInfo"))
@@ -217,7 +227,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
-
+        padding: 3mm;
         .print-title {
             text-align: center;
             font-size: 16px;
@@ -228,7 +238,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 12 - 2
src/views/settings/components/modules/printComponents/hotelOutPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}出库单</div>
         <div v-if="sizeTypeClass == 'a5'">
             <div class="print-fee-info">
@@ -162,6 +165,13 @@
                 type: String,
                 default: ""
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             dataSource:{
                 type:Array ,
                 default() {
@@ -207,7 +217,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
-
+        padding: 3mm;
         .print-title {
             text-align: center;
             font-size: 16px;
@@ -218,7 +228,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 12 - 2
src/views/settings/components/modules/printComponents/incomePrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}收款单</div>
         <div class="print-no">NO.{{ feeInfo.no }}</div>
         <div class="print-fee-info">
@@ -151,6 +154,13 @@ export default {
             type: String,
             default: ""
         },
+        defModel:{
+            type:Object,
+            default(){
+                return {
+                }
+            }
+        },
         dataSource:{
             type:Array,
             default() {
@@ -201,7 +211,7 @@ export default {
 .mm58 {
     width: 58mm;
     border: 1px solid #00000055;
-
+    padding: 3mm;
     .print-title {
         text-align: center;
         font-size: 16px;
@@ -212,7 +222,7 @@ export default {
 .mm80 {
     width: 80mm;
     border: 1px solid #00000055;
-    padding-left: 3mm;
+    padding: 3mm;
 
     .print-fee-info {
         display: flex;

+ 13 - 3
src/views/settings/components/modules/printComponents/memberChargePrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}会员扣费单</div>
         <div v-if="sizeTypeClass == 'a5'">
             <div class="print-fee-info">
@@ -131,7 +134,14 @@
             defContent: {
                 type: String,
                 default: ""
-            }
+            },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
         },
         data() {
             let storeInfo = JSON.parse(localStorage.getItem("storeInfo"))
@@ -152,7 +162,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
-
+        padding: 3mm;
         .print-title {
             text-align: center;
             font-size: 16px;
@@ -163,7 +173,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 10 - 0
src/views/settings/components/modules/printComponents/paymentPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}支付单</div>
 
         <div class="print-fee-info">
@@ -83,6 +86,13 @@
                 type: String,
                 default: ""
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             dataSource:{
                 type:Array,
                 default() {

+ 10 - 0
src/views/settings/components/modules/printComponents/posCheckOutPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}预结单</div>
         <div class="print-fee-info">
             <div class="print-fee-item-wrapper">
@@ -123,6 +126,13 @@
                 type: String,
                 default: ""
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             dataSource:{
                 type:Object,
                 default() {

+ 12 - 2
src/views/settings/components/modules/printComponents/refundPrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}退款单</div>
 <!--        <div class="print-no">NO.{{ feeInfo.no }}</div>-->
         <div v-if="sizeTypeClass == 'a5'">
@@ -263,6 +266,13 @@
                 type: String,
                 default: ""
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             dataSource:{
                 type:Array,
                 default() {
@@ -301,7 +311,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
-
+        padding: 3mm;
         .print-title {
             text-align: center;
             font-size: 16px;
@@ -312,7 +322,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 10 - 0
src/views/settings/components/modules/printComponents/renewalOrderPrint.vue

@@ -1,6 +1,9 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="content">
+            <div class="print-logo">
+                <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+            </div>
             <div class="print-title">{{ storeInfo.name }}续住单</div>
 
             <div class="print-fee-info">
@@ -70,6 +73,13 @@
                     }
                 }
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             defContent: {
                 type: String,
                 default: ""

+ 12 - 2
src/views/settings/components/modules/printComponents/settlePrint.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}结账单</div>
         <div class="print-no">NO.{{ feeInfo.no }}</div>
         <div class="print-fee-info">
@@ -127,6 +130,13 @@ export default {
             type: String,
             default: ""
         },
+        defModel:{
+            type:Object,
+            default(){
+                return {
+                }
+            }
+        },
         dataSource:{
             type:Array,
             default() {
@@ -177,7 +187,7 @@ export default {
 .mm58 {
     width: 58mm;
     border: 1px solid #00000055;
-
+    padding: 3mm;
     .print-title {
         text-align: center;
         font-size: 16px;
@@ -188,7 +198,7 @@ export default {
 .mm80 {
     width: 80mm;
     border: 1px solid #00000055;
-    padding-left: 3mm;
+    padding: 3mm;
 
     .print-fee-info {
         display: flex;

文件差異過大導致無法顯示
+ 697 - 0
src/views/settings/components/modules/printComponents/teamCheckInPrint.vue


+ 12 - 1
src/views/settings/components/modules/printComponents/teamCheckOut.vue

@@ -1,5 +1,8 @@
 <template>
     <div :class="sizeTypeClass">
+        <div class="print-logo">
+            <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
+        </div>
         <div class="print-title">{{ storeInfo.name }}团队 结账单</div>
 
         <div class="print-fee-info">
@@ -158,6 +161,13 @@
                 type: String,
                 default: ""
             },
+            defModel:{
+                type:Object,
+                default(){
+                    return {
+                    }
+                }
+            },
             dataSource:{
                 type:Object ,
                 default() {
@@ -202,6 +212,7 @@
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
+        padding: 3mm;
 
         .print-title {
             text-align: center;
@@ -213,7 +224,7 @@
     .mm80 {
         width: 80mm;
         border: 1px solid #00000055;
-        padding-left: 3mm;
+        padding: 3mm;
 
         .print-fee-info {
             display: flex;

+ 128 - 112
src/views/settings/components/modules/printTemplateForm.vue

@@ -10,144 +10,145 @@
 <!--                  <a-input v-model="model.name" placeholder="请输入打印模板名称" ></a-input>-->
 <!--                </a-form-model-item>-->
 <!--              </a-col>-->
-              <a-col :span="24" v-if="model.type == 10">
-                <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specs">
-                  <j-dict-select-tag type="radio" v-model="model.specs" placeholder="请选择规格" dictCode="print_template_specs"
-                                     disabled="disabled"
-                                     @change="e=>onSpecsChange(e)"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24" v-else>
-                <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specs">
-                  <j-dict-select-tag type="radio" v-model="model.specs" placeholder="请选择规格" dictCode="print_template_specs"
-                                     @change="e=>onSpecsChange(e)"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24">
-                <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">
-                  <a-textarea :rows="4" v-model="model.remarks" placeholder="请输入备注"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24">
-                <a-form-model-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preview">
-                  <a-checkbox v-model="model.preview">不显示打印预览窗口,直接打印小票</a-checkbox>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :span="24">
-                <a-form-model-item label="默认打印机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="defaultPrint">
-                  <a-input v-model="model.defaultPrint" placeholder="请输入默认打印机"  ></a-input>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24" v-if=" model.type == 1 || model.type == 9 || model.type == 14">
-                <a-form-model-item label="打印类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printType">
-                  <j-dict-select-tag type="radio" v-model="model.printType" placeholder="请选择打印类型" dictCode="print_template_type"/>
-                </a-form-model-item>
-              </a-col>
+                <a-col :span="24">
+                    <a-form-model-item  label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specs">
+                        <j-dict-select-tag v-if="model.type == 10" type="radio" v-model="model.specs" placeholder="请选择规格" dictCode="print_template_specs"
+                                           @change="e=>onSpecsChange(e)"/>
+                        <j-dict-select-tag v-else type="radio" v-model="model.specs" placeholder="请选择规格" dictCode="print_template_specs"
+                                           @change="e=>onSpecsChange(e)"/>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">
+                        <a-textarea v-model="model.remarks" rows="4" placeholder="请输入备注" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-model-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preview">
+                        <a-checkbox v-model="model.preview">不显示打印预览窗口,直接打印小票</a-checkbox>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-model-item label="默认打印机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="defaultPrint">
+                        <a-input v-model="model.defaultPrint" placeholder="请输入默认打印机"  ></a-input>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="24" v-if=" model.type == 1 || model.type == 9 || model.type == 14">
+                    <a-form-model-item label="打印类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printType">
+                        <j-dict-select-tag type="radio" v-model="model.printType" placeholder="请选择打印类型" dictCode="print_template_type"/>
+                    </a-form-model-item>
+                </a-col>
                 <a-col :span="24" v-if="model.type == 9">
                     <a-form-model-item label="是否显示退菜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowRefund">
                         <j-dict-select-tag type="radio" v-model="model.isShowRefund" placeholder="请选择是否显示退菜" dictCode="print_template_refund"/>
                     </a-form-model-item>
                 </a-col>
-
-                <a-row>
-                    <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
-                        <a-form-model-item label="是否打印证件信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowIdcard">
-                            <j-dict-select-tag type="radio" v-model="model.isShowIdcard" placeholder="请选择是否打印证件信息" dictCode="print_template_refund"/>
-                        </a-form-model-item>
-                    </a-col>
-                    <a-col :span="1"></a-col>
-                    <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
-                        <a-form-model-item label="是否打印早餐信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowBreakfast">
-                            <j-dict-select-tag type="radio" v-model="model.isShowBreakfast" placeholder="请选择是否打印早餐信息" dictCode="print_template_refund"/>
-                        </a-form-model-item>
-                    </a-col>
-                </a-row>
-                <a-row>
-                    <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
-                        <a-form-model-item label="是否打印客人详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowAddress">
-                            <j-dict-select-tag type="radio" v-model="model.isShowAddress" placeholder="请选择是否打印客人详细地址" dictCode="print_template_refund"/>
-                        </a-form-model-item>
-                    </a-col>
-                    <a-col :span="1"></a-col>
-                    <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
-                        <a-form-model-item label="是否打印客人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowPhone">
-                            <j-dict-select-tag type="radio" v-model="model.isShowPhone" placeholder="请选择是否打印客人电话" dictCode="print_template_refund"/>
-                        </a-form-model-item>
-                    </a-col>
-                </a-row>
-
-              <a-col :span="24">
-                <a-form-model-item label="打印份数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printSum">
-                  <a-input-number v-model="model.printSum" placeholder="请输入打印份数" style="width: 100%" />
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="10">
-                <a-form-model-item label="打印时内容宽度偏差" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printContentOffset">
-                  <a-input v-model="model.printContentOffset" placeholder="请输入打印时内容宽度偏差"  ></a-input>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="1"></a-col>
-              <a-col :span="10">
-                <a-form-model-item label="打印时纸张宽度偏差" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printPaperOffset">
-                  <a-input v-model="model.printPaperOffset" placeholder="请输入打印时纸张宽度偏差"  ></a-input>
-                </a-form-model-item>
-              </a-col>
+                <a-col :span="24">
+                    <a-row>
+                        <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
+<!--                            <a-form-model-item label="是否打印证件信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowIdcard">-->
+<!--                                <j-dict-select-tag type="radio" v-model="model.isShowIdcard" placeholder="请选择是否打印证件信息" dictCode="print_template_refund"/>-->
+<!--                            </a-form-model-item>-->
+                            <a-form-model-item label="是否显示二维码信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowQrCode">
+                                <j-dict-select-tag type="radio" v-model="model.isShowQrCode" placeholder="请选择是否显示二维码信息" dictCode="print_template_refund"/>
+                            </a-form-model-item>
+                        </a-col>
+                        <a-col :span="1"></a-col>
+                        <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
+                            <a-form-model-item label="是否打印早餐信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowBreakfast">
+                                <j-dict-select-tag type="radio" v-model="model.isShowBreakfast" placeholder="请选择是否打印早餐信息" dictCode="print_template_refund"/>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-col>
+                <a-col :span="24">
+                    <a-row>
+                        <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
+                            <a-form-model-item label="是否打印客人详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowAddress">
+                                <j-dict-select-tag type="radio" v-model="model.isShowAddress" placeholder="请选择是否打印客人详细地址" dictCode="print_template_refund"/>
+                            </a-form-model-item>
+                        </a-col>
+                        <a-col :span="1"></a-col>
+                        <a-col :span="11" v-if="model.type == 1 || model.type == 8 || model.type == 14 || model.type == 15">
+                            <a-form-model-item label="是否打印客人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isShowPhone">
+                                <j-dict-select-tag type="radio" v-model="model.isShowPhone" placeholder="请选择是否打印客人电话" dictCode="print_template_refund"/>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-model-item label="打印份数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printSum">
+                        <a-input-number v-model="model.printSum" placeholder="请输入打印份数" style="width: 100%" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="10">
+                    <a-form-model-item label="打印时内容宽度偏差" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printContentOffset">
+                        <a-input v-model="model.printContentOffset" placeholder="请输入打印时内容宽度偏差"  ></a-input>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="1"></a-col>
+                <a-col :span="10">
+                    <a-form-model-item label="打印时纸张宽度偏差" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="printPaperOffset">
+                        <a-input v-model="model.printPaperOffset" placeholder="请输入打印时纸张宽度偏差"  ></a-input>
+                    </a-form-model-item>
+                </a-col>
             </a-row>
           </a-form-model>
         </j-form-container>
       </div>
       <div class="right" id="print_content">
         <div v-if="model.type == 1">
-          <jzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></jzd>
+          <jzd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jzd>
         </div>
         <div v-else-if="model.type == 2">
-          <skd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></skd>
+          <skd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></skd>
         </div>
         <div v-else-if="model.type == 3">
-          <tkd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></tkd>
+          <tkd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></tkd>
         </div>
         <div v-else-if="model.type == 4">
-          <jbb :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jbb>
+          <jbb ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jbb>
         </div>
         <div v-else-if="model.type == 5">
-          <hfd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></hfd>
+          <hfd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></hfd>
         </div>
         <div v-else-if="model.type == 6">
-          <xzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></xzd>
+          <xzd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></xzd>
         </div>
         <div v-else-if="model.type == 7">
-          <zfd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></zfd>
+          <zfd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></zfd>
         </div>
         <div v-else-if="model.type == 8">
-          <djd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></djd>
+<!--          <djd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></djd>-->
+            <rzdjd ref="printContent" :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></rzdjd>
         </div>
         <div v-else-if="model.type == 9">
-          <posjzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></posjzd>
+          <posjzd ref="printContent" :defModel="model" :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></posjzd>
         </div>
         <div v-else-if="model.type == 10">
-          <jbmxb :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jbmxb>
+          <jbmxb ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></jbmxb>
         </div>
         <div v-else-if="model.type == 11">
-          <hykfd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></hykfd>
+          <hykfd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></hykfd>
         </div>
         <div v-else-if="model.type == 12">
-          <ckd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></ckd>
+          <ckd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></ckd>
         </div>
         <div v-else-if="model.type == 13">
-          <rkd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></rkd>
+          <rkd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></rkd>
         </div>
         <div v-else-if="model.type == 14">
-          <tdjzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></tdjzd>
+          <tdjzd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></tdjzd>
         </div>
         <div v-else-if="model.type == 15">
-          <tdrzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></tdrzd>
+<!--          <tdrzd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></tdrzd>-->
+            <tdrzdjd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></tdrzdjd>
         </div>
         <div v-else-if="model.type == 16">
-          <zcq :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></zcq>
+          <zcq ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></zcq>
         </div>
         <div v-else-if="model.type == 17">
-          <qxd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></qxd>
+          <qxd ref="printContent" :defModel="model"  :sizeTypeClass="sizeTypeClass" :defContent="model.remarks"></qxd>
         </div>
         <div v-else></div>
       </div>
@@ -193,6 +194,10 @@
   import jbb from './printComponents/handoverPrint.vue'
   import jbmxb from './printComponents/handoverDetailPrint.vue'
 
+  //入住登记单-客户提供
+  import rzdjd from './printComponents/checkInPrint.vue'
+  import tdrzdjd from './printComponents/teamCheckInPrint.vue'
+
   import { getLodop } from '../../../../utils/lodop/LodopFuncs'
   import Print from '../../../../utils/lodop/print.min'
 
@@ -200,23 +205,25 @@
   export default {
     name: 'printTemplateForm',
     components: {
-      jzd,
-      skd,
-      tkd,
-      qxd,
-      zcq,
-      tdrzd,
-      tdjzd,
-      rkd,
-      ckd,
-      hykfd,
-      posjzd,
-      zfd,
-      xzd,
-      hfd,
-      djd,
-      jbb,
-      jbmxb
+        jzd,
+        skd,
+        tkd,
+        qxd,
+        zcq,
+        tdrzd,
+        tdjzd,
+        rkd,
+        ckd,
+        hykfd,
+        posjzd,
+        zfd,
+        xzd,
+        hfd,
+        djd,
+        jbb,
+        jbmxb,
+        rzdjd,
+        tdrzdjd
     },
     props: {
       //表单禁用
@@ -293,6 +300,15 @@
         },
         submitForm() {
             const that = this;
+            var printContent = this.$refs.printContent
+            if (printContent){
+                var hotelLogo = printContent.defModel.hotelLogo
+
+                if (hotelLogo){
+                    this.model.hotelLogo = hotelLogo
+                }
+            }
+
             // 触发表单验证
             this.$refs.form.validate(valid => {
                 if (valid) {

+ 17 - 1
src/views/settings/components/paySettings.vue

@@ -112,6 +112,8 @@
                 <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
           <a-divider type="vertical" />
+          <a @click="configuration(record)">配置</a>
+          <a-divider type="vertical" />
            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
               <a>删除</a>
             </a-popconfirm>
@@ -132,6 +134,7 @@
         </div>
 
         <room-pay-type-modal ref="modalForm" @ok="modalFormOk"></room-pay-type-modal>
+        <pay-interface-config-modal ref="modalFormPay" @ok="modalFormOk"></pay-interface-config-modal>
     </a-card>
 </template>
 
@@ -142,12 +145,14 @@
     import { JeecgListMixin } from '@/mixins/JeecgListMixin'
     import roomPayTypeModal from './modules/roomPayTypeModal'
     import {hotelQueryList} from "../../../api/hotel";
+    import payInterfaceConfigModal from './modules/payInterfaceConfigModal'
 
     export default {
         name: 'paySettings',
         mixins:[JeecgListMixin, mixinDevice],
         components: {
-            roomPayTypeModal
+            roomPayTypeModal,
+            payInterfaceConfigModal
         },
         data () {
             return {
@@ -234,6 +239,17 @@
             },
         },
         methods: {
+            configuration(record){
+                // this.$refs.modalFormPay.edit()
+                if (!record.busPayInterfaceConfig) {
+                    record.busPayInterfaceConfig = {
+                        payTypeId:record.id
+                    }
+                }
+                this.$refs.modalFormPay.edit(record.busPayInterfaceConfig);
+                this.$refs.modalFormPay.title = record.busPayInterfaceConfig ? '配置' : '新增';
+                this.$refs.modalFormPay.disableSubmit = false;
+            },
             initDictConfig(){
             },
             initData(){

+ 100 - 69
src/views/settings/components/roomModules/roomNumSettings/roomNumTable.vue

@@ -4,32 +4,41 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-        <a-tag color="pink" v-if="buildingFloorSearchTag.name" >
-            {{ buildingFloorSearchTag.name }}
-            <a-icon type="close"  @click="onFliterClose" />
-        </a-tag>
+      <a-tag color="pink" v-if="buildingFloorSearchTag.name">
+        {{ buildingFloorSearchTag.name }}
+        <a-icon type="close" @click="onFliterClose" />
+      </a-tag>
       <a-button @click="handleAdd" type="primary" icon="plus"
         >新增房间</a-button
       >
       <a-button @click="onAddBatch" type="primary" icon="tags"
         >批量新增</a-button
       >
+      <a-popconfirm title="确定全部删除吗?" @confirm="delAll">
+        <a-button
+          :disabled="delLoading"
+          :loading="delLoading"
+          type="primary"
+          icon="stop"
+          >全部删除</a-button
+        >
+      </a-popconfirm>
+
       <a-popconfirm
-            title="确定全部删除吗?"
-            @confirm="delAll"
-          >
-          <a-button :disabled="delLoading" :loading="delLoading" type="primary" icon="stop">全部删除</a-button>
-          </a-popconfirm>
-      
-      <a-popconfirm
-      v-if="selectedRowKeys.length > 0"
-            title="确定删除吗?"
-            @confirm="delBatch"
-          >
-          <a-button :disabled="delLoading" :loading="delLoading" icon="stop" style="margin-left: 8px">
-          批量删除</a-button>
-          </a-popconfirm>
-      
+        v-if="selectedRowKeys.length > 0"
+        title="确定删除吗?"
+        @confirm="delBatch"
+      >
+        <a-button
+          :disabled="delLoading"
+          :loading="delLoading"
+          icon="stop"
+          style="margin-left: 8px"
+        >
+          批量删除</a-button
+        >
+      </a-popconfirm>
+
       <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-button style="margin-left: 8px">
           批量操作 <a-icon type="down"
@@ -59,7 +68,11 @@
         class="j-table-force-nowrap"
         @change="handleTableChange"
       >
-
+        <template slot="numberSlot" slot-scope="text, record">
+          <div style="display: flex; align-items: center">
+            <a-input v-model="record.passWord" @blur="(e) => handleNumber(e, record)" />
+          </div>
+        </template>
         <template slot="layoutId" slot-scope="text, record">
           {{ getLayoutName(record) }}
         </template>
@@ -72,7 +85,7 @@
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
-       
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -94,17 +107,18 @@
 </template>
   
 <script>
+import { httpAction, getAction } from "@/api/manage";
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import roomNumModal from "./roomNumModal.vue"; // todo roomLayoutForm 需要替换成房型的表单弹窗
-import roomImgs from './roomImagesForm.vue'
+import roomImgs from "./roomImagesForm.vue";
 import { getAllLayouts } from "@/api/roomLayout";
-import { delBatch, delAll } from '@/api/roomBuildingApi'
+import { delBatch, delAll } from "@/api/roomBuildingApi";
 let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
 export default {
   mixins: [JeecgListMixin],
   components: {
     roomNumModal,
-    roomImgs
+    roomImgs,
   },
   data() {
     return {
@@ -153,9 +167,10 @@ export default {
           scopedSlots: { customRender: "prefix_name" },
         },
         {
-          title: "创建时间",
+          title: "门锁密码",
           align: "center",
-          dataIndex: "createAt",
+          dataIndex: "passWord",
+          scopedSlots: { customRender: "numberSlot" },
         },
         {
           title: "操作",
@@ -175,7 +190,7 @@ export default {
         importExcelUrl: "rooms/cesRooms/importExcel",
       },
       buildingFloorSearchTag: {
-        name: null
+        name: null,
       },
       dictOptions: {},
       superFieldList: [],
@@ -196,31 +211,43 @@ export default {
     });
   },
   methods: {
+    handleNumber(e, record) {
+      const that = this;
+      let method = "put";
+      httpAction("/rooms/cesRooms/modify", record, method)
+        .then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+          } else {
+            that.$message.warning(res.message);
+          }
+        });
+    },
     onImgSave() {
-      this.loadData()
+      this.loadData();
     },
     onFliterClose() {
-        this.filters['buildId'] = null
-        this.filters['floorId'] = null
-        this.ipagination.current = 1
-        this.buildingFloorSearchTag.name = null
-        this.loadData()
+      this.filters["buildId"] = null;
+      this.filters["floorId"] = null;
+      this.ipagination.current = 1;
+      this.buildingFloorSearchTag.name = null;
+      this.loadData();
     },
     // 搜索
     searchParam(id, name, isBuilding) {
-        this.$set(this.buildingFloorSearchTag,'name',name)
-        if(isBuilding) {
-            this.filters['buildId'] = id
-            if(this.filters['floorId']) {
-                delete this.filters.floorId
-            }
-        } else {
-            this.filters['floorId'] = id
-            if(this.filters['buildId']) {
-                delete this.filters.buildId
-            }
+      this.$set(this.buildingFloorSearchTag, "name", name);
+      if (isBuilding) {
+        this.filters["buildId"] = id;
+        if (this.filters["floorId"]) {
+          delete this.filters.floorId;
         }
-        this.loadData()
+      } else {
+        this.filters["floorId"] = id;
+        if (this.filters["buildId"]) {
+          delete this.filters.buildId;
+        }
+      }
+      this.loadData();
     },
     getLayoutName(row) {
       let i = this.layouts.findIndex((s) => s.id == row.layoutId);
@@ -231,47 +258,51 @@ export default {
     },
     // 批量删除
     delBatch() {
-      let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
-      let keys = this.selectedRowKeys
-      this.delLoading = true
+      let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+      let keys = this.selectedRowKeys;
+      this.delLoading = true;
       delBatch({
         hotelId: hotelInfo.id,
-        idStr: keys.toString()
-      }).then(res => {
-        if(res.code == 200) {
-          this.selectedRowKeys = []
-          this.$message.success('删除成功');
-          this.loadData()
-        }
-      }).finally(_ => {
-        this.delLoading = false
+        idStr: keys.toString(),
       })
+        .then((res) => {
+          if (res.code == 200) {
+            this.selectedRowKeys = [];
+            this.$message.success("删除成功");
+            this.loadData();
+          }
+        })
+        .finally((_) => {
+          this.delLoading = false;
+        });
     },
     // 删除所有
     delAll() {
-      let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
-      this.delLoading = true
+      let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+      this.delLoading = true;
       delAll({
         hotelId: hotelInfo.id,
-      }).then(res => {
-        if(res.code == 200) {
-          this.selectedRowKeys = []
-          this.$message.success('全部删除成功');
-          this.loadData()
-        }
-      }).finally(_ => {
-        this.delLoading = false
       })
+        .then((res) => {
+          if (res.code == 200) {
+            this.selectedRowKeys = [];
+            this.$message.success("全部删除成功");
+            this.loadData();
+          }
+        })
+        .finally((_) => {
+          this.delLoading = false;
+        });
     },
     // 批量添加按钮
     onAddBatch() {
-        this.$router.push('/tenant/gen/rooms');
+      this.$router.push("/tenant/gen/rooms");
     },
     // 全部删除
     onDelAll() {},
     // 显示图片弹窗
     handleImage(row) {
-      this.$refs.roomimgmodal.setModel(row)
+      this.$refs.roomimgmodal.setModel(row);
     },
     onSaveOk() {
       this.loadData();

+ 4 - 4
src/views/settings/systemInfo.vue

@@ -48,20 +48,20 @@
 
                 </div>
             </a-tab-pane>
-            <a-tab-pane key="6">
+            <!-- <a-tab-pane key="6">
                 <span slot="tab">
                     <a-icon type="pay" />
                     门锁管理
                 </span>
                 <door-lock-list></door-lock-list>
-            </a-tab-pane>
-            <a-tab-pane key="7">
+            </a-tab-pane> -->
+            <!-- <a-tab-pane key="7">
                 <span slot="tab">
                     <a-icon type="payinterface" />
                     支付接口配置
                 </span>
                 <pay-api-settings></pay-api-settings>
-            </a-tab-pane>
+            </a-tab-pane> -->
             <a-tab-pane key="8">
                 <span slot="tab">
                     <a-icon type="parameter" />

+ 34 - 27
src/views/system/RoleList.vue

@@ -68,23 +68,25 @@
         <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>
 
-
-          <a-dropdown>
-            <a class="ant-dropdown-link">
-              更多 <a-icon type="down" />
-            </a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="handlePerssion(record.id)">授权</a>
-              </a-menu-item>
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+<!--          <a-dropdown>-->
+<!--            <a class="ant-dropdown-link">-->
+<!--              更多 <a-icon type="down" />-->
+<!--            </a>-->
+<!--            <a-menu slot="overlay">-->
+<!--              <a-menu-item>-->
+<!--                <a @click="handlePerssion(record.id)">授权</a>-->
+<!--              </a-menu-item>-->
+<!--              <a-menu-item>-->
+<!--                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
+<!--                  <a>删除</a>-->
+<!--                </a-popconfirm>-->
+<!--              </a-menu-item>-->
+<!--            </a-menu>-->
+<!--          </a-dropdown>-->
         </span>
 
 
@@ -131,15 +133,20 @@
             }
           },
           {
-            title: '角色名称',
+            title: '商家名称',
             align:"center",
-            dataIndex: 'roleName'
+            dataIndex: 'hotelName'
           },
           {
-            title: '角色编码',
+            title: '角色名称',
             align:"center",
-            dataIndex: 'roleCode'
+            dataIndex: 'roleName'
           },
+          // {
+          //   title: '角色编码',
+          //   align:"center",
+          //   dataIndex: 'roleCode'
+          // },
           {
             title: '备注',
             align:"center",
@@ -151,12 +158,12 @@
             align:"center",
             sorter: true
           },
-          {
-            title: '更新时间',
-            dataIndex: 'updateTime',
-            align:"center",
-            sorter: true
-          },
+          // {
+          //   title: '更新时间',
+          //   dataIndex: 'updateTime',
+          //   align:"center",
+          //   sorter: true
+          // },
           {
             title: '操作',
             dataIndex: 'action',
@@ -191,4 +198,4 @@
 </script>
 <style scoped>
   @import '~@assets/less/common.less'
-</style>
+</style>

+ 4 - 4
src/views/system/RoleUserList.vue

@@ -68,9 +68,9 @@
                 更多 <a-icon type="down"/>
               </a>
               <a-menu slot="overlay">
-                <a-menu-item>
-                  <a @click="handlePerssion(record.id)">授权</a>
-                </a-menu-item>
+<!--                <a-menu-item>-->
+<!--                  <a @click="handlePerssion(record.id)">授权</a>-->
+<!--                </a-menu-item>-->
                 <a-menu-item>
                   <a @click="handleEdit(record)">编辑</a>
                 </a-menu-item>
@@ -542,4 +542,4 @@
   .ant-btn {
     margin-left: 8px
   }
-</style>
+</style>

+ 7 - 1
src/views/system/UserList.vue

@@ -2,10 +2,14 @@
   <a-card style="width: 100%; height: 100%">
     <a-tabs default-active-key="1">
       <a-tab-pane key="1">
+        <span slot="tab"> 角色管理 </span>
+        <role-list></role-list>
+      </a-tab-pane>
+      <a-tab-pane key="2">
         <span slot="tab"> 员工管理 </span>
         <yuangong-list></yuangong-list>
       </a-tab-pane>
-      <a-tab-pane key="2">
+      <a-tab-pane key="3">
         <span slot="tab"> 业主管理 </span>
         <yezhu-list></yezhu-list>
       </a-tab-pane>
@@ -16,8 +20,10 @@
 <script>
 import YuangongList from "./YuangongList.vue";
 import YezhuList from "./YezhuList.vue";
+import RoleList from './RoleList'
 export default {
   components: {
+    RoleList,
     YuangongList,
     YezhuList,
   },

+ 81 - 6
src/views/system/modules/RoleModal.vue

@@ -21,13 +21,34 @@
         <a-form-model-item label="描述" prop="description">
           <a-textarea :rows="5" v-model="model.description" placeholder="请输入角色描述"/>
         </a-form-model-item>
+        <a-form-item label='授权'>
+          <a-card style="max-height: 400px;overflow: scroll;">
+            <a-tree
+                    checkable
+                    @check="onCheck"
+                    :checkedKeys="checkedKeys"
+                    :treeData="treeData"
+                    @expand="onExpand"
+                    @select="onTreeNodeSelect"
+                    :selectedKeys="selectedKeys"
+                    :expandedKeys="expandedKeysss"
+                    :checkStrictly="checkStrictly">
+          <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
+            {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
+          </span>
+            </a-tree>
+          </a-card>
+        </a-form-item>
       </a-form-model>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-  import {addRole,editRole,duplicateCheck } from '@/api/api'
+  import {addRole,editRole,duplicateCheck,queryTreeListForRole,queryRolePermission,
+    saveRolePermission,saveRoleAndPermission,editRoleAndPermission } from '@/api/api'
+
+  const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
   export default {
     name: "RoleModal",
     data () {
@@ -55,6 +76,13 @@
             { min: 0, max: 126, message: '长度不超过 126 个字符', trigger: 'blur' }
           ]
         },
+        treeData: [],
+        checkedKeys:[],
+        expandedKeysss:[],
+        selectedKeys:[],
+        defaultCheckedKeys:[],
+        allTreeKeys:[],
+        checkStrictly: true,
       }
     },
     created () {
@@ -74,6 +102,7 @@
         }else{
           this.roleDisabled = false;
         }
+        this.loadData();
       },
       close () {
         this.$refs.form.clearValidate();
@@ -87,10 +116,22 @@
           if (valid) {
             that.confirmLoading = true;
             let obj;
+            if (hotelInfo && hotelInfo.id){
+              this.model.hotelId = hotelInfo.id;
+            }
+            var param = {
+              role: this.model,
+              permissionJson: {
+                permissionIds: that.checkedKeys.join(","),
+                lastpermissionIds: that.defaultCheckedKeys.join(","),
+              }
+            }
             if(!this.model.id){
-              obj=addRole(this.model);
-            }else{
-              obj=editRole(this.model);
+              // obj=addRole(this.model);
+              obj=saveRoleAndPermission(param);
+            }else {
+              // obj=editRole(this.model);
+              obj = editRoleAndPermission(param);
             }
             obj.then((res)=>{
               if(res.success){
@@ -129,11 +170,45 @@
             }
           });
         }
-      }
+      },
+      loadData(){
+        var _this = this;
+        var _roleId = "";
+        if (_this.model.id !== null &&_this.model.id !== undefined){
+          _roleId = _this.model.id;
+        }
+        queryTreeListForRole().then((res) => {
+          this.treeData = res.result.treeList
+          this.allTreeKeys = res.result.ids
+          queryRolePermission({roleId:_roleId}).then((res)=>{
+            this.checkedKeys = [...res.result];
+            this.defaultCheckedKeys = [...res.result];
+            this.expandedKeysss = this.allTreeKeys;
+            console.log(this.defaultCheckedKeys)
+          })
+        })
+      },
+      onCheck (o) {
+        if(this.checkStrictly){
+          this.checkedKeys = o.checked;
+        }else{
+          this.checkedKeys = o
+        }
+      },
+      onExpand(expandedKeys){
+        this.expandedKeysss = expandedKeys;
+        this.autoExpandParent = false
+      },
+      onTreeNodeSelect(id){
+        if(id && id.length>0){
+          this.selectedKeys = id
+        }
+        this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
+      },
     }
   }
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 3 - 3
src/views/system/modules/UserModal.vue

@@ -175,7 +175,7 @@ export default {
       title: "操作",
       visible: false,
       model: {
-       
+
       },
       labelCol: {
         xs: { span: 24 },
@@ -226,7 +226,7 @@ export default {
       this.resetScreenSize();
       that.userId = record.id;
       that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record);
-      
+
       //身份为上级显示负责部门,否则不显示
       if (this.model.userIdentity == 2) {
         this.departIdShow = true;
@@ -236,7 +236,7 @@ export default {
 
       if (record.hasOwnProperty("id")) {
         that.getUserRoles(record.id);
-        that.getUserDeparts(record.id);
+        // that.getUserDeparts(record.id);
       }
       console.log('that.model=', that.model)
     },